It is currently March 28th, 2024, 7:27 pm

[reloaded] I am struggling with RoundLine

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: [Solved] I am struggling with RoundLine

Post by Mor3bane »

eclectic-tech wrote:Glad to help.

To have midnight at the top center, replace '90' in the StartAngle value calculation with '270'. The default starting point (Rad(0)) is at the 3 o'clock position, so just add (or subtract) the degrees to start where you want.

Nice edit on the skins! :great:
Yes, I was never savvy at maths but once I learn something it tends to stick, mostly due to having a new "toy" to play with and the repetition of reuse while learning.

Whilst reading how the roundline works the zero degrees at 3 o'clock was something I picked up ok. Your putting it into focus got me where I wanted to be and 270 degrees was relatively easy seeing the correct math in action.

Thanks for the compliment also :)
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: [reloaded] I am struggling with RoundLine

Post by Mor3bane »

Mor3bane wrote:Hi all,

The goal: Make a RoundLine Hour circle that starts at a variable time and concludes at another variable time.

What I think I need to do: Make a RoundLine Meter that has a "zero" position and it draws in an arc until the "end" position reletive to an actual clock's hours.

How to do it?: I can draw a circle, size it, position it, but not much after that.

I cannot seem to get my head around all of the different parameters - without a basic working meter to start from - basic would be managing the start and end positions effectively/accurately.

I will keep tacking away, and hopefully someone might be able to get me rolling in the right direction in the mean time.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: For some reason I am struggling with RoundLine

Post by Mor3bane »

eclectic-tech wrote:So, if I understand, you want a 2 pixel wide, 20 pixel diameter radius circle, that shows when the sun is up/down in relation to your 24 Clock, which has midnight at the bottom center?

First you need to set the startangle at the offset to your 'zero' position (bottom center to match your 24 hour clock), so that would be (Rad(90)). Then add to that, the time of sunrise using the value of the sunrise hour times 15 (each hour of a 24 hour clock is 15 degrees) + the sunrise minutes times 0.25 (each minute is 1/4 of a degree) to set the starting point at sunrise.

Then in your measure to drive the roundline, use the difference between sunset hours times 60 plus the sunset minutes and the sunrise hours times 60 + the sunrise minutes, and divided that by the total minutes in a day (1440) to get a percentage.

You do not need to calculate the sundown, since it is the remaining percentage value of sunup.

So to display, use a roundline, solid filled circle, the same size as the sunup meter to start (this will represent the sun down time) and overlay the sunup roundline.

Code: Select all

[MeterSundial]
Meter=RoundLine
X=135
Y=150
LineStart=10
LineColor=#FontColor#
Solid=1
Antialias=1

[MeasureTimeUp]
Measure=Calc
Formula=((MeasureAstronomySunsetHourAdjust * 60 + MeasureAstronomySunsetMin)-(MeasureAstronomySunriseHour * 60 + MeasureAstronomySunriseMin)) / 1440

[MeterSunUp]
Meter=Roundline
MeasureName=MeasureTimeUp
X=135
Y=150
LineLength=20
LineStart=10
StartAngle=(Rad(90+([MeasureAstronomySunriseHour] * 15) + ([MeasureAstronomySunriseMin] * 0.25)))
RotationAngle=(Rad(360))
LineColor=#ProgressCir#
Solid=1
DynamicVariables=1
I used a 10 pixel wide arc to show the settings...
sundial1.pngThis will match the times on your 24 hour clock.

If you had something else in mind, let us know...
It has become a need that I figure out how to represent the sundown to sunup arc. However, I have been lost on the math.
Perhaps eclectic-tech has a suggestion?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: [reloaded] I am struggling with RoundLine

Post by FreeRaider »

Post all things of your skin.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: [reloaded] I am struggling with RoundLine

Post by Mor3bane »

Ok here it is...
What it looks like is the final goal - however wrong the sun-down to sun-up math is wrong...so wrong... :-(
Sun Cycle_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: [reloaded] I am struggling with RoundLine

Post by FreeRaider »

Is your problem this error?

Formula: Extra operation in key "StartAngle" in [MeterSunUp] (Sun Circle\Circle Cycle\Circle Cycle.ini)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [reloaded] I am struggling with RoundLine

Post by eclectic-tech »

You didn't include the variables file "@include=#@#RoundVariables.inc" so I checked your file assuming that file did not contain any useful info...

To eliminate the extra calculation errors, I modified the substitution of the SunriseAMPM and SunsetAMPM measures to substitute 0 or 12, instead of doing the multiplication math in the HourAdjust measures it simply adds the values. Also used the number value section variables in the StartAngle calculation (and modified your formula; you were adding a Rad value to a Rad value calc...).

Code: Select all

...

[SunriseAMPM]
Measure=WebParser
URL=[MeasureParent]
StringIndex=3
Substitute="AM":"0","PM":"12"

...

[SunsetAMPM]
Measure=WebParser
URL=[MeasureParent]
StringIndex=6
Substitute="AM":"0","PM":"12"

[SunriseHourAdjust]
Measure=Calc
Formula=([SunriseAMPM]+SunriseHour)
Percentual=1
DynamicVariables=1

[SunsetHourAdjust]
Measure=Calc
Formula=([SunsetAMPM]+SunsetHour)
Percentual=1
DynamicVariables=1

You do not need to calculate the sun down time since it is always the remainder of the sun up time. So you can use a completely colored full 360 degree ring as the sun down time and overlay the sun up roundline meter to show the difference.
2018-08-20 15_16_00-C__Users_John_Rainmeter_Skins_Sun Circle_Circle Cycle_Circle Cycle.ini.png
Full Modified code:

Code: Select all

[Rainmeter]
Author=Morbane
Update=1000
Group=Big

[Variables]
@include=#@#RoundVariables.inc
Color=#GlobalFontColor#
Font=#GlobalFont#
ColorZ=#ColorOffset#
Wreath=#WreathColor#
Goth=#Gothic#
FreeColor=#Free#
UsedColor=#Used#
LocationCode=#GlobalLocation#
Units=c
WebParserSunRiseSet=<sunr>(.*):(.*) (.*)</sunr>.*<suns>(.*):(.*) (.*)</suns>

[Background]
Meter=Image
ImageName=#@#Background.png

[MeasureParent]
Measure=WebParser
URL=https://wxdata.weather.com/wxdata/weather/local/#LocationCode#?cc=*&unit=#Units#&dayf=1
RegExp="(?siU)#WebParserSunRiseSet#"
;Debug=2

;===== MeasureSunrise/set ======;

[SunriseHour]
Measure=WebParser
URL=[MeasureParent]
StringIndex=1

[SunriseMin]
Measure=WebParser
URL=[MeasureParent]
StringIndex=2

[SunriseAMPM]
Measure=WebParser
URL=[MeasureParent]
StringIndex=3
Substitute="AM":"0","PM":"12"

[SunsetHour]
Measure=WebParser
URL=[MeasureParent]
StringIndex=4

[SunsetMin]
Measure=WebParser
URL=[MeasureParent]
StringIndex=5

[SunsetAMPM]
Measure=WebParser
URL=[MeasureParent]
StringIndex=6
Substitute="AM":"0","PM":"12"

[SunriseHourAdjust]
Measure=Calc
Formula=([SunriseAMPM]+SunriseHour)
Percentual=1
DynamicVariables=1

[SunsetHourAdjust]
Measure=Calc
Formula=([SunsetAMPM]+SunsetHour)
Percentual=1
DynamicVariables=1

[MeasureTimeUp]
Measure=Calc
Formula=((SunsetHourAdjust * 60 + SunsetMin)-(SunriseHour * 60 + SunriseMin)) / 1440

; You don't need to know the measure value of Sun Down since it is always the remainder of the sun up time...

; [MeasureTimeDown]
; Measure=Calc
; Formula=((SunsetHourAdjust * 60 + SunsetMin)-(SunriseHour * 60 + SunriseMin)) / 1440
; InvertMeasure=1

; You can use a full colored circle as the sun down, when you cover it with the sun up roundline meter, what remains visible is the sun down... 

[MeterSunDown]
Meter=ROUNDLINE
;MeasureName=MeasureTimeDown
X=129
Y=128
LineLength=88
LineStart=100
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineColor=#UsedColor#
Solid=1
AntiAlias=1

[MeterSunUp]
Meter=Roundline
MeasureName=MeasureTimeUp
X=129
Y=128
LineLength=88
LineStart=100
StartAngle=(Rad(90+[SunriseHour:]*15+[SunriseMin:]*0.25))
RotationAngle=(Rad(360)) 
LineColor=#Goth#
Solid=1
AntiAlias=1
DynamicVariables=1

[MeasureTime24]
Measure=Time
Format=%H
MinValue=0
MaxValue=24

[FreeCPU]
;MeasureName=MeasureTime24
;Meter=ROUNDLINE
X=r
Y=r
StartAngle=1.56079
RotationAngle=0.55
LineLength=88
LineStart=100
LineColor=#FreeColor#
Solid=1
AntiAlias=10

[MeterDivisions]
Meter=Image
ImageName=#@#24 Faceb.png
ImageTint=#FreeColor#
X=46
Y=45
W=166
H=167
Hidden=0
I am sure there may be other ways to achieve your desired result, but hopefully, this will help you...
You do not have the required permissions to view the files attached to this post.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: [reloaded] I am struggling with RoundLine

Post by Mor3bane »

Thanks eclectic-tech for your reply.

The sun down arc is what I was hoping to calculate, as that is what I am trying to achieve.

Having the sunup arc just eclipse a full circle is not the desired method in my case, as I am trying to have the appearance of a small gap between the arcs.

Is the sun down arc really weird to code? I have tried, but in vain.
Untitled.jpg
Is that possible, without insanity as i have come to know it?
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: [reloaded] I am struggling with RoundLine

Post by Mor3bane »

FreeRaider wrote:Is your problem this error?

Formula: Extra operation in key "StartAngle" in [MeterSunUp] (Sun Circle\Circle Cycle\Circle Cycle.ini)
I didn't think so... The MeterSunUp works fine to my understanding.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: [reloaded] I am struggling with RoundLine

Post by Mor3bane »

eclectic-tech wrote:You didn't include the variables file "@include=#@#RoundVariables.inc" so I checked your file assuming that file did not contain any useful info...
It certainly is there, as the colors would not have been correct?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.