It is currently March 28th, 2024, 3:30 pm

Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Get help with creating, editing & fixing problems with skins
Post Reply
rtrski
Posts: 2
Joined: August 12th, 2021, 12:50 pm

Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by rtrski »

Hi, semi-new here but think I'm off and running. This is a 'cleanliness' question because I don't see a "!DisableMeter" bang documented, only "!DisableMeasure" or "!HideMeter".

I have a Measure that's a random number generator from 0 - 2, which updates only every 100-150 intervals. If the value is 1 or 2, I set a base filename and start a Loop Measure, and enable a Meter to display one of two sets of 10 frames in sequence. If the random value is 0 I just leave that image Meter, and the Loop measure controlling its filename reset and disabled.

The Loop Measure is actually set to have range 1 - 11, so once the image clips play when it hits 11 another measure resets it and then disables it. (which fixes it at 0, until the next time the random measure triggers it off again. (Took me a while to figure out I couldn't have that Ifcondition in the rando trigger because it only updates every 150 cycles...)

The ONLY issue with this functioning the way I want is the log is being hit every update that the frames are not playing (so something like 140 of every 150 cycles) with: "Unable to open: {path}\Frame-0.png " error messages.

Any pointers? Should I also maybe when 'finishing' my 10 frames, besides hiding the image meter, reset its UpdateDivider to a high count to reduce these messages? I can (I think) drop the Update divider back down to the frame rate I want when I re-enabled it the next time my random triggers.

Or IS there a way to entirely disable/renable a Meter like a measure, vs. just show/hide/toggle??

Or...don't care, the Errors don't harm anything if logging is off, they just buffer for a little while then drop off?

Pertinent Code (Missing some surrounding context, and another couple meters that show text and shapes along with the image, but I hope clear enough otherwise):

Code: Select all

[MeasureRando3]
;Use for Poole Animations, 3 states
Measure=Calc
Formula=Random
UpdateRandom=1
LowBound=0
HighBound=2
UpdateDivider=150
;10 frames per short clip segment, turn on and start frame count if 1 or 2
IfCondition=((MeasureRando3 = 1) && (MeasureImageLoop = 0))
IfTrueAction=[!SetVariable FileBase "Frame-"] [!EnableMeasure MeasureImageLoop] [!CommandMeasure MeasureImageLoop "Reset"] [!SetOption MeterPooleText Text "transponder re-acquired"] [!ShowMeter "Meter_Brackets_Small2"] [!ShowMeter "MeterPooleFloat"]
IfCondition2=((MeasureRando3 = 2) && (MeasureImageLoop = 0))
IfTrueAction2=[!SetVariable FileBase "Frame_2-"] [!EnableMeasure MeasureImageLoop] [!CommandMeasure MeasureImageLoop "Reset"]   [!SetOption MeterPooleText Text "*medical link updating... *"] [!ShowMeter "Meter_Brackets_Small2"] [!ShowMeter "MeterPooleFloat"]
;turn off and reset counter if 0, don't show images by hiding meter
IfCondition3=(MeasureRando3 = 0)
IfTrueAction3=[!SetOption MeterPooleText Text "**SIGNAL LOST**"] [!CommandMeasure MeasureImageLoop "Reset"] [!DisableMeasure MeasureImageLoop] [!HideMeter "Meter_Brackets_Small2"] [!HideMeter "MeterPooleFloat"] 

[MeasureImageLoop]
Measure=Loop
StartValue=1
EndValue=11
;Last value triggers reset, should hide meter but might see a 'no frame 11' or '0' message depending on when reset happens.
Increment=1
LoopCount=1
UpdateDivider=2
;slow the animation rate a little

;Rando3 only triggers every 150 updates, so need another measure to reset and shut off MeasureImageLoop when it hits 11. (Can't seem to have Ifconditions inside the Loop measure, but there might be a cleaner way than another measure i haven't figured out)
[MeasureImageReset]
Measure=Calc
Formula=1
IfCondition=(MeasureImageLoop = 11)
IfTrueAction=[!SetOption MeterPooleText Text "**SIGNAL LOST**"] [!CommandMeasure MeasureImageLoop "Reset"] [!DisableMeasure MeasureImageLoop] [!HideMeter "Meter_Brackets_Small2"] [!HideMeter "MeterPooleFloat"]

[MeterPooleFloat]
;display a brief clip of tumbling dead astronaut which does not "close" so I can't loop it endlessly, just play and then hide again...
Meter=Image
X=550
Y=200
W=304
H=300
PreserveAspectRatio=1
ImageCrop=460,80,220,220
ImageName=C:\Users\rtrem\OneDrive\Documents\2020_CPU_Build\PooleTumbling\#FileBase#[MeasureImageLoop].png
AntiAlias=1
Padding 2,2,2,2
SolidColor=180,50,50,(50+[MeasureBlinker])
UpdateDivider=2
DynamicVariables=1


User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by SilverAzide »

To disable a meter, just hide it; i.e., Hidden=1. (!ShowMeter and !HideMeter are the bangs you can use.)
rtrski
Posts: 2
Joined: August 12th, 2021, 12:50 pm

Re: Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by rtrski »

I am using the !HideMeter bang. However, the Meter itself is still Updating, it's just not being rendered on the screen.

So if the counter trying to open the file is set to 0, and I only have filenames with 1-10, it is throwing error messages.

Now that I think about it, I guess there's no need to set it to 0, just leave it on 10 but not show the meter and I won't see the messages in the log...I'll try that.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by balala »

rtrski wrote: August 12th, 2021, 2:30 pm The ONLY issue with this functioning the way I want is the log is being hit every update that the frames are not playing (so something like 140 of every 150 cycles) with: "Unable to open: {path}\Frame-0.png " error messages.
Can't check, because we don't have the images. So first please pack the whole config which contains the images and upload the package here.
rtrski wrote: August 12th, 2021, 2:30 pm Or IS there a way to entirely disable/renable a Meter like a measure, vs. just show/hide/toggle??
There is a notions confusion problem: a meter can't be enabled / disabled. Makes no sense. So I don't understand your intention: what should go on with a so called "disabled" meter?
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by SilverAzide »

rtrski wrote: August 12th, 2021, 3:34 pm I am using the !HideMeter bang. However, the Meter itself is still Updating, it's just not being rendered on the screen.
Just because you disable a measure, does not mean it is "dead". To Rainmeter, it doesn't "update" a disabled measure just like it doesn't draw a hidden meter. But it is still alive. If you'd like to prove it for yourself, set a measure's Disabled to a formula or variable (with DynamicVariables=1 of course) that is controlled by something else. You will see the measure enable and disable itself as needed, since Rainmeter is still processing it every update cycle.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureLoop]
Measure=Loop
StartValue=0
EndValue=1

[MeasureCalc]
Measure=Calc
Formula=1
Disabled=([MeasureLoop])
DynamicVariables=1

[Text]
Meter=String
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by balala »

rtrski wrote: August 12th, 2021, 3:34 pm So if the counter trying to open the file is set to 0, and I only have filenames with 1-10, it is throwing error messages.
The simplest solution to this problem is to create a 0.png image, which can be either transparent, or 1 pixel wide and high. This way the error message is avoided and there is nothing shown on the screen (at least nothing visible).
User avatar
Yincognito
Rainmeter Sage
Posts: 7024
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Should I try and suppress/decrease "cannot open file" messages for cleanliness/cpu burn?

Post by Yincognito »

rtrski wrote: August 12th, 2021, 3:34 pm I am using the !HideMeter bang. However, the Meter itself is still Updating, it's just not being rendered on the screen.

So if the counter trying to open the file is set to 0, and I only have filenames with 1-10, it is throwing error messages.

Now that I think about it, I guess there's no need to set it to 0, just leave it on 10 but not show the meter and I won't see the messages in the log...I'll try that.
Yes, you could let it at 10 and hide the meter, but that could lead to inconsistencies if you somehow have other meters relatively positioned to the image or do other things with the W and / or H of the meter. Balala's solution of creating a Frame-0.png transparent image of the same W and H is both the simplest and the safest way to deal with this, just in case scenarios like the above are (or will be, at some point) present in your skin.
Post Reply