Add new parametrs of high and low votage stimulation
This commit is contained in:
parent
157af94874
commit
6fbcb3bc78
@ -277,7 +277,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="visual">
|
<widget class="QWidget" name="visual">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -2038,6 +2038,132 @@
|
|||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="Psense_period_l">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>460</y>
|
||||||
|
<width>231</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string> Длительность поиска события после Vp, мс</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="Post_pace_block_period_l">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>490</y>
|
||||||
|
<width>181</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Время слепоты после Vp, мс </string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="Post_pace_amplitude_l">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>520</y>
|
||||||
|
<width>221</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Амплитуда сигнала после Vp, мВ</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSpinBox" name="Psense_period_spinBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>270</x>
|
||||||
|
<y>460</y>
|
||||||
|
<width>61</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSpinBox" name="Post_pace_block_period_spinBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>270</x>
|
||||||
|
<y>490</y>
|
||||||
|
<width>61</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>50</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QDoubleSpinBox" name="Post_pace_amplitude_SpinBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>270</x>
|
||||||
|
<y>520</y>
|
||||||
|
<width>61</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>0.500000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>15.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.500000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>2.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
@ -2507,7 +2633,7 @@
|
|||||||
<number>100</number>
|
<number>100</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>10000</number>
|
<number>5000</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>100</number>
|
<number>100</number>
|
||||||
@ -3015,7 +3141,7 @@
|
|||||||
<double>0.100000000000000</double>
|
<double>0.100000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<double>2.000000000000000</double>
|
<double>3.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QDoubleSpinBox" name="t3_hv_phase_2_duration_SpinBox">
|
<widget class="QDoubleSpinBox" name="t3_hv_phase_2_duration_SpinBox">
|
||||||
@ -3043,6 +3169,45 @@
|
|||||||
<double>6.000000000000000</double>
|
<double>6.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="High_Tf_checkBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>90</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>31</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="High_Tt2_checkBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>310</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>31</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="High_Tt1_checkBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>470</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>31</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<zorder>level</zorder>
|
<zorder>level</zorder>
|
||||||
<zorder>High_Tf_spinBox</zorder>
|
<zorder>High_Tf_spinBox</zorder>
|
||||||
<zorder>High_Tt2_spinBox</zorder>
|
<zorder>High_Tt2_spinBox</zorder>
|
||||||
@ -3092,6 +3257,9 @@
|
|||||||
<zorder>t1_hv_phase_1_duration_SpinBox</zorder>
|
<zorder>t1_hv_phase_1_duration_SpinBox</zorder>
|
||||||
<zorder>t2_hv_switch_duration_SpinBox</zorder>
|
<zorder>t2_hv_switch_duration_SpinBox</zorder>
|
||||||
<zorder>t3_hv_phase_2_duration_SpinBox</zorder>
|
<zorder>t3_hv_phase_2_duration_SpinBox</zorder>
|
||||||
|
<zorder>High_Tf_checkBox</zorder>
|
||||||
|
<zorder>High_Tt2_checkBox</zorder>
|
||||||
|
<zorder>High_Tt1_checkBox</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
@ -3355,7 +3523,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>360</y>
|
<y>360</y>
|
||||||
<width>491</width>
|
<width>491</width>
|
||||||
<height>131</height>
|
<height>181</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
@ -3428,7 +3596,7 @@
|
|||||||
<widget class="QLabel" name="burst_voltage_l">
|
<widget class="QLabel" name="burst_voltage_l">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>20</x>
|
||||||
<y>60</y>
|
<y>60</y>
|
||||||
<width>101</width>
|
<width>101</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
@ -3469,7 +3637,7 @@
|
|||||||
<widget class="QSpinBox" name="burst_period_spinBox">
|
<widget class="QSpinBox" name="burst_period_spinBox">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>190</x>
|
<x>270</x>
|
||||||
<y>90</y>
|
<y>90</y>
|
||||||
<width>81</width>
|
<width>81</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
@ -3493,17 +3661,55 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>90</y>
|
<y>90</y>
|
||||||
<width>181</width>
|
<width>241</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>T следования импульсов, мс</string>
|
<string>Начальный T следования импульсов, мс</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="burst_end_period_l">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>120</y>
|
||||||
|
<width>241</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Конечный T следования импульсов, мс</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSpinBox" name="burst_end_period_spinBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>270</x>
|
||||||
|
<y>120</y>
|
||||||
|
<width>81</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>150</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>250</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@ -212,6 +212,7 @@ class DataClass:
|
|||||||
self.sub_mode = 0 # текущий подрежим терапии
|
self.sub_mode = 0 # текущий подрежим терапии
|
||||||
self.terapy_now = 0 # текущий режим терапии
|
self.terapy_now = 0 # текущий режим терапии
|
||||||
self.burst_period = 0 # период следования импульсов при НВ стимуляции
|
self.burst_period = 0 # период следования импульсов при НВ стимуляции
|
||||||
|
self.burst_end_period = 0 # конечный период следования импульсов при НВ стимуляции
|
||||||
self.burst_voltage = 0 # напряжение импульсов при НВ стимуляции
|
self.burst_voltage = 0 # напряжение импульсов при НВ стимуляции
|
||||||
self.burst_cnt = 0 # количество импульсов в пачке при НВ стимуляции
|
self.burst_cnt = 0 # количество импульсов в пачке при НВ стимуляции
|
||||||
self.lv_relax_time = 0 # время стабилизации после НВ стимуляции
|
self.lv_relax_time = 0 # время стабилизации после НВ стимуляции
|
||||||
@ -226,6 +227,10 @@ class DataClass:
|
|||||||
self.lv_voltage = 0 # напряжение НВ стимуляции
|
self.lv_voltage = 0 # напряжение НВ стимуляции
|
||||||
self.lv_mode = 0 # режим низковольтной стимуляции
|
self.lv_mode = 0 # режим низковольтной стимуляции
|
||||||
self.lv_polarity = 0 # полярность для НВ
|
self.lv_polarity = 0 # полярность для НВ
|
||||||
|
self.Psense_period = 0 # длительность поиска события после Vp
|
||||||
|
self.post_pace_block_period = 0 # время слепоты после Vp
|
||||||
|
self.post_pace_amplitude = 0 # амплитуда сигнала после Vp
|
||||||
|
|
||||||
|
|
||||||
def clear_data(self):
|
def clear_data(self):
|
||||||
"""
|
"""
|
||||||
@ -505,10 +510,13 @@ class DataClass:
|
|||||||
|
|
||||||
if self.counter[self.draw_cnt] % 12 == 11:
|
if self.counter[self.draw_cnt] % 12 == 11:
|
||||||
int1 = int.from_bytes(self.data_rx[self.pac_count + 23], "big")
|
int1 = int.from_bytes(self.data_rx[self.pac_count + 23], "big")
|
||||||
self.hv_polarity = (int1 & 0xF0) >> 4
|
self.hv_polarity = (int1 & 0xC) >> 2
|
||||||
self.hv_mode = int1 & 0xF
|
self.hv_mode = int1 & 0x3
|
||||||
self.hv_phase_1_duration = int.from_bytes(self.data_rx[self.pac_count + 24], "big")
|
self.hv_phase_1_duration = int.from_bytes(self.data_rx[self.pac_count + 24], "big")
|
||||||
self.hv_switch_duration = int.from_bytes(self.data_rx[self.pac_count + 26], "big")
|
self.hv_switch_duration = int.from_bytes(self.data_rx[self.pac_count + 26], "big")
|
||||||
self.hv_phase_2_duration = int.from_bytes(self.data_rx[self.pac_count + 25], "big")
|
self.hv_phase_2_duration = int.from_bytes(self.data_rx[self.pac_count + 25], "big")
|
||||||
self.hv_switching_voltage = int.from_bytes(self.data_rx[self.pac_count + 27], "big")
|
self.hv_switching_voltage = int.from_bytes(self.data_rx[self.pac_count + 27], "big")
|
||||||
self.hv_cutoff_voltage = int.from_bytes(self.data_rx[self.pac_count + 28], "big")
|
self.hv_cutoff_voltage = int.from_bytes(self.data_rx[self.pac_count + 28], "big")
|
||||||
|
self.burst_end_period = (
|
||||||
|
shift_or_16(int.from_bytes(self.data_rx[self.pac_count + 29], "big", signed=False),
|
||||||
|
int.from_bytes(self.data_rx[self.pac_count + 30], "big", signed=False)))
|
||||||
|
|||||||
114
project/view.py
114
project/view.py
@ -90,6 +90,11 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
self.RA_square_time_ms_BOX.editTextChanged.connect(self.set_RA_square_time_ms_BOX)
|
self.RA_square_time_ms_BOX.editTextChanged.connect(self.set_RA_square_time_ms_BOX)
|
||||||
self.RA_square_coeff_BOX.editTextChanged.connect(self.set_RA_square_coeff_BOX)
|
self.RA_square_coeff_BOX.editTextChanged.connect(self.set_RA_square_coeff_BOX)
|
||||||
self.RA_all_time_ms_BOX.editTextChanged.connect(self.set_RA_all_time_ms_BOX)
|
self.RA_all_time_ms_BOX.editTextChanged.connect(self.set_RA_all_time_ms_BOX)
|
||||||
|
self.Psense_period_spinBox.valueChanged.connect(self.set_Psense_period_spinBox)
|
||||||
|
self.Post_pace_block_period_spinBox.valueChanged.connect(self.set_Post_pace_block_period_spinBox)
|
||||||
|
self.Post_pace_amplitude_SpinBox.valueChanged.connect(self.set_Post_pace_amplitude_SpinBox)
|
||||||
|
|
||||||
|
|
||||||
self.Signal_Box.currentIndexChanged.connect(self.set_Signal_Box)
|
self.Signal_Box.currentIndexChanged.connect(self.set_Signal_Box)
|
||||||
self.Channel_Box.currentIndexChanged.connect(self.set_Channel_Box)
|
self.Channel_Box.currentIndexChanged.connect(self.set_Channel_Box)
|
||||||
self.DC_cut_Box.currentIndexChanged.connect(self.set_DC_cut_Box)
|
self.DC_cut_Box.currentIndexChanged.connect(self.set_DC_cut_Box)
|
||||||
@ -123,11 +128,14 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
self.burst_cnt_spinBox.valueChanged.connect(self.set_burst_cnt_spinBox)
|
self.burst_cnt_spinBox.valueChanged.connect(self.set_burst_cnt_spinBox)
|
||||||
self.burst_voltage_SpinBox.valueChanged.connect(self.set_burst_voltage_SpinBox)
|
self.burst_voltage_SpinBox.valueChanged.connect(self.set_burst_voltage_SpinBox)
|
||||||
self.burst_period_spinBox.valueChanged.connect(self.set_burst_period_spinBox)
|
self.burst_period_spinBox.valueChanged.connect(self.set_burst_period_spinBox)
|
||||||
self.u1_hv_switching_voltage_l.setVisible(False)
|
self.burst_end_period_spinBox.valueChanged.connect(self.set_burst_end_period_spinBox)
|
||||||
self.u2_hv_cutoff_voltage_l.setVisible(False)
|
self.u1_hv_switching_voltage_l.setVisible(True)
|
||||||
self.u1_hv_switching_voltage_spinBox.setVisible(False)
|
self.u2_hv_cutoff_voltage_l.setVisible(True)
|
||||||
self.u2_hv_cutoff_voltage_spinBox.setVisible(False)
|
self.u1_hv_switching_voltage_spinBox.setVisible(True)
|
||||||
self.burst_frame.setVisible(False)
|
self.u2_hv_cutoff_voltage_spinBox.setVisible(True)
|
||||||
|
self.burst_frame.setVisible(True)
|
||||||
|
self.HV_Box.currentIndexChanged.connect(self.set_HV_Box)
|
||||||
|
self.LV_Box.currentIndexChanged.connect(self.set_LV_Box)
|
||||||
|
|
||||||
set_up_controls()
|
set_up_controls()
|
||||||
|
|
||||||
@ -148,6 +156,10 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
self.timer_LS.timeout.connect(self.timerEvent_param)
|
self.timer_LS.timeout.connect(self.timerEvent_param)
|
||||||
self.timer_LS.start(2000)
|
self.timer_LS.start(2000)
|
||||||
|
|
||||||
|
# Создание таймера для отображения зарядки конденсатора
|
||||||
|
self.timer_charge = QtCore.QTimer()
|
||||||
|
self.timer_charge.timeout.connect(self.timerEvent_charge)
|
||||||
|
|
||||||
def write_file(self):
|
def write_file(self):
|
||||||
"""
|
"""
|
||||||
Открытие на запись файла
|
Открытие на запись файла
|
||||||
@ -180,6 +192,20 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
# отрисовка
|
# отрисовка
|
||||||
app.processEvents()
|
app.processEvents()
|
||||||
|
|
||||||
|
def timerEvent_charge(self):
|
||||||
|
if MODE_COM_PORT:
|
||||||
|
self.draw_charge(data_IN_COM)
|
||||||
|
if MODE_FILE:
|
||||||
|
self.draw_charge(data_IN_FILE)
|
||||||
|
app.processEvents()
|
||||||
|
|
||||||
|
def draw_charge(self, data_in):
|
||||||
|
self.text = pg.TextItem('*')
|
||||||
|
self.text.setColor('red')
|
||||||
|
self.text.setFont(QFont('Arial', 20))
|
||||||
|
self.text.setPos(data_in.draw_cnt / my_data.DATA_RATE, (0.05 if data_in.dc_cut else 16))
|
||||||
|
self.graph_1.addItem(self.text)
|
||||||
|
|
||||||
def synchronise_param(self, data_in):
|
def synchronise_param(self, data_in):
|
||||||
"""Синхронизация параметров стимулятора"""
|
"""Синхронизация параметров стимулятора"""
|
||||||
self.SD_card_Box.setCurrentIndex(int(data_in.sd_card))
|
self.SD_card_Box.setCurrentIndex(int(data_in.sd_card))
|
||||||
@ -205,21 +231,27 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
self.redet_bad_spinBox.setValue(data_in.redet_bad)
|
self.redet_bad_spinBox.setValue(data_in.redet_bad)
|
||||||
self.Work_Mode_pacemaker.setCurrentIndex(data_in.Work_Mode_pacemaker)
|
self.Work_Mode_pacemaker.setCurrentIndex(data_in.Work_Mode_pacemaker)
|
||||||
self.Spi_spot_set_spinBox.setValue(data_in.spi_pot_set)
|
self.Spi_spot_set_spinBox.setValue(data_in.spi_pot_set)
|
||||||
self.hv_polarity_BOX.setValue(data_in.hv_polarity)
|
self.hv_polarity_BOX.setCurrentIndex(data_in.hv_polarity)
|
||||||
self.hv_mode_BOX.setValue(data_in.hv_mode)
|
self.hv_mode_BOX.setCurrentIndex(data_in.hv_mode)
|
||||||
self.t1_hv_phase_1_duration_SpinBox.setValue(data_in.hv_phase_1_duration / 10.0)
|
self.t1_hv_phase_1_duration_SpinBox.setValue(data_in.hv_phase_1_duration / 10.0)
|
||||||
self.t3_hv_phase_2_duration_SpinBox.setValue(data_in.hv_phase_2_duration / 10.0)
|
self.t3_hv_phase_2_duration_SpinBox.setValue(data_in.hv_phase_2_duration / 10.0)
|
||||||
self.t2_hv_switch_duration_SpinBox.setValue(data_in.hv_switch_duration / 10.0)
|
self.t2_hv_switch_duration_SpinBox.setValue(data_in.hv_switch_duration / 10.0)
|
||||||
self.u1_hv_switching_voltage_spinBox.setValue(data_in.hv_switching_voltage)
|
self.u1_hv_switching_voltage_spinBox.setValue(data_in.hv_switching_voltage)
|
||||||
self.u2_hv_cutoff_voltage_spinBox.setValue(data_in.hv_cutoff_voltage)
|
self.u2_hv_cutoff_voltage_spinBox.setValue(data_in.hv_cutoff_voltage)
|
||||||
self.lv_polarity_BOX.setValue(data_in.lv_polarity)
|
self.lv_polarity_BOX.setCurrentIndex(data_in.lv_polarity)
|
||||||
self.lv_mode_BOX.setValue(data_in.lv_mode)
|
self.lv_mode_BOX.setCurrentIndex(data_in.lv_mode)
|
||||||
self.t1_lv_shock_time_SpinBox().setValue(data_in.lv_shock_time / 10.0)
|
self.t1_lv_shock_time_SpinBox.setValue(data_in.lv_shock_time / 10.0)
|
||||||
self.t2_lv_relax_time_spinBox().setValue(data_in.lv_relax_time)
|
self.t2_lv_relax_time_spinBox.setValue(data_in.lv_relax_time)
|
||||||
self.u_lv_voltage_SpinBox().setValue(data_in.lv_voltage / 10.0)
|
self.u_lv_voltage_SpinBox.setValue(data_in.lv_voltage / 10.0)
|
||||||
self.burst_cnt_spinBox.setValue(data_in.burst_cnt)
|
self.burst_cnt_spinBox.setValue(data_in.burst_cnt)
|
||||||
self.burst_voltage_SpinBox.setValue(data_in.burst_voltage / 10.0)
|
self.burst_voltage_SpinBox.setValue(data_in.burst_voltage / 10.0)
|
||||||
self.burst_period.setValue(data_in.burst_period)
|
self.burst_period_spinBox.setValue(data_in.burst_period)
|
||||||
|
self.burst_end_period_spinBox.setValue(data_in.burst_end_period)
|
||||||
|
self.Psense_period_spinBox.setValue(data_in.Psense_period)
|
||||||
|
self.Post_pace_block_period_spinBox.setValue(data_in.post_pace_block_period)
|
||||||
|
self.Post_pace_amplitude_SpinBox.setValue(data_in.post_pace_amplitude)
|
||||||
|
self.HV_Box.setCurrentIndex(int(data_in.hv))
|
||||||
|
self.LV_Box.setCurrentIndex(int(data_in.lv))
|
||||||
|
|
||||||
|
|
||||||
def timerEvent(self):
|
def timerEvent(self):
|
||||||
@ -362,6 +394,7 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
if data_in.sub_mode == 0:
|
if data_in.sub_mode == 0:
|
||||||
self.sub_modeB.setStyleSheet('background-color: green; color: white')
|
self.sub_modeB.setStyleSheet('background-color: green; color: white')
|
||||||
self.sub_modeB.setText("Терапия неактивна")
|
self.sub_modeB.setText("Терапия неактивна")
|
||||||
|
|
||||||
if data_in.sub_mode == 1:
|
if data_in.sub_mode == 1:
|
||||||
self.sub_modeB.setStyleSheet('background-color: blue; color: white')
|
self.sub_modeB.setStyleSheet('background-color: blue; color: white')
|
||||||
self.sub_modeB.setText("Зарядка конденсатора")
|
self.sub_modeB.setText("Зарядка конденсатора")
|
||||||
@ -380,8 +413,13 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
# Вывод времени зарядки конденсатора
|
# Вывод времени зарядки конденсатора
|
||||||
if data_in.sub_mode == 1 and self.sub_mode_previous != 1:
|
if data_in.sub_mode == 1 and self.sub_mode_previous != 1:
|
||||||
self.start_time_charging = time.time()
|
self.start_time_charging = time.time()
|
||||||
|
self.U_cap_max = 0
|
||||||
|
self.timer_charge.start(100)
|
||||||
if data_in.sub_mode == 1 and self.sub_mode_previous == 1:
|
if data_in.sub_mode == 1 and self.sub_mode_previous == 1:
|
||||||
self.end_time_charging = time.time()
|
self.end_time_charging = time.time()
|
||||||
|
if data_in.sub_mode != 1 and self.sub_mode_previous == 1:
|
||||||
|
self.timer_charge.stop()
|
||||||
|
|
||||||
self.sub_mode_previous = data_in.sub_mode
|
self.sub_mode_previous = data_in.sub_mode
|
||||||
self.charge_timer_label.setText(f"{(self.end_time_charging - self.start_time_charging):.2f}")
|
self.charge_timer_label.setText(f"{(self.end_time_charging - self.start_time_charging):.2f}")
|
||||||
|
|
||||||
@ -406,6 +444,11 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
self.text.setColor('red')
|
self.text.setColor('red')
|
||||||
self.text.setPos(data_in.draw_cnt_last / my_data.DATA_RATE, (0 if data_in.dc_cut else 15))
|
self.text.setPos(data_in.draw_cnt_last / my_data.DATA_RATE, (0 if data_in.dc_cut else 15))
|
||||||
self.graph_1.addItem(self.text)
|
self.graph_1.addItem(self.text)
|
||||||
|
if data_in.draw_last_QRS == 2:
|
||||||
|
self.text = pg.TextItem('Vn\nT:' + str(data_in.draw_last_period))
|
||||||
|
self.text.setColor('blue')
|
||||||
|
self.text.setPos(data_in.draw_cnt_last / my_data.DATA_RATE, (0 if data_in.dc_cut else 15))
|
||||||
|
self.graph_1.addItem(self.text)
|
||||||
|
|
||||||
def on_stop(self):
|
def on_stop(self):
|
||||||
self.close_file()
|
self.close_file()
|
||||||
@ -729,17 +772,9 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
case 0:
|
case 0:
|
||||||
self.picture_4.setVisible(True)
|
self.picture_4.setVisible(True)
|
||||||
self.picture_5.setVisible(False)
|
self.picture_5.setVisible(False)
|
||||||
self.u1_hv_switching_voltage_l.setVisible(False)
|
|
||||||
self.u2_hv_cutoff_voltage_l.setVisible(False)
|
|
||||||
self.u1_hv_switching_voltage_spinBox.setVisible(False)
|
|
||||||
self.u2_hv_cutoff_voltage_spinBox.setVisible(False)
|
|
||||||
case 1:
|
case 1:
|
||||||
self.picture_5.setVisible(True)
|
self.picture_5.setVisible(True)
|
||||||
self.picture_4.setVisible(False)
|
self.picture_4.setVisible(False)
|
||||||
self.u1_hv_switching_voltage_l.setVisible(True)
|
|
||||||
self.u2_hv_cutoff_voltage_l.setVisible(True)
|
|
||||||
self.u1_hv_switching_voltage_spinBox.setVisible(True)
|
|
||||||
self.u2_hv_cutoff_voltage_spinBox.setVisible(True)
|
|
||||||
my_data.state_packet(self.send_mode, self.serial, 0x31, param, 1, int)
|
my_data.state_packet(self.send_mode, self.serial, 0x31, param, 1, int)
|
||||||
|
|
||||||
def set_t1_hv_phase_1_duration_SpinBox(self):
|
def set_t1_hv_phase_1_duration_SpinBox(self):
|
||||||
@ -770,11 +805,6 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
def set_lv_mode_BOX(self):
|
def set_lv_mode_BOX(self):
|
||||||
"""Выбор режима низковольтной стимуляции"""
|
"""Выбор режима низковольтной стимуляции"""
|
||||||
param = self.lv_mode_BOX.currentIndex()
|
param = self.lv_mode_BOX.currentIndex()
|
||||||
match param:
|
|
||||||
case 3:
|
|
||||||
self.burst_frame.setVisible(True)
|
|
||||||
case _:
|
|
||||||
self.burst_frame.setVisible(False)
|
|
||||||
my_data.state_packet(self.send_mode, self.serial, 0x23, param, 1, int)
|
my_data.state_packet(self.send_mode, self.serial, 0x23, param, 1, int)
|
||||||
|
|
||||||
|
|
||||||
@ -794,7 +824,7 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
my_data.state_packet(self.send_mode, self.serial, 0x24, param, 1, int)
|
my_data.state_packet(self.send_mode, self.serial, 0x24, param, 1, int)
|
||||||
def set_t2_lv_relax_time_spinBox(self):
|
def set_t2_lv_relax_time_spinBox(self):
|
||||||
"""Выбор времени стабилизации после НВ стимуляции"""
|
"""Выбор времени стабилизации после НВ стимуляции"""
|
||||||
param = int(self.t2_lv_relax_time_spinBox.value() * 10)
|
param = int(self.t2_lv_relax_time_spinBox.value())
|
||||||
my_data.state_packet(self.send_mode, self.serial, 0x25, param, 1, int)
|
my_data.state_packet(self.send_mode, self.serial, 0x25, param, 1, int)
|
||||||
def set_burst_cnt_spinBox(self):
|
def set_burst_cnt_spinBox(self):
|
||||||
"""Выбор количества импульсов в пачке при НВ стимуляции"""
|
"""Выбор количества импульсов в пачке при НВ стимуляции"""
|
||||||
@ -808,3 +838,33 @@ class Ui(QtWidgets.QMainWindow):
|
|||||||
"""Выбор периода следования импульсов при НВ стимуляции"""
|
"""Выбор периода следования импульсов при НВ стимуляции"""
|
||||||
param = self.burst_period_spinBox.value()
|
param = self.burst_period_spinBox.value()
|
||||||
my_data.state_packet(self.send_mode, self.serial, 0x29, param, 2, int)
|
my_data.state_packet(self.send_mode, self.serial, 0x29, param, 2, int)
|
||||||
|
def set_burst_end_period_spinBox(self):
|
||||||
|
"""Выбор периода следования импульсов при НВ стимуляции"""
|
||||||
|
param = self.burst_end_period_spinBox.value()
|
||||||
|
my_data.state_packet(self.send_mode, self.serial, 0x37, param, 2, int)
|
||||||
|
def set_Psense_period_spinBox(self):
|
||||||
|
"""Выбор длительность поиска события после Vp, мс"""
|
||||||
|
param = int(self.Psense_period_spinBox.value())
|
||||||
|
my_data.state_packet(self.send_mode, self.serial, 0x00, param, 2, int)
|
||||||
|
|
||||||
|
def set_Post_pace_block_period_spinBox(self):
|
||||||
|
"""Выбор времени слепоты после Vp, мс """
|
||||||
|
param = int(self.Post_pace_block_period_spinBox.value())
|
||||||
|
my_data.state_packet(self.send_mode, self.serial, 0x00, param, 2, int)
|
||||||
|
|
||||||
|
def set_Post_pace_amplitude_SpinBox(self):
|
||||||
|
"""Выбор амплитуды сигнала после Vp, мВ"""
|
||||||
|
param = int(self.Post_pace_amplitude_SpinBox.value())
|
||||||
|
my_data.state_packet(self.send_mode, self.serial, 0x00, param, 1, int)
|
||||||
|
|
||||||
|
def set_HV_Box(self):
|
||||||
|
"""Настройка активации режима высоковольтной стимуляции"""
|
||||||
|
param = int(self.HV_Box.currentIndex())
|
||||||
|
my_data.state_packet(self.send_mode, self.serial, 0x0F, param, 1, int)
|
||||||
|
|
||||||
|
def set_LV_Box(self):
|
||||||
|
"""Настройка активации режима низковольтной стимуляции"""
|
||||||
|
param = int(self.LV_Box.currentIndex())
|
||||||
|
my_data.state_packet(self.send_mode, self.serial, 0x0E, param, 1, int)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
viewer.exe
BIN
viewer.exe
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user