stationeers_ic10/solar_tracking.ic10

45 lines
1.2 KiB
Plaintext
Raw Normal View History

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
# define directions of sensor and panel power ports
define SENSORDATAANGLE 0
define PANELPOWERANGLE 90
2021-08-29 12:34:08 +00:00
# calculate horizontal correction
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
start:
2021-08-29 12:34:08 +00:00
yield
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
2021-08-29 12:34:08 +00:00
j start