2022-09-09 09:39:14 +00:00
|
|
|
alias Sensor d0 # Kit (Sensor) > Daylight Sensor
|
|
|
|
# Place sensor facing UP, and not in an enclosed space
|
|
|
|
alias Display d1 # Optional, Kit (Console)
|
|
|
|
alias PanelType1 d2 # Any controllable Solar Panel
|
|
|
|
alias PanelType2 d3 # Optional
|
|
|
|
|
|
|
|
alias AngleVertical r0
|
|
|
|
alias AngleHorizontal r1
|
|
|
|
alias CorrectionAngle r2
|
|
|
|
alias Panel1Hash r3
|
|
|
|
alias Panel2Hash r4
|
|
|
|
alias PanelEfficiency r5
|
2021-08-29 12:34:08 +00:00
|
|
|
|
2022-06-09 21:38:38 +00:00
|
|
|
# define directions of sensor and panel power ports
|
2022-09-09 09:39:14 +00:00
|
|
|
define SENSORDATAANGLE 0
|
|
|
|
define PANELPOWERANGLE 90
|
2021-08-29 12:34:08 +00:00
|
|
|
|
2022-06-09 21:38:38 +00:00
|
|
|
# calculate horizontal correction
|
2022-09-09 09:39:14 +00:00
|
|
|
sub CorrectionAngle SENSORDATAANGLE PANELPOWERANGLE
|
|
|
|
sub CorrectionAngle CorrectionAngle 90
|
|
|
|
|
|
|
|
# load panel PrefabHash for later use
|
|
|
|
l Panel1Hash PanelType1 PrefabHash
|
|
|
|
bdns PanelType2 start
|
|
|
|
l Panel2Hash PanelType2 PrefabHash
|
2021-08-29 12:34:08 +00:00
|
|
|
|
2022-06-09 21:38:38 +00:00
|
|
|
start:
|
2021-08-29 12:34:08 +00:00
|
|
|
yield
|
2022-09-09 09:39:14 +00:00
|
|
|
l AngleVertical Sensor Vertical
|
|
|
|
sub AngleVertical 90 AngleVertical
|
|
|
|
l AngleHorizontal Sensor Horizontal
|
|
|
|
add AngleHorizontal AngleHorizontal CorrectionAngle
|
|
|
|
|
|
|
|
bdns Display panelmove
|
|
|
|
lb PanelEfficiency Panel1Hash Ratio Average
|
|
|
|
s Display Setting PanelEfficiency
|
|
|
|
|
|
|
|
panelmove:
|
|
|
|
sb Panel1Hash Vertical AngleVertical
|
|
|
|
sb Panel1Hash Horizontal AngleHorizontal
|
|
|
|
bdns PanelType2 start
|
|
|
|
sb Panel2Hash Vertical AngleVertical
|
|
|
|
sb Panel2Hash Horizontal AngleHorizontal
|
2022-06-09 21:38:38 +00:00
|
|
|
|
2021-08-29 12:34:08 +00:00
|
|
|
j start
|