(SOLVED) Counter variable for async meter text update?
Posted: July 17th, 2017, 10:41 pm
UPDATE: Just found the "UpdateDivider" general option, which is exactly what I needed.
Hello,
I am trying to setup an asynchronous update between the network upload and download speed string meters and their corresponding line meters such that while the line meter updates ever 100ms, the string value only updates every 1000ms.
I saw that the actionTimer doesn't support infinite loops due to performance concerns, so I figured I'd just use a variable that counts to 10, then updates the upload and download speed text and then resets to a value of 0, effectively making the update period 10 times that of the global update period.
The problem is, is that it doesn't work. At them moment, it still updates at a 100ms cycle.
The full Network.ini is in the spoiler tag below, but here's the excerpt that I believe is the important bits:
As as aside, I am assuming that one of my "DynamicVariables=1" lines is redundant, but I'm not sure which since I read that all meters and measures using changing variables need that line, so I figured I should just put it in both the meter and the measure.
Full Network.ini
Hello,
I am trying to setup an asynchronous update between the network upload and download speed string meters and their corresponding line meters such that while the line meter updates ever 100ms, the string value only updates every 1000ms.
I saw that the actionTimer doesn't support infinite loops due to performance concerns, so I figured I'd just use a variable that counts to 10, then updates the upload and download speed text and then resets to a value of 0, effectively making the update period 10 times that of the global update period.
The problem is, is that it doesn't work. At them moment, it still updates at a 100ms cycle.
The full Network.ini is in the spoiler tag below, but here's the excerpt that I believe is the important bits:
Code: Select all
[Variables]
ctr=0
upValue=0
[measureNetIn]
Measure=NetIn
NetInSpeed=#maxDownload#
IfCondition=#ctr#=10
IfTrueAction=[!SetOption meterUploadValue Text #upValue#][!SetVariable ctr 0]
IfFalseAction=[!SetVariable ctr (#ctr#+1)]
OnUpdateAction=[!UpdateMeter meterUploadValue][!Redraw]
DynamicVariables=1
[meterUploadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetOut
X=200
Y=0r
W=190
H=14
upValue=%1B/s
; Text=%1B/s
NumOfDecimals=2
AutoScale=1
DynamicVariables=1
Full Network.ini