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" ))
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]))
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
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
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
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
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 )