It is currently October 12th, 2024, 2:54 am

I need help with RAM measures coding

Get help with creating, editing & fixing problems with skins
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

Judian81 wrote: September 12th, 2022, 3:46 pm ow. wait. i just have 8 GB of ram. so i had to change the ImageName=Back16.png to ImageName=Back8.png right?!
You should change the ImageNames in [MtrBarBg] and [MtrBarProgress] to Back8.png and Bar8.png.

I would be happy if you repost the result. According to this situation, I will interfere with the skin :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: I need help with RAM measures coding

Post by Judian81 »

tass_co wrote: September 12th, 2022, 3:52 pm I would be happy if you repost the result. According to this situation, I will interfere with the skin :thumbup:

that does the trick.

mem meter 8gb.png

cool.
You do not have the required permissions to view the files attached to this post.
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

Judian81 wrote: September 12th, 2022, 4:22 pm that does the trick.


mem meter 8gb.png
Earlier, I added a code for it to set the image files itself according to the RAM status. But it caused some problems. I had to extract the code.
Judian81 wrote: September 12th, 2022, 4:22 pm cool.
Glad you like it :great:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16651
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I need help with RAM measures coding

Post by balala »

Judian81 wrote: September 12th, 2022, 3:46 pm ow. wait. i just have 8 GB of ram. so i had to change the ImageName=Back16.png to ImageName=Back8.png right?!
Well, not to nitpick, but this kind of manual modification should be avoided as much as possible. Additionally there I see a small problem with tass_co's code:
RAM.png
Additionally, I'd tend to have visible so many Bar meters as many GB memory is present. In the last posted skin, there are only two Bar meters, one horizontal, the other vertical. Seems weird a little bit, even if it does work well.
So, I post another approach, in which I used more Bar meters. In this case the skin shows up so many such bars as many GB of memory the system has (as said above). The skin works for systems with up to 16 GB of memory, but if needed can be extended (waiting for a reply if anyone is interested, but can't realize how to add the needed suplimentar sections). To extend the range, you have to add further [MeasureBarXX] Calc measures and the appropriate [MeterBarXX] meters. Eventually suplimentar [MeterStringXX] String meters will also be needed.

Code: Select all

[Rainmeter]
Update=1000

[Variables]

[BarStyle]
Y=80
W=6
H=26
BarColor=119,167,187
SolidColor=255,114,98
BarOrientation=Vertical
DynamicVariables=1

[StringStyle]
FontColor=255,255,255
FontFace=Arial
FontSize=6
StringAlign=Left
DynamicVariables=1

[MeaTotalMem]
Measure=PhysicalMemory
Total=1
UpdateDivider=3600

[MeasureNumOfBars]
Measure=Calc
Formula=( Ceil ( MeaTotalMem / ( 1024 ** 3 )))
;(( MeaTotalMem > ( 1024 ** 3 )) ? ( Ceil ( MeaTotalMem / ( 1024 ** 3 ))) : (( MeaTotalMem > ( 1024 ** 2 )) ? ( Ceil ( MeaTotalMem / ( 1024 ** 2 ))) : (( MeaTotalMem > 1024 ) ? ( Ceil ( MeaTotalMem /  1024 )) : MeaTotalMem )))

[MeasureFreeMemInteger]
Measure=Calc
Formula=( Trunc ( MeaFreeMem / ( 1024 ** 3 )))

[MeaFreeMem]
Measure=PhysicalMemory
InvertMeasure=1

[MeasureBar1]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 0 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 0 ))

[MeasureBar2]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 1 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 1 ))

[MeasureBar3]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 2 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 2 ))

[MeasureBar4]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 3 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 3 ))

[MeasureBar5]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 4 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 4 ))

[MeasureBar6]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 5 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 5 ))

[MeasureBar7]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 6 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 6 ))

[MeasureBar8]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 7 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 7 ))

[MeasureBar9]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 8 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 8 ))

[MeasureBar10]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 9 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 9 ))

[MeasureBar11]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 10 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 10 ))

[MeasureBar12]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 11 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 11 ))

[MeasureBar13]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 12 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 12 ))

[MeasureBar14]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 13 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 13 ))

[MeasureBar15]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 14 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 14 ))

[MeasureBar16]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 15 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 15 ))

[MeterBar1]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar1
X=0
Hidden=([MeasureNumOfBars]<1)

[MeterBar2]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar2
X=2R
Hidden=([MeasureNumOfBars]<2)

[MeterBar3]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar3
X=2R
Hidden=([MeasureNumOfBars]<3)

[MeterBar4]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar4
X=2R
Hidden=([MeasureNumOfBars]<4)

[MeterBar5]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar5
X=2R
Hidden=([MeasureNumOfBars]<5)

