Unverified Commit 4b6050eb authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Updated minor servos (#871)

* Fix #865, fix #869, updated SRTMinorServo component

The component now handles correctly a SETUP command.
The component is also capable of commanding the gregorian air blade with the 'setGregorianAirBladeStatus' command.
A few bugs were fixed here and there.
This branch MUST be tested with the real hardware before merging it onto the centos_7_compatibility branch.

* Fixed small bug

* Various upgrades

* Updated _airBlade.py and _servoReset.py

* Updated _servoReset

* Updated telescopePark procedure commands order

With this order, the gregorian cover is started parking when the antenna is already at 89.8 degrees of elevation.
This will avoid getting an error on a gregorian cover axis pre limit.
Unfortunately, this will not fix a change in configuration from primary to gregorian or BWG and vice versa.
That will need to be addressed by opening a ticket.

* Upgraded _servoReset behahviour
parent d8d4b64b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ int main(int argc, char *argv[]) {
		status_box->setStatusLook(Management::MNG_OK,CStyle(BLACK_GREEN,CStyle::BOLD));
		status_box->setStatusLook(Management::MNG_WARNING,CStyle(BLACK_YELLOW,CStyle::BOLD));
		status_box->setStatusLook(Management::MNG_FAILURE,CStyle(BLACK_RED,CStyle::BOLD));
        _TW_SET_COMPONENT(motionInfo_field,18,3,30,1,CColorPair::WHITE_BLACK,CStyle::BOLD,output_label);
        _TW_SET_COMPONENT(motionInfo_field,18,3,40,1,CColorPair::WHITE_BLACK,CStyle::BOLD,output_label);

        /* ****************************************************************** */
        _TW_SET_COMPONENT(userInput,0,WINDOW_HEIGHT-6,WINDOW_WIDTH-1,1,USER_INPUT_COLOR_PAIR,USER_INPUT_STYLE,NULL);
+40 −1
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@ from __future__ import print_function
# Marco Buttu <mbuttu@oa-cagliari.inaf.it> 
# Doctrings from the "Observing at the SRT with Nuraghe, Issue n.8, 21/10/14",
# by Simona Righini and Andrea Orlati"
# 21/05/2024 G. Carboni: commands prependend with SRT_, Medicina_, Noto_ are
# only added to the operator input according to the STATION environment
# variable


def antennaPark():
@@ -538,6 +541,12 @@ def servoSetup():
    (CCB, KKG, LLP, PLP, PPP) configures the minor servos in ordet to put on focus the receiver
    """

def SRT_servoReset():
    """
    servoReset
    sends the emergency and alarm reset command to OR7 VBrain server, SRT only
    """

def setAttenuation():
    """
    setAttenuation=sect,att 
@@ -584,6 +593,29 @@ def setServoOffset():
        setServoOffset=SRP_TY,5
    """

def SRT_setGregorianCoverPosition():
    """
    setGregorianCoverPosition=POSITION
    It sets the gregorian cover position
    Allowed POSITIONs
        CLOSED, closed
        OPEN, open
    """

def SRT_setGregorianAirBladeStatus():
    """
    setGregorianAirBladeStatus=STATUS
    It sets the gregorian air blade status
    Allowed STATUSes:
        AUTO, auto
        OFF, off
        ON, on
    If a ON status is commanded, the air blade stays on for 30 seconds.
    It can be toggled off manually.
    Sending setGregorianAirBladeStatus=ON again will toggle the air blade to
    turn on again.
    """

def setupCCB():
    """
    The setup command sets the antenna mount, the minor servos, 
@@ -694,6 +726,9 @@ def wx():
    atmospheric pressure (hPa), wind speed (km/h).
    """

stations = ['SRT', 'Medicina', 'Noto']
import os
station = os.environ.get('STATION')
import copy
myself =  __import__(__name__)
# Create the commands dictionary
@@ -701,10 +736,14 @@ commands = myself.__dict__.copy() # Shallow copy, but we do not mind
for cmd in list(commands.keys()):
    if cmd.startswith('__'):
        del commands[cmd]
    elif any(cmd.startswith(s) for s in stations):
        command = commands.pop(cmd)
        s, cmd = cmd.split('_')
        if s == station:
            commands[cmd] = command

# Make the setupXXX.__doc__
for cmd in commands:
    if cmd.startswith('setup'):
        setupXXX = getattr(myself, cmd)
        setupXXX.__doc__ = setupCCB.__doc__
+3 −0
Original line number Diff line number Diff line
@@ -217,6 +217,9 @@ void CCore::execute() throw(ComponentErrors::TimerErrorExImpl, ComponentErrors::
	m_parser->add("setServoASConfiguration", "minorservo", 4, &CCore::remoteCall);
	m_parser->add("clearServoOffsets", "minorservo", 4, &CCore::remoteCall);
	m_parser->add("setServoOffset", "minorservo", 4, &CCore::remoteCall);
	m_parser->add("servoReset", "_servoReset", 0, "SRT");
	m_parser->add("setGregorianCoverPosition", "_cover", 1, "SRT");
	m_parser->add("setGregorianAirBladeStatus", "_airBlade", 1, "SRT");

	// active surface
	m_parser->add("asSetup", "activesurface", 5, &CCore::remoteCall);
+5 −5
Original line number Diff line number Diff line
@@ -23,10 +23,10 @@
    <MISTRAL>           <axis>ROTATION</axis> <coefficients>-51.821170  </coefficients></MISTRAL>
    <MISTRAL_ASACTIVE>  <axis>ROTATION</axis> <coefficients>-51.821170  </coefficients></MISTRAL_ASACTIVE>

    <!-- BWG - GFR open -->
    <CCB>               <axis>ROTATION</axis> <coefficients>0           </coefficients></CCB>
    <CCB_ASACTIVE>      <axis>ROTATION</axis> <coefficients>0           </coefficients></CCB_ASACTIVE>
    <XB>                <axis>ROTATION</axis> <coefficients>0           </coefficients></XB>
    <XB_ASACTIVE>       <axis>ROTATION</axis> <coefficients>0           </coefficients></XB_ASACTIVE>
    <!-- BWG - GFR open - configurations commented out since the SETUP command takes care of positioning the GFR to 0 -->
    <!--CCB>               <axis>ROTATION</axis> <coefficients>0           </coefficients></CCB-->
    <!--CCB_ASACTIVE>      <axis>ROTATION</axis> <coefficients>0           </coefficients></CCB_ASACTIVE-->
    <!--XB>                <axis>ROTATION</axis> <coefficients>0           </coefficients></XB-->
    <!--XB_ASACTIVE>       <axis>ROTATION</axis> <coefficients>0           </coefficients></XB_ASACTIVE-->

</SRTMinorServoLookupTable>
+14 −0
Original line number Diff line number Diff line
CONFIGURATION;PFP_TX;PFP_TZ;PFP_RTHETA;SRP_TX;SRP_TY;SRP_TZ;SRP_RX;SRP_RY;SRP_RZ;M3R_RZ;GFR_RZ;DR_GFR1;DR_GFR2;DR_GFR3;DR_PFP;GREGORIAN_CAP;
Primario;0;0;0;-5;5;-120;0;0;0;*;*;*;*;*;*;1;
Gregoriano1;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;-88.70659;*;*;*;*;3;
Gregoriano2;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;-159.8899;*;*;*;*;3;
Gregoriano3;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;90.97161;*;*;*;*;3;
Gregoriano4;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;162.771;*;*;*;*;3;
Gregoriano5;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;55.373967;*;*;*;*;3;
Gregoriano6;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;-51.82117;*;*;*;*;3;
Gregoriano7;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
Gregoriano8;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
BWG1;0;0;0;-1.5;11.1393650793988;0.358165166130078;0.049894179898239;-0.036111111111111;0;10;0;*;*;*;*;3;
BWG2;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
BWG3;0;0;0;-1.5;11.1393650793988;-3.77159716192807;0.049894179898239;-0.036111111111111;0;20;0;*;*;*;*;3;
BWG4;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
Loading