Commit ff705987 authored by Jörg Weingrill's avatar Jörg Weingrill
Browse files

Dome and flatscreen now controllable by TCS

parent 9cc40c63
......@@ -19,6 +19,12 @@ VAR
move_azimuth, stop_azimuth: BOOL;
DomeCommErrorTimer: TON;
DomeCommError: BOOL;
OpenDome,
CloseDome,
DomeOpened,
DomeClosed,
Flatscreen: BOOL;
FlatScreenTimer: TP;
END_VAR
]]></Declaration>
<Implementation>
......@@ -35,9 +41,46 @@ IF ABS(ConvertEnvironment.WindDirection - Azimuth_current) > 150.0 THEN
Azimuth_set := ConvertEnvironment.WindDirection;
END_IF
*)
DomeOpened := GVL_Dome.ShutterOpened OR GVL_Dome.FlapOpened;
DomeClosed := GVL_Dome.ShutterClosed AND GVL_Dome.FlapClosed;
FlatScreenTimer(IN := FlatScreen, PT := T#1H, Q => GVL_Dome.FlatScreen);
// give feedback that Flatscreen is on
FlatScreen := FlatScreenTimer.Q;
IF TelescopeControl.telescope_mode = E_TelescopeMode.automatic THEN
IF CloseDome THEN
GVL_Dome.OpenShutter := FALSE;
GVL_Dome.OpenFlap := FALSE;
GVL_Dome.CloseShutter := TRUE;
GVL_Dome.CloseFlap := TRUE;
OpenDome := FALSE;
ELSIF OpenDome THEN
GVL_Dome.OpenShutter := TRUE;
GVL_Dome.OpenFlap := TRUE;
END_IF
IF OpenDome AND Environment.avg_wind < 10.0 THEN
GVL_Dome.OpenFlap := TRUE;
END_IF
// Weather conditions
IF Environment.avg_wind > 12.0 THEN
GVL_Dome.CloseFlap := TRUE;
END_IF
IF Environment.DustAverage.AVG > 0.5 OR
Environment.avg_wind > 15.0 OR
Environment.PrecipitationAverage.AVG > 1.0 THEN
GVL_Dome.CloseShutter := TRUE;
GVL_Dome.CloseFlap := TRUE;
CloseDome := TRUE;
OpenDome := FALSE;
END_IF
END_IF
DomeAxis(bPowerEnable := TRUE,
bMoveModExec := (Azimuth_set <> Azimuth_old) OR move_azimuth, //ConvertEnvironment.WindSpeed > 15.0,
bMoveModExec := (Azimuth_set <> Azimuth_old) OR move_azimuth, //Environment.WindSpeed > 15.0,
fMoveModPos := Azimuth_set,
fMoveModVelo := 3.0,
bHalt := stop_azimuth,
......@@ -115,6 +158,17 @@ DomeLog(Trigger := DomeCommError,
<LineId Id="310" Count="0" />
<LineId Id="312" Count="1" />
<LineId Id="289" Count="0" />
<LineId Id="430" Count="0" />
<LineId Id="444" Count="0" />
<LineId Id="453" Count="0" />
<LineId Id="468" Count="0" />
<LineId Id="467" Count="0" />
<LineId Id="498" Count="0" />
<LineId Id="469" Count="0" />
<LineId Id="472" Count="24" />
<LineId Id="500" Count="1" />
<LineId Id="497" Count="0" />
<LineId Id="470" Count="1" />
<LineId Id="365" Count="0" />
<LineId Id="291" Count="0" />
<LineId Id="294" Count="0" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment