Update to dms control phase1.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "TabFormWidget.h"
|
||||
#include "ui_tabformwidget.h"
|
||||
#include "ui_TabFormWidget.h"
|
||||
#include <QDateTime>
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#include "ReconFormWidget.h"
|
||||
#include "ui_tabformwidget.h"
|
||||
#include "ui_TabFormWidget.h"
|
||||
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "json/cJSON.h"
|
||||
#include "event/EventCenter.h"
|
||||
#include "json/ScanJson.h"
|
||||
#include "models/User.h"
|
||||
|
||||
PatientInformationForm::PatientInformationForm(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -45,21 +46,25 @@ void PatientInformationForm::setProtocol(int type) {
|
||||
}
|
||||
}
|
||||
|
||||
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty) {
|
||||
cJSON* root = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(root, "PatientName", cJSON_CreateString(mUI->lbl_Name->text().replace(' ', '_').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientID", cJSON_CreateString(mUI->lbl_ID->text().replace(' ', '_').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientSex", cJSON_CreateString(mUI->lbl_Sex->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientBirthDate",
|
||||
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
|
||||
{
|
||||
cJSON* patientInfoObject = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mUI->lbl_Name->text().replace(' ', '_').toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mUI->lbl_ID->text().replace(' ', '_').toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mUI->lbl_Sex->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientBirthDate",
|
||||
cJSON_CreateString(mUI->lbl_Date->text().replace("/", "").replace("-", "").replace(' ', '.').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "Laterality", cJSON_CreateString(mCurrentProtocol ? "R" : "L"));
|
||||
cJSON_AddItemToObject(root, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0));
|
||||
cJSON_AddItemToObject(root, "OperatorName", cJSON_CreateString("Bob"));
|
||||
cJSON_AddItemToObject(root, "ReferringPhysicianName", cJSON_CreateString("XX"));
|
||||
cJSON_AddItemToObject(root, "InstitutionName", cJSON_CreateString("EQ9"));
|
||||
cJSON_AddItemToObject(root, "InstitutionAddress", cJSON_CreateString("HZ"));
|
||||
cJSON_AddItemToObject(patientInfoObject, "Laterality", cJSON_CreateString(mCurrentProtocol ? "R" : "L"));
|
||||
cJSON_AddItemToObject(patientInfoObject, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0));
|
||||
cJSON_AddItemToObject(patientInfoObject, "OperatorName", cJSON_CreateString(User::Current()->getUserName().toStdString().c_str()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "ReferringPhysicianName", cJSON_CreateString("XX"));
|
||||
cJSON_AddItemToObject(patientInfoObject, "InstitutionName", cJSON_CreateString("EQ9"));
|
||||
cJSON_AddItemToObject(patientInfoObject, "InstitutionAddress", cJSON_CreateString("HZ"));
|
||||
|
||||
cJSON* rootObject = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(rootObject, "Patient Info", patientInfoObject);
|
||||
delete mJsonStr;
|
||||
mJsonStr = cJSON_Print(root);
|
||||
ScanJson::Current()->store(root);
|
||||
mJsonStr = cJSON_PrintUnformatted (rootObject);
|
||||
ScanJson::Current()->store(rootObject);
|
||||
return mJsonStr;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
#include "ScanFormWidget.h"
|
||||
#include "ui_tabformwidget.h"
|
||||
#include "ui_TabFormWidget.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QToolButton>
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "event/EventCenter.h"
|
||||
#include "log/UserOperationLog.h"
|
||||
#include "json/jsonobject.h"
|
||||
#include "device/DeviceManager.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#else
|
||||
@@ -157,7 +158,7 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
||||
connect(mBtnScan, &QToolButton::clicked, [=]() {
|
||||
QString patientInf(mPatInf->getCurrentPatientJsonString(false));
|
||||
LOG_USER_OPERATION(StartScan)
|
||||
if (!JsonObject::Instance()->getEmptyScanID()){
|
||||
if (!DeviceManager::Default()->hasValidEmptyScan()){
|
||||
QString msg(tr("No refresh data exists, please do Refresh operation first."));
|
||||
EventCenter::Default()->triggerEvent(DeviceErrorRaise, nullptr, (QObject*)(&msg));
|
||||
return;
|
||||
@@ -166,7 +167,7 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
||||
});
|
||||
connect(mBtnStop, &QToolButton::clicked, [=]() {
|
||||
LOG_USER_OPERATION(Stop)
|
||||
EventCenter::Default()->triggerEvent(RequestStop, nullptr, nullptr);
|
||||
EventCenter::Default()->triggerEvent(RequestPreviewStop, nullptr, nullptr);
|
||||
});
|
||||
connect(mBtnDrainage, &QToolButton::toggled, [=](bool aSatus) {
|
||||
//Drainage
|
||||
@@ -218,7 +219,7 @@ void ScanFormWidget::renderLoading() {
|
||||
mViewer->setPixmap(pic);
|
||||
}
|
||||
|
||||
void ScanFormWidget::renderPreviewData(const QObject *sender,const QObject *data) {
|
||||
void ScanFormWidget::renderPreviewData(const QObject* /*sender*/,const QObject *data) {
|
||||
if (!data)return;
|
||||
auto array = (QByteArray*)data;
|
||||
auto raw_dataptr = (uchar*)array->data();
|
||||
@@ -268,7 +269,7 @@ void ScanFormWidget::initEvents() {//Events-------------------------------------
|
||||
}
|
||||
mPatInf->setPatientInformation((PatientInformation*)data);
|
||||
});
|
||||
connect(EventCenter::Default(), &EventCenter::ResponseStop, [=](QObject* sender, QObject* data) {
|
||||
connect(EventCenter::Default(), &EventCenter::ResponseStopPreview, [=](QObject* sender, QObject* data) {
|
||||
setPreviewing(false);
|
||||
});
|
||||
connect(EventCenter::Default(), &EventCenter::ResponsePreview, this,&ScanFormWidget::renderLoading);
|
||||
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
void initScanControlBar(QHBoxLayout *layout);
|
||||
void initScanContent();
|
||||
void renderLoading();
|
||||
void renderPreviewData(const QObject *sender,const QObject *data);
|
||||
void renderPreviewData(const QObject* sender, const QObject *data);
|
||||
void reloadLanguage();
|
||||
private slots:
|
||||
void protocolChanged(int type);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Created by Krad on 2021/10/8.
|
||||
//
|
||||
#include "ui_tabformwidget.h"
|
||||
#include "ui_TabFormWidget.h"
|
||||
#include "SelectFormWidget.h"
|
||||
|
||||
#include <QToolButton>
|
||||
@@ -57,7 +57,7 @@ SelectFormWidget::SelectFormWidget(QWidget* parent)
|
||||
prepareButtons(true);
|
||||
});
|
||||
// event ResponseStop slot
|
||||
connect(EventCenter::Default(), &EventCenter::ResponseStop, [=](QObject* sender, QObject* data) {
|
||||
connect(EventCenter::Default(), &EventCenter::ResponseStopPreview, [=](QObject* sender, QObject* data) {
|
||||
prepareButtons(false);
|
||||
});
|
||||
// event ReloadLanguage slot;
|
||||
|
||||
@@ -75,7 +75,7 @@ void AboutForm::initUiWidget()
|
||||
pMainLayout->addWidget(pGuiVer);
|
||||
|
||||
pEmbededSoftVer = new QLabel(this);
|
||||
pEmbededSoftVer->setText(tr("Embedded Software %1, Data store Path:%2").arg(getEmbVersion(), getDataStorePath()));
|
||||
pEmbededSoftVer->setText(tr("Embedded Software %1").arg(getEmbVersion()));
|
||||
pMainLayout->addWidget(pEmbededSoftVer);
|
||||
|
||||
pReconSotfVer = new QLabel(this);
|
||||
@@ -130,7 +130,7 @@ void AboutForm::initUiWidget()
|
||||
pBtnHelp->setText(tr("?"));
|
||||
pCompanyCopyRight->setText(tr("Copyright © 2017-2020 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed"));
|
||||
pGuiVer->setText(QString(tr("GUI Software V%1")).arg(getGUIVersion()));
|
||||
pEmbededSoftVer->setText(tr("Embedded Software %1, Data store Path:%2").arg(getEmbVersion(), getDataStorePath()));
|
||||
pEmbededSoftVer->setText(tr("Embedded Software %1").arg(getEmbVersion()));
|
||||
pReconSotfVer->setText(tr("Reconstruction Software V1.2"));
|
||||
pFEBVer->setText(tr("FEB Information"));
|
||||
});
|
||||
@@ -160,8 +160,3 @@ QString AboutForm::getEmbVersion()
|
||||
{
|
||||
return DeviceManager::Default()->getSoftwareVersion();
|
||||
}
|
||||
|
||||
QString AboutForm::getDataStorePath()
|
||||
{
|
||||
return DeviceManager::Default()->getScanOutputPath();;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
|
||||
QString getGUIVersion();
|
||||
QString getEmbVersion();
|
||||
QString getDataStorePath();
|
||||
|
||||
private slots:
|
||||
void openHelpFile();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "generalform.h"
|
||||
#include "GeneralForm.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QPushButton>
|
||||
@@ -19,6 +19,31 @@
|
||||
namespace
|
||||
{
|
||||
const int MINIMUM_LOCKTIME = 30;
|
||||
|
||||
QString toTimeString(int aSeconds)
|
||||
{
|
||||
if(aSeconds == 0)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
|
||||
if(aSeconds < 3600)
|
||||
{
|
||||
return QString("%1%2%3 %4%5%6 ").arg(QString::number((aSeconds % 3600) / 600))
|
||||
.arg(QString::number((aSeconds % 600) / 60))
|
||||
.arg(QObject::tr("Min"))
|
||||
.arg(QString::number((aSeconds % 60) / 10))
|
||||
.arg(QString::number(aSeconds % 10))
|
||||
.arg(QObject::tr("Sec"));
|
||||
}
|
||||
|
||||
return QString("%1%2%3 %4%5%6 ").arg(QString::number(aSeconds / 36000))
|
||||
.arg(QString::number((aSeconds / 3600) % 10))
|
||||
.arg(QObject::tr("Hour"))
|
||||
.arg(QString::number((aSeconds % 3600) / 600))
|
||||
.arg(QString::number((aSeconds % 600) / 60))
|
||||
.arg(QObject::tr("Min"));
|
||||
}
|
||||
}
|
||||
|
||||
GeneralForm::GeneralForm(QWidget* aParent)
|
||||
@@ -61,14 +86,26 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
QLabel* lockScreenLabel = new QLabel(tr("Lock Screen"));
|
||||
lockHeaderLayout->addWidget(lockScreenLabel);
|
||||
|
||||
QLineEdit* lockTime = new ULineEdit(lockHeader);
|
||||
lockTime->setMaximumSize(QSize(300, 32768));
|
||||
ListBox* lockTime = new ListBox(lockHeader);
|
||||
lockHeaderLayout->addWidget(lockTime);
|
||||
|
||||
QLabel* ss = new QLabel(tr("s"));
|
||||
lockHeaderLayout->addWidget(ss);
|
||||
lockHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||
|
||||
QWidget* shutdownHeader = new QWidget(this);
|
||||
mLayout->addWidget(shutdownHeader);
|
||||
QHBoxLayout* shutdownHeaderLayout = new QHBoxLayout(shutdownHeader);
|
||||
QToolButton* shutdownButton = new QToolButton(this);
|
||||
shutdownButton->setText(tr("Shut Down"));
|
||||
shutdownHeaderLayout->addWidget(shutdownButton);
|
||||
shutdownHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||
connect(shutdownButton, &QToolButton::clicked, []()
|
||||
{
|
||||
if(DialogManager::Default()->requestAlertMessage(QString(tr("Shut down now ?")), DialogButtonMode::OkAndCancel,tr("Shut Down")) == QDialog::Accepted)
|
||||
{
|
||||
EventCenter::Default()->triggerEvent(GUIEvents::RequestShutdown, nullptr, nullptr);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//...
|
||||
mLayout->addSpacerItem(new QSpacerItem(20, 300, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
|
||||
@@ -76,8 +113,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
btnLan->setText(JsonObject::Instance()->defaultLanguage());
|
||||
instName->setText(JsonObject::Instance()->institutionName());
|
||||
instAddr->setText(JsonObject::Instance()->institutionAddr());
|
||||
lockTime->setText(JsonObject::Instance()->lockScreenTimeout());
|
||||
|
||||
lockTime->setText(toTimeString(JsonObject::Instance()->lockScreenTimeout().toInt()));
|
||||
//connection
|
||||
connect(instName, &QLineEdit::textChanged, [=](const QString& str)
|
||||
{
|
||||
@@ -88,14 +124,30 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
{
|
||||
JsonObject::Instance()->setInstitutionAddr(str);
|
||||
});
|
||||
connect(lockTime, &QLineEdit::textChanged, [=](const QString& str)
|
||||
connect(lockTime, &QToolButton::clicked, [=]()
|
||||
{
|
||||
//take effect
|
||||
int time = str.toInt();
|
||||
if (MINIMUM_LOCKTIME < time)
|
||||
int second = JsonObject::Instance()->lockScreenTimeout().toInt();
|
||||
DialogResult result = DialogManager::Default()->requestSelectTime(second);
|
||||
if (result.ResultCode == false)
|
||||
{
|
||||
JsonObject::Instance()->setLockScreenTimeout(str);
|
||||
Locker::getInstance()->setTimer(str.toInt() * 1000);
|
||||
return;
|
||||
}
|
||||
second = result.ResultData.toInt();
|
||||
if(second == 0)
|
||||
{
|
||||
JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
|
||||
lockTime->setText(toTimeString(second));
|
||||
Locker::getInstance()->setIsEnable(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (MINIMUM_LOCKTIME < second)
|
||||
{
|
||||
JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
|
||||
Locker::getInstance()->setTimer(second * 1000);
|
||||
Locker::getInstance()->setIsEnable(true);
|
||||
lockTime->setText(toTimeString(second));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user