Изменил(а) на 'main2'
This commit is contained in:
parent
7b71cdd0c5
commit
03d59cc155
24
main2
24
main2
@ -15,13 +15,13 @@ import pyqtgraph as pg
|
|||||||
#import matplotlib.pyplot as plt
|
#import matplotlib.pyplot as plt
|
||||||
#import sys
|
#import sys
|
||||||
|
|
||||||
colors = {}
|
colors = {} #переменная для работы с цветом, позже нам понадобится
|
||||||
last_clicked_label = None
|
last_clicked_label = None
|
||||||
plotLen = 20
|
plotLen = 20
|
||||||
valArr = [20] * plotLen
|
valArr = [20] * plotLen
|
||||||
plot = None
|
plot = None
|
||||||
|
|
||||||
def led1 (checked):
|
def led1 (checked): #отвечает за включение первого светодиода
|
||||||
if checked:
|
if checked:
|
||||||
form.pushButton_2.setText("Выкл")
|
form.pushButton_2.setText("Выкл")
|
||||||
print("I'm worked too much")
|
print("I'm worked too much")
|
||||||
@ -33,7 +33,7 @@ def led1 (checked):
|
|||||||
form.pushButton_2.setText("Вкл")
|
form.pushButton_2.setText("Вкл")
|
||||||
print ("I'm worked too")
|
print ("I'm worked too")
|
||||||
|
|
||||||
def led2 (checked):
|
def led2 (checked): #отвечает за включение второго светодиода
|
||||||
if checked:
|
if checked:
|
||||||
form.pushButton_3.setText("Выкл")
|
form.pushButton_3.setText("Выкл")
|
||||||
print("I'm worked too much")
|
print("I'm worked too much")
|
||||||
@ -45,7 +45,7 @@ def led2 (checked):
|
|||||||
form.pushButton_3.setText("Вкл")
|
form.pushButton_3.setText("Вкл")
|
||||||
print ("I'm worked too")
|
print ("I'm worked too")
|
||||||
|
|
||||||
def led3 (checked):
|
def led3 (checked): #отвечает за включение третьего светодиода
|
||||||
if checked:
|
if checked:
|
||||||
form.pushButton_4.setText("Выкл")
|
form.pushButton_4.setText("Выкл")
|
||||||
print("I'm worked too much")
|
print("I'm worked too much")
|
||||||
@ -60,14 +60,14 @@ def led3 (checked):
|
|||||||
print ("I'm worked too")
|
print ("I'm worked too")
|
||||||
|
|
||||||
|
|
||||||
def updateLCD():
|
def updateLCD(): #обновление дисплея
|
||||||
global temp
|
global temp #переменная для работы с дисплеем
|
||||||
form.lcdNumber.display(temp)
|
form.lcdNumber.display(temp)
|
||||||
|
|
||||||
def sed ():
|
def sed (): #проверка работы элемента
|
||||||
print ("I'm worked!")
|
print ("I'm worked!")
|
||||||
|
|
||||||
led_data = {
|
led_data = { #список начальных параметров у светодиода
|
||||||
"leds1": {"red": 0, "green": 0, "blue": 0},
|
"leds1": {"red": 0, "green": 0, "blue": 0},
|
||||||
"leds2": {"red": 0, "green": 0, "blue": 0},
|
"leds2": {"red": 0, "green": 0, "blue": 0},
|
||||||
"leds3": {"red": 0, "green": 0, "blue": 0},
|
"leds3": {"red": 0, "green": 0, "blue": 0},
|
||||||
@ -80,7 +80,7 @@ led_data = {
|
|||||||
|
|
||||||
def vkl():
|
def vkl():
|
||||||
for led in form.leds:
|
for led in form.leds:
|
||||||
#caution! Naming will be the same for a Led and JSON led objects
|
#осторожно! Одинаковые названия у объектов Led и JSON.
|
||||||
led.setStyleSheet(f"background-color: yellow;")
|
led.setStyleSheet(f"background-color: yellow;")
|
||||||
led_data[led.objectName()]["red"] = 255
|
led_data[led.objectName()]["red"] = 255
|
||||||
led_data[led.objectName()]["green"] = 255
|
led_data[led.objectName()]["green"] = 255
|
||||||
@ -88,15 +88,15 @@ def vkl():
|
|||||||
|
|
||||||
def vikl():
|
def vikl():
|
||||||
for led in form.leds:
|
for led in form.leds:
|
||||||
#caution! Naming will be the same for a Led and JSON led objects
|
#осторожно! Одинаковые названия у объектов Led и JSON.
|
||||||
led.setStyleSheet(f"background-color: black;")
|
led.setStyleSheet(f"background-color: black;")
|
||||||
led_data[led.objectName()]["red"] = 0
|
led_data[led.objectName()]["red"] = 0
|
||||||
led_data[led.objectName()]["green"] = 0
|
led_data[led.objectName()]["green"] = 0
|
||||||
led_data[led.objectName()]["blue"] = 0
|
led_data[led.objectName()]["blue"] = 0
|
||||||
|
|
||||||
def color():
|
def color():
|
||||||
color = QColorDialog.getColor()
|
color = QColorDialog.getColor() #получение цвета от диалога
|
||||||
if color.isValid():
|
if color.isValid(): #проверка наличия цвета и применение его над изображением программы
|
||||||
palette = QPalette()
|
palette = QPalette()
|
||||||
palette.setColor(QPalette.Button, color)
|
palette.setColor(QPalette.Button, color)
|
||||||
form.color_b.setPalette(palette)
|
form.color_b.setPalette(palette)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user