Exemplo n.º 1
0
    def __init__(self, master, brickletid):
        super(DigOut, self).__init__()
        self._brickletid = brickletid
        self._master = master
        self._tfobject = None
        self._rgates = []

        self._rgates.append(rGate())
        self._rgates.append(rGate())
        self._rgates.append(rGate())
        self._rgates.append(rGate())

        self._rgates[0].onReceive(self._receive, [0])
        self._rgates[1].onReceive(self._receive, [1])
        self._rgates[2].onReceive(self._receive, [2])
        self._rgates[3].onReceive(self._receive, [3])
Exemplo n.º 2
0
    def getRGate(self, portid):
        if portid not in self._rgates:
            thisrgate = rGate()
            thisrgate.onReceive(self._receive, [portid])
            self._rgates[portid] = {}
            self._rgates[portid]['gate'] = thisrgate
            self._rgates[portid]['lastmessage'] = ''

        return self._rgates[portid]['gate']
Exemplo n.º 3
0
    def __init__(self, interleavesignal, startWithInterleave=False):
        super(SignalInterleaver, self).__init__()
        self._interleave = interleavesignal
        self._sendout = 'in'

        self._sGate = sGate()
        self._rGate = rGate()
        self._rGate.onReceive(self._notify)

        if startWithInterleave:
            self._sendout = 'inter'
Exemplo n.º 4
0
    def __init__(self, longitude, latitude):
        super(ForwardAtDay, self).__init__()
        # ephem expects the values to be strings. It won't
        # fail if you pass integers, it will just not do the
        # calculations correctly.
        self._longitude = str(longitude)
        self._latitude = str(latitude)

        self._sgate = sGate()
        self._rgate = rGate()
        self._rgate.onReceive(self._notify)
Exemplo n.º 5
0
    def __init__(self, insignal=None, outsignal=None):
        super(SimpleSignalTranslator, self).__init__()

        self._sGate = sGate()
        self._rGate = rGate()
        self._rGate.onReceive(self._notify)

        self._translations = {}

        if insignal is not None and \
                outsignal is not None:
            self.addTranslation(insignal, outsignal)
Exemplo n.º 6
0
    def __init__(self, master, brickletid, inoutsetting={}):
        super(Io16, self).__init__()
        self._brickletid = brickletid
        self._master = master
        self._tfobject = None
        self._gates = []
        self._inoutsetting = inoutsetting

        # By default all gates will be 'inputs' and therefore
        # sending gates.
        for i in range(0, 16):
            if i in self._inoutsetting:
                if self._inoutsetting[i] == "out":
                    gate = rGate()
                    gate.onReceive(self._receive, [i])
                    self._gates.append({"gate": gate, "type": "r"})
                else:
                    self._gates.append({"gate": sGate(), "type": "s"})

            else:
                self._gates.append({"gate": sGate(), "type": "s"})
Exemplo n.º 7
0
 def __init__(self):
     super(SignalFilterAllowOnly, self).__init__()
     self._allowedsignals = []
     self._rgate = rGate()
     self._rgate.onReceive(self._notify)
     self._sgate = sGate()