Rind пре 2 година
родитељ
комит
b30536482b
5 измењених фајлова са 205 додато и 77 уклоњено
  1. 12 12
      app/visu/qml/Ip4Address.qml
  2. 1 1
      app/visu/qml/globals.js
  3. 52 45
      app/visu/qml/ifedit.qml
  4. 63 0
      app/visu/qml/itf.qml
  5. 77 19
      app/visu/qml/stgdev.qml

+ 12 - 12
app/visu/qml/Ip4Address.qml

@@ -37,14 +37,14 @@ Item {
 	        font.pointSize: 8
 	        inputMethodHints: Qt.ImhDigitsOnly
 	        validator: IntValidator{bottom: 0; top: 255;}
-            text: (parseInt(address, 10) >> 24) & 0xFF
+            text: parseInt(address, 10) & 0xFF
             KeyNavigation.tab: idb2
  			onAccepted: {
- 				setAddrByte(3, text);
+ 				setAddrByte(0, text);
             }
 			onActiveFocusChanged: {
 				if(!activeFocus)
-	 				setAddrByte(3, text);
+	 				setAddrByte(0, text);
 	 			else
 	 				selectAll();
 			}
@@ -78,14 +78,14 @@ Item {
 	        font.pointSize: 8
 	        inputMethodHints: Qt.ImhDigitsOnly
 	        validator: IntValidator{bottom: 0; top: 255;}
-            text: (parseInt(address, 10) >> 16) & 0xFF
+            text: (parseInt(address, 10) >> 8) & 0xFF
             KeyNavigation.tab: idb1
  			onAccepted: {
- 				setAddrByte(2, text);
+ 				setAddrByte(1, text);
             }
 			onActiveFocusChanged: {
 				if(!activeFocus)
-	 				setAddrByte(2, text);
+	 				setAddrByte(1, text);
 	 			else
 	 				selectAll();
 			}
@@ -119,14 +119,14 @@ Item {
 	        font.pointSize: 8
 	        inputMethodHints: Qt.ImhDigitsOnly
 	        validator: IntValidator{bottom: 0; top: 255;}
-            text: (parseInt(address, 10) >> 8) & 0xFF
+            text: (parseInt(address, 10) >> 16) & 0xFF
             KeyNavigation.tab: idb0
  			onAccepted: {
- 				setAddrByte(1, text);
+ 				setAddrByte(2, text);
             }
 			onActiveFocusChanged: {
 				if(!activeFocus)
-	 				setAddrByte(1, text);
+	 				setAddrByte(2, text);
 	 			else
 	 				selectAll();
 			}
@@ -160,14 +160,14 @@ Item {
 	        font.pointSize: 8
 	        inputMethodHints: Qt.ImhDigitsOnly
 	        validator: IntValidator{bottom: 0; top: 255;}
-            text: parseInt(address, 10) & 0xFF
+            text: (parseInt(address, 10) >> 24) & 0xFF
             KeyNavigation.tab: idb3
  			onAccepted: {
- 				setAddrByte(0, text);
+ 				setAddrByte(3, text);
             }
 			onActiveFocusChanged: {
 				if(!activeFocus)
-	 				setAddrByte(0, text);
+	 				setAddrByte(3, text);
 	 			else
 	 				selectAll();
 			}

+ 1 - 1
app/visu/qml/globals.js

@@ -1,4 +1,4 @@
-var tabBarModel = [["App Control", "appctrl.qml"], ["SysInfo", "sysinfo.qml"], ["Network", "ifedit.qml"], ["Storage Dev.", "stgdev.qml"]];
+var tabBarModel = [["App Control", "appctrl.qml"], ["SysInfo", "sysinfo.qml"], ["Network", "itf.qml"], ["Storage Dev.", "stgdev.qml"]];
 var zeroBasedLabels = false;
 var ledGrey		= "qrc:/img/led-grey24.png";
 var ledGreen	= "qrc:/img/led-green24.png";

+ 52 - 45
app/visu/qml/ifedit.qml

@@ -1,17 +1,17 @@
 import QtQuick 2.6
 import QtQuick.Window 2.2
-import QtQuick.Controls 2.0
-//import QtQuick.Controls 1.5
-import QtQuick.Controls 1.4 as Ctrl14
+import QtQuick.Controls 1.5
+import QtQuick.Controls 2.0 as Ctrl20
 import QtQuick.Controls.Styles 1.4
-import com.gfa.ipc.appctrl 1.0
 import "globals.js" as Globals
+import com.gfa.ipc.appctrl 1.0
 import QtQuick.FreeVirtualKeyboard 1.0
 
 Rectangle {
     id: idEdit
-    width: Screen.width
-    height: Screen.height
+    visible: true
+    width: 800
+    height: 480
 
     property bool isDirty: false
     property bool ifUpDownInProgress: false
@@ -88,10 +88,10 @@ Rectangle {
 
 	/////////////////////////////////////////////////////////////////////////////////////////////////
 
-	TabBar {
+	Ctrl20.TabBar {
 		id: idTabBar
 		width: parent.width
-		currentIndex: 2
+		currentIndex: 6
 
 		Repeater {
 			id: idRep
@@ -107,7 +107,7 @@ Rectangle {
 
 	/////////////////////////////////////////////////////////////////////////////////////////////////
 
-	Ctrl14.TableView {
+	TableView {
 		id: idItfList
 		height: 420
 		width:	180
@@ -124,14 +124,14 @@ Rectangle {
 			updateUI(idItfList.currentRow);
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			role: "name"
 		}
 	}
 
 	/////////////////////////////////////////////////////////////////////////////////////////////////
 
-	Ctrl14.ExclusiveGroup { id: idMethExGroup }
+	ExclusiveGroup { id: idMethExGroup }
 
 	Rectangle {
 		id: idMethGroup
@@ -146,7 +146,7 @@ Rectangle {
 		
 		property int method: (idItfList.currentRow > 0) ? qGfaAppCtrl.sysInfo.netInterfaceInfo.interfaces[idItfList.currentRow].method : 0
 
-		Ctrl14.RadioButton {
+		RadioButton {
 			x: 10
 			y: 10
 			id: idMethStatic
@@ -171,7 +171,7 @@ Rectangle {
 			}
 		}
 
-		Ctrl14.RadioButton {
+		RadioButton {
 			x: 100
 			y: 10
 			id: idMethDhcp
@@ -359,8 +359,13 @@ Rectangle {
 	    y: 230
 	    width: 590
 	    height: 180
+//		radius: 5
+//		border.width: 1
+//		border.color: "black"
 		visible: false
 
+//		ScrollView {
+//		    anchors.fill: parent
 		TextArea {
 		    id: idIfUpDownText
 		    anchors.fill: parent
@@ -368,7 +373,9 @@ Rectangle {
 		    selectByMouse: false
 		    selectByKeyboard: false
 	        font.pointSize: 8
+//			verticalAlignment: Text.AlignTop
 		}
+//		}
 	}
 
 	/////////////////////////////////////////////////////////////////////////////////////////////////
@@ -383,7 +390,7 @@ Rectangle {
 		border.width: 1
 		border.color: "black"
 
-		Ctrl14.Button {
+		Button {
 			x: 10
 			y: 10
 			width: 100
@@ -398,7 +405,7 @@ Rectangle {
 			style: idButtonStyle
 		}
 
-		Ctrl14.Button {
+		Button {
 			x: 120
 			y: 10
 			width: 100
@@ -413,7 +420,7 @@ Rectangle {
 			style: idButtonStyle
 		}
 
-		Ctrl14.Button {
+		Button {
 			x: 260
 			y: 10
 			width: 100
@@ -429,7 +436,7 @@ Rectangle {
 			style: idButtonStyle
 		}
 
-		Ctrl14.Button {
+		Button {
 			x: 370
 			y: 10
 			width: 100
@@ -445,7 +452,7 @@ Rectangle {
 			style: idButtonStyle
 		}
 
-		Ctrl14.Button {
+		Button {
 			x: 480
 			y: 10
 			width: 100
@@ -465,31 +472,31 @@ Rectangle {
 	/////////////////////////////////////////////////////////////////////////////////////////////////
 
     InputPanel {
-           id: inputPanel
-           z: 99
-           y: idEdit.height
-           anchors.left: parent.left
-           anchors.right: parent.right
-
-           states: State {
-               name: "visible"
-               when: Qt.inputMethod.visible
-               PropertyChanges {
-                   target: inputPanel
-                   y: idEdit.height - inputPanel.height
-               }
-           }
-           transitions: Transition {
-               from: ""
-               to: "visible"
-               reversible: true
-               ParallelAnimation {
-                   NumberAnimation {
-                       properties: "y"
-                       duration: 150
-                       easing.type: Easing.InOutQuad
-                   }
-               }
-           }
-       }
+		id: inputPanel
+		z: 99
+		y: idEdit.height
+		anchors.left: parent.left
+		anchors.right: parent.right
+
+		states: State {
+		   name: "visible"
+		   when: Qt.inputMethod.visible
+		   PropertyChanges {
+		       target: inputPanel
+		       y: idEdit.height - inputPanel.height
+		   }
+		}
+		transitions: Transition {
+		   from: ""
+		   to: "visible"
+		   reversible: true
+		   ParallelAnimation {
+		       NumberAnimation {
+		           properties: "y"
+		           duration: 150
+		           easing.type: Easing.InOutQuad
+		       }
+		   }
+		}
+	}
 }

+ 63 - 0
app/visu/qml/itf.qml

@@ -0,0 +1,63 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import QtQuick.Controls 1.5
+import QtQuick.Controls 2.0 as Ctrl20
+import QtQuick.Controls.Styles 1.4
+import "globals.js" as Globals
+import com.gfa.ipc.appctrl 1.0
+
+Rectangle {
+    width: Screen.width
+    height: Screen.height
+
+	/////////////////////////////////////////////////////////////////////////////////////////////////
+
+	Ctrl20.TabBar {
+		id: idTabBar
+		width: parent.width
+		currentIndex: 2
+
+		Repeater {
+			id: idRep
+			model: Globals.tabBarModel
+
+			NavButton {
+				text: modelData[0]
+				onClicked: { idPageLoader.source = modelData[1]; }
+				width: idTabBar.width / idRep.count
+			}
+		}
+	}
+
+	/////////////////////////////////////////////////////////////////////////////////////////////////
+
+	Rectangle {
+        x: 10
+        y: 50
+		width: parent.width - 20
+        height: parent.height - idTabBar.height - 20
+        radius: 5
+		border.width: 1
+		border.color: "black"
+		TreeView {
+			anchors.fill:	parent
+			model:			qGfaAppCtrl.sysInfo.netInterfaceInfo.schemaModel
+			itemDelegate:	idTreeItemStyle
+			headerVisible:	false
+			style:			TreeViewStyle {
+				indentation: 50
+			}
+
+			TableViewColumn {
+				role: "name"
+				title: "Name"
+				width: 250
+			}
+
+			TableViewColumn {
+				role: "infoFormatted"
+				title: "Info"
+			}
+		}
+	}
+}

+ 77 - 19
app/visu/qml/stgdev.qml

@@ -1,14 +1,14 @@
 import QtQuick 2.6
 import QtQuick.Window 2.2
 import QtQuick.Controls 1.4 as Ctrl14
-import QtQuick.Controls 2.0
-//import QtQuick.Controls 1.5
+import QtQuick.Controls 1.5
+import QtQuick.Controls 2.0 as Ctrl20
 import QtQuick.Controls.Styles 1.4
-import com.gfa.ipc.appctrl 1.0
 import "globals.js" as Globals
+import com.gfa.ipc.appctrl 1.0
 
 /*
-	Available Roles (Columns):
+	Available Role names (Columns):
 
 	DiskName
 	DiskDevNode
@@ -25,6 +25,32 @@ import "globals.js" as Globals
 	PartFsSize
 	PartFsFree
 	PartFsUsed
+	PartSizeFmt
+	PartFsSizeFmt
+	PartFsFreeFmt
+	PartFsUsedFmt
+
+	Available Role-IDs:
+
+    SDR_DISKNAME
+    SDR_DISKDEVNODE
+    SDR_DISKBUSTYPE
+    SDR_DISKVENDORNAME
+    SDR_DISKVENDORID
+	SDR_DISKPRODUCTID
+	SDR_PARTFSLABEL
+	SDR_PARTFSTYPE
+	SDR_PARTFSVERSION
+	SDR_PARTDEVNODE
+	SDR_PARTMOUNTPOINT
+	SDR_PARTSIZE
+	SDR_PARTFSSIZE
+	SDR_PARTFSFREE
+	SDR_PARTFSUSED
+	SDR_PARTSIZE_FMT
+	SDR_PARTFSSIZE_FMT
+	SDR_PARTFSFREE_FMT
+	SDR_PARTFSUSED_FMT
 */
 
 Rectangle {
@@ -33,10 +59,25 @@ Rectangle {
 
 	/////////////////////////////////////////////////////////////////////////////////////////////////
 
-	TabBar {
+	function getPartitionDataByMountpoint(mopt, roleID)
+	{
+		var index;
+		for(var i = 0; i < qGfaAppCtrl.sysInfo.stgDev.rowCount(); ++i)
+		{
+	    	index = qGfaAppCtrl.sysInfo.stgDev.index(i, 0);
+	    	var mp = qGfaAppCtrl.sysInfo.stgDev.data(index, QGfaStgDevList.SDR_PARTMOUNTPOINT);
+	    	if(mp === mopt)
+	    		return qGfaAppCtrl.sysInfo.stgDev.data(index, roleID);
+		}
+		return null;
+	}
+
+	/////////////////////////////////////////////////////////////////////////////////////////////////
+
+	Ctrl20.TabBar {
 		id: idTabBar
 		width: parent.width
-		currentIndex: 3
+		currentIndex: 6
 
 		Repeater {
 			id: idRep
@@ -52,63 +93,80 @@ Rectangle {
 
 	/////////////////////////////////////////////////////////////////////////////////////////////////
 
-	Ctrl14.TableView {
+	TableView {
         x: 10
         y: 50
         width: parent.width - 20
-        height: 420
+        height: 380
         style: TableViewStyle {
         	itemDelegate: idTableViewItemStyle
         	headerDelegate: idTableViewHeaderStyle
         }
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			role: "DiskDevType"
 			width: 32
 			delegate:imageDelegate
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			width: 120
 			title: "Disk"
 			role: "DiskName"
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			width: 80
 			title: "Volume"
 			role: "PartFsLabel"
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			width: 80
 			title: "Size"
-			role: "PartSize"
+			role: "PartSizeFmt"
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			width: 80
 			title: "Used"
-			role: "PartFsUsed"
+			role: "PartFsUsedFmt"
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			width: 80
 			title: "Free"
-			role: "PartFsFree"
+			role: "PartFsFreeFmt"
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			width: 145
 			title: "Node"
 			role: "PartDevNode"
 		}
 
-		Ctrl14.TableViewColumn {
+		TableViewColumn {
 			title: "Mountpoint"
 			role: "PartMountPoint"
 		}
 
 		model: qGfaAppCtrl.sysInfo.stgDev
 	}
+
+    Rectangle {
+        x: 10
+        y: 440
+        height: 30
+        width: parent.width - 20
+		Ctrl14.Button {
+            text: "Update Storage Device Info"
+			style: idButtonStyle
+            anchors.fill: parent
+            onClicked: qGfaAppCtrl.sysInfoUpdateStgDevInfo()
+/*            onClicked: {
+                var data = getPartitionDataByMountpoint("/", QGfaStgDevList.SDR_PARTSIZE);
+            	console.log(data);
+            }*/
+		}
+    }
 }