It is currently March 28th, 2024, 12:28 pm

Rainmeter unexpectedly terminate while using InlineSetting option

Report bugs with the Rainmeter application and suggest features.
Post Reply
LittleSuXing
Posts: 14
Joined: August 25th, 2013, 2:42 pm

Rainmeter unexpectedly terminate while using InlineSetting option

Post by LittleSuXing »

while using the InlineSetting option , a ChildMeasure of WebParserMeasure,a static string and a"#CRLF" at the same String type Meter ,rainmeter will
terminate.


For example :

Code: Select all

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

[MeasureWebparser]
Measure=Plugin
Plugin=WebParser
URL=https://www.wunderground.com/cgi-bin/findweather/getForecast?query=pws:IWENZHOU7&MR=1
RegExp=(?siU).*<meta
 property="og:title" content="(.*)\|.*(.*);.*\|(.*)".*/>
UpdateRate=300

[MeasureTitle1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWebparser]
StringIndex=1


[MeterString1]
Meter=String
text=[MeasureTitle1]#CRLF#testWord
DynamicVariables=1
Fontsize=20
InlineSetting=GradientColor | 130 | 90,90,90,255 ; 0.0  | 120,120,120,255 ; 0.3| 150,150,150,255 ; 0.6| 180,180,180,255 ; 0.9
When MeasureTile1 get the return string,the rainmeter will terminate.
But if lost anyone of the four things I listed before,the code would be safe.
LittleSuXing
Posts: 14
Joined: August 25th, 2013, 2:42 pm

Re: Rainmeter unexpectedly terminate while using InlineSetting option

Post by LittleSuXing »

My rainmeter version is 4.0.0 r2746 64-bit (Jan 1 2017)
windows system is Windows 7 Ultimate 64-bit (build 7601) Service Pack 1
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter unexpectedly terminate while using InlineSetting option

Post by jsmorley »

First, your RegExp isn't working, so nothing is actually being returned. I fixed it in my code below.

Now, once that works, you are right. What is happening is that on the first skin update, when the value of [MeasureTitle1] is still "" (an empty string) that combination of NULL#CRLF#testWord is crashing Rainmeter with InlineSetting. That shouldn't happen, and I'm sure brian will take a look at it.

This problem will be particular to WebParser, QuotePlugin, FileView, RunCommand and other measures that are "threaded" and will always have a string value of "" on the first skin update. Unlike other measures, Rainmeter doesn't "wait" for an answer from those kinds of measures, but sends them off to do their thing and carries on. When they are "done", which might be on the second skin update, or even later, then their value will be populated. In the meantime, their value is ""

It can be fixed for now, by ensuring that an empty string is never passed to that Text option. Use FinishAction on the parent WebParser measure to set the Text option on the meter, so it won't be set until WebParser has actually successfully returned some value.

Code: Select all

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

[MeasureWebparser]
Measure=Plugin
Plugin=WebParser
URL=https://www.wunderground.com/cgi-bin/findweather/getForecast?query=pws:IWENZHOU7&MR=1
RegExp=(?siU).*<meta property="og:title" content="(.*) \| (.*)&.*\| (.*)"
UpdateRate=300
FinishAction=[!SetOption MeterString1 Text "[*MeasureTitle1*]#CRLF#testWord"]

[MeasureTitle1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWebparser]
StringIndex=1


[MeterString1]
Meter=String
DynamicVariables=1
Fontsize=20
InlineSetting=GradientColor | 130 | 90,90,90,255 ; 0.0  | 120,120,120,255 ; 0.3| 150,150,150,255 ; 0.6| 180,180,180,255 ; 0.9
1.jpg
LittleSuXing
Posts: 14
Joined: August 25th, 2013, 2:42 pm

Re: Rainmeter unexpectedly terminate while using InlineSetting option

Post by LittleSuXing »

jsmorley wrote:First, your RegExp isn't working, so nothing is actually being returned. I fixed it in my code below.

Now, once that works, you are right. What is happening is that on the first skin update, when the value of [MeasureTitle1] is still "" (an empty string) that combination of NULL#CRLF#testWord is crashing Rainmeter with InlineSetting. That shouldn't happen, and I'm sure brian will take a look at it.

This problem will be particular to WebParser, QuotePlugin, FileView, RunCommand and other measures that are "threaded" and will always have a string value of "" on the first skin update. Unlike other measures, Rainmeter doesn't "wait" for an answer from those kinds of measures, but sends them off to do their thing and carries on. When they are "done", which might be on the second skin update, or even later, then their value will be populated. In the meantime, their value is ""

It can be fixed for now, by ensuring that an empty string is never passed to that Text option. Use FinishAction on the parent WebParser measure to set the Text option on the meter, so it won't be set until WebParser has actually successfully returned some value.

Code: Select all

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

[MeasureWebparser]
Measure=Plugin
Plugin=WebParser
URL=https://www.wunderground.com/cgi-bin/findweather/getForecast?query=pws:IWENZHOU7&MR=1
RegExp=(?siU).*<meta property="og:title" content="(.*) \| (.*)&.*\| (.*)"
UpdateRate=300
FinishAction=[!SetOption MeterString1 Text "[*MeasureTitle1*]#CRLF#testWord"]

[MeasureTitle1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWebparser]
StringIndex=1


[MeterString1]
Meter=String
DynamicVariables=1
Fontsize=20
InlineSetting=GradientColor | 130 | 90,90,90,255 ; 0.0  | 120,120,120,255 ; 0.3| 150,150,150,255 ; 0.6| 180,180,180,255 ; 0.9
1.jpg
I'm sorry for forgetting check the RegExp code after I pasted it.
:rosegift: Thanks for your replay ,I will try.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Rainmeter unexpectedly terminate while using InlineSetting option

Post by Brian »

This issue has been fixed and will be in the next beta. Thanks for reporting.

-Brian
Post Reply