[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,1

[Metadata]
Name=ASTRO Weather
Author=xxenium
Information=Current weather conditions, current sun position, current moon position  
Version=WEATHER
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0


; © 2020 by xxenium


[Variables]
@Include=#@#Variables.inc
@Include2=#@#RegExp.inc
@Include3=#@#Measures.inc

size=#SizeValue#



;==========MEASURES SUN CALC=============


[MeasureSunriseHour]
Measure=String
String=[MeasureSunrise]
RegExpSubstitute=1
Substitute="^(\d{1,2}):\d{1,2}$":"\1","^$":"0"
DynamicVariables=1

[MeasureSunriseMinute]
Measure=String
String=[MeasureSunrise]
RegExpSubstitute=1
Substitute="^\d{1,2}:(\d{1,2})$":"\1","^$":"0"
DynamicVariables=1

[MeasureSunriseMoment]
Measure=Calc
Formula=( 60 * [MeasureSunriseHour] + [MeasureSunriseMinute] )
DynamicVariables=1

[MeasureSunsetHour]
Measure=String
String=[MeasureSunset]
RegExpSubstitute=1
Substitute="^(\d{1,2}):\d{1,2}$":"\1","^$":"0"
DynamicVariables=1

[MeasureSunsetMinute]
Measure=String
String=[MeasureSunset]
RegExpSubstitute=1
Substitute="^\d{1,2}:(\d{1,2})$":"\1","^$":"0"
DynamicVariables=1

[MeasureSunsetMoment]
Measure=Calc
Formula=( 60 * [MeasureSunsetHour] + [MeasureSunsetMinute] )
DynamicVariables=1

[MeasureHour]
Measure=Time
Format=%#H

[MeasureMinute]
Measure=Time
Format=%M

[MeasureDayLengthSUN]
Measure=Calc
Formula=( MeasureSunsetMoment - MeasureSunriseMoment )

[MeasureSinceSunrise]
Measure=Calc
Formula=(( 60 * MeasureHour + MeasureMinute - MeasureSunriseMoment ) / ( 0.00001 + MeasureDayLengthSUN ))

[MeasureTimeSUN]
Measure=Calc
Formula=( 60 * MeasureHour + MeasureMinute )
IfCondition=((#CURRENTSECTION#>=MeasureSunriseMoment)&&(#CURRENTSECTION#<MeasureSunsetMoment))
IfTrueAction=[!ShowMeter "MeterSun"]
IfFalseAction=[!HideMeter "MeterSun"]



;==========MEASURES MOON CALC=============


[MeasureMoonriseHour]
Measure=String
String=[MeasureMoonrise]
RegExpSubstitute=1
Substitute="^(\d{1,2}):\d{1,2}$":"\1","^$":"0"
DynamicVariables=1

[MeasureMoonriseMinute]
Measure=String
String=[MeasureMoonrise]
RegExpSubstitute=1
Substitute="^\d{1,2}:(\d{1,2})$":"\1","^$":"0"
DynamicVariables=1

[MeasureMoonriseMoment]
Measure=Calc
Formula=( 60 * [MeasureMoonriseHour] + [MeasureMoonriseMinute] )
DynamicVariables=1

[MeasureMoonsetHour]
Measure=String
String=[MeasureMoonset]
RegExpSubstitute=1
Substitute="^(\d{1,2}):\d{1,2}$":"\1","^$":"0"
DynamicVariables=1

[MeasureMoonsetMinute]
Measure=String
String=[MeasureMoonset]
RegExpSubstitute=1
Substitute="^\d{1,2}:(\d{1,2})$":"\1","^$":"0"
DynamicVariables=1

[MeasureMoonsetMoment]
Measure=Calc
Formula=( 60 * [MeasureMoonsetHour] + [MeasureMoonsetMinute] )
DynamicVariables=1

[MeasureDayLengthMOON]
Measure=Calc
Formula=(( MeasureMoonsetMoment > MeasureMoonriseMoment ) ? ( MeasureMoonsetMoment - MeasureMoonriseMoment ) : ( 1440 - MeasureMoonriseMoment + MeasureMoonsetMoment ))

[MeasureSinceMoonrise]
Measure=Calc
Formula=(( MeasureMoonsetMoment > MeasureMoonriseMoment ) ? (( 60 * MeasureHour + MeasureMinute - MeasureMoonriseMoment ) / ( 0.00001 + MeasureDayLengthMOON )) : ((( 60 * MeasureHour + MeasureMinute ) >= MeasureMoonriseMoment ) ? (( 60 * MeasureHour + MeasureMinute - MeasureMoonriseMoment ) / ( 0.00001 + MeasureDayLengthMOON )) : (( 1440 - MeasureMoonriseMoment + 60 * MeasureHour + MeasureMinute ) / ( 0.00001 + MeasureDayLengthMOON ))))

[MeasureTimeMOON]
Measure=Calc
Formula=( 60 * MeasureHour + MeasureMinute )
IfCondition=(((MeasureMoonsetMoment>MeasureMoonriseMoment)&&((#CURRENTSECTION#>=MeasureMoonriseMoment)&&(#CURRENTSECTION#<MeasureMoonsetMoment)))||((MeasureMoonriseMoment>MeasureMoonsetMoment)&&((#CURRENTSECTION#>=MeasureMoonriseMoment)||(#CURRENTSECTION#<MeasureMoonsetMoment))))
IfTrueAction=[!ShowMeter "MeterMoon"]
IfFalseAction=[!HideMeter "MeterMoon"]


;==============METERS=============


[MeterVertLine]
Meter=Image
SolidColor=255,255,255,200
X=(#size#*121)
Y=(#size#*86)
W=(#size#*3)
H=(#size#*69)

[MeterIcon]
MeasureName=MeasureIcon
Meter=IMAGE
ImagePath=#@#Icons
X=(#size#*42)
Y=(#size#*86)
W=(#size#*70)
H=(#size#*70)
ToolTipTitle=[MeasureCity],[MeasureCountry]
ToolTipType=1
ToolTipWidth=250
ToolTipText=[MeasureUpdate#TimeFormat#] [MeasureUpdateTimeZoneAbbrev]#CRLF##CRLF#[MeasureCondition]#CRLF##CRLF#[MeasureFeelsLikeLabels] [MeasureFeelsLike]°#CRLF#[MeasureWindLabels] [MeasureWindDirection] [MeasureWindSpeed] [Measure#SpeedUnit#]#CRLF#[MeasureHumidityLabels] [MeasureHumidity]%#CRLF#[MeasurePressureLabels] [MeasurePressure] [Measure#PressureUnit#]#CRLF#[MeasureVisibilityLabels] [MeasureVisibility] [Measure#VisibilityUnit#]#CRLF##CRLF# ☀↑  [MeasureSunrise#TimeFormat#]     ☀↓  [MeasureSunset#TimeFormat#]#CRLF# ☾ ↑  [MeasureMoonrise#TimeFormat#]      ☾ ↓  [MeasureMoonset#TimeFormat#]
DynamicVariables=1

[MeterTEMP]
Meter=String
MeasureName=MeasureTemperature
X=(#size#*132)
Y=(#size#*78)
W=(#size#*70)
H=(#size#*50)
FontSize=(#size#*30)
FontColor=#FontColor#
StringStyle=normal
StringEffect=SHADOW
FontFace=#FontFace2#
StringAlign=left
FontEffectColor=#FontEffectColor#
AntiAlias=1
Text=%1°
LeftMouseUpAction=!ToggleConfig "#ROOTCONFIG#\Settings" "Settings.ini"

[MeterPP]
Meter=String
MeasureName=MeasureDailyPrecipDay1
X=(#size#*150)
Y=(#size#*127)
W=(#size#*70)
H=(#size#*50)
FontSize=(#size#*20)
FontColor=#FontColor2#
StringStyle=normal
StringEffect=SHADOW
FontFace=#FontFace2#
StringAlign=left
FontEffectColor=#FontEffectColor#
AntiAlias=1
Text=%1%

[drop]
Meter=IMAGE
ImageName=#@#drop.png
X=(#size#*117)
Y=(#size#*112)
W=(#size#*45)
H=(#size#*64)

[MeterSunPath]
Meter=Shape
X=(#size#*12)
Y=(#size#*115)
Shape=Arc (#size#*11.25),0,(#size#*210),0,(#size#*100),(#size#*100) | Extend MyModifiers1
MyModifiers1=StrokeWidth 2 | Stroke Color 255,255,255
UpdateDivider=-1

[MeterMoon]
Meter=Shape
X=0r
Y=0r
Shape=Ellipse ((#size#*12.5)+(#size#*200)*[MeasureSinceMoonrise]),((#size#*25)*(Abs([MeasureSinceMoonrise]-0.5))+(#size#*12.5)*(1-Abs(2*[MeasureSinceMoonrise]-1.2))-(#size#*100)*Sin(Acos(2*[MeasureSinceMoonrise]-1))),(#size#*12.5) | StrokeWidth (#size#*0.5) | Stroke Color 252,194,27 | Fill RadialGradient MyGradient1
MyGradient1=3,2 | 192,192,192 ; 0.0 | 60,60,60 ; 1.0
DynamicVariables=1

[MeterSun]
Meter=Shape
X=0r
Y=0r
Shape=Ellipse ((#size#*12.5)+(#size#*200)*[MeasureSinceSunrise]),((#size#*25)*(Abs([MeasureSinceSunrise]-0.5))+(#size#*12.5)*(1-Abs(2*[MeasureSinceSunrise]-1.2))-(#size#*100)*Sin(Acos(2*[MeasureSinceSunrise]-1))),(#size#*12.5) | StrokeWidth (#size#*0.5) | Stroke Color 255,120,0 | Fill RadialGradient MyGradient1
MyGradient1=3,2 | 255,140,0 ; 0.0 | 255,215,0 ; 1.0
DynamicVariables=1



; © 2020 by xxenium



