fixed the beta
This commit is contained in:
@@ -32,7 +32,7 @@ QtObject {
|
|||||||
property string _activeDevice: ""
|
property string _activeDevice: ""
|
||||||
property real _prevRxBytes: 0
|
property real _prevRxBytes: 0
|
||||||
property real _prevTxBytes: 0
|
property real _prevTxBytes: 0
|
||||||
property int _prevUpdateTime: 0
|
property var _prevUpdateTime: 0
|
||||||
|
|
||||||
property Timer networkTimer: Timer {
|
property Timer networkTimer: Timer {
|
||||||
interval: 10000
|
interval: 10000
|
||||||
@@ -137,13 +137,27 @@ QtObject {
|
|||||||
else if (tline.indexOf("TX_BYTES=") === 0) txBytes = parseFloat(tline.substring("TX_BYTES=".length))
|
else if (tline.indexOf("TX_BYTES=") === 0) txBytes = parseFloat(tline.substring("TX_BYTES=".length))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.log("[Network] rxBytes:", rxBytes, "txBytes:", txBytes)
|
||||||
|
// console.log("[Network] activeDevice:", activeDevice, "| prevActiveDevice:", root._activeDevice)
|
||||||
|
// console.log("[Network] prevRxBytes:", root._prevRxBytes, "prevTxBytes:", root._prevTxBytes, "prevTime:", root._prevUpdateTime)
|
||||||
|
|
||||||
if (activeDevice === root._activeDevice && root._prevRxBytes > 0 && root._prevUpdateTime > 0) {
|
if (activeDevice === root._activeDevice && root._prevRxBytes > 0 && root._prevUpdateTime > 0) {
|
||||||
var interval = (Date.now() - root._prevUpdateTime) / 1000
|
var now = Date.now()
|
||||||
|
var interval = (now - root._prevUpdateTime) / 1000
|
||||||
|
// console.log("[Network] Same device, interval:", interval, "s")
|
||||||
|
// console.log("[Network] rxDelta:", (rxBytes - root._prevRxBytes), "txDelta:", (txBytes - root._prevTxBytes))
|
||||||
if (interval > 0) {
|
if (interval > 0) {
|
||||||
root.downloadSpeed = root.formatSpeed((rxBytes - root._prevRxBytes) / interval)
|
var downBps = (rxBytes - root._prevRxBytes) / interval
|
||||||
root.uploadSpeed = root.formatSpeed((txBytes - root._prevTxBytes) / interval)
|
var upBps = (txBytes - root._prevTxBytes) / interval
|
||||||
|
// console.log("[Network] downBps:", downBps, "upBps:", upBps)
|
||||||
|
root.downloadSpeed = root.formatSpeed(downBps)
|
||||||
|
root.uploadSpeed = root.formatSpeed(upBps)
|
||||||
|
// console.log("[Network] downloadSpeed:", root.downloadSpeed, "uploadSpeed:", root.uploadSpeed)
|
||||||
|
} else {
|
||||||
|
console.log("[Network] Interval zero or negative, skipping")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// console.log("[Network] First run or device changed, storing baseline")
|
||||||
root.downloadSpeed = ""
|
root.downloadSpeed = ""
|
||||||
root.uploadSpeed = ""
|
root.uploadSpeed = ""
|
||||||
}
|
}
|
||||||
@@ -152,6 +166,7 @@ QtObject {
|
|||||||
root._prevRxBytes = rxBytes
|
root._prevRxBytes = rxBytes
|
||||||
root._prevTxBytes = txBytes
|
root._prevTxBytes = txBytes
|
||||||
root._prevUpdateTime = Date.now()
|
root._prevUpdateTime = Date.now()
|
||||||
|
// console.log("[Network] Stored baseline: rxBytes:", root._prevRxBytes, "txBytes:", root._prevTxBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse WIFI section
|
// Parse WIFI section
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ PopupWindow {
|
|||||||
|
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
width: popupWidth
|
// width: popupWidth
|
||||||
height: background.height
|
// height: background.height
|
||||||
|
|
||||||
onAnchorHoveredChanged: popup.updateVisibility()
|
onAnchorHoveredChanged: popup.updateVisibility()
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ Rectangle { //workspace
|
|||||||
id: clockPopup
|
id: clockPopup
|
||||||
anchorItem: clockRect
|
anchorItem: clockRect
|
||||||
anchorHovered: clockArea.containsMouse
|
anchorHovered: clockArea.containsMouse
|
||||||
width: Math.max(text1.width, text2.width) + (Config.spacing_fun(clockRect.height) * 3)
|
implicitWidth: Math.max(text1.width, text2.width) + (Config.spacing_fun(clockRect.height) * 3)
|
||||||
height: text1.height*3+(Config.spacing_fun(clockRect.height) * 5)
|
implicitHeight: text1.height*3+(Config.spacing_fun(clockRect.height) * 5)
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ MouseArea {
|
|||||||
anchorItem: networkButton
|
anchorItem: networkButton
|
||||||
anchorHovered: networkButton.containsMouse
|
anchorHovered: networkButton.containsMouse
|
||||||
property int count: 17
|
property int count: 17
|
||||||
width: Math.max(text1.width, text2.width, text3.width, text4.width, text5.width, text6.width) + (Config.spacing_fun(networkButton.height) * 3)
|
implicitWidth: Math.max(text1.width, text2.width, text3.width, text4.width, text5.width, text6.width) + (Config.spacing_fun(networkButton.height) * 3)
|
||||||
height: text1.height*count+(Config.spacing_fun(networkButton.height) * (count + 2))
|
implicitHeight: text1.height*count+(Config.spacing_fun(networkButton.height) * (count + 2))
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
Reference in New Issue
Block a user