witam, zmieniłem kod na:
def NotifyChannelState(self, addrKey, state):
if addrKey == 1:
if state != 3:
self.Channel1Button.SetFontColor(0.0, 1.0, 0.0)
self.Channel1Button.SetText(localeInfo.CHANNEL + " 1 (" + STATE_DICT[state] + ")")
if addrKey == 2:
if state != 3:
self.Channel2Button.SetFontColor(0.0, 1.0, 0.0)
self.Channel2Button.SetText(localeInfo.CHANNEL + " 2 (" + STATE_DICT[state] + ")")
if addrKey == 3:
if state != 3:
self.Channel3Button.SetFontColor(0.0, 1.0, 0.0)
self.Channel4Button.SetText(localeInfo.CHANNEL + " 3 (" + STATE_DICT[state] + ")")
if addrKey == 4:
if state != 3:
self.Channel4Button.SetFontColor(0.0, 1.0, 0.0)
self.Channel4Button.SetText(localeInfo.CHANNEL + " 4 (" + STATE_DICT[state] + ")"){
"name": "Channel1Button",
"type": "radio_button",
"x": 10,
"y": 10,
"default_image": "d:/ymir work/ui/public/large_button_01.sub",
"over_image": "d:/ymir work/ui/public/large_button_02.sub",
"down_image": "d:/ymir work/ui/public/large_button_03.sub",
"color": 4294281095L,
"text": ".....",
},Lecz wyświetla "....." a powinno: "Kanał 1 (NORM)"
Logi z syser:
0315 17:41:00530 :: mouseModule:357: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
0315 17:41:00530 :: Traceback (most recent call last):
0315 17:41:00530 :: File "mouseModule.py", line 357, in Update
0315 17:41:00530 :: TypeError
0315 17:41:00530 :: :
0315 17:41:00530 :: an integer is required
0315 17:41:00530 ::
0315 17:41:01393 :: Traceback (most recent call last):
0315 17:41:01393 :: File "mouseModule.py", line 357, in Update
0315 17:41:01393 :: TypeError
0315 17:41:01393 :: :
0315 17:41:01393 :: an integer is required
0315 17:41:01393 ::
0315 17:41:01661 :: Traceback (most recent call last):
0315 17:41:01661 :: File "mouseModule.py", line 357, in Update
0315 17:41:01661 :: TypeError
0315 17:41:01661 :: :
0315 17:41:01661 :: an integer is required
0315 17:41:01661 ::
0315 17:41:01945 :: Traceback (most recent call last):
0315 17:41:01945 :: File "mouseModule.py", line 357, in Update
0315 17:41:01945 :: TypeError
0315 17:41:01945 :: :
0315 17:41:01945 :: an integer is required
0315 17:41:01945 :: Co robię źle?
Przez
benio101, · Opublikowano