tuanchris před 4 měsíci
rodič
revize
7115f83441

+ 1 - 0
docker-compose.yml

@@ -10,5 +10,6 @@ services:
     devices:
       - "/dev/ttyACM0:/dev/ttyACM0"
       - "/dev/ttyUSB0:/dev/ttyUSB0"
+      - "/dev/ttyAMA0:/dev/ttyAMA0"
     privileged: true
     container_name: dune-weaver

+ 151 - 66
dune-weaver-touch/qml/pages/ExecutionPage.qml

@@ -336,12 +336,15 @@ Page {
                     height: parent.height
                     color: "white"
                     
-                    Column {
-                        anchors.left: parent.left
-                        anchors.right: parent.right
-                        anchors.top: parent.top
+                    ScrollView {
+                        anchors.fill: parent
                         anchors.margins: 10
-                        spacing: 15
+                        clip: true
+                        contentWidth: availableWidth
+                        
+                        Column {
+                            width: parent.width
+                            spacing: 8
                         
                         // Pattern Name
                         Rectangle {
@@ -428,7 +431,7 @@ Page {
                         // Control Buttons
                         Rectangle {
                             width: parent.width
-                            height: 180
+                            height: 90
                             radius: 8
                             color: "#f8f9fa"
                             border.color: "#e5e7eb"
@@ -446,86 +449,167 @@ Page {
                                     color: "#333"
                                 }
                                 
-                                // Pause/Resume button
-                                Rectangle {
+                                // Control buttons row
+                                Row {
                                     width: parent.width
                                     height: 35
-                                    radius: 6
-                                    color: pauseMouseArea.pressed ? "#1e40af" : (backend && backend.currentFile !== "" ? "#2563eb" : "#9ca3af")
+                                    spacing: 8
                                     
-                                    Text {
-                                        anchors.centerIn: parent
-                                        text: (backend && backend.isRunning) ? "|| Pause" : "▶ Resume"
-                                        color: "white"
-                                        font.pixelSize: 12
-                                        font.bold: true
-                                    }
-                                    
-                                    MouseArea {
-                                        id: pauseMouseArea
-                                        anchors.fill: parent
-                                        enabled: backend && backend.currentFile !== ""
-                                        onClicked: {
-                                            if (backend) {
-                                                if (backend.isRunning) {
-                                                    backend.pauseExecution()
-                                                } else {
-                                                    backend.resumeExecution()
+                                    // Pause/Resume button
+                                    Rectangle {
+                                        width: (parent.width - 16) / 3  // Divide width evenly with spacing
+                                        height: parent.height
+                                        radius: 6
+                                        color: pauseMouseArea.pressed ? "#1e40af" : (backend && backend.currentFile !== "" ? "#2563eb" : "#9ca3af")
+                                        
+                                        Text {
+                                            anchors.centerIn: parent
+                                            text: (backend && backend.isRunning) ? "||" : "▶"
+                                            color: "white"
+                                            font.pixelSize: 14
+                                            font.bold: true
+                                        }
+                                        
+                                        MouseArea {
+                                            id: pauseMouseArea
+                                            anchors.fill: parent
+                                            enabled: backend && backend.currentFile !== ""
+                                            onClicked: {
+                                                if (backend) {
+                                                    if (backend.isRunning) {
+                                                        backend.pauseExecution()
+                                                    } else {
+                                                        backend.resumeExecution()
+                                                    }
                                                 }
                                             }
                                         }
                                     }
-                                }
-                                
-                                // Stop button
-                                Rectangle {
-                                    width: parent.width
-                                    height: 35
-                                    radius: 6
-                                    color: stopMouseArea.pressed ? "#b91c1c" : (backend && backend.currentFile !== "" ? "#dc2626" : "#9ca3af")
                                     
-                                    Text {
-                                        anchors.centerIn: parent
-                                        text: "■ Stop"
-                                        color: "white"
-                                        font.pixelSize: 12
-                                        font.bold: true
+                                    // Stop button
+                                    Rectangle {
+                                        width: (parent.width - 16) / 3
+                                        height: parent.height
+                                        radius: 6
+                                        color: stopMouseArea.pressed ? "#b91c1c" : (backend && backend.currentFile !== "" ? "#dc2626" : "#9ca3af")
+                                        
+                                        Text {
+                                            anchors.centerIn: parent
+                                            text: "■"
+                                            color: "white"
+                                            font.pixelSize: 14
+                                            font.bold: true
+                                        }
+                                        
+                                        MouseArea {
+                                            id: stopMouseArea
+                                            anchors.fill: parent
+                                            enabled: backend
+                                            onClicked: {
+                                                if (backend) {
+                                                    backend.stopExecution()
+                                                }
+                                            }
+                                        }
                                     }
                                     
-                                    MouseArea {
-                                        id: stopMouseArea
-                                        anchors.fill: parent
-                                        enabled: backend && backend.currentFile !== ""
-                                        onClicked: {
-                                            if (backend) {
-                                                backend.stopExecution()
+                                    // Skip button
+                                    Rectangle {
+                                        width: (parent.width - 16) / 3
+                                        height: parent.height
+                                        radius: 6
+                                        color: skipMouseArea.pressed ? "#525252" : (backend && backend.currentFile !== "" ? "#6b7280" : "#9ca3af")
+                                        
+                                        Text {
+                                            anchors.centerIn: parent
+                                            text: "▶▶"
+                                            color: "white"
+                                            font.pixelSize: 14
+                                            font.bold: true
+                                        }
+                                        
+                                        MouseArea {
+                                            id: skipMouseArea
+                                            anchors.fill: parent
+                                            enabled: backend && backend.currentFile !== ""
+                                            onClicked: {
+                                                if (backend) {
+                                                    backend.skipPattern()
+                                                }
                                             }
                                         }
                                     }
                                 }
+                            }
+                        }
+                        
+                        // Speed Control Section
+                        Rectangle {
+                            width: parent.width
+                            height: 120
+                            radius: 8
+                            color: "#f8f9fa"
+                            border.color: "#e5e7eb"
+                            border.width: 1
+                            
+                            Column {
+                                anchors.fill: parent
+                                anchors.margins: 10
+                                spacing: 10
+                                
+                                Label {
+                                    text: "Speed"
+                                    font.pixelSize: 12
+                                    font.bold: true
+                                    color: "#333"
+                                }
                                 
-                                // Skip button
-                                Rectangle {
+                                // Touch-friendly button row for speed options
+                                Row {
+                                    id: speedControlRow
                                     width: parent.width
-                                    height: 35
-                                    radius: 6
-                                    color: skipMouseArea.pressed ? "#525252" : (backend && backend.currentFile !== "" ? "#6b7280" : "#9ca3af")
+                                    spacing: 8
+                                    
+                                    property string currentSelection: backend ? backend.getCurrentSpeedOption() : "200"
                                     
-                                    Text {
-                                        anchors.centerIn: parent
-                                        text: "▶▶ Skip"
-                                        color: "white"
-                                        font.pixelSize: 12
-                                        font.bold: true
+                                    // Speed buttons
+                                    Repeater {
+                                        model: ["50", "100", "200", "300", "500"]
+                                        
+                                        Rectangle {
+                                            width: (speedControlRow.width - 32) / 5  // Distribute evenly with spacing
+                                            height: 50
+                                            color: speedControlRow.currentSelection === modelData ? "#2196F3" : "#f0f0f0"
+                                            border.color: speedControlRow.currentSelection === modelData ? "#1976D2" : "#ccc"
+                                            border.width: 2
+                                            radius: 8
+                                            
+                                            Label {
+                                                anchors.centerIn: parent
+                                                text: modelData
+                                                font.pixelSize: 12
+                                                font.bold: true
+                                                color: speedControlRow.currentSelection === modelData ? "white" : "#333"
+                                            }
+                                            
+                                            MouseArea {
+                                                anchors.fill: parent
+                                                onClicked: {
+                                                    if (backend) {
+                                                        backend.setSpeedByOption(modelData)
+                                                        speedControlRow.currentSelection = modelData
+                                                    }
+                                                }
+                                            }
+                                        }
                                     }
                                     
-                                    MouseArea {
-                                        id: skipMouseArea
-                                        anchors.fill: parent
-                                        enabled: backend && backend.currentFile !== ""
-                                        onClicked: {
+                                    // Update selection when backend changes
+                                    Connections {
+                                        target: backend
+                                        function onSpeedChanged(speed) {
                                             if (backend) {
-                                                backend.skipPattern()
+                                                speedControlRow.currentSelection = backend.getCurrentSpeedOption()
                                             }
                                         }
                                     }
@@ -535,6 +619,7 @@ Page {
                     }
                 }
             }
+            }
         }
     }
 }

+ 3 - 2
dune-weaver-touch/qml/pages/ModernPlaylistPage.qml

@@ -479,7 +479,7 @@ Page {
                                     
                                     Text {
                                         anchors.centerIn: parent
-                                        text: "🔀"
+                                        text: ""
                                         color: "white"
                                         font.pixelSize: 16
                                     }
@@ -498,7 +498,8 @@ Page {
                             // Settings section
                             Rectangle {
                                 Layout.fillWidth: true
-                                Layout.fillHeight: true
+                                Layout.preferredHeight: 280
+                                Layout.minimumHeight: 250
                                 radius: 10
                                 color: "#f8f9fa"
                                 border.color: "#e5e7eb"

+ 6 - 193
dune-weaver-touch/qml/pages/TableControlPage.qml

@@ -10,7 +10,6 @@ Page {
     property var serialPorts: []
     property string selectedPort: ""
     property bool isSerialConnected: false
-    property int currentSpeed: 130
     property bool autoPlayOnBoot: false
     
     // Backend signal connections
@@ -34,16 +33,11 @@ Page {
             }
         }
         
-        function onSpeedChanged(speed) {
-            console.log("Speed changed:", speed)
-            currentSpeed = speed
-        }
         
         function onSettingsLoaded() {
             console.log("Settings loaded")
             if (backend) {
                 autoPlayOnBoot = backend.autoPlayOnBoot
-                currentSpeed = backend.currentSpeed
                 isSerialConnected = backend.serialConnected
                 // Screen timeout is now managed by button selection, no need to convert
                 if (backend.currentPort) {
@@ -124,14 +118,14 @@ Page {
             
             ColumnLayout {
                 width: parent.width
-                anchors.margins: 10
-                spacing: 10
+                anchors.margins: 5
+                spacing: 2
                 
                 // Serial Connection Section
                 Rectangle {
                     Layout.fillWidth: true
                     Layout.preferredHeight: 160
-                    Layout.margins: 10
+                    Layout.margins: 5
                     radius: 8
                     color: "white"
                     
@@ -253,8 +247,8 @@ Page {
                 // Hardware Movement Section
                 Rectangle {
                     Layout.fillWidth: true
-                    Layout.preferredHeight: 180
-                    Layout.margins: 10
+                    Layout.preferredHeight: 100
+                    Layout.margins: 5
                     radius: 8
                     color: "white"
                     
@@ -321,193 +315,12 @@ Page {
                     }
                 }
                 
-                // Speed Control Section
-                Rectangle {
-                    Layout.fillWidth: true
-                    Layout.preferredHeight: 120  // Reduced from original for single row layout
-                    Layout.margins: 10
-                    radius: 8
-                    color: "white"
-                    
-                    ColumnLayout {
-                        anchors.fill: parent
-                        anchors.margins: 15
-                        spacing: 15
-                        
-                        Label {
-                            text: "Speed:"
-                            font.pixelSize: 14
-                            font.bold: true
-                            color: "#333"
-                            Layout.alignment: Qt.AlignLeft
-                        }
-                        
-                        // Touch-friendly button row for speed options
-                        RowLayout {
-                            id: speedGrid
-                            Layout.fillWidth: true
-                            spacing: 8
-                            
-                            property string currentSelection: backend ? backend.getCurrentSpeedOption() : "200"
-                            
-                            // 50 button
-                            Rectangle {
-                                Layout.preferredWidth: 100
-                                Layout.preferredHeight: 50
-                                color: speedGrid.currentSelection === "50" ? "#2196F3" : "#f0f0f0"
-                                border.color: speedGrid.currentSelection === "50" ? "#1976D2" : "#ccc"
-                                border.width: 2
-                                radius: 8
-                                
-                                Label {
-                                    anchors.centerIn: parent
-                                    text: "50"
-                                    font.pixelSize: 14
-                                    font.bold: true
-                                    color: speedGrid.currentSelection === "50" ? "white" : "#333"
-                                }
-                                
-                                MouseArea {
-                                    anchors.fill: parent
-                                    onClicked: {
-                                        if (backend) {
-                                            backend.setSpeedByOption("50")
-                                            speedGrid.currentSelection = "50"
-                                        }
-                                    }
-                                }
-                            }
-                            
-                            // 100 button
-                            Rectangle {
-                                Layout.preferredWidth: 100
-                                Layout.preferredHeight: 50
-                                color: speedGrid.currentSelection === "100" ? "#2196F3" : "#f0f0f0"
-                                border.color: speedGrid.currentSelection === "100" ? "#1976D2" : "#ccc"
-                                border.width: 2
-                                radius: 8
-                                
-                                Label {
-                                    anchors.centerIn: parent
-                                    text: "100"
-                                    font.pixelSize: 14
-                                    font.bold: true
-                                    color: speedGrid.currentSelection === "100" ? "white" : "#333"
-                                }
-                                
-                                MouseArea {
-                                    anchors.fill: parent
-                                    onClicked: {
-                                        if (backend) {
-                                            backend.setSpeedByOption("100")
-                                            speedGrid.currentSelection = "100"
-                                        }
-                                    }
-                                }
-                            }
-                            
-                            // 200 button
-                            Rectangle {
-                                Layout.preferredWidth: 100
-                                Layout.preferredHeight: 50
-                                color: speedGrid.currentSelection === "200" ? "#2196F3" : "#f0f0f0"
-                                border.color: speedGrid.currentSelection === "200" ? "#1976D2" : "#ccc"
-                                border.width: 2
-                                radius: 8
-                                
-                                Label {
-                                    anchors.centerIn: parent
-                                    text: "200"
-                                    font.pixelSize: 14
-                                    font.bold: true
-                                    color: speedGrid.currentSelection === "200" ? "white" : "#333"
-                                }
-                                
-                                MouseArea {
-                                    anchors.fill: parent
-                                    onClicked: {
-                                        if (backend) {
-                                            backend.setSpeedByOption("200")
-                                            speedGrid.currentSelection = "200"
-                                        }
-                                    }
-                                }
-                            }
-                            
-                            // 300 button
-                            Rectangle {
-                                Layout.preferredWidth: 100
-                                Layout.preferredHeight: 50
-                                color: speedGrid.currentSelection === "300" ? "#2196F3" : "#f0f0f0"
-                                border.color: speedGrid.currentSelection === "300" ? "#1976D2" : "#ccc"
-                                border.width: 2
-                                radius: 8
-                                
-                                Label {
-                                    anchors.centerIn: parent
-                                    text: "300"
-                                    font.pixelSize: 14
-                                    font.bold: true
-                                    color: speedGrid.currentSelection === "300" ? "white" : "#333"
-                                }
-                                
-                                MouseArea {
-                                    anchors.fill: parent
-                                    onClicked: {
-                                        if (backend) {
-                                            backend.setSpeedByOption("300")
-                                            speedGrid.currentSelection = "300"
-                                        }
-                                    }
-                                }
-                            }
-                            
-                            // 500 button
-                            Rectangle {
-                                Layout.preferredWidth: 100
-                                Layout.preferredHeight: 50
-                                color: speedGrid.currentSelection === "500" ? "#2196F3" : "#f0f0f0"
-                                border.color: speedGrid.currentSelection === "500" ? "#1976D2" : "#ccc"
-                                border.width: 2
-                                radius: 8
-                                
-                                Label {
-                                    anchors.centerIn: parent
-                                    text: "500"
-                                    font.pixelSize: 14
-                                    font.bold: true
-                                    color: speedGrid.currentSelection === "500" ? "white" : "#333"
-                                }
-                                
-                                MouseArea {
-                                    anchors.fill: parent
-                                    onClicked: {
-                                        if (backend) {
-                                            backend.setSpeedByOption("500")
-                                            speedGrid.currentSelection = "500"
-                                        }
-                                    }
-                                }
-                            }
-                            
-                            // Update selection when backend changes
-                            Connections {
-                                target: backend
-                                function onSpeedChanged(speed) {
-                                    if (backend) {
-                                        speedGrid.currentSelection = backend.getCurrentSpeedOption()
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
                 
                 // Auto Play on Boot Section
                 Rectangle {
                     Layout.fillWidth: true
                     Layout.preferredHeight: 200  // Reduced from 280 for single row layout
-                    Layout.margins: 10
+                    Layout.margins: 5
                     radius: 8
                     color: "white"
                     

+ 2 - 2
modules/connection/connection_manager.py

@@ -361,7 +361,7 @@ def get_machine_steps(timeout=10):
     
     # Process results and determine table type
     if settings_complete:
-        if y_steps_per_mm == 180:
+        if y_steps_per_mm == 180 and x_steps_per_mm == 256:
             state.table_type = 'dune_weaver_mini'
         elif y_steps_per_mm >= 320:
             state.table_type = 'dune_weaver_pro'
@@ -406,7 +406,7 @@ def home(timeout=15):
                     homing_speed = 120
                 logger.info("Sensorless homing not supported. Using crash homing")
                 logger.info(f"Homing with speed {homing_speed}")
-                if state.gear_ratio == 6.25:
+                if state.gear_ratio == 6.25 and state.x_steps_per_mm == 256:
                     result = send_grbl_coordinates(0, - 30, homing_speed, home=True)
                     if result == False:
                         logger.error("Homing failed - send_grbl_coordinates returned False")