[MeterBar6]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar6
X=2R
Hidden=([MeasureNumOfBars]<6)

[MeterBar7]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar7
X=2R
Hidden=([MeasureNumOfBars]<7)

[MeterBar8]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar8
X=2R
Hidden=([MeasureNumOfBars]<8)

[MeterBar9]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar9
X=2R
Hidden=([MeasureNumOfBars]<9)

[MeterBar10]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar10
X=2R
Hidden=([MeasureNumOfBars]<10)

[MeterBar11]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar11
X=2R
Hidden=([MeasureNumOfBars]<11)

[MeterBar12]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar12
X=2R
Hidden=([MeasureNumOfBars]<12)

[MeterBar13]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar13
X=2R
Hidden=([MeasureNumOfBars]<13)

[MeterBar14]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar14
X=2R
Hidden=([MeasureNumOfBars]<14)

[MeterBar15]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar15
X=2R
Hidden=([MeasureNumOfBars]<15)

[MeterBar16]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar16
X=2R
Hidden=([MeasureNumOfBars]<16)

[MeterString1]
Meter=String
MeterStyle=StringStyle
Text=1
X=0
Y=([MeterBar1:YH]+2)
Hidden=([MeasureNumOfBars]<1)

[MeterString8]
Meter=String
MeterStyle=StringStyle
Text=8
X=56
Y=0r
Hidden=([MeasureNumOfBars]<8)

[MeterString16]
Meter=String
MeterStyle=StringStyle
Text=16
X=118
Y=0r
Hidden=([MeasureNumOfBars]<16)
Sorry tass_co, don't want to upset you, hope I didn't. Definitely was not my intention.
You do not have the required permissions to view the files attached to this post.
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: I need help with RAM measures coding

Post by tass_co »

balala wrote: September 12th, 2022, 7:20 pm Well, not to nitpick, but this kind of manual modification should be avoided as much as possible. Additionally there I see a small problem with tass_co's code:
RAM.png
Additionally, I'd tend to have visible so many Bar meters as many GB memory is present. In the last posted skin, there are only two Bar meters, one horizontal, the other vertical. Seems weird a little bit, even if it does work well.
So, I post another approach, in which I used more Bar meters. In this case the skin shows up so many such bars as many GB of memory the system has (as said above). The skin works for systems with up to 16 GB of memory, but if needed can be extended (waiting for a reply if anyone is interested, but can't realize how to add the needed suplimentar sections). To extend the range, you have to add further [MeasureBarXX] Calc measures and the appropriate [MeterBarXX] meters. Eventually suplimentar [MeterStringXX] String meters will also be needed.

Sorry tass_co, don't want to upset you, hope I didn't. Definitely was not my intention.
No, you definitely don't, balala :thumbup:

I tried to create a skin as requested.
I thought to thing for the design;
There will be 2 bars
One horizontal and the other vertical.
The horizontal bar would shows the fully used memory,
The other one would be positioned according to the memory space...

If there is a better code, we should prefer it.
After all, our purpose here is to help each other, isn't it? :bow:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16651
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I need help with RAM measures coding

Post by balala »

tass_co wrote: September 12th, 2022, 8:10 pm After all, our purpose here is to help each other, isn't it? :bow:
Definitely right.
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: I need help with RAM measures coding

Post by Judian81 »

thanks guys. :great:


i have a very big screen. so i build in a scale option. i thought just to share it.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
vSkinscale=3

[BarStyle]
Y=80
W=(6*#vSkinscale#)
H=(26*#vSkinscale#)
BarColor=119,167,187
SolidColor=255,114,98
BarOrientation=Vertical
DynamicVariables=1

[StringStyle]
FontColor=255,255,255
FontFace=Arial
FontSize=(6*#vSkinscale#)
StringAlign=Left
DynamicVariables=1

[MeaTotalMem]
Measure=PhysicalMemory
Total=1
UpdateDivider=3600

[MeasureNumOfBars]
Measure=Calc
Formula=( Ceil ( MeaTotalMem / ( 1024 ** 3 )))
;(( MeaTotalMem > ( 1024 ** 3 )) ? ( Ceil ( MeaTotalMem / ( 1024 ** 3 ))) : (( MeaTotalMem > ( 1024 ** 2 )) ? ( Ceil ( MeaTotalMem / ( 1024 ** 2 ))) : (( MeaTotalMem > 1024 ) ? ( Ceil ( MeaTotalMem /  1024 )) : MeaTotalMem )))

[MeasureFreeMemInteger]
Measure=Calc
Formula=( Trunc ( MeaFreeMem / ( 1024 ** 3 )))

[MeaFreeMem]
Measure=PhysicalMemory
InvertMeasure=1

[MeasureBar1]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 0 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 0 ))

[MeasureBar2]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 1 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 1 ))

