It is currently May 4th, 2024, 2:34 am

Help to assemble a formula

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7198
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

arcanosa84 wrote: October 13th, 2023, 1:02 am https://forum.rainmeter.net/viewtopic.php?t=42818&start=140#p218279
I don't know what happened with the translation, so let me try to explain the problem again:
Here I posted all my Skins and among them, I talked about the Pings graphic.
The problem I have is that you can not recreate it, and I can not disable this measure when there is no internet, to connect if it works well, but even being disabled still trying to ping, which is not possible because the cable is disconnected, I know we have reviewed several times this point but I can not, and yes, when I connect the internet works correctly.
What I need is to effectively disable it when there is no internet connection.
I did not write it that way because when I connect the internet it works perfectly, the problem is the other way around. I tried to use !Pause and !Unpause but the same thing happens.
Alright, thanks for the link, this might help by not having to search through tons of posts to find the package. However, I believe we've already discussed this thing before. You have 2 ways to try to do that in your condition branches from InternetStatus (if the 1st way doesn't work, try the 2nd way):

1. Continue with disabling / enabling, like in the code you posted above, BUT also update the ping measures afterwards (you could update the relevant meters and redraw as well, if you want). This is how you update a ping measure:
https://forum.rainmeter.net/viewtopic.php?t=20880#p111353
So, just add the 3 bangs from the mouse action there for both your measures, adjusting to your case (like using your own measure names and setting the update rate back to #Rate# in the last bangs).

2. Avoid disabling / enabling altogether, and work ONLY with the update rate, by setting it to #Rate# when you want to continue pinging regularly, and setting it to -1 when you want to stop pinging. This is how I already explained how to do that, more than 2 months ago (if anyone listened, that is):
https://forum.rainmeter.net/viewtopic.php?t=42401&start=60#p216940
So, just adapt the 3 bangs from the 1st measure there to your current case (like using specific measure bangs instead of the earlier group ones and using #Rate# instead of the earlier 60).

Note: you might have to disable / enable (normally) AND update the 1C and 2C measures too (and possibly update meters and redraw the skin), to completely achieve what you want, by the way.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16198
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: October 5th, 2023, 12:02 am I already have it ready for the next step.
Ok, even if extremely late, here is a next step. Once again I worked only with the three planets, respectively Mercury, Venus and Mars. The others will be added later if you find the code well enough.
For first, add three new variables to the [Variables] section. These variables represent the number of steps for a whole revolution of the appropriate planet around the Sun. For instance:

Code: Select all

[Variables]
...
StepMerkur=60
StepVenus=100
StepMars=185
...
Obviously these are just arbitrary values, for sure much larger values have to be used. These values are set in a way to can relative easily follow the revolution of planets.
Now these variables have to be used in two places:
  • In the [MeasureMerkur], [MeasureVenus] and [MeasureMars] measures:

    Code: Select all

    [MeasureMerkur]
    Measure=Calc
    Formula=([MeasureTime:TimeStamp]%#StepMerkur#)
    DynamicVariables=1
    
    [MeasureVenus]
    Measure=Calc
    Formula=([MeasureTime:TimeStamp]%#StepVenus#)
    DynamicVariables=1
    
    [MeasureMars]
    Measure=Calc
    Formula=([MeasureTime:TimeStamp]%#StepMars#)
    DynamicVariables=1
  • In the X and Y options of the [MeterMerkur], [MeterVenus] and [MeterMars] meters. Alter them as it follows:

    Code: Select all

    [MeterMerkur]
    Meter=Image
    ImageName=merkur.png
    X=(((2*#Radiuspluto#-[#CURRENTSECTION#:W])/2)+#RadiusMerkur#*Sin(-2*PI*[MeasureMerkur]/#StepMerkur#))
    Y=(((700-[#CURRENTSECTION#:H])/2)+50+#RadiusMerkur#*#Ratio#*Cos(-2*PI*[MeasureMerkur]/#StepMerkur#))
    DynamicVariables=1
    
    [MeterVenus]
    Meter=Image
    ImageName=venus.png
    X=(((2*#Radiuspluto#-[#CURRENTSECTION#:W])/2)+#RadiusVenus#*Sin(-2*PI*[MeasureVenus]/#StepVenus#))
    Y=(((700-[#CURRENTSECTION#:H])/2)+88+#RadiusVenus#*#Ratio#*Cos(-2*PI*[MeasureVenus]/#StepVenus#))
    DynamicVariables=1
    
    [MeterMars]
    Meter=Image
    ImageName=mars.png
    X=(((2*#Radiuspluto#-[#CURRENTSECTION#:W])/2)+#RadiusMars#*Sin(-2*PI*[MeasureMars]/#StepMars#))
    Y=(((700-[#CURRENTSECTION#:H])/2)+164+#RadiusMars#*#Ratio#*Cos(-2*PI*[MeasureMars]/#StepMars#))
    DynamicVariables=1
Please try out this solution and let me know if it works as expected. If it does, you can try adapt it to all planets.
Is this alright?
Fierke
Posts: 6
Joined: September 4th, 2020, 5:58 pm

Re: Help to assemble a formula

Post by Fierke »

I would like to reduce the size of the Rotating Tilted Geographical 3D Globe, but cannot figure out where or how to do so. Any suggestions?
:???:

Code: Select all

[Rainmeter]
Author=Doctor-Digital
Update=60

[MeasureAnimation]
Measure=CALC
Formula=Counter % 120

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=\Red\Red Small.png
BitmapFrames=120
BitmapExtend=1
Last edited by balala on April 23rd, 2024, 6:37 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting codes. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 16198
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

Fierke wrote: April 23rd, 2024, 5:53 pm Any suggestions?
Yep. But even if the W and H options are valid on Bitmap meters, on these kind of meters they are used for something else then resizing it. Accordingly the only way to resize such a meter is by a TransformationMatrix option, which has to be added to the meter (to [MeterAnimation]). In this case the task is pretty simple, because the meter is placed "at the origin" (so to X=0 and Y=0) and this simplifies the option.
So, for first, add a [Variables] section and store the Scale variable into it, which obviously will set the scale of the meter (Scale=1 means the normal size, any lower value reduces the size of the meter):

Code: Select all

[Variables]
Scale=0.5
Obviously here Scale=0.5 is just an example, you can use any value you need. Just keep in mind that lower values then 1 reduces the size of the image, while larger values are increasing it. However if you're using a larger value, some additional things have to be added. since you've said you want to reduce the image, I don't add them now, but if you are interested, let me know and I'm gonna explain what I mean.
To resize the bitmap, add the following option to the [MeterAnimation] meter: TransformationMatrix=#Scale#;0;0;#Scale#;0;0. Note here that as said above, the second, third, fifth and sixth (last) parameters here are 0, but this just because the meter is placed to X=0 and Y=0. If you want to move the meter away, additional parameters are needed. Also let me know please, for further help, if you need this.