Exemplo n.º 1
0
 def getTempHighThresh(self, idx):
     """
     Retrieve an analogue input value.
     """
     WbDefs.checkRange(idx, 0, WbDefs.TEMPCOUNT)
     nodeList = self.dom.getElementsByTagName("Tmp")
     return self.convertTemp(getAttrText( nodeList[idx], "hi" ))
Exemplo n.º 2
0
 def getTemp(self, idx):
     """
     Retrieve a single temperature value.
     """
     WbDefs.checkRange(idx, 0, WbDefs.TEMPCOUNT)
     nodeList = self.dom.getElementsByTagName("Tmp")
     return self.convertTemp(getElemText(nodeList[idx]))
Exemplo n.º 3
0
 def getAnInHighThresh(self, idx):
     """
     Retrieve an analogue input value.
     """
     WbDefs.checkRange(idx, 0, WbDefs.AICOUNT)
     nodeList = self.dom.getElementsByTagName("AI")
     val = float(getAttrText( nodeList[idx], "hi" ) )
     return val
Exemplo n.º 4
0
 def getAnOut(self, idx):
     """
     Retrieve an analogue output value.
     """
     WbDefs.checkRange(idx, 0, WbDefs.AOCOUNT)
     nodeList = self.dom.getElementsByTagName("AO")
     val = float(getElemText(nodeList[idx]))
     return val
Exemplo n.º 5
0
 def getDigIn(self, idx):
     """
     Retrieve a digital input state
     """
     WbDefs.checkRange(idx, 0, WbDefs.DICOUNT)
     val = int(getNamedNodeText(self.dom, "DI"))
     if ( val & ( 0x01 << idx ) ) != 0 :
         return True
     return False
Exemplo n.º 6
0
 def getDigOut(self, idx):
     """
     Retrieve a digital output state, note mimics are dig out 8-15
     """
     WbDefs.checkRange(idx, 0, WbDefs.DOCOUNT+WbDefs.MIMICCOUNT)
     val = int(getNamedNodeText(self.dom, "DO"))
     
     if ( val & ( 0x01 << idx ) ) != 0 :
         return True
     return False
Exemplo n.º 7
0
    def getMonitor(self, idx):
        """
        Retrieve a monitor input state

        This is an obsolete function as monitor inputs are now the same as digital inputs
        This is retained for backward compatiblity but will eventually dissapear.
        Monitor 0-3 are the digital inouts 8-11
        """
        WbDefs.checkRange(idx, 0, WbDefs.MONCOUNT)
        return self.getDigIn( idx + 8 )