Someone didn't approve of my old code,
So I made it more complicated while still doing the same
This commit is contained in:
parent
49a91599b9
commit
e47ade1f57
@ -1,38 +1,45 @@
|
|||||||
alias sensor d0
|
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 angle_v r0
|
alias AngleVertical r0
|
||||||
alias angle_h r1
|
alias AngleHorizontal r1
|
||||||
alias corr_angle r2
|
alias CorrectionAngle r2
|
||||||
|
alias Panel1Hash r3
|
||||||
|
alias Panel2Hash r4
|
||||||
|
alias PanelEfficiency r5
|
||||||
|
|
||||||
# define directions of sensor and panel power ports
|
# define directions of sensor and panel power ports
|
||||||
define SENSOR_DATA_ANGLE 0
|
define SENSORDATAANGLE 0
|
||||||
define PANEL_POWER_ANGLE 90
|
define PANELPOWERANGLE 90
|
||||||
|
|
||||||
# define panel hashes
|
|
||||||
define BASIC_1_PANEL -2045627372
|
|
||||||
define BASIC_2_PANEL -539224550
|
|
||||||
define HEAVY_1_PANEL -934345724
|
|
||||||
define HEAVY_2_PANEL -1545574413
|
|
||||||
|
|
||||||
# calculate horizontal correction
|
# calculate horizontal correction
|
||||||
sub corr_angle SENSOR_DATA_ANGLE PANEL_POWER_ANGLE
|
sub CorrectionAngle SENSORDATAANGLE PANELPOWERANGLE
|
||||||
sub corr_angle corr_angle 90
|
sub CorrectionAngle CorrectionAngle 90
|
||||||
|
|
||||||
|
# load panel PrefabHash for later use
|
||||||
|
l Panel1Hash PanelType1 PrefabHash
|
||||||
|
bdns PanelType2 start
|
||||||
|
l Panel2Hash PanelType2 PrefabHash
|
||||||
|
|
||||||
start:
|
start:
|
||||||
yield
|
yield
|
||||||
|
l AngleVertical Sensor Vertical
|
||||||
|
sub AngleVertical 90 AngleVertical
|
||||||
|
l AngleHorizontal Sensor Horizontal
|
||||||
|
add AngleHorizontal AngleHorizontal CorrectionAngle
|
||||||
|
|
||||||
l angle_v sensor Vertical
|
bdns Display panelmove
|
||||||
sub angle_v 90 angle_v
|
lb PanelEfficiency Panel1Hash Ratio Average
|
||||||
l angle_h sensor Horizontal
|
s Display Setting PanelEfficiency
|
||||||
add angle_h angle_h corr_angle
|
|
||||||
|
|
||||||
sb BASIC_1_PANEL Vertical angle_v
|
panelmove:
|
||||||
sb BASIC_2_PANEL Vertical angle_v
|
sb Panel1Hash Vertical AngleVertical
|
||||||
sb HEAVY_1_PANEL Vertical angle_v
|
sb Panel1Hash Horizontal AngleHorizontal
|
||||||
sb HEAVY_2_PANEL Vertical angle_v
|
bdns PanelType2 start
|
||||||
sb BASIC_1_PANEL Horizontal angle_h
|
sb Panel2Hash Vertical AngleVertical
|
||||||
sb BASIC_2_PANEL Horizontal angle_h
|
sb Panel2Hash Horizontal AngleHorizontal
|
||||||
sb HEAVY_1_PANEL Horizontal angle_h
|
|
||||||
sb HEAVY_2_PANEL Horizontal angle_h
|
|
||||||
|
|
||||||
j start
|
j start
|
Loading…
Reference in New Issue
Block a user