This commit is contained in:
Zhang0626 2023-04-17 17:40:26 +08:00
parent 218bfd5839
commit 884e2b0a00
24 changed files with 527 additions and 362 deletions

View File

@ -600,3 +600,11 @@ void CChannelList::on_pushButton_close_clicked()
putJson();
}
void CChannelList::on_pushButton_refresh_clicked()
{
model->removeRows(0, model->rowCount());
g_channelSetting = g_SqliteDB->GetDataMultiLine("t_ChannelSetting");
initReadConfig();
}

View File

@ -56,6 +56,7 @@ private slots:
void on_pushButton_close_clicked();
void on_pushButton_open_clicked();
void on_pushButton_refresh_clicked();
};
#endif // CHANNELLIST_H

View File

@ -3,6 +3,7 @@
#include <QListView>
#include <QTimer>
#include <QTime>
#include "CopyChannelSetting.h"
@ -48,6 +49,8 @@ CChannelSetting::CChannelSetting(QWidget *parent) :
ui->lineEdit_tachTriggerPerRev->setValidator(Validator);
ui->lineEdit_tachTriggerHysteresis->setValidator(Validator);
connect(ui->channelTypeCombox,SIGNAL(currentTextChanged(QString)),this,SLOT(on_channelTypeCombox_currentTextChanged(const QString&)));
}
CChannelSetting::~CChannelSetting()
@ -84,7 +87,6 @@ void CChannelSetting::displayChannelSetting()
QMap<QString,QString>::Iterator iter = g_MapChannelType.begin();
for (; iter != g_MapChannelType.end(); iter++) {
if(iter.key() == channelSetting.sensorType){
qDebug() <<"iter.value()" << iter.value() <<endl;
ui->channelTypeCombox->setCurrentText(iter.value());
}
}
@ -141,10 +143,8 @@ void CChannelSetting::displayChannelSetting()
ui->comboBox_sensorICP->setCurrentText("");
else
ui->comboBox_sensorICP->setCurrentText("");
QString frequencyRangeMax = QString("%1").arg(channelSetting.frequencyRangeMax);
ui->lineEdit_frequencyRangeMax->setText(frequencyRangeMax);
QString frequencyRangeMin = QString("%1").arg(channelSetting.frequencyRangeMin);
ui->lineEdit_frequencyRangeMax->setText(frequencyRangeMin);
ui->lineEdit_frequencyRangeMax->setText(channelSetting.frequencyRangeMax);
ui->lineEdit_frequencyRangeMin->setText(channelSetting.frequencyRangeMin);
ui->comboBox_sensorRangeCheck->clear();
ui->comboBox_sensorRangeCheck->addItems(m_itemList);
@ -266,14 +266,14 @@ void CChannelSetting::on_pushButton_submit_clicked()
}else if(ui->channelTypeCombox->currentText() == "声音"){
channelSetting.sensorType ="MICROPHONE";
}else if(ui->channelTypeCombox->currentText() == "轴向位移"){
channelSetting.sensorType ="PROXIMETER";
channelSetting.sensorType ="THRUST";
}else if(ui->channelTypeCombox->currentText() == "速度"){
channelSetting.sensorType ="VELOCITY";
}else if(ui->channelTypeCombox->currentText() == "转速"){
channelSetting.sensorType ="TACHOMETER";
}else if(ui->channelTypeCombox->currentText() == "径向振动位移"){
channelSetting.sensorType ="THRUST";
channelSetting.sensorType ="PROXIMETER";
}else if(ui->channelTypeCombox->currentText() == "动态电压"){
channelSetting.sensorType ="FAST_VOLTAGE";
}
@ -586,8 +586,61 @@ void CChannelSetting::on_comboBox_samplingRate_currentTextChanged(const QString
}
void CChannelSetting::slotSetChannelData(QStringList& listChannelName)
{
qDebug() << listChannelName << endl;
for (int i = 0; i < listChannelName.size(); i++)
{
QString strUpdateSql = QString(" set ChUnitCoeff = '%1' , ChUnitDot = %2,SensorICP = '%3', \
SensorType = '%4',bearingClearance='%5',bearingStartPosition='%6',\
channelIntDiff = '%7',channelRMSPkPk2Pk='%8',channelSensorType='%9',\
comments = '%10',couplingACDC='%11',envelopeHighpassband=%12,envelopeLowpassband=%13,\
equipmentId = %14,filter='%15',frequencyRangeMax='%16',frequencyRangeMin='%17',\
fullScalePosition=%18,highPassFrequency='%19',installMethod='%20',isEnable=%21,\
isWork=%22,lowPassFrequency='%23',measuringRange='%24',offset=%25,pairChannelId='%26',\
pairChannelName='%27',rpmMultiplier='%28',samplingRate=%29,sensor1xAmplitudeRunout='%30',\
sensor1xPhaseRunout='%31',sensorConfigureDate='%32',sensorEngineeringUnit='%33',\
sensorGapVoltage='%34',sensorLeftOrRight='%35',sensorLocationInDegree=%36,\
sensorRange='%37',sensorRangeCheck='%38',sensorRangeMax='%39',sensorRangeMin='%40',\
sensorSensitivity='%41',shaftRotationDirection='%42',speedRefChannelId='%43',\
startBrands='%44',stopBrands='%45',tachAutoTach='%46',tachTriggerEdge='%47',tachTriggerHysteresis=%48,\
tachTriggerPerRev='%49',tachTriggerVoltageLevel='%50',thermalCoupleType = '%51',xFullScalePosition='%52',\
xProcessVariableName='%53',xZeroScalePosition='%54',zeroScalePosition='%55',speedRefChannelName = '%56',defaultDisplay = '%57' where channelName = '%58'").\
arg(channelSetting.ChUnitCoeff).arg(channelSetting.ChUnitDot).arg(channelSetting.sensorICP).\
arg(channelSetting.sensorType).arg(channelSetting.bearingClearance).arg(channelSetting.bearingStartPosition).\
arg(channelSetting.channelIntDiff).arg(channelSetting.channelRMSPkPk2Pk).arg(channelSetting.channelSensorType).\
arg(channelSetting.comments).arg(channelSetting.couplingACDC).arg(channelSetting.envelopeHighpassband).arg(channelSetting.envelopeLowpassband).\
arg(channelSetting.equipmentId).arg(channelSetting.filter).arg(channelSetting.frequencyRangeMax).\
arg(channelSetting.frequencyRangeMin).arg(channelSetting.fullScalePosition).arg(channelSetting.highPassFrequency).\
arg(channelSetting.installMethod).arg(channelSetting.isEnable).arg(channelSetting.isWork).\
arg(channelSetting.lowPassFrequency).arg(channelSetting.measuringRange).arg(channelSetting.offset).\
arg(channelSetting.pairChannelId).arg(channelSetting.pairChannelName).arg(channelSetting.rpmMultiplier).\
arg(channelSetting.samplingRate).arg(channelSetting.sensor1xAmplitudeRunout).arg(channelSetting.sensor1xPhaseRunout).\
arg(channelSetting.sensorConfigureDate).arg(channelSetting.sensorEngineeringUnit).arg(channelSetting.sensorGapVoltage).\
arg(channelSetting.sensorLeftOrRight).arg(channelSetting.sensorLocationInDegree).\
arg(channelSetting.sensorRange).arg(channelSetting.sensorRangeCheck).\
arg(channelSetting.sensorRangeMax).arg(channelSetting.sensorRangeMin).arg(channelSetting.sensorSensitivity).\
arg(channelSetting.shaftRotationDirection).arg(channelSetting.speedRefChannelId).\
arg(channelSetting.startBrands).arg(channelSetting.stopBrands).arg(channelSetting.tachAutoTach).arg(channelSetting.tachTriggerEdge).\
arg(channelSetting.tachTriggerHysteresis).arg(channelSetting.tachTriggerPerRev).arg(channelSetting.tachTriggerVoltageLevel).\
arg(channelSetting.thermalCoupleType).arg(channelSetting.xFullScalePosition).arg(channelSetting.xProcessVariableName).arg(channelSetting.xZeroScalePosition).\
arg(channelSetting.zeroScalePosition).arg(channelSetting.speedRefChannelName).arg(channelSetting.defaultDisplay).arg(listChannelName[i]);
QString tableName = "t_ChannelSetting ";
g_SqliteDB->UpdateDataSql(tableName,strUpdateSql);
}
}
void CChannelSetting::on_pushButton_copy_clicked()
{
//sensorModuleNo
QString strWhere = QString(" sensorModuleNo = %1 and channelId <> '%2' ").arg(channelSetting.sensorModuleNo).arg(channelSetting.channelId);
QVector<ChannelSetting> copyChannel = g_SqliteDB->GetDataMultiLine("t_ChannelSetting","*",strWhere);
CopyChannelSetting *dialog = new CopyChannelSetting();
connect(dialog, SIGNAL(sgSetChannelData(QStringList&)), this, SLOT(slotSetChannelData(QStringList&)));
dialog->copyChannel = copyChannel;
dialog->setWindowModality(Qt::ApplicationModal);
dialog->displayCopyChannel();
dialog->show();
}

View File

@ -3,6 +3,7 @@
#include <QWidget>
#include "global.h"
#include "sqlitedb.h"
namespace Ui {
class CChannelSetting;
@ -31,6 +32,9 @@ private slots:
void on_comboBox_samplingRate_currentTextChanged(const QString &arg1);
void on_pushButton_copy_clicked();
public slots:
void slotSetChannelData(QStringList&);
private:
Ui::CChannelSetting *ui;
QStringList m_itemList;

View File

@ -31,7 +31,7 @@ void CCharacteristicList::timerEvent(QTimerEvent *ev)
void CCharacteristicList::InitTable()
{
headerStr = QObject::tr("通道名称,单位,通频值,峰峰值,1X幅值,1X相位,平均工作位置,间隙,安装角度,状态");
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
model = new QStandardItemModel(ui->tableView);
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); //选中行
QStringList headerList = headerStr.split(",");
@ -40,7 +40,7 @@ void CCharacteristicList::InitTable()
ui->tableView->setModel(model);
ui->tableView->setAlternatingRowColors(true);
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->setColumnWidth(0, 600);
ui->tableView->setColumnWidth(0, 300);
ui->tableView->setColumnWidth(6, 200);
// for (int i = 0;i < g_ChannelView.size(); i++)

View File

@ -1,6 +1,8 @@
#include "CopyChannelSetting.h"
#include "ui_CopyChannelSetting.h"
#include<QGridLayout>
CopyChannelSetting::CopyChannelSetting(QWidget *parent) :
QWidget(parent),
ui(new Ui::CopyChannelSetting)
@ -12,3 +14,45 @@ CopyChannelSetting::~CopyChannelSetting()
{
delete ui;
}
void CopyChannelSetting::displayCopyChannel()
{
QGridLayout* layout = new QGridLayout(ui->widget);
int col = 0,row = 0;
for(int i = 0; i < copyChannel.size();i++){
QCheckBox *checkButton = new QCheckBox(copyChannel[i].channelName,ui->widget);
if(!int((i+1) % 2)){
layout->addWidget(checkButton, col, row);
col ++ ;
row = 0;
}else{
layout->addWidget(checkButton, col, row);
row ++ ;
}
m_listCheckBox.append(checkButton);
}
}
void CopyChannelSetting::on_pushButton_confirm_clicked()
{
QStringList listChannelName;
for (int i = 0; i < m_listCheckBox.size(); i++) {
if(m_listCheckBox[i]->checkState()){
qDebug() << m_listCheckBox[i]->text() << endl;
listChannelName.append(m_listCheckBox[i]->text());
}
}
sgSetChannelData(listChannelName);
this->close();
}
void CopyChannelSetting::on_pushButton_selectAll_clicked()
{
for (int i = 0; i < m_listCheckBox.size(); i++) {
m_listCheckBox[i]->setCheckState(Qt::Checked);
}
}

View File

@ -2,6 +2,8 @@
#define COPYCHANNELSETTING_H
#include <QWidget>
#include "global.h"
#include <QCheckBox>
namespace Ui {
class CopyChannelSetting;
@ -15,8 +17,20 @@ public:
explicit CopyChannelSetting(QWidget *parent = nullptr);
~CopyChannelSetting();
QVector<ChannelSetting> copyChannel;
void displayCopyChannel();
private slots:
void on_pushButton_confirm_clicked();
void on_pushButton_selectAll_clicked();
private:
Ui::CopyChannelSetting *ui;
QList<QCheckBox*> m_listCheckBox;
signals:
void sgSetChannelData(QStringList&);
};
#endif // COPYCHANNELSETTING_H

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>681</width>
<height>429</height>
<width>855</width>
<height>605</height>
</rect>
</property>
<property name="windowTitle">
@ -21,7 +21,7 @@ color: rgb(27, 30, 35);</string>
<property name="geometry">
<rect>
<x>140</x>
<y>110</y>
<y>50</y>
<width>421</width>
<height>31</height>
</rect>
@ -30,6 +30,86 @@ color: rgb(27, 30, 35);</string>
<string>你想要把当前通道的配置复制到哪些通道?</string>
</property>
</widget>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>70</x>
<y>130</y>
<width>751</width>
<height>351</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_confirm">
<property name="geometry">
<rect>
<x>480</x>
<y>520</y>
<width>120</width>
<height>35</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_confirm { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_confirm:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_confirm:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_confirm:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_selectAll">
<property name="geometry">
<rect>
<x>240</x>
<y>520</y>
<width>120</width>
<height>35</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_selectAll { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_selectAll:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_selectAll:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_selectAll:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>全选</string>
</property>
</widget>
</widget>
<resources/>
<connections/>

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.15.0, 2023-04-13T16:06:37. -->
<!-- Written by QtCreator 4.15.0, 2023-04-17T09:23:44. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{4d2e0de9-4d17-4362-8db9-5eb52cc06e2d}</value>
<value type="QByteArray">{168666bd-c3a3-4089-8a9e-043b6ddc15f8}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">1</value>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
@ -79,7 +79,7 @@
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">12</value>
<value type="int" key="ClangTools.ParallelJobs">3</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
@ -91,16 +91,16 @@
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.11 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.11 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51211.win64_msvc2017_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.11 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.11 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51211.win32_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\chaos\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/chaos/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:\WorkSpace\3500\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">E:/WorkSpace/3500/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -137,8 +137,8 @@
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\chaos\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MSVC2017_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/chaos/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MSVC2017_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:\WorkSpace\3500\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">E:/WorkSpace/3500/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -177,13 +177,13 @@
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\chaos\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MSVC2017_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/chaos/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MSVC2017_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:\WorkSpace\3500\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">E:/WorkSpace/3500/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">true</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
@ -294,236 +294,21 @@
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.11 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.11 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51211.win64_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\chaos\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_64_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/chaos/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_64_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\chaos\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_64_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/chaos/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_64_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\chaos\build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_64_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/chaos/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_64_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="QString" key="Analyzer.Valgrind.Callgrind.Arguments"></value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="QString" key="Analyzer.Valgrind.Memcheck.Arguments"></value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindArguments"></value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/WorkSpace/3500/DataWatch3500_GUI/DataWatch3500_GUI.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">E:/WorkSpace/3500/DataWatch3500_GUI/DataWatch3500_GUI.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">E:/WorkSpace/3500/build-DataWatch3500_GUI-Desktop_Qt_5_12_11_MinGW_32_bit-Release</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">2</value>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>

View File

@ -16,10 +16,8 @@ CFileServerConfig::CFileServerConfig(QWidget *parent) :
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
QString exp = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\."
"(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."
"(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."
"(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$";
QString exp = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.)"
"{3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
QRegExp rege(exp);
QValidator *Validator = new QRegExpValidator(rege);
ui->lineEdit_IP_PS->setValidator(Validator);
@ -33,8 +31,6 @@ CFileServerConfig::CFileServerConfig(QWidget *parent) :
ui->lineEdit_Mask_PL->setValidator(Validator);
ui->lineEdit_ServerIP->setValidator(Validator);
}
CFileServerConfig::~CFileServerConfig()
@ -118,27 +114,6 @@ void CFileServerConfig::Init()
void CFileServerConfig::on_pushButtonPush_clicked()
{
QString strTableName = "t_DeviceInfo";
QString strUpdateSql = QString(" set IP = '%1' ;").arg(ui->lineEdit_hostIP->text());
g_SqliteDB->UpdateDataSql(strTableName,strUpdateSql);
QString col = "IP";
QString str = g_SqliteDB->GetSingelLine(strTableName,col);
QStringList strList = str.split(",");
IP = strList[0];
qDebug() << "IP" << IP << endl;
QJsonObject allObj,cmdBody;
QNetworkRequest req;
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
allObj.insert("cmd", "20");
cmdBody.insert("type","GET");
allObj["cmdBody"] = cmdBody;
req.setUrl(sUrl);
g_NetMgr->PostJson(req,allObj);
QJsonObject netWorkObj,plObj,psObj;
psObj["ipAddress"] = ui->lineEdit_IP_PS->text();
psObj["hostName"] = ui->lineEdit_HostName_PS->text();
@ -221,3 +196,27 @@ void CFileServerConfig::slotNetMgr(QString sAddr, const QVariant &msg)
}
void CFileServerConfig::on_pushButton_get_clicked()
{
QString strTableName = "t_DeviceInfo";
QString strUpdateSql = QString(" set IP = '%1' ;").arg(ui->lineEdit_hostIP->text());
g_SqliteDB->UpdateDataSql(strTableName,strUpdateSql);
QString col = "IP";
QString str = g_SqliteDB->GetSingelLine(strTableName,col);
QStringList strList = str.split(",");
IP = strList[0];
qDebug() << "IP" << IP << endl;
QJsonObject allObj,cmdBody;
QNetworkRequest req;
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
allObj.insert("cmd", "20");
cmdBody.insert("type","GET");
allObj["cmdBody"] = cmdBody;
req.setUrl(sUrl);
g_NetMgr->PostJson(req,allObj);
}

View File

@ -22,6 +22,8 @@ private slots:
//网络请求数据响应
void slotNetMgr(QString sAddr,const QVariant& msg);
void on_pushButton_get_clicked();
private:
Ui::CFileServerConfig *ui;

View File

@ -120,7 +120,7 @@
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<width>150</width>
<height>16777215</height>
</size>
</property>
@ -158,7 +158,7 @@
<rect>
<x>13</x>
<y>53</y>
<width>429</width>
<width>451</width>
<height>321</height>
</rect>
</property>
@ -378,6 +378,12 @@
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>主机IP</string>
</property>
@ -398,6 +404,41 @@
</size>
</property>
</widget>
<widget class="QPushButton" name="pushButton_get">
<property name="geometry">
<rect>
<x>170</x>
<y>492</y>
<width>120</width>
<height>35</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_get { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_get:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_get:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_get:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>获取</string>
</property>
</widget>
</widget>
</item>
<item>
@ -410,7 +451,7 @@
<rect>
<x>10</x>
<y>50</y>
<width>429</width>
<width>453</width>
<height>321</height>
</rect>
</property>

View File

@ -14,7 +14,7 @@ CHistoryAlarm::CHistoryAlarm(QWidget *parent) :
model->setHorizontalHeaderLabels(headerList);
model->setColumnCount(headerList.size());
ui->tableView->setModel(model);
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
ui->tableView->setColumnWidth(2, 300);
ui->tableView->setAlternatingRowColors(true);
model->setRowCount(10);

View File

@ -14,11 +14,11 @@ void CMyCustomGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even
qDebug() << "mouseDoubleClickEvent" << event->scenePos() <<endl;
//QGraphicsItem *item = scene.itemAt(mapToScene(event->pos()), QTransform());
QMessageBox msgBox; // 生成对象
msgBox.setText("This is Rect."); // 设置文本
int ret = msgBox.exec(); // 执行
// QMessageBox msgBox; // 生成对象
// msgBox.setText("This is Rect."); // 设置文本
// int ret = msgBox.exec(); // 执行
emit doubleclick(event);
// emit doubleclick(event);
}
void CMyCustomGraphicsItem::wheelEvent(QGraphicsSceneWheelEvent *event)

View File

@ -17,7 +17,7 @@ CRealTimeAlarm::CRealTimeAlarm(QWidget *parent) :
ui->tableView->setColumnWidth(2, 300);
ui->tableView->setAlternatingRowColors(true);
model->setRowCount(10);
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
ui->tableView->horizontalHeader()->setSectionResizeMode(0,QHeaderView::ResizeToContents);
ui->tableView->horizontalHeader()->setSectionResizeMode(4,QHeaderView::ResizeToContents);

View File

@ -1426,48 +1426,6 @@ color: rgb(27, 30, 35);</string>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_26">
<item>
<widget class="QPushButton" name="pushButton_copy">
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_copy { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_copy:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_copy:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_copy:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>复制通道</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_submit">
<property name="minimumSize">

View File

@ -12,6 +12,7 @@ CWaveDisPlay::CWaveDisPlay(QWidget *parent) :
m_ChannelID = "";
m_PackgNum = 1;
bFlag = false;
m_Times = 0;
ui->widget->setProperty("flag", "Title");
ui->widget_4->setProperty("flag", "normal");
// QAbstractItemView* view = ui->comboBox_channel_2->view();
@ -58,6 +59,13 @@ void CWaveDisPlay::InitWindows()
QPushButton:pressed{border-image:url(:/image/Btn/timewave-p.png) 5; }\
QPushButton:checked{border-image:url(:/image/Btn/timewave-p.png) 5; } " );
ui->Btn_Timewave->setChecked(true);
ui->pushButton_1S->setStyleSheet(" QPushButton{ border-image:url(:/image/Btn/normal_Btn.png); color:#1f5188 }\
QPushButton:hover{ border-image:url(:/image/Btn/normal_Btn_p.png); color:#ffffff }\
QPushButton:pressed{border-image:url(:/image/Btn/normal_Btn_p.png); color:#ffffff }\
QPushButton:checked{border-image:url(:/image/Btn/normal_Btn_p.png); color:#ffffff } " );
ui->pushButton_1S->setChecked(true);
//绑定HTTP消息响应
connect(m_pNetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
@ -372,3 +380,51 @@ void CWaveDisPlay::on_comboBox_channel_2_currentTextChanged(const QString &arg1)
}
}
void CWaveDisPlay::timerEvent(QTimerEvent *ev)
{
if(ev->timerId() == id1)
{
QJsonObject allObj,cmdBody;
allObj.insert("cmd", "30");
cmdBody.insert("package",0);
cmdBody.insert("channelId",m_ChannelID);
allObj["cmdBody"] = cmdBody;
QNetworkRequest req;
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
req.setUrl(sUrl);
m_pNetMgr->PostJson(req,allObj);
m_Times = m_Times + 1;
if(m_Times == 4){
killTimer(id1);
m_Times = 0;
}
}
}
void CWaveDisPlay::on_pushButton_1S_clicked()
{
ui->pushButton_4S->setChecked(false);
if(!ui->pushButton_1S->isChecked()){
return;
}
}
void CWaveDisPlay::on_pushButton_4S_clicked()
{
ui->pushButton_1S->setChecked(false);
if(ui->pushButton_4S->isChecked()){
id1 = startTimer(1000); //参数1 间隔 单位 毫秒
//定时器第二种方式
QTimer * timer = new QTimer(this);
//启动定时器
timer->start(500);
return;
}
}

View File

@ -36,6 +36,10 @@ private slots:
void on_comboBox_channel_2_currentTextChanged(const QString &arg1);
void on_pushButton_1S_clicked();
void on_pushButton_4S_clicked();
public slots:
void mouseMoveEvent(QMouseEvent *event);
@ -50,11 +54,17 @@ private:
bool bFlag;
QCPItemTracer *tracer; //游标
QCPItemText *tracerLabel; //游标标签
int id1; //定时器1的唯一标示
int m_Times;
void InitWindows();
void ParseDataTimeWave(QJsonObject&);
void ParseDataFsWave(QJsonObject&);
void InitGraph();
void Cursor();
virtual void timerEvent(QTimerEvent *);
};
#endif // WAVEDISPLAY_H

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>913</width>
<width>1203</width>
<height>646</height>
</rect>
</property>
@ -324,6 +324,70 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_1S">
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_1S { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_1S:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_1S:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_1S:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>1S</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_4S">
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_4S { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_4S:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_4S:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_4S:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>4S</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_refresh">
<property name="minimumSize">

View File

@ -70,7 +70,7 @@ QTableView::item {
<height>80</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@ -140,28 +140,59 @@ QTableView::item {
</property>
<property name="sizeHint" stdset="0">
<size>
<width>523</width>
<height>20</height>
<width>241</width>
<height>59</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_line">
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_line { border-image: url(:/image/Btn/normal_Btn.png);
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButton_refresh">
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_refresh { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_refresh:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_refresh:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
#pushButton_refresh:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>刷新</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_line">
<property name="minimumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_line { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 }
#pushButton_line:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}
@ -169,11 +200,13 @@ QTableView::item {
color:#ffffff}
#pushButton_line:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string>
</property>
<property name="text">
<string>查看线路图</string>
</property>
</widget>
</property>
<property name="text">
<string>查看线路图</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

View File

@ -34,6 +34,8 @@ void FtpClient::SetUserInfo(const QString userAccount, const QString pwd)
void FtpClient::SetServerInfo(const QString fileAddr, int Port/* =21 */)
{
m_ftpManager->disconnect(SIGNAL(finished(QNetworkReply*)));
connect(m_ftpManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*)));
m_ftpUrl = new QUrl(fileAddr);
m_ftpUrl->setPort(Port);
@ -45,7 +47,7 @@ void FtpClient::slotNetMgr(QString sAddr, const QVariant &msg)
if(objec.contains("cmd"))
{
QJsonValue arrays_value = objec.take("cmd");
//qDebug()<<"cmd ="<<arrays_value.toString();
qDebug()<<"cmd ="<<arrays_value.toString();
if(arrays_value.toString() == "90" || arrays_value.toString() == "46" )
{
bool Status = objec.take("success").toBool();
@ -63,7 +65,7 @@ void FtpClient::finished(QNetworkReply* reply)
{
if(m_fileName != ""){
qDebug() << "ftp finished" << endl;
//QMessageBox::information(this, QStringLiteral("提示"), QStringLiteral("保存成功!"));
QJsonObject allObj,cmdBody,temp;
QJsonArray tempArray;
if(m_fileName.contains("tar.gz")){

View File

@ -130,10 +130,10 @@ void MainWindow::initWindow()
g_MapChannelType.insert("ACCELEROMETER","加速度");
g_MapChannelType.insert("MICROPHONE","声音");
g_MapChannelType.insert("PROXIMETER","轴向位移");
g_MapChannelType.insert("THRUST","轴向位移");
g_MapChannelType.insert("VELOCITY","速度");
g_MapChannelType.insert("TACHOMETER","转速");
g_MapChannelType.insert("THRUST","径向振动位移");
g_MapChannelType.insert("PROXIMETER","径向振动位移");
g_MapChannelType.insert("FAST_VOLTAGE","动态电压");
g_MapChannelType.insert("SLOW_CURRENT","低速电流");
g_MapChannelType.insert("PULSE_CURRENT","高速电流");
@ -141,6 +141,7 @@ void MainWindow::initWindow()
g_MapChannelType.insert("DO","开出");
}
void MainWindow::initStyle()
{
//加载样式表

View File

@ -147,12 +147,12 @@ void CRealTimeForm::on_graphView_customContextMenuRequested(const QPoint &pos)
if(ui->graphicsView->itemAt(pos))
return;
QMenu menu(this);
pActionVerticalLine = menu.addAction("Add VerticalLine");
pActionHorizontalLine = menu.addAction("Add HorizontalLine");
pActionRect = menu.addAction("Add Channel");
pActionPixmap = menu.addAction("Add Pixmap");
pActionText = menu.addAction("Add Text");
pActionSave = menu.addAction("Save");
pActionVerticalLine = menu.addAction("添加竖线");
pActionHorizontalLine = menu.addAction("添加横线");
pActionRect = menu.addAction("添加通道");
pActionPixmap = menu.addAction("添加图片");
pActionText = menu.addAction("添加文字");
pActionSave = menu.addAction("保存");
pActionVerticalLine->setData(1);
pActionHorizontalLine->setData(2);
@ -259,7 +259,10 @@ void CRealTimeForm::on_addchannel(channelBaseInfo channelbaseInfo,QString str)
pTextUnits = new QGraphicsTextItem(channelbaseInfo.sensorEngineeringUnit);
}
}else if(channelbaseInfo.channelType == "FAST_VOLTAGE"){
pTextUnits = new QGraphicsTextItem("V");
}
QGraphicsTextItem* pTextChannel = new QGraphicsTextItem(channelbaseInfo.channelName);
QGraphicsTextItem* pTextValue = new QGraphicsTextItem("0.0");

View File

@ -102,7 +102,14 @@ QVector<ChannelSetting> SqliteDB::GetDataMultiLine(QString tablename, QString co
QVector<ChannelSetting> vecResult;
ChannelSetting tempchannel;
QString strSql = QString("SELECT * FROM %1 order BY sensorModuleNo;").arg(tablename);
QString strSql = "SELECT ";
if(column != ""){
strSql = strSql + column + " from " + tablename + " where " + whereCon + ";";
}
else{
strSql = QString("SELECT * FROM %1 order BY sensorModuleNo;").arg(tablename);
}
qDebug() << strSql;
sql_query.exec(strSql);
if(!sql_query.exec())
{
@ -419,7 +426,7 @@ int SqliteDB::UpdateDataSql(QString& tablename,QString& UpdataSql)
int iRet = -1;
QString strSql = "update ";
strSql = strSql + tablename + UpdataSql;
//qDebug() << strSql << endl;
qDebug() << strSql << endl;
if(!sql_query.exec(strSql))
{
qDebug() << sql_query.lastError();