[MeasureBar3]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 2 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 2 ))

[MeasureBar4]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 3 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 3 ))

[MeasureBar5]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 4 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 4 ))

[MeasureBar6]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 5 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 5 ))

[MeasureBar7]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 6 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 6 ))

[MeasureBar8]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 7 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 7 ))

[MeasureBar9]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 8 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 8 ))

[MeasureBar10]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 9 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 9 ))

[MeasureBar11]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 10 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 10 ))

[MeasureBar12]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 11 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 11 ))

[MeasureBar13]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 12 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 12 ))

[MeasureBar14]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 13 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 13 ))

[MeasureBar15]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 14 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 14 ))

[MeasureBar16]
Measure=Calc
Formula=(( MeasureFreeMemInteger = 15 ) ? ( Frac ( MeaFreeMem / ( 1024 ** 3 ))) : ( MeasureFreeMemInteger > 15 ))

[MeterBar1]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar1
X=0
Hidden=([MeasureNumOfBars]<1)

[MeterBar2]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar2
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<2)

[MeterBar3]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar3
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<3)

[MeterBar4]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar4
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<4)

[MeterBar5]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar5
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<5)

[MeterBar6]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar6
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<6)

[MeterBar7]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar7
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<7)

[MeterBar8]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar8
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<8)

[MeterBar9]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar9
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<9)

[MeterBar10]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar10
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<10)

[MeterBar11]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar11
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<11)

[MeterBar12]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar12
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<12)

[MeterBar13]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar13
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<13)

[MeterBar14]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar14
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<14)

[MeterBar15]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar15
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<15)

[MeterBar16]
Meter=Bar
MeterStyle=BarStyle
MeasureName=MeasureBar16
X=(2*#vSkinscale#)R
Hidden=([MeasureNumOfBars]<16)

[MeterString1]
Meter=String
MeterStyle=StringStyle
Text=1
X=0
Y=([MeterBar1:YH]+2)
Hidden=([MeasureNumOfBars]<1)

[MeterString8]
Meter=String
MeterStyle=StringStyle
Text=8
X=((8*8-8)*#vSkinscale#)
Y=0r
Hidden=([MeasureNumOfBars]<8)

[MeterString16]
Meter=String
MeterStyle=StringStyle
Text=(16*#vSkinscale#)
;X=118
X=((8*16-8)*#vSkinscale#)
Y=0r
Hidden=([MeasureNumOfBars]<16)
User avatar
balala
Rainmeter Sage
Posts: 16651
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I need help with RAM measures coding

Post by balala »

Judian81 wrote: September 13th, 2022, 4:26 pm i have a very big screen. so i build in a scale option. i thought just to share it.
Good job! :thumbup:
User avatar
truejaz
Posts: 11
Joined: September 10th, 2022, 7:06 pm

Re: I need help with RAM measures coding

Post by truejaz »

This is the skin I made.
I would love to get your feedback so I can improve it.
Thanks to all of you for your help
cyberfreak 2077_0.0.1 Alpha.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16651
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I need help with RAM measures coding

Post by balala »

truejaz wrote: September 14th, 2022, 8:26 am I would love to get your feedback so I can improve it.
You definitely should improve, at least the cyberfreak 2077\RAM\RAM.ini skin. Here is why:
cyberfreak.png
(screenshot of the cyberfreak 2077\RAM\RAM.ini skin).

Another issue: the buttons of the cyberfreak 2077\Menu\Cybermenu.ini skin (Computer, Control Panel, Pictures and so on) are overlaping each other. Due to this, when you're hovering the mouse over the overlaping regions, you get highlighted two buttons in the same time:
cyberfreak2.png
You should resize the buttons, not to have them overlaping.

Suplimentar advice: if your skin is using some resources as this one does (in this case I'm talking about the BackXX.png and BarXX.png images), these resources should be placed into the @Resources folder. Especially that there is such a folder in your config, so why not to use it? Accordingly I'd create a folder called for instance RAM in the @Resources folder, would move all .png files from the cyberfreak 2077\RAM folder there and would replace the appropriate paths in the options in the RAM.ini skin file to use this new location of the images (for instance the BarImage=Bar16.png option of the [MtrBarProgress] meter would become BarImage=#@#RAM\Bar16.png). From now it's basic requirement to place and use the resources from the @Resources folder.
Same applies for the cyberfreak 2077\Menu\Cybermenu.ini skin as well, which uses the resources from the ing folder. Move them as well to the @Resources folder.
You do not have the required permissions to view the files attached to this post.