def update(self, helem): for i in [0, 1]: if helem == self.volume[i]: self.volumearray[i] = HValue(helem).getArray( self.volumeinfo[i].type, self.volumeinfo[i].count) elif helem == self.switch[i]: self.switcharray[i] = HValue(helem).getArray( self.switchinfo[i].type, self.switchinfo[i].count) self.eventValue()
def attachVolume(self, helem, dir): self.volume[dir] = helem self.volumeinfo[dir] = HInfo(helem) self.min[dir] = self.volumeinfo[dir].min self.max[dir] = self.volumeinfo[dir].max self.volumearray[dir] = HValue(helem).getArray( self.volumeinfo[dir].type, self.volumeinfo[dir].count)
def opsSetVolume(self, dir, chn, value): val = self.volumeFromUser(self.volumeinfo[dir], dir, value) if self.volumearray[dir][chn] == val: return self.volumearray[dir][chn] = val hv = HValue(self.volume[dir]) hv.setArray(self.volumeinfo[dir].type, self.volumearray[dir]) hv.write()
def opsSetEnumItem(self, chn, value): if chn >= self.channels: return -1 if self.enumarray[chn] == value: return self.enumarray[chn] = int(value) hv = HValue(self.enum) hv.setArray(self.enuminfo.type, self.enumarray) hv.write()
def attach(self, helem): BaseElement.attach(self, helem) self.enum = helem self.enuminfo = HInfo(helem) self.enumarray = HValue(helem).getArray(self.enuminfo.type, self.enuminfo.count) self.channels = self.enuminfo.count self.texts = self.enuminfo.itemNames self.caps |= self.mycaps
def opsSetSwitch(self, dir, chn, value): if self.switcharray[dir][chn] and value: return if not self.switcharray[dir][chn] and not value: return self.switcharray[dir] = int(value) hv = HValue(self.switch[dir]) hv.setArray(self.switchinfo[dir].type, self.switcharray[dir]) hv.write()
def attachSwitch(self, helem, dir): self.switch[dir] = helem self.switchinfo[dir] = HInfo(helem) self.switcharray[dir] = HValue(helem).getArray( self.switchinfo[dir].type, self.switchinfo[dir].count)
def update(self, helem): self.enumarray = HValue(helem).getArray(self.enuminfo.type, self.enuminfo.count) self.eventValue()