It is currently May 24th, 2019, 10:11 pm

illustro-Network editing problem

Help with creating, editing & fixing problems with skins
Sliver
Posts: 3
Joined: May 15th, 2019, 9:57 pm

illustro-Network editing problem

Sliver » May 17th, 2019, 12:23 am

Hi to everyone,

I am new to rainmeter "coding" so please go with ease on me :D.
I am messing around with illustro skin and in particular with the Network.ini.
My goal is to obtain info from an arduino and pass this info (through a python program which modifies the .ini with the new variables (in this case temp and humi)) and then refreshes the skin.
As you ll see in my "code" i have it working but the problem is with the meterBar. I could easily take it out but i thought why not? And then 3 hours later after modifying and reading every topic in case i find anything i realized that i failed miserably. Please can anyone point the mistake i have made? I am almost certain that the problem is somewhere here:

Code: Select all

[measureHumiforBar]
Measure=#humi#
max_Humi=#maxHumi#

[measureTempforBar]
Measure=#temp#
Max_Temp=#maxTemp#
Full code: (Note that i haven't changed every value's name for my need because i still test it.)

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Variables]
temp = 25
humi = 79

fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
maxHumi=100
MaxTemp=45

[measureIP]
Measure=Plugin
Plugin=WebParser
URL=https://checkip.amazonaws.com/
UpdateRate=14400
RegExp=(?siU)^(.*)$
StringIndex=1
Substitute="":"N/A"

[measureHumiforBar]
Measure=#humi#
max_Humi=#maxHumi#

[measureTempforBar]
Measure=#temp#
Max_Temp=#maxTemp#


[styleTitle]
StringAlign=Center
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[styleSeperator]
SolidColor=255,255,255,15

[meterTitle]
Meter=String
MeterStyle=styleTitle
X=100
Y=12
W=190
H=18
Text=Indoor Sensors

[meterIPLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text=Something else here

[meterIPValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureIP
X=200
Y=0r
W=190
H=14
Text=%1

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1

[meterUploadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text=Temperature

[meterUploadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureTempforBar
X=200
Y=0r
W=190
H=14
Text=#temp# °C
AutoScale=1

[meterUploadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureTempforBar
X=10
Y=72
W=190
H=1

[meterDownloadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Humidity

[meterDownloadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureHumiforBar		; Or does the problem occur here?
X=200
Y=0r
W=190
H=14
Text=#humi# °%
AutoScale=1

[meterDownloadBar]				
Meter=Bar
MeterStyle=styleBar
MeasureName=measureHumiforBar		; Or here?
X=10
Y=92
W=190
H=1
I guess i can't understand how the Bar works. Where(or how) does it take values to compare.
Thank you in advance even for reading my question.
Cheers,
Jim
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3335
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: illustro-Network editing problem

eclectic-tech » May 17th, 2019, 1:15 am

The bar meter displays PERCENTUAL values, so the measure needs to tell the bar meter the "MinValue" and "MaxValue" so it can calculate the percentage. Adding those lines to your measures should get the bar to display. You do not have to use zero as the minimum value, the meter will still determine the percentage from min to max values.

Code: Select all

[measureHumiforBar]
Measure=#humi#
max_Humi=#maxHumi#
MinValue=0
MaxValue=#maxHumi#

[measureTempforBar]
Measure=#temp#
Max_Temp=#maxTemp#
MinValue=0
MaxValue=#maxTemp#
Sliver
Posts: 3
Joined: May 15th, 2019, 9:57 pm

Re: illustro-Network editing problem

Sliver » May 17th, 2019, 11:23 am

Hi eclectic-tech,
And thank you for your reply.

Unfortunately that didn't work either. i still have no bar.
I messed around a bit but i couldn't make the bar to work .
I had already read the article you proposed.
Is there any other suggestion you can make please?

Thank you in advance,
Jim
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3335
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: illustro-Network editing problem

eclectic-tech » May 17th, 2019, 12:30 pm

Sliver wrote:
May 17th, 2019, 11:23 am
Hi eclectic-tech,
And thank you for your reply.

Unfortunately that didn't work either. i still have no bar.
I messed around a bit but i couldn't make the bar to work .
I had already read the article you proposed.
Is there any other suggestion you can make please?

Thank you in advance,
Jim
JIm,

I only added the lines needed to set a percentage... I completely overlooked the errors in your code... My Bad! O.O

The measures you added for temp and humidity have errors and omissions. The measures needs to be defined as one of the built-in measures or a plugin, not as a static value. In Rainmeter, bangs are used to achieve the desired effects in meters, measures, and plugins.

I set them up as random number Calc measures which require LowBound/HighBound to control the randomness, along with MinValue/MaxValue for percentages; you would need to use your own measures that obtain the info you want from your sensors.

Also, comments can not be added to lines of code; this will cause the code to be invalid and generate errors in the log. The log is your best tool to view as you modify or create skins (select "Open log" from Manage or select "About" to see the log).

Once you correct your new measures and remove the in-line comments it will work. Sorry for not looking closer before.

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Variables]
temp = 25
humi = 79

fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
maxHumi=100
MaxTemp=45

[measureIP]
Measure=Plugin
Plugin=WebParser
URL=https://checkip.amazonaws.com/
UpdateRate=14400
RegExp=(?siU)^(.*)$
StringIndex=1
Substitute="":"N/A"

[measureHumiforBar]
Measure=Calc
Formula=random
LowBound=0
HighBound=#maxHumi#
MinValue=0
MaxValue=#maxHumi#
DynamicVariables=1

[measureTempforBar]
Measure=Calc
Formula=random
LowBound=0
HighBound=#maxTemp#
MinValue=0
MaxValue=#maxTemp#
DynamicVariables=1

[styleTitle]
StringAlign=Center
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[styleSeperator]
SolidColor=255,255,255,15

[meterTitle]
Meter=String
MeterStyle=styleTitle
X=100
Y=12
W=190
H=18
Text=Indoor Sensors

[meterIPLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text=Sensor Data for IP:

[meterIPValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureIP
X=200
Y=0r
W=190
H=14
Text=%1

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1

[meterUploadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text=Temperature (0~45)

[meterUploadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureTempforBar
X=200
Y=0r
W=190
H=14
Text=%1 °C
AutoScale=1

[meterUploadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureTempforBar
X=10
Y=72
W=190
H=1

[meterDownloadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Humidity (0~100)

[meterDownloadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureHumiforBar
X=200
Y=0r
W=190
H=14
Text=%1°%
AutoScale=1

[meterDownloadBar]				
Meter=Bar
MeterStyle=styleBar
MeasureName=measureHumiforBar
X=10
Y=92
W=190
H=1
is2.gif
You do not have the required permissions to view the files attached to this post.
Sliver
Posts: 3
Joined: May 15th, 2019, 9:57 pm

Re: illustro-Network editing problem

Sliver » May 17th, 2019, 9:19 pm

Hey eclectic-tech,

Damn you are good. I really tried the calc as a measure but i wouldn't be able with my current experience to add all the necessary lines of code for this to work like you did.

I can't thank you enough. You are the man.
Jim
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3335
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: illustro-Network editing problem

eclectic-tech » May 18th, 2019, 3:46 am

Glad to help :great: