def setData(self):
        sender = self.sender()
        name = sender.objectName()
        if name[1] in ('1', '2', '3', '4', '5', '6', '7', '8', '9', '0'):
            point = name[1]
            point = int(point)
            sender.setStyleSheet(metrocss.data_active)
            data = self.UserData.toPlainText()
            data = int(data)
            if data == 0:
                data = point
                self.UserData.setHtml(metrocss.Show_Main_Temp(data))
            else:
                data = data * 10 + point
                if self.tempisset == 0:
                    if data > 0 and data < 211:
                        self.UserData.setHtml(metrocss.Show_Main_Temp(data))
                else:
                    if data > 0 and data < 31:
                        self.UserData.setHtml(metrocss.Show_Main_Temp(data))

        if sender == self.bdel:
            sender.setStyleSheet(metrocss.data_active)
            data = self.UserData.toPlainText()
            data = int(data)
            if data == 0:
                pass
            else:
                data = data // 10
                self.UserData.setHtml(metrocss.Show_Main_Temp(data))

        if sender == self.bok:
            sender.setStyleSheet(metrocss.data_active)
            if self.tempisset == 0:
                self.tempisset = 1
                data = self.UserData.toPlainText()
                self.T = int(data)
                self.label.setText(metrocss.SetLabelText(self.label2))
                self.UserData.setHtml(metrocss.Show_Main_Temp(0))
            else:
                self.timeisset = 1
                data = self.UserData.toPlainText()
                self.t = int(data)
示例#2
0
    def setData(self):
        d = u'\xB7'
        sender = self.sender()
        name = sender.objectName()
        if name[1] in ('1', '2', '3', '4', '5', '6', '7', '8', '9', '0'):
            point = name[1]
            sender.setStyleSheet(metrocss.data_active)
            self.data = self.data + point
            self.UserData.setHtml(metrocss.Show_Main_Temp(d * len(self.data)))

        if sender == self.bdel:
            sender.setStyleSheet(metrocss.data_active)

            if len(self.data) == 0:
                pass
            else:
                self.data = self.data[0:-1]
                self.UserData.setHtml(
                    metrocss.Show_Main_Temp(d * len(self.data)))

        if sender == self.bok:
            sender.setStyleSheet(metrocss.data_active)
示例#3
0
    def __init__(self, user_data_signal, parent=None):

        super(PinCode, self).__init__(parent)
        Ui_InputWindow.__init__(self)

        self.setupUi(self)
        self.setWindowModality(QtCore.Qt.WindowModal)
        self.setWindowFlags(Qt.FramelessWindowHint)

        self.signal = user_data_signal
        self.label1 = u'ПИНКОД'
        self.data = ''
        self.UserData.setHtml(metrocss.Show_Main_Temp(''))

        self.label.setText(metrocss.SetLabelText(self.label1))
        self.label.setAlignment(Qt.AlignCenter)

        self.b1.pressed.connect(self.setData)
        self.b2.pressed.connect(self.setData)
        self.b3.pressed.connect(self.setData)
        self.b4.pressed.connect(self.setData)
        self.b5.pressed.connect(self.setData)
        self.b6.pressed.connect(self.setData)
        self.b7.pressed.connect(self.setData)
        self.b8.pressed.connect(self.setData)
        self.b9.pressed.connect(self.setData)
        self.b0.pressed.connect(self.setData)
        self.bdel.pressed.connect(self.setData)
        self.bok.pressed.connect(self.setData)

        self.b1.released.connect(self.Clear)
        self.b2.released.connect(self.Clear)
        self.b3.released.connect(self.Clear)
        self.b4.released.connect(self.Clear)
        self.b5.released.connect(self.Clear)
        self.b6.released.connect(self.Clear)
        self.b7.released.connect(self.Clear)
        self.b8.released.connect(self.Clear)
        self.b9.released.connect(self.Clear)
        self.b0.released.connect(self.Clear)
        self.bdel.released.connect(self.Clear)
        self.bok.released.connect(self.Clear)
示例#4
0
    def ShowResults(self, Tin):#вывод температуры на рабочую зону
        #-------------рассчитываем температуры по разрешенным датчикам---------
        if sets['sensor1_1']==1 and sets['sensor1_2']==1:
            self.MTemp1=(float(Tin[1])+float(Tin[2]))/2
            self.MainTemp1.setHtml(metrocss.Show_Main_Temp ("%.1f" %self.MTemp1 ))
            self.Channel1.setHtml(metrocss.Show_temp(Tin[1]))
            self.Channel2.setHtml(metrocss.Show_temp(Tin[2]))
        elif sets['sensor1_1']==0 and sets['sensor1_2']==1:
            self.MTemp1=float(Tin[2])
            self.MainTemp1.setHtml(metrocss.Show_Main_Temp ("%.1f" %self.MTemp1 ))
            self.Channel1.setHtml(metrocss.Show_temp("NaN"))
            self.Channel2.setHtml(metrocss.Show_temp(Tin[2]))
        elif sets['sensor1_1']==1 and sets['sensor1_2']==0:
            self.MTemp1=float(Tin[1])
            self.MainTemp1.setHtml(metrocss.Show_Main_Temp ("%.1f" %self.MTemp1 ))
            self.Channel1.setHtml(metrocss.Show_temp(Tin[1]))
            self.Channel2.setHtml(metrocss.Show_temp("NaN"))
       
       
        self.Channel3.setHtml(metrocss.Show_temp(Tin[3]))#Тэны всегда!
        self.Channel6.setHtml(metrocss.Show_temp(Tin[6])) 
        self.Heater1=Tin[3]
        self.Heater2=Tin[6]
        
        if sets['sensor2_1']==1 and sets['sensor2_2']==1:
            self.MTemp2=(float(Tin[4])+float(Tin[5]))/2
            self.MainTemp2.setHtml(metrocss.Show_Main_Temp ("%.1f" %self.MTemp2 ))
            self.Channel4.setHtml(metrocss.Show_temp(Tin[4]))
            self.Channel5.setHtml(metrocss.Show_temp(Tin[5]))
        elif sets['sensor2_1']==0 and sets['sensor2_2']==1:
            self.MTemp2=float(Tin[5])
            self.MainTemp2.setHtml(metrocss.Show_Main_Temp ("%.1f" %self.MTemp2 ))
            self.Channel4.setHtml(metrocss.Show_temp("NaN"))
            self.Channel5.setHtml(metrocss.Show_temp(Tin[5]))
        elif sets['sensor2_1']==1 and sets['sensor2_2']==0:
            self.MTemp2=float(Tin[4])
            self.MainTemp2.setHtml(metrocss.Show_Main_Temp ("%.1f" %self.MTemp2 ))
            self.Channel4.setHtml(metrocss.Show_temp(Tin[4]))
            self.Channel5.setHtml(metrocss.Show_temp("NaN"))
        
        #-------------работаем со стеком значений температур---------
        if self.coldStart==0:
            for i in range(60):
                self.TRate1.append(self.MTemp1)
                self.TRate2.append(self.MTemp2)
                
            self.coldStart=1
        else:
            self.TRate1.append(self.MTemp1)
            self.TRate2.append(self.MTemp2)
            
        if self.coldStart1==0:
            self.TRate1=[]
            for i in range(60):
                self.TRate1.append(self.MTemp1)
            self.coldStart1=1

    
        if self.coldStart2==0: 
            self.TRate2=[]      
            for i in range(60):   
                self.TRate2.append(self.MTemp2)
            self.coldStart2=1
        
        #-------------вычисляем скорость изменения температуры по стеку---------
        self.deltaTRate1=self.MTemp1-self.TRate1.pop(0)
        self.deltaTRate2=self.MTemp2-self.TRate2.pop(0)
        
        self.Rate1.setHtml(metrocss.Show_Rate(self.deltaTRate1))
        self.Rate2.setHtml(metrocss.Show_Rate(self.deltaTRate2))
        
        #-----вызываем обработку состояния вкл/выкл линии по полученным данным----
        self.DoMainWork()