Reinhard Russinger 5 жил өмнө
parent
commit
c7dd0df0fc

+ 8 - 3
ADMIN_Settings.qml

@@ -10,6 +10,10 @@ Rectangle {
     height: parent.height
     color: "white"
 
+    border.color: "red"
+    border.width: 3
+
+
     property color inputBackgrund: "lightgray"
     property int inputRadius: 4
     property int inputHeight: 40
@@ -42,16 +46,17 @@ Rectangle {
                 property int factoryRestFontSize: 20
                 property int factoryResetRectHeight: 40
                 id: factoryResetRECT
-                x: ((root.width / 17) * 14) - 10
+                x: root.width - root.width * 0.03 - width
                 y: (root.height / 12)
-                width: (root.width / 17) * 3
-                height: factoryResetRectHeight
+                width: factoryResetLabel.implicitWidth * 1.2
+                height: factoryResetLabel.implicitHeight * 2
                 color: Globals.customer_color_base
 
                 border.color: "lightgray"
                 border.width: 3
 
                 Label {
+                    id: factoryResetLabel
                     anchors.centerIn: parent
                     font.pixelSize: roleFontSize
                     //:ID: admin_factory_reset_butt buttontext for factory reset button

+ 8 - 5
HMI_DateTimeSettings.qml

@@ -6,7 +6,7 @@ Item {
     id: dateTimeSETTINGS
     property int dateListTextFontSize: mHighlightBarHeight - 3 * mHighlightBarThickness
     property int mHighlightBarThickness: 3
-    property int mHighlightBarHeight: (setMonthRect.height / 3)
+    property int mHighlightBarHeight: (setMonthRect.height / 3) * 0.8
     property color cGreenLetterColor: "gray" //Globals.customer_color_base
     property color bgColor: "lightgray"
     property color selCol: Globals.customer_color_base //"black"//"white"
@@ -770,11 +770,14 @@ Item {
         y: parent.height / 3
         color: bgColor
 
+        //border.color: "blue"
+        //border.width: 3
+
         ButtHMI {
             id: datetimeOK
             buttY: (parent.height / 2) - (buttHeight / 2)
-            buttX: parent.width / 3 // (parent.width / 2) - (buttWidth / 2)
-            buttWidth: 35
+            buttX: (parent.width / 2) * 0.1 // (parent.width / 2) - (buttWidth / 2)
+            buttWidth: parent.width / 2 * 0.75
             buttHeight: buttWidth
             color: Globals.customer_color_base
             text: "\uf046" //check-sqare
@@ -789,8 +792,8 @@ Item {
         ButtHMI {
             id: datetimeREDO
             buttY: (parent.height / 2) - (buttHeight / 2)
-            buttX: parent.width - (parent.width / 3) // (parent.width / 2) - (buttWidth / 2)
-            buttWidth: 35
+            buttX: parent.width / 2 + (parent.width / 2) * 0.1 // (parent.width / 2) - (buttWidth / 2)
+            buttWidth: parent.width / 2 * 0.75
             buttHeight: buttWidth
             color: Globals.customer_color_base
             text: "\uf01e" // redo

+ 227 - 216
HMI_Settings.qml

@@ -14,7 +14,6 @@ Rectangle {
     width: parent.width
     height: parent.height
     color: "white"
-    property int ipsettingsXpos: 200
 
     Flickable {
         id: flickable
@@ -35,247 +34,259 @@ Rectangle {
                 hmiIP.ipFocus = 0;
             }
 
-//            Rectangle{
-//                x: 100
-//                y: 50
-//                width:200
-//                height: 50
-//                color: "lightgray"
-
-//                Switch {
-//                    id:dhcpSWITCH
-//                    checked: false
-
-//                    text: (checked)?"DHCP":"STATIC"
-//                    font.pixelSize: 20
-
-//                    onCheckedChanged: {
-//                        hmiIP.ipvisible = !checked;
-//                        hmiNETMASK.ipvisible = !checked;
-//                        hmiGATEWAY.ipvisible = !checked;
-//                        hmiDNS.ipvisible = !checked;
-
-//                    }
-//                }
-//            }
-
-            Label {
-                id: lab1
-                x: hmiIP.posX - lab1.implicitWidth
-                y: hmiIP.posY
-//                visible: !dhcpSWITCH.checked
-                font.pixelSize: 20
-                //: ID:_sys_ipaddress Ip Address settings
-                text: qsTrId("_sys_ipaddress") + " : " + transLoad.emptyString //qsTr("IP-Adresse : ") + transLoad.emptyString
-            }
-
-            IpAddressInput {
-                id: hmiIP
-                posX: ipsettingsXpos
-                posY: 100
-                ipwidth: 200
-                ipcolor: "black"
-                ipFontSize: 20
+            Rectangle {
+                id: setNetworkADDRESS
+                width: root.width / 2
+                height: root.height
 
-                onIpAddressChanged: {
-                    setEth0.address = ipAddress;
+                //border.color: "blue"
+                //border.width: 2
+
+                property double ipDisplayFontSize: (height / 16) * 0.74
+                property int ipsettingsXpos: (width / 3) * 1.25
+                property double ipsettingsWidth: width - ipsettingsXpos
+
+                //            Rectangle{
+                //                x: 100
+                //                y: 50
+                //                width:200
+                //                height: 50
+                //                color: "lightgray"
+
+                //                Switch {
+                //                    id:dhcpSWITCH
+                //                    checked: false
+
+                //                    text: (checked)?"DHCP":"STATIC"
+                //                    font.pixelSize: 20
+
+                //                    onCheckedChanged: {
+                //                        hmiIP.ipvisible = !checked;
+                //                        hmiNETMASK.ipvisible = !checked;
+                //                        hmiGATEWAY.ipvisible = !checked;
+                //                        hmiDNS.ipvisible = !checked;
+
+                //                    }
+                //                }
+                //            }
+
+                Label {
+                    id: lab1
+                    x: hmiIP.posX - lab1.implicitWidth
+                    y: hmiIP.posY
+                    //                visible: !dhcpSWITCH.checked
+                    font.pixelSize: parent.ipDisplayFontSize //20
+                    //: ID:_sys_ipaddress Ip Address settings
+                    text: qsTrId("_sys_ipaddress") + " : " + transLoad.emptyString //qsTr("IP-Adresse : ") + transLoad.emptyString
                 }
 
-                onKeyDownPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiNETMASK.ipFocus = foc;
-                }
-                onKeyUpPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiDNS.ipFocus = foc;
-                }
-            }
+                IpAddressInput {
+                    id: hmiIP
+                    posX: parent.ipsettingsXpos
+                    posY: parent.height / 16 * 4
+                    ipwidth: parent.ipsettingsWidth
+                    ipcolor: "black"
+                    ipFontSize: parent.ipDisplayFontSize //20
 
-            Label {
-                id: lab2
-                x: hmiNETMASK.posX - lab2.implicitWidth
-                y: hmiNETMASK.posY
-//                visible: !dhcpSWITCH.checked
-                font.pixelSize: 20
-                //: ID:_sys_netmask Ip Address settings Netmask
-                text: qsTrId("_sys_netmask") + " : " + transLoad.emptyString //qsTr("Netmask : ") + transLoad.emptyString
-            }
-
-            IpAddressInput {
-                id: hmiNETMASK
-                posX: ipsettingsXpos
-                posY: 150
-                ipwidth: 200
-                ipcolor: "black"
-                ipFontSize: 20
+                    onIpAddressChanged: {
+                        setEth0.address = ipAddress;
+                    }
 
-                onIpAddressChanged: {
-                    setEth0.netmask = ipAddress;
-                }
-                onKeyDownPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiGATEWAY.ipFocus = foc;
-                }
-                onKeyUpPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiIP.ipFocus = foc;
+                    onKeyDownPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiNETMASK.ipFocus = foc;
+                    }
+                    onKeyUpPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiDNS.ipFocus = foc;
+                    }
                 }
-            }
 
-            Label {
-                id: lab3
-                x: hmiGATEWAY.posX - lab3.implicitWidth
-                y: hmiGATEWAY.posY
-//                visible: !dhcpSWITCH.checked
-                font.pixelSize: 20
-                //: ID:_sys_defaultrouter Ip Address settings Defaultrouter
-                text: qsTrId("_sys_defaultrouter") + " : " + transLoad.emptyString //qsTr("Def. Router : ") + transLoad.emptyString
-            }
+                Label {
+                    id: lab2
+                    x: hmiNETMASK.posX - lab2.implicitWidth
+                    y: hmiNETMASK.posY
+                    //                visible: !dhcpSWITCH.checked
+                    font.pixelSize: parent.ipDisplayFontSize // 20
+                    //: ID:_sys_netmask Ip Address settings Netmask
+                    text: qsTrId("_sys_netmask") + " : " + transLoad.emptyString //qsTr("Netmask : ") + transLoad.emptyString
+                }
 
-            IpAddressInput {
-                id: hmiGATEWAY
-                posX: ipsettingsXpos
-                posY: 200
-                ipwidth: 200
-                ipcolor: "black"
-                ipFontSize: 20
+                IpAddressInput {
+                    id: hmiNETMASK
+                    posX: parent.ipsettingsXpos
+                    posY: parent.height / 16 * 6
+                    ipwidth: parent.ipsettingsWidth
+                    ipcolor: "black"
+                    ipFontSize: parent.ipDisplayFontSize //20
 
-                onIpAddressChanged: {
-                    setEth0.gateway = ipAddress;
-                }
-                onKeyDownPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiDNS.ipFocus = foc;
-                }
-                onKeyUpPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiNETMASK.ipFocus = foc;
+                    onIpAddressChanged: {
+                        setEth0.netmask = ipAddress;
+                    }
+                    onKeyDownPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiGATEWAY.ipFocus = foc;
+                    }
+                    onKeyUpPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiIP.ipFocus = foc;
+                    }
                 }
-            }
 
-            Label {
-                id: lab4
-                x: hmiDNS.posX - lab4.implicitWidth
-                y: hmiDNS.posY
-//                visible: !dhcpSWITCH.checked
-                font.pixelSize: 20
-                //: ID:_sys_dns1 Ip Address settings DNS Server 1
-                text: qsTrId("_sys_dns1") + " : " + transLoad.emptyString //qsTr("DNS Server : ") + transLoad.emptyString
-            }
+                Label {
+                    id: lab3
+                    x: hmiGATEWAY.posX - lab3.implicitWidth
+                    y: hmiGATEWAY.posY
+                    //                visible: !dhcpSWITCH.checked
+                    font.pixelSize: parent.ipDisplayFontSize //20
+                    //: ID:_sys_defaultrouter Ip Address settings Defaultrouter
+                    text: qsTrId("_sys_defaultrouter") + " : " + transLoad.emptyString //qsTr("Def. Router : ") + transLoad.emptyString
+                }
 
-            IpAddressInput {
-                id: hmiDNS
-                posX: ipsettingsXpos
-                posY: 250
-                ipwidth: 200
-                ipcolor: "black"
-                ipFontSize: 20
+                IpAddressInput {
+                    id: hmiGATEWAY
+                    posX: parent.ipsettingsXpos
+                    posY: parent.height / 16 * 8
+                    ipwidth: parent.ipsettingsWidth
+                    ipcolor: "black"
+                    ipFontSize: parent.ipDisplayFontSize //20
 
-                onIpAddressChanged: {
-                    setEth0.nameserver = ipAddress;
-                }
-                onKeyDownPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiIP.ipFocus = foc;
-                }
-                onKeyUpPressed: {
-                    var foc = ipFocus;
-                    ipFocus = 0;
-                    hmiGATEWAY.ipFocus = foc;
+                    onIpAddressChanged: {
+                        setEth0.gateway = ipAddress;
+                    }
+                    onKeyDownPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiDNS.ipFocus = foc;
+                    }
+                    onKeyUpPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiNETMASK.ipFocus = foc;
+                    }
                 }
-            }
 
-            ButtHMI {
-                buttX: 50
-                buttY: 290
-                buttWidth:35
-                buttHeight: buttWidth
-                text: "\uf0c7" //floppy-sign
-                color: Globals.customer_color_base
-                onButtPressed: {
-                    hmiIP.makeIpAddress();
-                    hmiNETMASK.makeIpAddress();
-                    hmiGATEWAY.makeIpAddress();
-                    hmiDNS.makeIpAddress();
-                    setEth0.doSetInterface();
+                Label {
+                    id: lab4
+                    x: hmiDNS.posX - lab4.implicitWidth
+                    y: hmiDNS.posY
+                    //                visible: !dhcpSWITCH.checked
+                    font.pixelSize: parent.ipDisplayFontSize //20
+                    //: ID:_sys_dns1 Ip Address settings DNS Server 1
+                    text: qsTrId("_sys_dns1") + " : " + transLoad.emptyString //qsTr("DNS Server : ") + transLoad.emptyString
                 }
-            }
 
-            ButtHMI {
-                buttX: 150
-                buttY: 290
-                buttWidth: 35
-                buttHeight: buttWidth
-                color: Globals.customer_color_base
-                text: "\uf046" //check-sqare
-                onButtPressed: {
-                    hmiIP.makeIpAddress();
-                    hmiNETMASK.makeIpAddress();
-                    hmiGATEWAY.makeIpAddress();
-                    hmiDNS.makeIpAddress();
-                    setEth0.doRestartNetwork();
-                }
-            }
+                IpAddressInput {
+                    id: hmiDNS
+                    posX: parent.ipsettingsXpos
+                    posY: parent.height / 16 * 10
+                    ipwidth: parent.ipsettingsWidth
+                    ipcolor: "black"
+                    ipFontSize: parent.ipDisplayFontSize //20
 
-            ButtHMI {
-                id: buttUPDATE
-                buttX: 250
-                buttY: 290
-                buttWidth: 35
-                buttHeight: buttWidth
-                visible: false
-                color: Globals.customer_color_base
-                text: "\uf0c5" //files -- für Update
-                onButtPressed: {
-                    console.debug("Update Button Pressed");
-                    updateHMI.popupVISIBLE = true;
+                    onIpAddressChanged: {
+                        setEth0.nameserver = ipAddress;
+                    }
+                    onKeyDownPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiIP.ipFocus = foc;
+                    }
+                    onKeyUpPressed: {
+                        var foc = ipFocus;
+                        ipFocus = 0;
+                        hmiGATEWAY.ipFocus = foc;
+                    }
                 }
-            }
 
-            HMI_UpdatePopup {
-                id: updateHMI
-                popupVISIBLE: false
-                //: ID:_sys_update_hmi Headline HMI Updatewindow
-                popupTEXT: qsTrId("_sys_update_hmi") + transLoad.emptyString
-            }
-
-            SetNetworkInterface {
-                id: setEth0
-                mode: "static"
-                ifacename: "eth0"
-                address: "192.168.0.125"
-                netmask: "255.255.0.0"
-                nameserver: "192.168.0.1"
-                gateway: "192.168.0.1"
-                infile: (sysinfo.currentCpuArchitecture == "x86_64") ?"/home/ru/IFACE/interfaces":"/etc/network/interfaces"
-                outfile: (sysinfo.currentCpuArchitecture == "x86_64") ?"/home/ru/IFACE/interfaces":"/etc/network/interfaces"
-
-                onAddressChanged: {
-                    hmiIP.ipAddress = address;
+                ButtHMI {
+                    buttX: parent.width/3 * 0.5
+                    buttY: parent.height / 16 * 12
+                    buttWidth:parent.height / 16 * 2
+                    buttHeight: buttWidth
+                    text: "\uf0c7" //floppy-sign
+                    color: Globals.customer_color_base
+                    onButtPressed: {
+                        hmiIP.makeIpAddress();
+                        hmiNETMASK.makeIpAddress();
+                        hmiGATEWAY.makeIpAddress();
+                        hmiDNS.makeIpAddress();
+                        setEth0.doSetInterface();
+                    }
                 }
-                onNetmaskChanged:  {
-                    hmiNETMASK.ipAddress = netmask;
+
+                ButtHMI {
+                    buttX: parent.width/3 * 1.5
+                    buttY: parent.height / 16 * 12
+                    buttWidth: parent.height / 16 * 2
+                    buttHeight: buttWidth
+                    color: Globals.customer_color_base
+                    text: "\uf046" //check-sqare
+                    onButtPressed: {
+                        hmiIP.makeIpAddress();
+                        hmiNETMASK.makeIpAddress();
+                        hmiGATEWAY.makeIpAddress();
+                        hmiDNS.makeIpAddress();
+                        setEth0.doRestartNetwork();
+                    }
                 }
-                onGatewayChanged: {
-                    hmiGATEWAY.ipAddress = gateway;
+
+                ButtHMI {
+                    id: buttUPDATE
+                    buttX: parent.width/3 * 2.5
+                    buttY: parent.height / 16 * 12
+                    buttWidth: parent.height / 16 * 2
+                    buttHeight: buttWidth
+                    visible: false
+                    color: Globals.customer_color_base
+                    text: "\uf0c5" //files -- für Update
+                    onButtPressed: {
+                        console.debug("Update Button Pressed");
+                        updateHMI.popupVISIBLE = true;
+                    }
                 }
-                onNameserverChanged: {
-                    hmiDNS.ipAddress = nameserver;
+
+                HMI_UpdatePopup {
+                    id: updateHMI
+                    popupVISIBLE: false
+                    //: ID:_sys_update_hmi Headline HMI Updatewindow
+                    popupTEXT: qsTrId("_sys_update_hmi") + transLoad.emptyString
                 }
 
-                onCmdDone: {
-                    hmiIP.ipAddress = setEth0.address;
-                    hmiNETMASK.ipAddress = setEth0.netmask;
-                    hmiGATEWAY.ipAddress = setEth0.gateway;
-                    hmiDNS.ipAddress = setEth0.nameserver;
+                SetNetworkInterface {
+                    id: setEth0
+                    mode: "static"
+                    ifacename: "eth0"
+                    address: "192.168.0.125"
+                    netmask: "255.255.0.0"
+                    nameserver: "192.168.0.1"
+                    gateway: "192.168.0.1"
+                    infile: (sysinfo.currentCpuArchitecture == "x86_64") ?"/home/ru/IFACE/interfaces":"/etc/network/interfaces"
+                    outfile: (sysinfo.currentCpuArchitecture == "x86_64") ?"/home/ru/IFACE/interfaces":"/etc/network/interfaces"
+
+                    onAddressChanged: {
+                        hmiIP.ipAddress = address;
+                    }
+                    onNetmaskChanged:  {
+                        hmiNETMASK.ipAddress = netmask;
+                    }
+                    onGatewayChanged: {
+                        hmiGATEWAY.ipAddress = gateway;
+                    }
+                    onNameserverChanged: {
+                        hmiDNS.ipAddress = nameserver;
+                    }
 
+                    onCmdDone: {
+                        hmiIP.ipAddress = setEth0.address;
+                        hmiNETMASK.ipAddress = setEth0.netmask;
+                        hmiGATEWAY.ipAddress = setEth0.gateway;
+                        hmiDNS.ipAddress = setEth0.nameserver;
+                    }
                 }
             }
             //============================================================================

+ 4 - 4
HMI_UpdatePopup.qml

@@ -14,11 +14,11 @@ Item {
     property int clickedINDEX: -1
     property string selectedFileName: ""
 
-    x: 20
-    y: 0
+    x: parent.width * 0.025
+    y: parent.height * 0.025
 
-    width: 500
-    height: 300
+    width: parent.width * 0.95
+    height: parent.height * 0.95
     visible: popupVISIBLE
 
     function fillData() {

+ 2 - 2
main.cpp

@@ -186,8 +186,8 @@ int main(int argc, char *argv[])
         item->setProperty("height", 272);
         //item->setProperty("width", 800);
         //item->setProperty("height", 480);
-        //        item->setProperty("width", 1280);
-        //        item->setProperty("height", 800);
+        //item->setProperty("width", 1280);
+        //item->setProperty("height", 800);
     } else {
         item->setProperty("width", availSize.width());
         item->setProperty("height", availSize.height());