Commit 99b58760 authored by Giuseppe Carboni's avatar Giuseppe Carboni
Browse files

Reverted the implementation of the ReceiversControl library

parent 45502d23
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -667,8 +667,8 @@ public:
            const BYTE port_type=MCB_PORT_TYPE_DIO,
            const BYTE port_number_sd=MCB_PORT_NUMBER_13,
            const BYTE port_number_vlbi=MCB_PORT_NUMBER_14,
            const BYTE value_sd=0x01,
            const BYTE value_vlbi=0x00
            const BYTE value_sd=0x00,
            const BYTE value_vlbi=0x01
    );


@@ -682,7 +682,7 @@ public:
    bool isSingleDishModeOn(
            const BYTE data_type=MCB_CMD_DATA_TYPE_B01,
            const BYTE port_type=MCB_PORT_TYPE_DIO, 
            const BYTE port_number=MCB_PORT_NUMBER_13
            const BYTE port_number=MCB_PORT_NUMBER_29
    );


@@ -704,8 +704,8 @@ public:
            const BYTE port_type=MCB_PORT_TYPE_DIO,
            const BYTE port_number_vlbi=MCB_PORT_NUMBER_14,
            const BYTE port_number_sd=MCB_PORT_NUMBER_13,
            const BYTE value_vlbi=0x01,
            const BYTE value_sd=0x00
            const BYTE value_vlbi=0x00,
            const BYTE value_sd=0x01
    );


@@ -719,7 +719,7 @@ public:
    bool isVLBIModeOn(
            const BYTE data_type=MCB_CMD_DATA_TYPE_B01,
            const BYTE port_type=MCB_PORT_TYPE_DIO,
            const BYTE port_number=MCB_PORT_NUMBER_14
            const BYTE port_number=MCB_PORT_NUMBER_30
    );

    
+54 −1
Original line number Diff line number Diff line
@@ -890,6 +890,20 @@ void ReceiverControl::setSingleDishMode(
                value_vlbi
        );

        // Turn OFF the single dish mode on port number 13
        makeRequest(
                m_dewar_board_ptr,     // Pointer to the dewar board
                MCB_CMD_SET_DATA,      // Command to send
                4,                     // Number of parameters
                data_type,
                port_type,
                port_number_sd,
                !value_sd
        );

        // Now the bits 13 and 14 are set to 1, meaning no current is now traversing any switch magnet and no mode is currently selected
        // We need to set the bit 13 to 0, which will send a TTL impulse to the desired magnet switch, selecting the desired mode
        
        usleep(3 * SETMODE_SLEEP_TIME);
        // Turn ON the single dish mode on port number 13
        makeRequest(
@@ -901,6 +915,19 @@ void ReceiverControl::setSingleDishMode(
                port_number_sd,
                value_sd
        );

        // We can switch off the TTL impulse after some time, setting the relative bit to 1 again
        usleep(3 * SETMODE_SLEEP_TIME);
        // Turn OFF the single dish mode on port number 13
        makeRequest(
                m_dewar_board_ptr,     // Pointer to the dewar board
                MCB_CMD_SET_DATA,      // Command to send
                4,                     // Number of parameters
                data_type,
                port_type,
                port_number_sd,
                !value_sd
        );
        pthread_mutex_unlock(&m_dewar_mutex); 
    }
    catch(MicroControllerBoardEx& ex) {
@@ -962,8 +989,21 @@ void ReceiverControl::setVLBIMode(
                value_sd
        );

        usleep(3 * SETMODE_SLEEP_TIME);
        // Turn OFF the VLBI mode on port number 14
        makeRequest(
                m_dewar_board_ptr,     // Pointer to the dewar board
                MCB_CMD_SET_DATA,      // Command to send
                4,                     // Number of parameters
                data_type,
                port_type,
                port_number_vlbi,
                !value_vlbi
        );

        // Now the bits 13 and 14 are set to 1, meaning no current is now traversing any switch magnet and no mode is currently selected
        // We need to set the bit 14 to 0, which will send a TTL impulse to the desired magnet switch, selecting the desired mode
        
        usleep(3 * SETMODE_SLEEP_TIME);
        // Turn ON the VLBI mode on port number 14
        makeRequest(
                m_dewar_board_ptr,     // Pointer to the dewar board
@@ -974,6 +1014,19 @@ void ReceiverControl::setVLBIMode(
                port_number_vlbi,
                value_vlbi
        );

        // We can switch off the TTL impulse after some time, setting the relative bit to 1 again
        usleep(3 * SETMODE_SLEEP_TIME);
        // Turn OFF the VLBI mode on port number 14
        makeRequest(
                m_dewar_board_ptr,     // Pointer to the dewar board
                MCB_CMD_SET_DATA,      // Command to send
                4,                     // Number of parameters
                data_type,
                port_type,
                port_number_vlbi,
                !value_vlbi
        );
        pthread_mutex_unlock(&m_dewar_mutex); 
    }
    catch(MicroControllerBoardEx& ex) {