83 lines
1.7 KiB
C++
83 lines
1.7 KiB
C++
#ifndef COUNTERVARSET_H
|
|
#define COUNTERVARSET_H
|
|
|
|
#include <QWidget>
|
|
#include <QTextEdit>
|
|
#include <QTextCharFormat>
|
|
#include "scene/ViewModels.h"
|
|
|
|
namespace Ui {
|
|
class CounterVarSet;
|
|
}
|
|
|
|
class CounterVarSet : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit CounterVarSet(QWidget *parent = 0);
|
|
~CounterVarSet();
|
|
|
|
void init();
|
|
void applyStyleSheet();
|
|
void getValue(int *varType,int *digitalWidth,unsigned char *splitMode);
|
|
void on_buttonInsertVari_pressed();
|
|
|
|
void bindSysPara(SysPara *sysPara);
|
|
|
|
void bindTxTEdit(QTextEdit* textEdit);
|
|
|
|
QString getFamilyName(int);
|
|
|
|
void updateSysParaToUI(); //重载
|
|
void applyUIPara(); //重载
|
|
|
|
void initReplaceValue();
|
|
|
|
void loadDataShow();
|
|
|
|
// 显示要修改计数器的界面
|
|
void editCounter(int index);
|
|
|
|
// 获取当前计数器配置:varType(7或8) 和 digitalNum(位数)
|
|
CounterViewModel getCounterConfig();
|
|
|
|
// 设置ui,用户编辑计数器item时,会调用此函数显示计数器的配置
|
|
void setCounterConfig(CounterViewModel viewModel);
|
|
signals:
|
|
void sendButtonClickedSignal(int);
|
|
|
|
void sig_clearTextEdit();
|
|
void sig_updateSelectedCounter();
|
|
|
|
private slots:
|
|
void buttonClickedSlot();
|
|
|
|
void on_checkBoxResetCnt1CurrValue_released();
|
|
|
|
void on_checkBoxResetCnt2CurrValue_released();
|
|
|
|
void on_pushOnlyCNT1Clear_pressed();
|
|
|
|
void on_pushOnlyCNT2Clear_pressed();
|
|
|
|
// void on_btnUP_clicked();
|
|
|
|
// void on_btnDown_clicked();
|
|
|
|
private:
|
|
Ui::CounterVarSet *ui;
|
|
SysPara* sysPara = nullptr;
|
|
|
|
QTextEdit* m_textEdit;
|
|
QTextCharFormat fmt;
|
|
|
|
QStringList dataList; //替换的内容 数据
|
|
int currPage;
|
|
|
|
bool editFlag = false;
|
|
};
|
|
|
|
#endif // COUNTERVARSET_H
|