def voltageCurrentGain(self, mainWindow): value = mainWindow.voltageCurrentWeightParamDialog.getValue() data = [value['mask']] data.extend(trans_floats_to_bytes(value['phase_a'])) data.extend(trans_floats_to_bytes(value['phase_b'])) data.extend(trans_floats_to_bytes(value['phase_c'])) frame = createFrame(105, 10, data, 67) send_frame(frame, mainWindow)
def powerOffset(self, mainWindow): value = mainWindow.powerOffsetParamDialog.getValue() data = [value['mask']] data.extend(trans_floats_to_bytes(value['phase_a'])) data.extend(trans_floats_to_bytes(value['phase_b'])) data.extend(trans_floats_to_bytes(value['phase_c'])) frame = createFrame(105, 8, data, 67) send_frame(frame, mainWindow)
def startPrice(self, mainWindow): data = [] value = mainWindow.startPriceParamDialog.getValue() data.append(value['electricity']) data.append(value['power']) data = trans_floats_to_bytes(data) frame = createFrame(105, 4, data, 67) send_frame(frame, mainWindow)
def temperatureCalib(self, mainWindow): try: data = [] data.append(mainWindow.tempSpinBox.value()) data = trans_floats_to_bytes(data) #温度校准 frame = createFrame(105, 5, data, 67) send_frame(frame, mainWindow) except Exception as e: print(e)
def powerGainCompensation(self, mainWindow): try: value = mainWindow.powerGainCompensationParamDialog.getValue() data = [value['mask']] data.extend(trans_floats_to_bytes(value['phase_a'])) data.extend(trans_floats_to_bytes(value['phase_b'])) data.extend(trans_floats_to_bytes(value['phase_c'])) frame = createFrame(105, 6, data, 67) send_frame(frame, mainWindow) except Exception as e: print(e)
def readData(self, mainWindow): frame = createFrame(105, 16, [], 67) send_frame(frame, mainWindow)
def stopCaLib(self, mainWindow): frame = createFrame(105, 11, [], 67) send_frame(frame, mainWindow)
def powerRms(self, mainWindow): frame = createFrame(105, 9, [], 67) send_frame(frame, mainWindow)