Commit 12a6a383 authored by Marco Buttu's avatar Marco Buttu
Browse files

Tests about max and min allowed values OK (Test n.1 and n.2)

Test 1: LO below the minimum allowed value
==========================================
> setLO=-1 # Target command

Expected: raises ComponentErrors::ComponentErrorsEx


Test 2: LO above the maximum allowed value
==========================================
> setLO=3001 # Target command

Expected: raises ComponentErrors::ComponentErrorsEx
parent 97bbed76
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ class BoardServer:
                        is_short = False
                        cmd = chr(0x00)
                        if(data):
                            if len(data) > 10:
                            if len(data) > 1:
                                for c in data:
                                    print hex(ord(c)),
                                print
@@ -160,7 +160,7 @@ class BoardServer:
                            if CMD_TYPE_MIN_EXT > data[CMD_IDX] or data[CMD_IDX] > CMD_TYPE_MAX_ABB:
                                # The last byte, 0x01, is the execution result of an "unknow command"
                                answer = "".join([CMD_STX, data[2], data[1], data[3], data[4], chr(0x01)])
                                # print "Sending message: %r" %binhex.binascii.hexlify(answer)
                                print "Sending message: %r" %binhex.binascii.hexlify(answer)
                                connection.send(answer)
                                continue
                            elif data[CMD_IDX] >= CMD_TYPE_MIN_ABB:
@@ -186,7 +186,7 @@ class BoardServer:

                            if cmd in answers_with_data:
                                if data_type == MCB_CMD_DATA_TYPE_B01:
                                    data_list += [randrange(0, 2)]
                                    data_list += [1] # Always remote ON
                                elif data_type == MCB_CMD_DATA_TYPE_F32:
                                    data_list += [156, 157, 158, 159] * AD24_LEN # Add four bytes
                                    pass
@@ -204,7 +204,7 @@ class BoardServer:
                                answer += chr(checksum)
                                answer += CMD_ETX
                            
                            # print "Sending message: %r" %binhex.binascii.hexlify(answer)
                            print "Sending message: %r" %binhex.binascii.hexlify(answer)
                            connection.send(answer)
                except:
                    raise
+8 −2
Original line number Diff line number Diff line
@@ -62,7 +62,13 @@ class AntennaSimulatorImpl(AntennaBoss, CI, Subsystem, CC, Services, Lcycle):
        
    def getApparentCoordinates(self, t):
        """Return (az, el, ra, dec) + (jepoch, lon, lat)"""
        return self.history.get(t) + (0, 0, 0)
        coordinates = self.history.get(t) + [0, 0, 0]
        return tuple(coordinates)

    def getRawCoordinates(self, t):
        """Return (az, el)"""
        az, el = self.history.get(t)[:2]
        return az, el

    def setOffsets(self, lon, lat, frame):
        """Set the (az, el) or (ra, dec) offset, depending of the frame"""
@@ -94,7 +100,7 @@ class History(object):
            self.history.append(data)
            self.history.sort(key=operator.itemgetter(0))
            self.history = self.history[-2**15:] # Last 2**15 positions
        print 'position inserted in the history: ', position
        # print 'position inserted in the history: ', position

    def clean(self, since=0):
        target_time = since if since else getTimeStamp().value
+3 −1
Original line number Diff line number Diff line
@@ -1052,7 +1052,9 @@ void CComponentCore::updateIsRemote() throw (ReceiversErrors::ReceiverControlBoa
        setStatusBit(CONNECTIONERROR);
        throw impl;
    }
    if (!answer) setStatusBit(LOCAL);
    if (!answer) {
        setStatusBit(LOCAL);
    }
    else clearStatusBit(LOCAL);
    clearStatusBit(CONNECTIONERROR); // the communication was ok so clear the CONNECTIONERROR bit
}
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ void CConfiguration::init(maci::ContainerServices *Services) throw (
    // read component configuration
    _GET_STRING_ATTRIBUTE("DewarIPAddress", "Dewar IP address:", m_dewarIPAddress,"");
    _GET_STRING_ATTRIBUTE("LNAIPAddress", "LNA IP address:", m_LNAIPAddress,"");
	_GET_STRING_ATTRIBUTE("LocalOscillatorInstance","Local oscillator instance:",m_localOscillatorInstance,"");
    _GET_STRING_ATTRIBUTE("SwitchIPAddress", "Switch board IP address:", m_switchIPAddress,"");
    _GET_DWORD_ATTRIBUTE("DewarPort", "Dewar port:", m_dewarPort,"");
    _GET_DWORD_ATTRIBUTE("LNAPort", "LNA port:", m_LNAPort,"");
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ void SRTLPBandCore::setMode(const char * mode) throw (
        m_configuration.setMode(cmdMode);
            
        setLBandFilter(m_configuration.getLBandFilterID());
            
        setPBandFilter(m_configuration.getPBandFilterID());
        setLBandPolarization(m_configuration.getLBandPolarization());
        setPBandPolarization(m_configuration.getPBandPolarization());
Loading