NexusMenu

main
dplimin 2023-12-14 17:04:09 +03:00
parent 74806d6574
commit 2c8a744b88
14 changed files with 1276 additions and 3333 deletions

View File

@ -24,7 +24,8 @@ SOURCES += \
main.cpp \
mainwindow.cpp \
modbusoverudp.cpp \
windowchannel.cpp
windowchannel.cpp \
windowchannelsettings.cpp
HEADERS += \
customcombobox.h \
@ -33,12 +34,14 @@ HEADERS += \
ipsettings.h \
mainwindow.h \
modbusoverudp.h \
windowchannel.h
windowchannel.h \
windowchannelsettings.h
FORMS += \
ipsettings.ui \
mainwindow.ui \
windowchannel.ui
windowchannel.ui \
windowchannelsettings.ui
win32:RC_FILE = icon.rc
# Default rules for deployment.

View File

@ -2,33 +2,20 @@
CustomComboBox::CustomComboBox(QWidget *parent) : QComboBox(parent)
{
this->setStyleSheet("QComboBox { background-color : black; color : #d4ae13; "
this->setStyleSheet("QComboBox { background-color : black; color : #f7e0b5; "
"}QComboBox:editable {"
" background: black; selection-background-color: black; color : #d4ae13;}"
" background: black; selection-background-color: black; color : #f7e0b5;}"
"QComboBox QAbstractItemView {"
" selection-background-color: black;}"
);
}
/*
void CustomComboBox::wheelEvent(QWheelEvent * event)
{
if (event->delta() > 0) {
emit wheelUp();
}else{
emit wheelDown();
}
}
*/
/*
void CustomComboBox::mousePressEvent(QMouseEvent *event)
{
emit clicked();
}
*/
void CustomComboBox::enterEvent(QEnterEvent * event)
{
this->setStyleSheet("QComboBox { background-color : black; color : green; "
"}QComboBox:editable {"
" background: black; selection-background-color: black;}"
@ -37,13 +24,15 @@ void CustomComboBox::enterEvent(QEnterEvent * event)
);
emit focused();
}
void CustomComboBox::leaveEvent(QEvent * event)
{
this->setStyleSheet("QComboBox { background-color : black; color : #d4ae13; "
this->setStyleSheet("QComboBox { background-color : black; color :#f7e0b5; "
"}QComboBox:editable {"
" background: black; selection-background-color: black; color : #d4ae13; selection-color: #d4ae13; }"
" background: black; selection-background-color: black; color : #f7e0b5; selection-color: #f7e0b5; }"
"QComboBox QAbstractItemView {"
" selection-background-color: black;}"
);

View File

@ -30,6 +30,6 @@ void CustomLabel::enterEvent(QEnterEvent *event)
void CustomLabel::leaveEvent(QEvent * event)
{
this->setStyleSheet("QLabel { color : #d4ae13; }");
this->setStyleSheet("QLabel { color : #f7e0b5; }");
emit unfocused();
}

View File

@ -20,7 +20,7 @@ typedef enum { Hp0_2 = 0, Hp0_3, Hp1, Hp2, Hp10 } typeIFV;
typedef enum { Lp200 = 0, Lp500, Lp1000, Lp5000, Lp10000, Lp20000, Lp50000, Lp100000 } typeIFN;
typedef enum { Ch1 = 0, Ch2, Ch3, Ch4, Ch5, Ch6, Ch7,
Ch8, Ch9, Ch10, Ch11, Ch12, Ch13, Ch14, Ch15, Ch16 } typeCHANNEL;
typedef enum { Accel = 0, Pascal, Nython } typeVALUE;
typedef enum { Accel = 0, Velocity, Pascal, k_Pascal, M_Pascal, Nython, k_Nuthon, pQ, mV } typeVALUE;
typedef enum
{
Out_0_0001 = 0,

View File

@ -38,7 +38,7 @@
<rect>
<x>20</x>
<y>60</y>
<width>81</width>
<width>91</width>
<height>16</height>
</rect>
</property>

View File

@ -13,7 +13,7 @@ MainWindow::MainWindow(QWidget *parent)
conf = new QSettings();
modbus=new ModbusOverUdp();
this->setWindowTitle ("Программа для управления A142");
this->setFixedSize(532,447);
this->setFixedSize(536,608);
ui->lineEditPort->setEnabled(0);
@ -22,10 +22,18 @@ MainWindow::MainWindow(QWidget *parent)
ui->widget3->setWindowsChannel(Ch3);
ui->widget4->setWindowsChannel(Ch4);
ui->widget1->hideValue();
ui->widget2->hideValue();
ui->widget3->hideValue();
ui->widget4->hideValue();
ui->widgetS1->setWindowsChannel(Ch1);
ui->widgetS2->setWindowsChannel(Ch2);
ui->widgetS3->setWindowsChannel(Ch3);
ui->widgetS4->setWindowsChannel(Ch4);
// ui->widget1->hideValue();
// ui->widget2->hideValue();
// ui->widget3->hideValue();
// ui->widget4->hideValue();
ui->lineEditAddres->setText(conf->value("section1/keyCurrentIp").toString());
@ -76,13 +84,41 @@ MainWindow::MainWindow(QWidget *parent)
modbus,SLOT(set(Set,typeREQ)));
connect(this->modbus,SIGNAL(stateRecive (Set)),
ui->widgetS1,SLOT(setState(Set)));
connect(modbus,SIGNAL(stateRecive (Set)),
ui->widgetS2,SLOT(setState(Set)));
connect(modbus,SIGNAL(stateRecive (Set)),
ui->widgetS3,SLOT(setState(Set)));
connect(modbus,SIGNAL(stateRecive (Set)),
ui->widgetS4,SLOT(setState(Set)));
connect(modbus,SIGNAL(sensRecive(Set)),
ui->widgetS1,SLOT(setSens(Set)));
connect(modbus,SIGNAL(sensRecive(Set)),
ui->widgetS2,SLOT(setSens(Set)));
connect(modbus,SIGNAL(sensRecive(Set)),
ui->widgetS3,SLOT(setSens(Set)));
connect(modbus,SIGNAL(sensRecive(Set)),
ui->widgetS4,SLOT(setSens(Set)));
connect(ui->widgetS1,SIGNAL(ReadyToSend(Set, typeREQ)),
modbus,SLOT(set(Set,typeREQ)));
connect(ui->widgetS2,SIGNAL(ReadyToSend(Set, typeREQ)),
modbus,SLOT(set(Set,typeREQ)));
connect(ui->widgetS3,SIGNAL(ReadyToSend(Set, typeREQ)),
modbus,SLOT(set(Set,typeREQ)));
connect(ui->widgetS4,SIGNAL(ReadyToSend(Set, typeREQ)),
modbus,SLOT(set(Set,typeREQ)));
}
MainWindow::~MainWindow()
{
qDebug()<<ui->lineEditAddres->text();
// qDebug()<<ui->lineEditAddres->text();
conf->setValue("section1/keyCurrentIp",ui->lineEditAddres->text());
qDebug()<<"Значение ва памяти"<<conf->value("section1/keyCurrentIp").toString();
// qDebug()<<"Значение в памяти"<<conf->value("section1/keyCurrentIp").toString();
delete ui;
}
@ -110,6 +146,11 @@ void MainWindow::on_pushButtonConnect_clicked()
ui->widget3->hideValue();
ui->widget4->hideValue();
ui->widgetS1->hideValue();
ui->widgetS2->hideValue();
ui->widgetS3->hideValue();
ui->widgetS4->hideValue();
ui->pushButtonConnect->setText("Подключиться");
ui->pushButtonSettings->setEnabled(1);
isConnected=0;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>532</width>
<height>447</height>
<width>575</width>
<height>644</height>
</rect>
</property>
<property name="windowTitle">
@ -150,14 +150,54 @@
<string>Настройка...</string>
</property>
</widget>
<widget class="WindowChannelSettings" name="widgetS1" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>440</y>
<width>517</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="WindowChannelSettings" name="widgetS2" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>470</y>
<width>517</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="WindowChannelSettings" name="widgetS3" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>500</y>
<width>517</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="WindowChannelSettings" name="widgetS4" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>530</y>
<width>517</width>
<height>31</height>
</rect>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>532</width>
<height>21</height>
<width>575</width>
<height>22</height>
</rect>
</property>
</widget>
@ -170,6 +210,12 @@
<header location="global">windowchannel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>WindowChannelSettings</class>
<extends>QWidget</extends>
<header>windowchannelsettings.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -1,376 +0,0 @@
#define __DBL_MIN_EXP__ (-1021)
#define __FLT32X_MAX_EXP__ 1024
#define __cpp_attributes 200809
#define __pentiumpro__ 1
#define __UINT_LEAST16_MAX__ 0xffff
#define __ATOMIC_ACQUIRE 2
#define __FLT128_MAX_10_EXP__ 4932
#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F
#define __GCC_IEC_559_COMPLEX 2
#define __UINT_LEAST8_TYPE__ unsigned char
#define __SIZEOF_FLOAT80__ 12
#define _WIN32 1
#define __INTMAX_C(c) c ## LL
#define __CHAR_BIT__ 8
#define __UINT8_MAX__ 0xff
#define __WINT_MAX__ 0xffff
#define __FLT32_MIN_EXP__ (-125)
#define __cpp_static_assert 200410
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __SIZE_MAX__ 0xffffffffU
#define __WCHAR_MAX__ 0xffff
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __DBL_DENORM_MIN__ double(4.94065645841246544176568792868221372e-324L)
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_IEC_559 2
#define __FLT32X_DECIMAL_DIG__ 17
#define __FLT_EVAL_METHOD__ 2
#define __cpp_binary_literals 201304
#define __FLT64_DECIMAL_DIG__ 17
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __cpp_variadic_templates 200704
#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL
#define __SIG_ATOMIC_TYPE__ int
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 0
#define __FLT32_HAS_DENORM__ 1
#define __UINT_FAST8_MAX__ 0xff
#define __has_include(STR) __has_include__(STR)
#define _stdcall __attribute__((__stdcall__))
#define __DEC64_MAX_EXP__ 385
#define __INT8_C(c) c
#define __INT_LEAST8_WIDTH__ 8
#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL
#define __SHRT_MAX__ 0x7fff
#define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L
#define __FLT64X_MAX_10_EXP__ 4932
#define __UINT_LEAST8_MAX__ 0xff
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128
#define __UINTMAX_TYPE__ long long unsigned int
#define __DEC32_EPSILON__ 1E-6DF
#define __FLT_EVAL_METHOD_TS_18661_3__ 2
#define __OPTIMIZE__ 1
#define __UINT32_MAX__ 0xffffffffU
#define __GXX_EXPERIMENTAL_CXX0X__ 1
#define __LDBL_MAX_EXP__ 16384
#define __FLT128_MIN_EXP__ (-16381)
#define __WINT_MIN__ 0
#define __FLT128_MIN_10_EXP__ (-4931)
#define __INT_LEAST16_WIDTH__ 16
#define __SCHAR_MAX__ 0x7f
#define __FLT128_MANT_DIG__ 113
#define __WCHAR_MIN__ 0
#define __INT64_C(c) c ## LL
#define __DBL_DIG__ 15
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __FLT64X_MANT_DIG__ 64
#define __SIZEOF_INT__ 4
#define __SIZEOF_POINTER__ 4
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __USER_LABEL_PREFIX__ _
#define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x
#define __STDC_HOSTED__ 1
#define __WIN32 1
#define __LDBL_HAS_INFINITY__ 1
#define __FLT32_DIG__ 6
#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F
#define __GXX_WEAK__ 1
#define __SHRT_WIDTH__ 16
#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
#define __DEC32_MAX__ 9.999999E96DF
#define __cpp_threadsafe_static_init 200806
#define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x
#define __MINGW32__ 1
#define __FLT32X_HAS_INFINITY__ 1
#define __INT32_MAX__ 0x7fffffff
#define __INT_WIDTH__ 32
#define __SIZEOF_LONG__ 4
#define __UINT16_C(c) c
#define __PTRDIFF_WIDTH__ 32
#define __DECIMAL_DIG__ 21
#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64
#define __INTMAX_WIDTH__ 64
#define __FLT64_MIN_EXP__ (-1021)
#define __has_include_next(STR) __has_include_next__(STR)
#define __FLT64X_MIN_10_EXP__ (-4931)
#define __LDBL_HAS_QUIET_NAN__ 1
#define __FLT64_MANT_DIG__ 53
#define _REENTRANT 1
#define __GNUC__ 7
#define _cdecl __attribute__((__cdecl__))
#define __GXX_RTTI 1
#define __cpp_delegating_constructors 200604
#define __FLT_HAS_DENORM__ 1
#define __SIZEOF_LONG_DOUBLE__ 12
#define __BIGGEST_ALIGNMENT__ 16
#define __STDC_UTF_16__ 1
#define __FLT64_MAX_10_EXP__ 308
#define __i686 1
#define __FLT32_HAS_INFINITY__ 1
#define __DBL_MAX__ double(1.79769313486231570814527423731704357e+308L)
#define _thiscall __attribute__((__thiscall__))
#define __cpp_raw_strings 200710
#define __INT_FAST32_MAX__ 0x7fffffff
#define __WINNT 1
#define __DBL_HAS_INFINITY__ 1
#define __INT64_MAX__ 0x7fffffffffffffffLL
#define __WINNT__ 1
#define __DEC32_MIN_EXP__ (-94)
#define __INTPTR_WIDTH__ 32
#define __FLT32X_HAS_DENORM__ 1
#define __INT_FAST16_TYPE__ short int
#define _fastcall __attribute__((__fastcall__))
#define __LDBL_HAS_DENORM__ 1
#define __cplusplus 201103L
#define __cpp_ref_qualifiers 200710
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __INT_LEAST32_MAX__ 0x7fffffff
#define __DEC32_MIN__ 1E-95DF
#define __DEPRECATED 1
#define __cpp_rvalue_references 200610
#define __DBL_MAX_EXP__ 1024
#define __WCHAR_WIDTH__ 16
#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32
#define __DEC128_EPSILON__ 1E-33DL
#define __ATOMIC_HLE_RELEASE 131072
#define __WIN32__ 1
#define __PTRDIFF_MAX__ 0x7fffffff
#define __ATOMIC_HLE_ACQUIRE 65536
#define __FLT32_HAS_QUIET_NAN__ 1
#define __GNUG__ 7
#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
#define __SIZEOF_SIZE_T__ 4
#define __cpp_rvalue_reference 200610
#define __cpp_nsdmi 200809
#define __FLT64X_MIN_EXP__ (-16381)
#define __SIZEOF_WINT_T__ 2
#define __LONG_LONG_WIDTH__ 64
#define __cpp_initializer_lists 200806
#define __FLT32_MAX_EXP__ 128
#define __cpp_hex_float 201603
#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __GXX_ABI_VERSION 1011
#define __FLT128_HAS_INFINITY__ 1
#define __FLT_MIN_EXP__ (-125)
#define __i686__ 1
#define __cpp_lambdas 200907
#define __FLT64X_HAS_QUIET_NAN__ 1
#define __INT_FAST64_TYPE__ long long int
#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64
#define __DBL_MIN__ double(2.22507385850720138309023271733240406e-308L)
#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x
#define __DECIMAL_BID_FORMAT__ 1
#define __GXX_TYPEINFO_EQUALITY_INLINE 0
#define __FLT64_MIN_10_EXP__ (-307)
#define __FLT64X_DECIMAL_DIG__ 21
#define __DEC128_MIN__ 1E-6143DL
#define __REGISTER_PREFIX__
#define __UINT16_MAX__ 0xffff
#define __DBL_HAS_DENORM__ 1
#define __cdecl __attribute__((__cdecl__))
#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32
#define __UINT8_TYPE__ unsigned char
#define __i386 1
#define __FLT_MANT_DIG__ 24
#define __LDBL_DECIMAL_DIG__ 21
#define __VERSION__ "7.3.0"
#define __UINT64_C(c) c ## ULL
#define __cpp_unicode_characters 200704
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __FLT128_MAX_EXP__ 16384
#define __FLT32_MANT_DIG__ 24
#define _X86_ 1
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLT128_HAS_DENORM__ 1
#define __FLT128_DIG__ 33
#define __SCHAR_WIDTH__ 8
#define __INT32_C(c) c
#define __DEC64_EPSILON__ 1E-15DD
#define __ORDER_PDP_ENDIAN__ 3412
#define __DEC128_MIN_EXP__ (-6142)
#define __code_model_32__ 1
#define __FLT32_MAX_10_EXP__ 38
#define __INT_FAST32_TYPE__ int
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __FLT64X_HAS_INFINITY__ 1
#define __INT16_MAX__ 0x7fff
#define __i386__ 1
#define __cpp_rtti 199711
#define __SIZE_TYPE__ unsigned int
#define __UINT64_MAX__ 0xffffffffffffffffULL
#define __FLT64X_DIG__ 18
#define __INT8_TYPE__ signed char
#define __GCC_ASM_FLAG_OUTPUTS__ 1
#define __FLT_RADIX__ 2
#define __INT_LEAST16_TYPE__ short int
#define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L
#define __UINTMAX_C(c) c ## ULL
#define __SIG_ATOMIC_MAX__ 0x7fffffff
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __SIZEOF_PTRDIFF_T__ 4
#define __FLT32X_MANT_DIG__ 53
#define __FLT32X_MIN_EXP__ (-1021)
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __pentiumpro 1
#define __MSVCRT__ 1
#define __INT_FAST16_MAX__ 0x7fff
#define __FLT64_DIG__ 15
#define __UINT_FAST32_MAX__ 0xffffffffU
#define __UINT_LEAST64_TYPE__ long long unsigned int
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 0x7fffffffL
#define __FLT64X_HAS_DENORM__ 1
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __FLT_HAS_INFINITY__ 1
#define __cpp_unicode_literals 200710
#define __UINT_FAST16_TYPE__ short unsigned int
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __INT_FAST32_WIDTH__ 32
#define __CHAR16_TYPE__ short unsigned int
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __SIZE_WIDTH__ 32
#define __SEG_FS 1
#define __INT_LEAST16_MAX__ 0x7fff
#define __DEC64_MANT_DIG__ 16
#define __UINT_LEAST32_MAX__ 0xffffffffU
#define __SEG_GS 1
#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __SIG_ATOMIC_WIDTH__ 32
#define __INT_LEAST64_TYPE__ long long int
#define __INT16_TYPE__ short int
#define __INT_LEAST8_TYPE__ signed char
#define __DEC32_MAX_EXP__ 97
#define __INT_FAST8_MAX__ 0x7f
#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128
#define __INTPTR_MAX__ 0x7fffffff
#define __GXX_MERGED_TYPEINFO_NAMES 0
#define __cpp_range_based_for 200907
#define __FLT64_HAS_QUIET_NAN__ 1
#define __stdcall __attribute__((__stdcall__))
#define __FLT32_MIN_10_EXP__ (-37)
#define __EXCEPTIONS 1
#define __LDBL_MANT_DIG__ 64
#define __DBL_HAS_QUIET_NAN__ 1
#define __FLT64_HAS_INFINITY__ 1
#define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __INTPTR_TYPE__ int
#define __UINT16_TYPE__ short unsigned int
#define __WCHAR_TYPE__ short unsigned int
#define __SIZEOF_FLOAT__ 4
#define __UINTPTR_MAX__ 0xffffffffU
#define __INT_FAST64_WIDTH__ 64
#define __DEC64_MIN_EXP__ (-382)
#define __cpp_decltype 200707
#define __FLT32_DECIMAL_DIG__ 9
#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __FLT_DIG__ 6
#define __FLT64X_MAX_EXP__ 16384
#define __UINT_FAST64_TYPE__ long long unsigned int
#define __INT_MAX__ 0x7fffffff
#define WIN32 1
#define __INT64_TYPE__ long long int
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __cpp_inheriting_constructors 201511
#define __SIZEOF_FLOAT128__ 16
#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL
#define __DEC64_MIN__ 1E-383DD
#define __WINT_TYPE__ short unsigned int
#define __UINT_LEAST32_TYPE__ unsigned int
#define __SIZEOF_SHORT__ 2
#define __LDBL_MIN_EXP__ (-16381)
#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64
#define __WINT_WIDTH__ 16
#define __INT_LEAST8_MAX__ 0x7f
#define __FLT32X_MAX_10_EXP__ 308
#define __WCHAR_UNSIGNED__ 1
#define __LDBL_MAX_10_EXP__ 4932
#define __ATOMIC_RELAXED 0
#define __DBL_EPSILON__ double(2.22044604925031308084726333618164062e-16L)
#define __thiscall __attribute__((__thiscall__))
#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128
#define __UINT8_C(c) c
#define __FLT64_MAX_EXP__ 1024
#define __INT_LEAST32_TYPE__ int
#define __SIZEOF_WCHAR_T__ 2
#define __FLT128_HAS_QUIET_NAN__ 1
#define __INT_FAST8_TYPE__ signed char
#define __fastcall __attribute__((__fastcall__))
#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x
#define __GNUC_STDC_INLINE__ 1
#define __FLT64_HAS_DENORM__ 1
#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32
#define __DBL_DECIMAL_DIG__ 17
#define __STDC_UTF_32__ 1
#define __INT_FAST8_WIDTH__ 8
#define __DEC_EVAL_METHOD__ 2
#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x
#define __ORDER_BIG_ENDIAN__ 4321
#define __cpp_runtime_arrays 198712
#define __UINT64_TYPE__ long long unsigned int
#define __UINT32_C(c) c ## U
#define __INTMAX_MAX__ 0x7fffffffffffffffLL
#define __cpp_alias_templates 200704
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define WINNT 1
#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F
#define __INT8_MAX__ 0x7f
#define __LONG_WIDTH__ 32
#define __UINT_FAST32_TYPE__ unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F
#define __cpp_constexpr 200704
#define __INT32_TYPE__ int
#define __SIZEOF_DOUBLE__ 8
#define __cpp_exceptions 199711
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64
#define __INT_LEAST32_WIDTH__ 32
#define __INTMAX_TYPE__ long long int
#define i386 1
#define _INTEGRAL_MAX_BITS 64
#define __DEC128_MAX_EXP__ 6145
#define __FLT32X_HAS_QUIET_NAN__ 1
#define __ATOMIC_CONSUME 1
#define __GNUC_MINOR__ 3
#define __INT_FAST16_WIDTH__ 16
#define __UINTMAX_MAX__ 0xffffffffffffffffULL
#define __DEC32_MANT_DIG__ 7
#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L
#define __INT16_C(c) c
#define __STDC__ 1
#define __FLT32X_DIG__ 15
#define __PTRDIFF_TYPE__ int
#define __ATOMIC_SEQ_CST 5
#define __UINT32_TYPE__ unsigned int
#define __FLT32X_MIN_10_EXP__ (-307)
#define __UINTPTR_TYPE__ unsigned int
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __LDBL_MIN_10_EXP__ (-4931)
#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128
#define __SIZEOF_LONG_LONG__ 8
#define __cpp_user_defined_literals 200809
#define __FLT128_DECIMAL_DIG__ 36
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x
#define __LDBL_DIG__ 18
#define __FLT_DECIMAL_DIG__ 9
#define __UINT_FAST16_MAX__ 0xffff
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __INT_LEAST64_WIDTH__ 64
#define __UINT_FAST8_TYPE__ unsigned char
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_RELEASE 3
#define __declspec(x) __attribute__((x))

View File

@ -13,14 +13,19 @@ windowChannel::windowChannel(QWidget *parent) :
//ДЕЛАЕМ ФОН ЧЕРНЫМ
QPalette Pal(palette());
Pal.setColor(QPalette::Base, Qt::black);
QPalette pal = QPalette();
// set black background
// Qt::black / "#000000" / "black"
pal.setColor(QPalette::Window, Qt::black);
this->setAutoFillBackground(true);
this->setPalette(Pal);
this->setPalette(pal);
this->show();
ui->comboBoxIIN->addItem("Заряд"); //индекс 0
ui->comboBoxIIN->addItem("IEPE");//индекс 1
ui->comboBoxVCH->addItem("0.2Гц"); //индекс 0
ui->comboBoxVCH->addItem("0.3Гц");//индекс 1
@ -51,12 +56,8 @@ windowChannel::windowChannel(QWidget *parent) :
thisData.SENS=1.0;
thisData.VALUE=Accel;
connect(ui->labelSENS,SIGNAL(clicked()),this,SLOT(sendSens()));//подключаю сигнал от кастом лэйбла для вызова процедуры смены чувствительности
hideValue();
}
@ -113,22 +114,86 @@ void windowChannel::setState(Set data)
void windowChannel::reDraw()
{
if(thisData.SENS<100000&&thisData.SENS>=10000) { ui->labelSENS->setText(QString::number(thisData.SENS,'f', 0));}
else if(thisData.SENS<10000&&thisData.SENS>=1000) { ui->labelSENS->setText(QString::number(thisData.SENS,'f', 1));}
else if(thisData.SENS<1000&&thisData.SENS>=100) {ui->labelSENS->setText(QString::number(thisData.SENS,'f', 2));}
else if(thisData.SENS<100&&thisData.SENS>=10){ui->labelSENS->setText(QString::number(thisData.SENS,'f', 3));}
else {ui->labelSENS->setText(QString::number(thisData.SENS,'f', 4));}
if(thisData.IIN==CHARGE&&thisData.VALUE==Accel)
ui->labelUNITS->setText("пКл/м/с2");
if(thisData.IIN==1&&thisData.VALUE==Accel)
ui->labelUNITS->setText("мВ/м/с2");
if(thisData.IIN==CHARGE&thisData.VALUE==Velocity)
ui->labelUNITS->setText("пКл/мм/с");
if(thisData.IIN==ICP&&thisData.VALUE==Velocity)
ui->labelUNITS->setText("мВ/мм/с");
if(thisData.IIN==CHARGE&&thisData.VALUE==Pascal)
ui->labelUNITS->setText("пКл/Па");
if(thisData.IIN==ICP&&thisData.VALUE==Pascal)
ui->labelUNITS->setText("мВ/Па");
if(thisData.IIN==CHARGE&&thisData.VALUE==k_Pascal)
ui->labelUNITS->setText("пКл/кПа");
if(thisData.IIN==ICP&&thisData.VALUE==k_Pascal)
ui->labelUNITS->setText("мВ/кПа");
if(thisData.IIN==CHARGE&&thisData.VALUE==M_Pascal)
ui->labelUNITS->setText("пКл/МПа");
if(thisData.IIN==ICP&&thisData.VALUE==M_Pascal)
ui->labelUNITS->setText("мВ/МПа");
if(thisData.IIN==CHARGE&&thisData.VALUE==Nython)
ui->labelUNITS->setText("пКл/Н");
if(thisData.IIN==ICP&&thisData.VALUE==Nython)
ui->labelUNITS->setText("мВ/Н");
if(thisData.IIN==CHARGE&&thisData.VALUE==k_Nuthon)
ui->labelUNITS->setText("пКл/кН");
if(thisData.IIN==ICP&&thisData.VALUE==k_Nuthon)
ui->labelUNITS->setText("мВ/кН");
if(thisData.IIN==CHARGE&&thisData.VALUE==pQ)
ui->labelUNITS->setText("пКл/мВ");
if(thisData.IIN==ICP&&thisData.VALUE==pQ)
ui->labelUNITS->setText("мВ/мВ");
if(thisData.IIN==CHARGE&&thisData.VALUE==mV)
ui->labelUNITS->setText("пКл/пКл");
if(thisData.IIN==ICP&&thisData.VALUE==mV)
ui->labelUNITS->setText("мВ/пКл");
//выставляем значение комбобоксов
switch (thisData.IIN) {
case ICP:{
ui->comboBoxIIN->setCurrentIndex(1);
ui->labelIIN->setText("IEPE");
break;
}
case CHARGE:{
ui->comboBoxIIN->setCurrentIndex(0);
ui->labelIIN->setText("IE");
break;
}
}//end switch
@ -205,51 +270,37 @@ void windowChannel::reDraw()
}
}//end switch
switch (thisData.VALUE) {
case Accel:{
ui->comboBoxUNIT->setCurrentIndex(0);
break;
}
case Nython:{
ui->comboBoxUNIT->setCurrentIndex(1);
break;
}
case Pascal:{
ui->comboBoxUNIT->setCurrentIndex(2);
break;
}
}//end switch
ui->labelOUT->setText(DisplayIKUA142(thisData.SENS, thisData.IKU, thisData.VALUE));
ui->comboBoxOUT->setCurrentText(DisplayIKUA142(thisData.SENS, thisData.IKU, thisData.VALUE));
showValue();
}
void windowChannel::hideValue()
{
ui->comboBoxIIN->hide();
ui->comboBoxNCH->hide();
ui->comboBoxOUT->hide();
ui->comboBoxVCH->hide();
ui->comboBoxIIN->hide();
ui->comboBoxUNIT->hide();
ui->labelSENS->hide();
ui->labelIIN->hide();
ui->labelUNITS->hide();
}
void windowChannel::showValue()
{
ui->comboBoxIIN->show();
ui->comboBoxNCH->show();
ui->comboBoxOUT->show();
ui->comboBoxVCH->show();
ui->comboBoxIIN->show();
ui->comboBoxUNIT->show();
ui->labelSENS->show();
ui->labelIIN->show();
ui->labelUNITS->show();
}
@ -441,118 +492,57 @@ QString windowChannel::DisplayIKUA142(float sens, typeIKU iku ,typeVALUE value)
{uint out;
uint offset;
//вбычку обьявлю тут
const char *pOUTUNITS[20]={
"В/м/c2",
"В/мм/с",
"В/Па",
"В/кПа",
"В/МПа",
"В/Н",
"В/кН",
"В/мВ",
"В/пКл",
};
const char *pOUT[3][35] =
const char *pOUT[35] =
{
{
"0.0001 мВ/м/c2",
"0.0002 мВ/м/c2",
"0.0005 мВ/м/c2",
"0.001 мВ/м/c2",
"0.002 мВ/м/c2",
"0.005 мВ/м/c2",
"0.01 мВ/м/c2",
"0.02 мВ/м/c2",
"0.05 мВ/м/c2",
"0.1 мВ/м/c2",
"0.2 мВ/м/c2",
"0.5 мВ/м/c2",
"1 мВ/м/c2",
"2 мВ/м/c2",
"5 мВ/м/c2",
"10 мВ/м/c2",
"20 мВ/м/c2",
"50 мВ/м/c2",
"100 мВ/м/c2",
"200 мВ/м/c2",
"500 мВ/м/c2",
"1 В/м/c2",
"2 В/м/c2",
"5 В/м/c2",
"10 В/м/c2",
"20В/м/c2",
"50В/м/c2",
"100В/м/c2",
"200В/м/c2",
"500В/м/c2",
"1000В/м/c2",
"2000В/м/c2",
"5000В/м/c2",
"10000В/м/c2",
"0.0001 м",
"0.0002 м",
"0.0005 м",
"0.001 м",
"0.002 м",
"0.005 м",
"0.01 м",
"0.02 м",
"0.05 м",
"0.1 м",
"0.2 м",
"0.5 м",
"1 м",
"2 м",
"5 м",
"10 м",
"20 м",
"50 м",
"100 м",
"200 м",
"500 м",
"1 ",
"2 ",
"5 ",
"10 ",
"20 ",
"50 ",
"100 ",
"200 ",
"500 ",
"1000 ",
"2000 ",
"5000 ",
"10000 ",
},
{
"0.0001 мВ/Па",
"0.0002 мВ/Па",
"0.0005 мВ/Па",
"0.001 мВ/Па",
"0.002 мВ/Па",
"0.005 мВ/Па",
"0.01 мВ/Па",
"0.02 мВ/Па",
"0.05 мВ/Па",
"0.1 мВ/Па",
"0.2 мВ/Па",
"0.5 мВ/Па",
"1 мВ/Па",
"2 мВ/Па",
"5 мВ/Па",
"10 мВ/Па",
"20 мВ/Па",
"50 мВ/Па",
"100 мВ/Па",
"200 мВ/Па",
"500 мВ/Па",
"1 В/Па",
"2 В/Па",
"5 В/Па",
"10 В/Па",
"20В/Па",
"50В/Па",
"100В/Па",//27
"200В/Па",
"500В/Па",
"1000В/Па", //30
"2000В/Па",
"5000В/Па",
"10000В/Па", //33
},
{
"0.0001 мВ/Н",
"0.0002 мВ/Н",
"0.0005 мВ/Н",
"0.001 мВ/Н",
"0.002 мВ/Н",
"0.005 мВ/Н",
"0.01 мВ/Н",
"0.02 мВ/Н",
"0.05 мВ/Н",
"0.1 мВ/Н",
"0.2 мВ/Н",
"0.5 мВ/Н",
"1 мВ/Н",
"2 мВ/Н",
"5 мВ/Н",
"10 мВ/Н",
"20 мВ/Н",
"50 мВ/Н",
"100 мВ/Н",
"200 мВ/Н",
"500 мВ/Н",
"1 В/Н",
"2 В/Н",
"5 В/Н",
"10 В/Н",
"20В/Н",
"50В/Н",
"100В/Н",//27
"200В/Н",
"500В/Н",
"1000В/Н", //30
"2000В/Н",
"5000В/Н",
"10000В/Н", //33
}
};
@ -612,7 +602,7 @@ QString windowChannel::DisplayIKUA142(float sens, typeIKU iku ,typeVALUE value)
// qDebug()<<"текущяя строка Ку по списку"<<out;
//qDebug()<<"смещение"<<offset;
qDebug()<<"валуе"<<value;
//этот кусочек смотрит на чувствительность и
//пытается заполнить комбобобокс значениями строк соответствующим индексам КУ
//todo: добавить проверку verify Gain!!!!
@ -624,7 +614,13 @@ QString windowChannel::DisplayIKUA142(float sens, typeIKU iku ,typeVALUE value)
((maxGain(thisData)+offset)>=offsetToWork)); //проверяем на максиимально возможный для данного сенса
offsetToWork++) {
ui->comboBoxOUT->addItem(pOUT[(uint16_t)value][offsetToWork]);
QString stringToComboBox;
stringToComboBox.append(pOUT[offsetToWork]);
stringToComboBox.append(pOUTUNITS[thisData.VALUE]);
ui->comboBoxOUT->addItem(stringToComboBox);
// ui->comboBoxOUT->addItem(pOUT[(uint16_t)value][offsetToWork]);
ui->comboBoxOUT->setCurrentIndex(iku);
//qDebug()<<"добавлено смещние"<<offsetToWork;
}
@ -646,34 +642,11 @@ QString windowChannel::DisplayIKUA142(float sens, typeIKU iku ,typeVALUE value)
}
return QString::fromStdString(pOUT[(uint16_t)value][out]);
return QString::fromStdString(pOUT[out]);
}
void windowChannel::on_comboBoxIIN_currentIndexChanged(int index) //если это делать в индекс активэйтэд то не обновляется единицы датчика с первого раза
{ //int currentIndex=ui->comboBoxUNIT->currentIndex();
ui->comboBoxUNIT->clear();
if(index==0) {thisData.IIN=CHARGE;
ui->comboBoxUNIT->addItem("пКл/м/с2");
ui->comboBoxUNIT->addItem("пКл/Н");
ui->comboBoxUNIT->addItem("пКл/Па");
//ui->comboBoxUNIT->setCurrentIndex(currentIndex);
}
else {thisData.IIN=ICP;
ui->comboBoxUNIT->addItem("мВ/м/c2");
ui->comboBoxUNIT->addItem("мВ/Н");
ui->comboBoxUNIT->addItem("мВ/Па");
// ui->comboBoxUNIT->setCurrentIndex(currentIndex);
}
emit ReadyToSend(thisData, IIN);
}
void windowChannel::on_comboBoxVCH_activated(int index)
{
@ -698,26 +671,9 @@ void windowChannel::on_comboBoxNCH_activated(int index)
emit ReadyToSend(thisData, IFN);
}
void windowChannel::on_comboBoxUNIT_currentIndexChanged(int index)
{
}
void windowChannel::on_comboBoxUNIT_activated(int index)
{
if(index==0) thisData.VALUE=Accel;
else if(index==1) thisData.VALUE=Nython;
else if(index==2) thisData.VALUE=Pascal;
emit ReadyToSend(thisData, VAL);
}
void windowChannel::on_comboBoxIIN_activated(int index)
{
}
QStringList windowChannel::avalibleKuList(Set thisData)
{

View File

@ -34,30 +34,22 @@ public:
public slots:
void sendSens();
void sendSens();
void setSens(Set data);
void setState(Set data);
void reDraw();
private slots:
//void on_comboBoxIIN_currentIndexChanged(const QString &arg1);
void on_comboBoxIIN_currentIndexChanged(int index);
void on_comboBoxVCH_activated(int index);
void on_comboBoxNCH_activated(int index);
void on_comboBoxUNIT_currentIndexChanged(int index);
void on_comboBoxUNIT_activated(int index);
void on_comboBoxIIN_activated(int index);
void on_comboBoxOUT_activated(int index);
//void on_comboBoxUNIT_activated(const QString &arg1);
private:
Set thisData; //данные этой структуры

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,445 @@
#include "windowchannelsettings.h"
#include "ui_windowchannelsettings.h"
void WindowChannelSettings::hideValue()
{
ui->comboBoxUNITS->hide();
ui->labelIIN->hide();
ui->labelSENS->hide();
}
void WindowChannelSettings::showValue()
{
ui->comboBoxUNITS->show();
ui->labelIIN->show();
ui->labelSENS->show();
}
WindowChannelSettings::WindowChannelSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::WindowChannelSettings)
{
ui->setupUi(this);
QPalette pal = QPalette();
// set black background
// Qt::black / "#000000" / "black"
pal.setColor(QPalette::Window, Qt::black);
this->setAutoFillBackground(true);
this->setPalette(pal);
this->show();
thisData.IFN=Lp200; //инициализирую по умолчанию, что бы когда прилетит первый сэнс не было вылета из за расчетов портированных с прибора
thisData.IFV=Hp1;
thisData.IIN=ICP;
thisData.IKU=Ku1;
thisData.SENS=1.0;
thisData.VALUE=Accel;
connect(ui->labelSENS,SIGNAL(clicked()),this,SLOT(sendSens()));//подключаю сигнал от кастом лэйбла для вызова процедуры смены чувствительности
ui->comboBoxUNITS->addItem("пКл/м/с2"); //индекс 0
ui->comboBoxUNITS->addItem("мВ/м/с2");//индекс 1
ui->comboBoxUNITS->addItem("пКл/мм/с"); //индекс 2
ui->comboBoxUNITS->addItem("мВ/мм/с");//индекс 3
ui->comboBoxUNITS->addItem("пКл/Па"); //индекс 4
ui->comboBoxUNITS->addItem("мВ/Па");//индекс 5
ui->comboBoxUNITS->addItem("пКл/кПа"); //индекс 6
ui->comboBoxUNITS->addItem("мВ/кПа");//индекс 7
ui->comboBoxUNITS->addItem("пКл/МПа");//индекс 8
ui->comboBoxUNITS->addItem("мВ/МПа"); //индекс 0
ui->comboBoxUNITS->addItem("пКл/Н");//индекс 1
ui->comboBoxUNITS->addItem("мВ/Н"); //индекс 2
ui->comboBoxUNITS->addItem("пКл/кН");//индекс 3
ui->comboBoxUNITS->addItem("мВ/кН"); //индекс 4
ui->comboBoxUNITS->addItem("пКл/мВ");//индекс 5
ui->comboBoxUNITS->addItem("мВ/мВ"); //индекс 6
ui->comboBoxUNITS->addItem("пКл/пКл");//индекс 7
ui->comboBoxUNITS->addItem("мВ/пКл");//индекс 8
hideValue();
}
WindowChannelSettings::~WindowChannelSettings()
{
delete ui;
}
void WindowChannelSettings::setWindowsChannel(typeCHANNEL channel)
{
this->channel = channel;
thisData.channel=channel;
ui->labelChanel->setNum((int)(channel+1)); //потому что енам с 0
}
void WindowChannelSettings::sendSens()
{
Set dataToSend=thisData;
bool ok;
dataToSend.SENS = QInputDialog::getDouble(this, tr("Введите значение"),
tr("Введите значение чувствительности датчика"), thisData.SENS, 0.0001, 99999, 4, &ok,
Qt::WindowFlags(), 1);
if (ok){emit ReadyToSend(dataToSend, SENS);}
if(thisData.IKU!=VerifyGainA142(thisData)){
thisData.IKU=VerifyGainA142(thisData);
emit ReadyToSend(thisData, IKU);
};
}
void WindowChannelSettings::setSens(Set data)
{
if(data.channel==this->channel){
thisData.SENS=data.SENS;
reDraw();
}
}
void WindowChannelSettings::setState(Set data)
{
if(data.channel==this->channel){
thisData.IKU=data.IKU;
thisData.IIN=data.IIN;
thisData.IFV=data.IFV;
thisData.IFN=data.IFN;
thisData.VALUE=data.VALUE;
reDraw();
}
}
void WindowChannelSettings::reDraw()
{
if(thisData.SENS<100000&&thisData.SENS>=10000) { ui->labelSENS->setText(QString::number(thisData.SENS,'f', 0));}
else if(thisData.SENS<10000&&thisData.SENS>=1000) { ui->labelSENS->setText(QString::number(thisData.SENS,'f', 1));}
else if(thisData.SENS<1000&&thisData.SENS>=100) {ui->labelSENS->setText(QString::number(thisData.SENS,'f', 2));}
else if(thisData.SENS<100&&thisData.SENS>=10){ui->labelSENS->setText(QString::number(thisData.SENS,'f', 3));}
else {ui->labelSENS->setText(QString::number(thisData.SENS,'f', 4));}
switch (thisData.IIN) {
case ICP:{
ui->labelIIN->setText("IEPE");
break;
}
case CHARGE:{
ui->labelIIN->setText("PE");
break;
}
}//end switch
if(thisData.IIN==ICP){
switch (thisData.VALUE){
case Accel:
ui->comboBoxUNITS->setCurrentIndex(1);
break;
case Velocity:
ui->comboBoxUNITS->setCurrentIndex(3);
break;
case Pascal:
ui->comboBoxUNITS->setCurrentIndex(5);
break;
case k_Pascal:
ui->comboBoxUNITS->setCurrentIndex(7);
break;
case M_Pascal:
ui->comboBoxUNITS->setCurrentIndex(9);
break;
case Nython:
ui->comboBoxUNITS->setCurrentIndex(11);
break;
case k_Nuthon:
ui->comboBoxUNITS->setCurrentIndex(13);
break;
case pQ:
ui->comboBoxUNITS->setCurrentIndex(15);
break;
case mV:
ui->comboBoxUNITS->setCurrentIndex(17);
break;
}
}
else{
switch (thisData.VALUE){
case Accel:
ui->comboBoxUNITS->setCurrentIndex(0);
break;
case Velocity:
ui->comboBoxUNITS->setCurrentIndex(2);
break;
case Pascal:
ui->comboBoxUNITS->setCurrentIndex(4);
break;
case k_Pascal:
ui->comboBoxUNITS->setCurrentIndex(6);
break;
case M_Pascal:
ui->comboBoxUNITS->setCurrentIndex(8);
break;
case Nython:
ui->comboBoxUNITS->setCurrentIndex(10);
break;
case k_Nuthon:
ui->comboBoxUNITS->setCurrentIndex(12);
break;
case pQ:
ui->comboBoxUNITS->setCurrentIndex(14);
break;
case mV:
ui->comboBoxUNITS->setCurrentIndex(16);
break;
}
}
showValue();
}
typeIKU WindowChannelSettings::VerifyGainA142(Set Data) //сверяет гейн на допусимый прибора при установке сенс
{
if(Data.SENS <= 0.0010f) //0.001
{
if(Data.IKU > Ku1000)
{
Data.IKU = Ku1000;
}
}
else
if(/*sens >= 0.0011f && */Data.SENS <= 10.000f) //0.002
{
if(Data.IKU > Ku1000)
{
Data.IKU = Ku1000;
}
}
else
if(/*sens >= 10.001f && */Data.SENS <= 20.000f) //20
{
if(Data.IKU > Ku500)
{
Data.IKU = Ku500;
}
}
else
if(/*sens >= 20.001f && */Data.SENS <= 50.000f) //50
{
if(Data.IKU > Ku200)
{
Data.IKU = Ku200;
}
}
else
if(/*sens >= 50.001f && */Data.SENS <= 100.00f) //100
{
if(Data.IKU > Ku100)
{
Data.IKU = Ku100;
}
}
else
if(/*sens >= 100.01f && */Data.SENS <= 200.00f) //200
{
if(Data.IKU > Ku50)
{
Data.IKU = Ku50;
}
}
else
if(/*sens >= 200.01f && */Data.SENS <= 500.00f) //500
{
if(Data.IKU > Ku20)
{
Data.IKU = Ku20;
}
}
else
if(/*sens >= 500.01f && */Data.SENS <= 1000.0f) //1000
{
if(Data.IKU > Ku10)
{
Data.IKU = Ku10;
}
}
else
if(/*sens >= 1000.01f && */Data.SENS <= 2000.0f) //2000
{
if(Data.IKU > Ku5)
{
Data.IKU = Ku5;
}
}
else
if(/*sens >= 2000.01f && */Data.SENS <= 5000.0f) //5000
{
if(Data.IKU > Ku2)
{
Data.IKU = Ku2;
}
}
else
if(/*sens >= 5000.01f && */Data.SENS <= 10000.0f) //10000
{
if(Data.IKU > Ku1)
{
Data.IKU = Ku1;
}
}
else
if(/*sens >= 10001.0f && */Data.SENS <= 20000.0f) //20000
{
if(Data.IKU > Ku0_5)
{
Data.IKU = Ku0_5;
}
}
else
if(/*sens >= 20001.0f && */Data.SENS <= 50000.0f) //50000
{
if(Data.IKU > Ku0_2)
{
Data.IKU = Ku0_2;
}
}
else
if(Data.SENS < 100000.0f) //99999
{
if(Data.IKU > Ku0_1)
{
Data.IKU = Ku0_1;
}
}
return Data.IKU;
}
void WindowChannelSettings::on_comboBoxUNITS_activated(int index)
{
if(index==0) {
thisData.IIN=CHARGE;
thisData.VALUE=Accel;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==1) {
thisData.IIN=ICP;
thisData.VALUE=Accel;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==2) {
thisData.IIN=CHARGE;
thisData.VALUE=Velocity;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==3) {
thisData.IIN=ICP;
thisData.VALUE=Velocity;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==4) {
thisData.IIN=CHARGE;
thisData.VALUE=Pascal;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==5) {
thisData.IIN=ICP;
thisData.VALUE=Pascal;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==6) {
thisData.IIN=CHARGE;
thisData.VALUE=k_Pascal;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==7) {
thisData.IIN=ICP;
thisData.VALUE=k_Pascal;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==8) {
thisData.IIN=CHARGE;
thisData.VALUE=M_Pascal;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==9) {
thisData.IIN=ICP;
thisData.VALUE=M_Pascal;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==10) {
thisData.IIN=CHARGE;
thisData.VALUE=Nython;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==11) {
thisData.IIN=ICP;
thisData.VALUE=Nython;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==12) {
thisData.IIN=CHARGE;
thisData.VALUE=k_Nuthon;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==13) {
thisData.IIN=ICP;
thisData.VALUE=k_Nuthon;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
if(index==14) {
thisData.IIN=CHARGE;
thisData.VALUE=pQ;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==15) {
thisData.IIN=ICP;
thisData.VALUE=pQ;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==16) {
thisData.IIN=CHARGE;
thisData.VALUE=mV;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
}; if(index==17) {
thisData.IIN=ICP;
thisData.VALUE=mV;
emit ReadyToSend(thisData, IIN);
emit ReadyToSend(thisData, VAL);
};
}

View File

@ -0,0 +1,47 @@
#ifndef WINDOWCHANNELSETTINGS_H
#define WINDOWCHANNELSETTINGS_H
#include <QWidget>
#include <enums.h>
#include <QInputDialog>
#include <mainwindow.h>
namespace Ui {
class WindowChannelSettings;
}
class WindowChannelSettings : public QWidget
{
Q_OBJECT
public:
void hideValue();
void showValue();
explicit WindowChannelSettings(QWidget *parent = nullptr);
~WindowChannelSettings();
void setWindowsChannel(typeCHANNEL channel);
typeIKU VerifyGainA142(Set Data);
signals:
void ReadyToSend(Set, typeREQ);
public slots:
void sendSens();
void setSens(Set data);
void setState(Set data);
void reDraw();
private slots:
void on_comboBoxUNITS_activated(int index);
private:
Ui::WindowChannelSettings *ui;
Set thisData; //данные этой структуры
typeCHANNEL channel;
};
#endif // WINDOWCHANNELSETTINGS_H

View File

@ -0,0 +1,333 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WindowChannelSettings</class>
<widget class="QWidget" name="WindowChannelSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>517</width>
<height>44</height>
</rect>
</property>
<property name="palette">
<palette>
<active/>
<inactive/>
<disabled/>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>19</x>
<y>2</y>
<width>61</width>
<height>26</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>КАНАЛ</string>
</property>
</widget>
<widget class="QLabel" name="labelChanel">
<property name="geometry">
<rect>
<x>86</x>
<y>2</y>
<width>16</width>
<height>26</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>?</string>
</property>
</widget>
<widget class="QLabel" name="labelIIN">
<property name="geometry">
<rect>
<x>167</x>
<y>2</y>
<width>48</width>
<height>26</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>ИЕПЕ</string>
</property>
</widget>
<widget class="CustomLabel" name="labelSENS">
<property name="geometry">
<rect>
<x>279</x>
<y>2</y>
<width>54</width>
<height>26</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>247</red>
<green>224</green>
<blue>181</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>0.0000</string>
</property>
</widget>
<widget class="CustomComboBox" name="comboBoxUNITS">
<property name="geometry">
<rect>
<x>390</x>
<y>-1</y>
<width>111</width>
<height>32</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>96</x>
<y>1</y>
<width>61</width>
<height>26</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>:</string>
</property>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>CustomLabel</class>
<extends>QLabel</extends>
<header>customlabel.h</header>
</customwidget>
<customwidget>
<class>CustomComboBox</class>
<extends>QComboBox</extends>
<header>customcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>