Add choice of divice
This commit is contained in:
parent
6fbcb3bc78
commit
181a625243
@ -72,9 +72,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>30</y>
|
||||
<width>851</width>
|
||||
<height>41</height>
|
||||
<y>20</y>
|
||||
<width>1031</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
@ -85,6 +85,58 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="device_groupBox">
|
||||
<property name="title">
|
||||
<string>Выбор устройства</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QRadioButton" name="device1_radioButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>31</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="device2_radioButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>31</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="device3_radioButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>20</y>
|
||||
<width>31</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>3</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Read">
|
||||
<property name="enabled">
|
||||
@ -277,7 +329,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="visual">
|
||||
<attribute name="title">
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
"""Режимы работы, переменные, влияющие на работу, которые с некоторой вероятностью будут меняться."""
|
||||
|
||||
|
||||
DATA_RATE = 200 # скорость передачи данных
|
||||
|
||||
# mes = "AT+CONA11899AA1670B\r\n"
|
||||
# mes = "AT+CONA11899AA21438\r\n" # для связи со стимулятором
|
||||
mes = "AT+CONA11899AA166E1\r\n" # для связи со стимулятором
|
||||
mes1 = "AT+CONA11899AA166E1\r\n" # для связи со стимулятором устройство 1
|
||||
mes2 = "AT+CONA11899AA21438\r\n" # для связи со стимулятором устройство 2
|
||||
mes3 = "AT+CONA11899AA1670B\r\n" # для связи со стимулятором устройство 3
|
||||
|
||||
@ -17,7 +17,7 @@ from PyQt5 import QtCore
|
||||
from pyqtgraph import TextItem
|
||||
import pyqtgraph as pg
|
||||
import project.controller as my_data
|
||||
from project import mes
|
||||
from project import mes1, mes2, mes3
|
||||
|
||||
# выбор режима чения из файла или из com-порта
|
||||
MODE_COM_PORT = False
|
||||
@ -282,7 +282,12 @@ class Ui(QtWidgets.QMainWindow):
|
||||
self.serial.setPortName(self.Port_ch.currentText())
|
||||
self.serial.open(QIODevice.ReadWrite)
|
||||
self.serial.flush()
|
||||
self.serial.write(mes.encode())
|
||||
if self.device1_radioButton.isChecked():
|
||||
self.serial.write(mes1.encode())
|
||||
if self.device2_radioButton.isChecked():
|
||||
self.serial.write(mes2.encode())
|
||||
if self.device3_radioButton.isChecked():
|
||||
self.serial.write(mes3.encode())
|
||||
self.on_close()
|
||||
MODE_COM_PORT = True
|
||||
self.graph_init()
|
||||
@ -598,6 +603,7 @@ class Ui(QtWidgets.QMainWindow):
|
||||
self.Close_file.setVisible(True)
|
||||
self.Restart.setVisible(True)
|
||||
self.horizontalScrollBar.setVisible(False)
|
||||
self.device_groupBox.setVisible(True)
|
||||
else:
|
||||
self.on_stop()
|
||||
self.OpenB.setVisible(True)
|
||||
@ -613,6 +619,7 @@ class Ui(QtWidgets.QMainWindow):
|
||||
self.Close_file.setVisible(False)
|
||||
self.Restart.setVisible(False)
|
||||
self.horizontalScrollBar.setVisible(True)
|
||||
self.device_groupBox.setVisible(False)
|
||||
|
||||
def set_send_mode(self):
|
||||
"""Установка режима передачи данных (Bluetooth/433)"""
|
||||
|
||||
BIN
viewer.exe
BIN
viewer.exe
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user