Refactor system page in GUI Alpha.

This commit is contained in:
sunwen
2024-04-25 14:37:38 +08:00
parent f9eb807fa3
commit 982b54b727
420 changed files with 23907 additions and 872 deletions

View File

@@ -44,10 +44,10 @@ option(Build_With_System_QT "Build With System QT" OFF)
if(Build_With_System_QT)
include_directories(/usr/include/qt5/ /usr/include/qt5/QtCore
/usr/include/qt5/QtNetwork /usr/include/qt5/QtWidgets /usr/include/qt5/QtGui
/usr/include/qt5/QtSql /usr/include/qt5/QtMultimedia /usr/include/qt5/QtMultimediaWidgets )
/usr/include/qt5/QtSql /usr/include/qt5/QtMultimedia /usr/include/qt5/QtMultimediaWidgets)
endif()
find_package(Qt5 COMPONENTS Core Widgets Gui Sql Network Multimedia MultimediaWidgets REQUIRED)
find_package(Qt5 COMPONENTS Core Widgets Gui Sql Network Multimedia MultimediaWidgets WebEngineWidgets REQUIRED)
find_package(DCMTK REQUIRED)
set(Req_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdParty/Req/pub/cmake")
@@ -113,13 +113,13 @@ if(UNIX )
if(Build_With_System_QT)
message("Build With System QT" )
link_directories( "/usr/lib64")
target_link_libraries(${PROJECT_NAME} Qt5Core.so Qt5Widgets.so Qt5Gui.so Qt5Sql.so Qt5Network.so Qt5Multimedia.so Qt5MultimediaWidgets.so pthread)
target_link_libraries(${PROJECT_NAME} Qt5Core.so Qt5Widgets.so Qt5Gui.so Qt5Sql.so Qt5Network.so Qt5Multimedia.so Qt5MultimediaWidgets.so Qt5WebEngineWidgets.so pthread)
else()
message("Build With packaged QT" )
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::Sql Qt5::Network Qt5::Multimedia Qt5::MultimediaWidgets pthread)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::Sql Qt5::Network Qt5::Multimedia Qt5::MultimediaWidgets Qt5::WebEngineWidgets pthread)
endif(Build_With_System_QT)
else()
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::Sql Qt5::Network Qt5::Multimedia Qt5::MultimediaWidgets)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::Sql Qt5::Network Qt5::Multimedia Qt5::MultimediaWidgets Qt5::WebEngineWidgets)
endif()
if(MSVC)

BIN
cfgs/initialize.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

BIN
cfgs/initialize.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

View File

@@ -72,6 +72,7 @@
"lists": "Today;Recent3Days;ThisWeek;ThisMonth"
},
"screensaver": {
"open": true,
"content": "screensaver.PNG;screensaver.mp4"
},
"operatorlog": {

View File

@@ -16,12 +16,16 @@
},
"general": {
"dateformat": "yyyy-MM-dd hh:mm:ss",
"defaultlanguage": "zh_CN",
"language": "zh_CN;en_US",
"defaultlanguage": "Chinese",
"language": "Chinese;English",
"lockScreenTimes": "Never;5 Minutes",
"defaultLockScreenTime": "Never",
"institutionName": "浙江大学附属第二医院",
"institutionAddr": "杭州市滨江区",
"lockscreen": "0",
"CompleteNotify": true
"CompleteNotify": true,
"ScanConfirm": false,
"AnonymousMode": false
},
"protocol": {
"default": "LSTAND",
@@ -58,10 +62,17 @@
"name": "3D recon",
"port": "5003"
},
"mpps": {
"ae": "mpps",
"ip": "192.168.1.15",
"name": "Mpps Server",
"port": "5002"
},
"address": {
"device": "eth0",
"dhcp": "true",
"dhcp": true,
"ip": "192.168.1.197",
"gateway": "192.168.1.1",
"mask": "255.255.255.0",
"ae": "MOON",
"name": "daq",
@@ -91,15 +102,16 @@
"lists": "Today;Recent3Days;ThisWeek;ThisMonth"
},
"screensaver": {
"open": true,
"content": "screensaver.PNG;screensaver.mp4"
},
"operatorlog": {
"expire" : "30"
"expire": "30"
},
"dms": {
"simulator": true
},
"patientlist":{
"expire":"7"
"patientlist": {
"expire": "7"
}
}

View File

@@ -16,13 +16,15 @@ void ListBox::paintEvent(QPaintEvent *e) {
QStylePainter painter(this);
QStyleOptionToolButton opt;
initStyleOption(&opt);
//在最后绘制按钮的时候将text清空避免绘制出左对齐的文字
opt.text.clear();
painter.drawComplexControl(QStyle::CC_ToolButton, opt);
//自行绘制居中对齐的文字
int x = (size().width() - this->iconSize().width()) / 2 - (this->text().length() * opt.font.pixelSize()) / 4;
int y = this->iconSize().height() + 2;
painter.drawText(x,y,this->text());
QFontMetrics fm(opt.font);
int textWidth = fm.horizontalAdvance(this->text());
int textHeight = fm.height();
int x = (size().width() - this->iconSize().width() - textWidth) / 2;
int y = (size().height() + textHeight) / 2 - fm.descent();
painter.drawText(x, y, this->text());
}
void ListBox::setSmallBox(bool isSmall) {

View File

@@ -36,6 +36,7 @@ namespace
{
const int PREVIEW_IMAGE_WH = 140;
const unsigned int GET_TEMPERATURE_TIME = 60000;
const int CHECK_RECON_CONNECTION_TIME = 30000;
const int SHUT_DOWN_TIMEOUT = 180000;//3 minitues
const int PUMP_TIMEOUT = 3000;//3 seconds
const QString DEFAULT_DMS_START_FAILED = "Dms start failed.";
@@ -148,16 +149,19 @@ void DeviceManager::initDevice()
//dmsInfoReceiverThread
mDmsInfoReceiveThread = new QThread(this);
InfoReceiveWorker* infoReceiveWorker = new InfoReceiveWorker(nullptr);
infoReceiveWorker->moveToThread(mDmsInfoReceiveThread);
connect(mDmsInfoReceiveThread, &QThread::started, infoReceiveWorker, &InfoReceiveWorker::startListen);
connect(mDmsInfoReceiveThread, &QThread::finished, infoReceiveWorker, &InfoReceiveWorker::deleteLater);
connect(infoReceiveWorker, &InfoReceiveWorker::infoReceived, this, &DeviceManager::processReceiveDMSInfoResult);
mInfoReceiveWorker = new InfoReceiveWorker(nullptr);
mInfoReceiveWorker->moveToThread(mDmsInfoReceiveThread);
connect(mDmsInfoReceiveThread, &QThread::started, mInfoReceiveWorker, &InfoReceiveWorker::startListen);
connect(mDmsInfoReceiveThread, &QThread::finished, mInfoReceiveWorker, &InfoReceiveWorker::deleteLater);
connect(mInfoReceiveWorker, &InfoReceiveWorker::infoReceived, this, &DeviceManager::processReceiveDMSInfoResult);
mDmsInfoReceiveThread->start();
//reconHttpThread
mReconHttpThread = new QThread(this);
QTimer* reconConnectionTimer = new QTimer(this);
reconConnectionTimer->start(CHECK_RECON_CONNECTION_TIME);
ReconManager::getInstance()->moveToThread(mReconHttpThread);
connect(reconConnectionTimer, &QTimer::timeout, ReconManager::getInstance(), &ReconManager::checkReconConnection);
connect(mReconHttpThread, &QThread::finished, ReconManager::getInstance(), &ReconManager::deleteLater);
connect(this, &DeviceManager::createEmptyScanToRecon, ReconManager::getInstance(), &ReconManager::createEmptyScan);
connect(this, &DeviceManager::createScanToRecon, ReconManager::getInstance(), &ReconManager::createScan);

View File

@@ -8,6 +8,7 @@
#include <QObject>
#include <QThread>
#include "DeviceDefs.h"
#include "InfoReceiveWorker.h"
class DmsSyncAction;
class DmsAsyncAction;
@@ -27,13 +28,14 @@ public:
~DeviceManager() override
{
// mCmdSendThread->quit();
// mCmdSendThread->wait();
// mCmdSendThread->deleteLater();
mInfoReceiveWorker->exit();
mDmsInfoReceiveThread->quit();
mDmsInfoReceiveThread->wait();
mDmsInfoReceiveThread->deleteLater();
mReconHttpThread->quit();
mReconHttpThread->wait();
mReconHttpThread->deleteLater();
}
DeviceManager(const DeviceManager &) = delete;
@@ -215,6 +217,8 @@ private:
DmsAsyncAction* mShutDownAction = nullptr;
DmsAsyncAction* mPumpControlAction = nullptr;
InfoReceiveWorker* mInfoReceiveWorker = nullptr;
friend class InfoReceiveWorker;
};

View File

@@ -27,8 +27,8 @@ DmsAsyncAction::DmsAsyncAction(int aServerId, int aActionId, QObject* aObject, c
DmsAsyncAction::~DmsAsyncAction()
{
disconnect(mTimer, &QTimer::timeout, this, &DmsAsyncAction::sendTimeoutSignal);
disconnect(mObject, ("2" + mResponseSignal).toStdString().c_str(), mTimer, SLOT(stop()));
//disconnect(mTimer, &QTimer::timeout, this, &DmsAsyncAction::sendTimeoutSignal);
//disconnect(mObject, ("2" + mResponseSignal).toStdString().c_str(), mTimer, SLOT(stop()));
}
void DmsAsyncAction::setSendData(const QString& aData)

View File

@@ -30,9 +30,9 @@ DmsSyncAction::DmsSyncAction(int aServerId, int aActionId, QObject* aObject, con
DmsSyncAction::~DmsSyncAction()
{
disconnect(mObject, ("2" + mSignal).toStdString().c_str(), mLoop, SLOT(quit()));
disconnect(mObject, ("2" + mSignal).toStdString().c_str(), this, SLOT(saveActionResult(const QString&)));
disconnect(mTimer, &QTimer::timeout, mLoop, &QEventLoop::quit);
//disconnect(mObject, ("2" + mSignal).toStdString().c_str(), mLoop, SLOT(quit()));
//disconnect(mObject, ("2" + mSignal).toStdString().c_str(), this, SLOT(saveActionResult(const QString&)));
// disconnect(mTimer, &QTimer::timeout, mLoop, &QEventLoop::quit);
}
DmsSyncActionResult DmsSyncAction::execute()

View File

@@ -28,6 +28,11 @@ void InfoReceiveWorker::startListen()
QString myQString = QString::fromUtf8(reinterpret_cast<const char*>(copyData));
emit infoReceived(serverID, actionID, myQString);
}
if(mExitFlag)
{
break;
}
}
}
@@ -111,3 +116,10 @@ void InfoReceiveWorker::responsed(int aServerID, int aActionID)
break;
}
}
void InfoReceiveWorker::exit()
{
mExitFlag = true;
uint32_t cnt = 0;
dmsmq_send( USRV_SCAN, ACT_SCAN_STATUS, ( uint8_t* )( &cnt ), sizeof( cnt ) );
}

View File

@@ -9,6 +9,7 @@ class InfoReceiveWorker : public QObject
Q_OBJECT
public:
InfoReceiveWorker(QObject* aParent);
void exit();
public slots:
void startListen();
@@ -19,6 +20,9 @@ signals:
private:
void responsed(int aServerID, int aActionID);
private:
bool mExitFlag = false;
};
#endif // INFORECEIVEWORKER_H

View File

@@ -90,7 +90,7 @@ bool NetworkManager::isDHCP()
}
IpAddr NetworkManager::getDefaultIpAddr()
{
return IpAddr{mIpAddress, mSubNetMask};
return IpAddr{mIsDHCP, mIpAddress, mSubNetMask, mGateway};
}
QList<QStringList> NetworkManager::getIpAddrList()
{

View File

@@ -38,6 +38,7 @@ private:
bool mIsDHCP;
QString mIpAddress;
QString mSubNetMask;
QString mGateway;
};

View File

@@ -20,6 +20,11 @@
#include "dialogs/GetWorkListDialog.h"
#include "dialogs/PatientConfirmDialog.h"
#include "dialogs/AdminSPwdDialog.h"
#include "dialogs/WorklistSettingsDialog.h"
#include "dialogs/PacsSettingsDialog.h"
#include "dialogs/ReconSettingsDialog.h"
#include "dialogs/IpSettingsDialog.h"
#include "dialogs/MppsSettingsDialog.h"
#include "network/DicomCfgDialog.h"
#include "network/GetAdminPsw.h"
@@ -263,6 +268,18 @@ DialogResult DialogManager::requestSelectFilter()
return DialogResult(ret,dialog.getSelectedValue());
}
DialogResult DialogManager::requestSelectLockScreenTime()
{
SelectDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setWindowModality(Qt::WindowModal);
dialog.setValues(JsonObject::Instance()->lockScreenTimes());
dialog.setSelectedValue(JsonObject::Instance()->defaultLockScreenTime());
int ret = dialog.exec();
releaseTopWidget(&dialog);
return DialogResult(ret,dialog.getSelectedValue());
}
int DialogManager::requestEditDicomConfig()
{
DicomCfgDialog dialog(mTopWidget);
@@ -273,6 +290,46 @@ int DialogManager::requestEditDicomConfig()
return ret;
}
int DialogManager::requestWorklistSettings()
{
WorklistSettingsDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setWindowModality(Qt::WindowModal);
int ret = dialog.exec();
releaseTopWidget(&dialog);
return ret;
}
int DialogManager::requestPacsSettings()
{
PacsSettingsDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setWindowModality(Qt::WindowModal);
int ret = dialog.exec();
releaseTopWidget(&dialog);
return ret;
}
int DialogManager::requestReconSettings()
{
ReconSettingsDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setWindowModality(Qt::WindowModal);
int ret = dialog.exec();
releaseTopWidget(&dialog);
return ret;
}
int DialogManager::requestMppsSettings()
{
MppsSettingsDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setWindowModality(Qt::WindowModal);
int ret = dialog.exec();
releaseTopWidget(&dialog);
return ret;
}
DialogResult DialogManager::requestInputAdminPasswd()
{
GetAdminPsw dialog(mTopWidget);
@@ -285,7 +342,13 @@ DialogResult DialogManager::requestInputAdminPasswd()
int DialogManager::requestEditNetworkConfig()
{
NetworkCfgDialog dialog(mTopWidget);
// NetworkCfgDialog dialog(mTopWidget);
// setTopWidget(&dialog);
// dialog.setWindowModality(Qt::WindowModal);
// int ret = dialog.exec();
// releaseTopWidget(&dialog);
// return ret;
IpSettingsDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setWindowModality(Qt::WindowModal);
int ret = dialog.exec();
@@ -518,7 +581,7 @@ void DialogManager::clearMessageDialog() {
DialogManager::~DialogManager() {
clearMessageDialog();
delete mScreenSaverWindow;
//delete mScreenSaverWindow;
}
void DialogManager::raiseMultyMessageDialog(const QString& aMessage, MessageLevel aMessageLevel)

View File

@@ -60,7 +60,12 @@ public:
DialogResult requestSelectLanguage();
DialogResult requestSelectProtocal();
DialogResult requestSelectFilter();
DialogResult requestSelectLockScreenTime();
int requestEditDicomConfig();
int requestWorklistSettings();
int requestPacsSettings();
int requestReconSettings();
int requestMppsSettings();
DialogResult requestInputAdminPasswd();
int requestEditNetworkConfig();
int requestGetWorkList();

View File

@@ -0,0 +1,69 @@
#include "DicomSettingsArea.h"
#include "ui_DicomSettingsArea.h"
#include "utilities/InputFormatValidator.h"
DicomSettingsArea::DicomSettingsArea(QWidget *aParent)
: QWidget(aParent)
, mUI(new Ui::DicomSettingsArea)
{
mUI->setupUi(this);
mUI->mServerPort->setObjectName("DicomSettingsLabel");
mUI->mMyAETitle->setObjectName("DicomSettingsLabel");
}
DicomSettingsArea::~DicomSettingsArea()
{
delete mUI;
}
bool DicomSettingsArea::isIpAddressValid()
{
return InputFormatValidator::ValidateIpAddressFormat(mUI->mServerIpAddressEdit->text());
}
bool DicomSettingsArea::isPortValid()
{
return InputFormatValidator::ValidatePortFormat(mUI->mServerPortEdit->text());
}
void DicomSettingsArea::setServerIpAddress(const QString& aValue)
{
mUI->mServerIpAddressEdit->setText(aValue);
}
void DicomSettingsArea::setServerPort(const QString& aValue)
{
mUI->mServerPortEdit->setText(aValue);
}
void DicomSettingsArea::setMyAETitle(const QString& aValue)
{
mUI->mMyAETitleEdit->setText(aValue);
}
void DicomSettingsArea::setServerAETitle(const QString& aValue)
{
mUI->mServerAETitleEdit->setText(aValue);
}
QString DicomSettingsArea::getServerIpAddress()
{
return mUI->mServerIpAddressEdit->text();
}
QString DicomSettingsArea::getServerPort()
{
return mUI->mServerPortEdit->text();
}
QString DicomSettingsArea::getMyAETitle()
{
return mUI->mMyAETitleEdit->text();
}
QString DicomSettingsArea::getServerAETitle()
{
return mUI->mServerAETitleEdit->text();
}

View File

@@ -0,0 +1,35 @@
#ifndef DICOMSETTINGSAREA_H
#define DICOMSETTINGSAREA_H
#include <QWidget>
namespace Ui
{
class DicomSettingsArea;
}
class DicomSettingsArea : public QWidget
{
Q_OBJECT
public:
explicit DicomSettingsArea(QWidget* aParent = nullptr);
~DicomSettingsArea();
bool isIpAddressValid();
bool isPortValid();
QString getServerIpAddress();
QString getServerPort();
QString getMyAETitle();
QString getServerAETitle();
void setServerIpAddress(const QString& aValue);
void setServerPort(const QString& aValue);
void setMyAETitle(const QString& aValue);
void setServerAETitle(const QString& aValue);
private:
Ui::DicomSettingsArea* mUI;
};
#endif // DICOMSETTINGSAREA_H

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DicomSettingsArea</class>
<widget class="QWidget" name="DicomSettingsArea">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0">
<item row="0" column="0">
<widget class="QLabel" name="mMyAETitle">
<property name="minimumSize">
<size>
<width>165</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>AE</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ULineEdit" name="mServerAETitleEdit"/>
</item>
<item row="2" column="1">
<widget class="ULineEdit" name="mServerIpAddressEdit"/>
</item>
<item row="0" column="1">
<widget class="ULineEdit" name="mMyAETitleEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mServerIpAddress">
<property name="text">
<string>Server Ip</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mServerAETitle">
<property name="text">
<string>Server AE</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="ULineEdit" name="mServerPortEdit"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mServerPort">
<property name="text">
<string>Server Port</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ULineEdit</class>
<extends>QLineEdit</extends>
<header location="global">components/ULineEdit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,99 @@
#include "IpSettingsDialog.h"
#include "json/jsonobject.h"
#include "components/ImageSwitch.h"
#include "components/ULineEdit.h"
#include "utilities/InputFormatValidator.h"
#include <QLabel>
#include <QVBoxLayout>
IpSettingsDialog::IpSettingsDialog(QWidget* aParent, Qt::WindowFlags aFlag)
: GUIFormBaseDialog(aParent, aFlag)
, mErrorText(new QLabel(this))
, mDhcpButton(new ImageSwitch(this))
, mIpAddress(new ULineEdit(this))
, mSubnetMask(new ULineEdit(this))
, mGateway(new ULineEdit(this))
{
IpAddr addr = JsonObject::Instance()->getDefaultIpAddr();
mDhcpButton->setChecked(addr.dhcp);
mIpAddress->setText(addr.ip);
mSubnetMask->setText(addr.mask);
mGateway->setText(addr.gateway);
init();
}
IpSettingsDialog::~IpSettingsDialog()
{
}
bool IpSettingsDialog::updateReferenceData()
{
if(!InputFormatValidator::ValidateIpAddressFormat(mIpAddress->text()))
{
mErrorText->show();
mErrorText->setText("Ip Address is not valid");
return false;
}
if(!InputFormatValidator::ValidateIpAddressFormat(mSubnetMask->text()))
{
mErrorText->show();
mErrorText->setText("Subnet Mask is not valid");
return false;
}
if(!InputFormatValidator::ValidateIpAddressFormat(mGateway->text()))
{
mErrorText->show();
mErrorText->setText("Gateway is not valid");
return false;
}
return true;
}
void IpSettingsDialog::init()
{
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(10);
//Title
QLabel* title = new QLabel(this);
title->setAlignment(Qt::AlignCenter);
title->setText(tr("IP Settings"));
title->setObjectName("title");
layout->addWidget(title);
QWidget* contentWidget = new QWidget(this);
QGridLayout* contentLayout = new QGridLayout(contentWidget);
layout->addWidget(contentWidget);
QLabel* dhcpLabel = new QLabel(this);
dhcpLabel->setText("DHCP");
contentLayout->addWidget(dhcpLabel,0,0);
//ImageSwitch* dhcpButton = new ImageSwitch(this);
contentLayout->addWidget(mDhcpButton,0,1);
QLabel* ipAddressLabel = new QLabel(this);
ipAddressLabel->setText(tr("IP Address"));
contentLayout->addWidget(ipAddressLabel);
contentLayout->addWidget(mIpAddress);
QLabel* subnetMaskLabel = new QLabel(this);
subnetMaskLabel->setText(tr("Subnet Mask"));
contentLayout->addWidget(subnetMaskLabel);
contentLayout->addWidget(mSubnetMask);
QLabel* gatewayLabel = new QLabel(this);
gatewayLabel->setText(tr("Gateway"));
contentLayout->addWidget(gatewayLabel);
contentLayout->addWidget(mGateway);
QLabel* endline = new QLabel(this);
endline->setFixedHeight(3);
endline->setObjectName("endline");
layout->addWidget(endline);
layout->addWidget(mErrorText);
mErrorText->setObjectName("warn");
mErrorText->hide();
}

View File

@@ -0,0 +1,32 @@
#ifndef IPSETTINGSDIALOG_H
#define IPSETTINGSDIALOG_H
#include "dialogs/GUIFormBaseDialog.h"
class QLabel;
class ImageSwitch;
class ULineEdit;
class IpSettingsDialog : public GUIFormBaseDialog
{
Q_OBJECT
public:
IpSettingsDialog(QWidget* aParent = nullptr, Qt::WindowFlags aFlag = Qt::WindowFlags());
~IpSettingsDialog() override;
protected:
bool updateReferenceData() override;
private:
void init();
private:
QLabel* mErrorText;
ImageSwitch* mDhcpButton;
ULineEdit* mIpAddress;
ULineEdit* mSubnetMask;
ULineEdit* mGateway;
};
#endif // IPSETTINGSDIALOG_H

View File

@@ -0,0 +1,109 @@
#include "MppsSettingsDialog.h"
#include "components/ULineEdit.h"
#include "dialogs/DicomSettingsArea.h"
#include "json/jsonobject.h"
#include <QVBoxLayout>
#include <QLabel>
namespace
{
const int ENDLINE_SPACE = 3;
}
MppsSettingsDialog::MppsSettingsDialog(QWidget* aParent, Qt::WindowFlags aWindowFlag)
: GUIFormBaseDialog(aParent, aWindowFlag)
, mSettingsArea(new DicomSettingsArea(this))
, mErrorText(new QLabel(this))
{
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(10);
//Title
QLabel* title = new QLabel(this);
title->setAlignment(Qt::AlignCenter);
title->setText(tr("Mpps Settings"));
title->setObjectName("title");
layout->addWidget(title);
layout->addWidget(mSettingsArea);
QLabel* endline = new QLabel(this);
endline->setFixedHeight(ENDLINE_SPACE);
endline->setObjectName("endline");
layout->addWidget(endline);
layout->addWidget(mErrorText);
mErrorText->setObjectName("warn");
mErrorText->hide();
initConfig();
}
MppsSettingsDialog::~MppsSettingsDialog()
{
}
void MppsSettingsDialog::initConfig()
{
host serverInfo;
serverInfo = JsonObject::Instance()->getServer(JsonObject::MPPS);
mSettingsArea->setServerAETitle(serverInfo.ae);
mSettingsArea->setServerIpAddress(serverInfo.ip);
mSettingsArea->setMyAETitle(serverInfo.name);
mSettingsArea->setServerPort(serverInfo.port);
}
bool MppsSettingsDialog::updateReferenceData()
{
QString myAETitle = mSettingsArea->getMyAETitle();
QString serverIp = mSettingsArea->getServerIpAddress();
QString serverPort = mSettingsArea->getServerPort();
QString serverAETitle = mSettingsArea->getServerAETitle();
mErrorText->show();
if(myAETitle.isEmpty())
{
mErrorText->setText(tr("AE can't be empty"));
return false;
}
if(serverAETitle.isEmpty())
{
mErrorText->setText(tr("Server AE can't be empty"));
return false;
}
if(serverIp.isEmpty())
{
mErrorText->setText(tr("Server Ip can't be empty"));
return false;
}
if(serverPort.isEmpty())
{
mErrorText->setText(tr("Server Port can't be empty"));
return false;
}
if(!mSettingsArea->isIpAddressValid())
{
mErrorText->setText(tr("Ip Address is not valid"));
return false;
}
if(!mSettingsArea->isPortValid())
{
mErrorText->setText(tr("Port is not valid"));
return false;
}
host serverInfo;
serverInfo.ip = serverIp;
serverInfo.ae = serverAETitle;
serverInfo.name = myAETitle;
serverInfo.port = serverPort;
JsonObject::Instance()->setServer(JsonObject::MPPS, serverInfo);
return true;
}

View File

@@ -0,0 +1,27 @@
#ifndef MPPSSETTINGSDIALOG_H
#define MPPSSETTINGSDIALOG_H
#include "dialogs/GUIFormBaseDialog.h"
class DicomSettingsArea;
class QLabel;
class MppsSettingsDialog : public GUIFormBaseDialog
{
Q_OBJECT
public:
MppsSettingsDialog(QWidget* aParent = nullptr, Qt::WindowFlags aFlag = Qt::WindowFlags());
~MppsSettingsDialog() override;
protected:
bool updateReferenceData() override;
private:
void initConfig();
private:
DicomSettingsArea* mSettingsArea;
QLabel* mErrorText;
};
#endif // MPPSSETTINGSDIALOG_H

View File

@@ -0,0 +1,106 @@
#include "PacsSettingsDialog.h"
#include "dialogs/DicomSettingsArea.h"
#include "json/jsonobject.h"
#include <QVBoxLayout>
#include <QLabel>
namespace
{
const int ENDLINE_SPACE = 3;
}
PacsSettingsDialog::PacsSettingsDialog(QWidget* aParent, Qt::WindowFlags aWindowFlag)
: GUIFormBaseDialog(aParent, aWindowFlag)
, mSettingsArea(new DicomSettingsArea(this))
, mErrorText(new QLabel(this))
{
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(10);
//Title
QLabel* title = new QLabel(this);
title->setAlignment(Qt::AlignCenter);
title->setText(tr("PACS Settings"));
title->setObjectName("title");
layout->addWidget(title);
layout->addWidget(mSettingsArea);
QLabel* endline = new QLabel(this);
endline->setFixedHeight(ENDLINE_SPACE);
endline->setObjectName("endline");
layout->addWidget(endline);
layout->addWidget(mErrorText);
mErrorText->setObjectName("warn");
mErrorText->hide();
initConfig();
}
PacsSettingsDialog::~PacsSettingsDialog()
{
}
void PacsSettingsDialog::initConfig()
{
host serverInfo;
serverInfo = JsonObject::Instance()->getServer(JsonObject::PACS);
mSettingsArea->setServerAETitle(serverInfo.ae);
mSettingsArea->setServerIpAddress(serverInfo.ip);
mSettingsArea->setMyAETitle(serverInfo.name);
mSettingsArea->setServerPort(serverInfo.port);
}
bool PacsSettingsDialog::updateReferenceData()
{
QString myAETitle = mSettingsArea->getMyAETitle();
QString serverIp = mSettingsArea->getServerIpAddress();
QString serverPort = mSettingsArea->getServerPort();
QString serverAETitle = mSettingsArea->getServerAETitle();
mErrorText->show();
if(myAETitle.isEmpty())
{
mErrorText->setText(tr("AE can't be empty"));
return false;
}
if(serverAETitle.isEmpty())
{
mErrorText->setText(tr("Server AE can't be empty"));
return false;
}
if(serverIp.isEmpty())
{
mErrorText->setText(tr("Server Ip can't be empty"));
return false;
}
if(serverPort.isEmpty())
{
mErrorText->setText(tr("Server Port can't be empty"));
return false;
}
if(!mSettingsArea->isIpAddressValid())
{
mErrorText->setText(tr("Ip Address is not valid"));
return false;
}
if(!mSettingsArea->isPortValid())
{
mErrorText->setText(tr("Port is not valid"));
return false;
}
host serverInfo;
serverInfo.ip = serverIp;
serverInfo.ae = serverAETitle;
serverInfo.name = myAETitle;
serverInfo.port = serverPort;
JsonObject::Instance()->setServer(JsonObject::PACS, serverInfo);
return true;
}

View File

@@ -0,0 +1,28 @@
#ifndef PACSSETTINGSDIALOG_H
#define PACSSETTINGSDIALOG_H
#include "dialogs/GUIFormBaseDialog.h"
class DicomSettingsArea;
class QLabel;
class PacsSettingsDialog : public GUIFormBaseDialog
{
Q_OBJECT
public:
PacsSettingsDialog(QWidget* aParent = nullptr, Qt::WindowFlags aFlag = Qt::WindowFlags());
~PacsSettingsDialog() override;
protected:
bool updateReferenceData() override;
private:
void initConfig();
private:
DicomSettingsArea* mSettingsArea;
QLabel* mErrorText;
};
#endif // PACSSETTINGSDIALOG_H

View File

@@ -0,0 +1,107 @@
#include "ReconSettingsDialog.h"
#include "components/ULineEdit.h"
#include "dialogs/DicomSettingsArea.h"
#include "json/jsonobject.h"
#include <QVBoxLayout>
#include <QLabel>
namespace
{
const int ENDLINE_SPACE = 3;
}
ReconSettingsDialog::ReconSettingsDialog(QWidget* aParent, Qt::WindowFlags aWindowFlag)
: GUIFormBaseDialog(aParent, aWindowFlag)
, mSettingsArea(new DicomSettingsArea(this))
, mErrorText(new QLabel(this))
{
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(10);
//Title
QLabel* title = new QLabel(this);
title->setAlignment(Qt::AlignCenter);
title->setText(tr("Recon Settings"));
title->setObjectName("title");
layout->addWidget(title);
layout->addWidget(mSettingsArea);
QLabel* endline = new QLabel(this);
endline->setFixedHeight(ENDLINE_SPACE);
endline->setObjectName("endline");
layout->addWidget(endline);
layout->addWidget(mErrorText);
mErrorText->setObjectName("warn");
mErrorText->hide();
initConfig();
}
ReconSettingsDialog::~ReconSettingsDialog()
{
}
void ReconSettingsDialog::initConfig()
{
host serverInfo;
serverInfo = JsonObject::Instance()->getServer(JsonObject::RECON);
mSettingsArea->setServerAETitle(serverInfo.ae);
mSettingsArea->setServerIpAddress(serverInfo.ip);
mSettingsArea->setMyAETitle(serverInfo.name);
mSettingsArea->setServerPort(serverInfo.port);
}
bool ReconSettingsDialog::updateReferenceData()
{
QString myAETitle = mSettingsArea->getMyAETitle();
QString serverIp = mSettingsArea->getServerIpAddress();
QString serverPort = mSettingsArea->getServerPort();
QString serverAETitle = mSettingsArea->getServerAETitle();
mErrorText->show();
if(myAETitle.isEmpty())
{
mErrorText->setText(tr("AE can't be empty"));
return false;
}
if(serverAETitle.isEmpty())
{
mErrorText->setText(tr("Server AE can't be empty"));
return false;
}
if(serverIp.isEmpty())
{
mErrorText->setText(tr("Server Ip can't be empty"));
return false;
}
if(serverPort.isEmpty())
{
mErrorText->setText(tr("Server Port can't be empty"));
return false;
}
if(!mSettingsArea->isIpAddressValid())
{
mErrorText->setText(tr("Ip Address is not valid"));
return false;
}
if(!mSettingsArea->isPortValid())
{
mErrorText->setText(tr("Port is not valid"));
return false;
}
host serverInfo;
serverInfo.ip = serverIp;
serverInfo.ae = serverAETitle;
serverInfo.name = myAETitle;
serverInfo.port = serverPort;
JsonObject::Instance()->setServer(JsonObject::RECON, serverInfo);
return true;
}

View File

@@ -0,0 +1,28 @@
#ifndef RECONSETTINGSDIALOG_H
#define RECONSETTINGSDIALOG_H
#include "dialogs/GUIFormBaseDialog.h"
class DicomSettingsArea;
class QLabel;
class ReconSettingsDialog : public GUIFormBaseDialog
{
Q_OBJECT
public:
ReconSettingsDialog(QWidget* aParent = nullptr, Qt::WindowFlags aFlag = Qt::WindowFlags());
~ReconSettingsDialog() override;
protected:
bool updateReferenceData() override;
private:
void initConfig();
private:
DicomSettingsArea* mSettingsArea;
QLabel* mErrorText;
};
#endif // RECONSETTINGSDIALOG_H

View File

@@ -0,0 +1,107 @@
#include "WorklistSettingsDialog.h"
#include "components/ULineEdit.h"
#include "dialogs/DicomSettingsArea.h"
#include "json/jsonobject.h"
#include <QVBoxLayout>
#include <QLabel>
namespace
{
const int ENDLINE_SPACE = 3;
}
WorklistSettingsDialog::WorklistSettingsDialog(QWidget* aParent, Qt::WindowFlags aWindowFlag)
: GUIFormBaseDialog(aParent, aWindowFlag)
, mSettingsArea(new DicomSettingsArea(this))
, mErrorText(new QLabel(this))
{
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(10);
//Title
QLabel* title = new QLabel(this);
title->setAlignment(Qt::AlignCenter);
title->setText(tr("Worklist Settings"));
title->setObjectName("title");
layout->addWidget(title);
layout->addWidget(mSettingsArea);
QLabel* endline = new QLabel(this);
endline->setFixedHeight(ENDLINE_SPACE);
endline->setObjectName("endline");
layout->addWidget(endline);
layout->addWidget(mErrorText);
mErrorText->setObjectName("warn");
mErrorText->hide();
initConfig();
}
WorklistSettingsDialog::~WorklistSettingsDialog()
{
}
void WorklistSettingsDialog::initConfig()
{
host serverInfo;
serverInfo = JsonObject::Instance()->getServer(JsonObject::WORKLIST);
mSettingsArea->setServerAETitle(serverInfo.ae);
mSettingsArea->setServerIpAddress(serverInfo.ip);
mSettingsArea->setMyAETitle(serverInfo.name);
mSettingsArea->setServerPort(serverInfo.port);
}
bool WorklistSettingsDialog::updateReferenceData()
{
QString myAETitle = mSettingsArea->getMyAETitle();
QString serverIp = mSettingsArea->getServerIpAddress();
QString serverPort = mSettingsArea->getServerPort();
QString serverAETitle = mSettingsArea->getServerAETitle();
mErrorText->show();
if(myAETitle.isEmpty())
{
mErrorText->setText(tr("AE can't be empty"));
return false;
}
if(serverAETitle.isEmpty())
{
mErrorText->setText(tr("Server AE can't be empty"));
return false;
}
if(serverIp.isEmpty())
{
mErrorText->setText(tr("Server Ip can't be empty"));
return false;
}
if(serverPort.isEmpty())
{
mErrorText->setText(tr("Server Port can't be empty"));
return false;
}
if(!mSettingsArea->isIpAddressValid())
{
mErrorText->setText(tr("Ip Address is not valid"));
return false;
}
if(!mSettingsArea->isPortValid())
{
mErrorText->setText(tr("Port is not valid"));
return false;
}
host serverInfo;
serverInfo.ip = serverIp;
serverInfo.ae = serverAETitle;
serverInfo.name = myAETitle;
serverInfo.port = serverPort;
JsonObject::Instance()->setServer(JsonObject::WORKLIST, serverInfo);
return true;
}

View File

@@ -0,0 +1,27 @@
#ifndef WORKLISTSETTINGSDIALOG_H
#define WORKLISTSETTINGSDIALOG_H
#include "dialogs/GUIFormBaseDialog.h"
class DicomSettingsArea;
class QLabel;
class WorklistSettingsDialog : public GUIFormBaseDialog
{
Q_OBJECT
public:
WorklistSettingsDialog(QWidget* aParent = nullptr, Qt::WindowFlags aFlag = Qt::WindowFlags());
~WorklistSettingsDialog() override;
protected:
bool updateReferenceData() override;
private:
void initConfig();
private:
DicomSettingsArea* mSettingsArea;
QLabel* mErrorText;
};
#endif // WORKLISTSETTINGSDIALOG_H

View File

@@ -7,6 +7,7 @@
#include <QDebug>
#include <QLabel>
#include <QEvent>
#include <QThread>
#include "event/EventCenter.h"
#include "json/jsonobject.h"
@@ -15,7 +16,10 @@
#include "utilities/LanguageSwitcher.h"
#include "components/ULineEdit.h"
#include "components/ListBox.h"
#include "components/ImageSwitch.h"
#include "components/BatteryWidget.h"
#include "log/UserOperationLog.h"
#include "utilities/DiskInfoWorker.h"
namespace
{
@@ -50,19 +54,19 @@ namespace
GeneralForm::GeneralForm(QWidget* aParent)
: QWidget(aParent)
, mLayout(new QVBoxLayout(this))
, mDiskInfoCaller(nullptr)
, mDiskSize(0)
, mDiskUsedSize(0)
, mDiskSizeFlag(false)
, mDiskUsedSizeFlag(false)
, mDiskInfoWorker(new DiskInfoWorker())
, mDiskIcon(new BatteryWidget(this))
, mDiskSizeLabel(new QLabel(this))
, mDiskUsedLabel(new QLabel(this))
{
setFocusPolicy(Qt::ClickFocus);
QWidget* lanHeader = new QWidget(this);
mLayout->addWidget(lanHeader);
QHBoxLayout* lanHeaderLayout = new QHBoxLayout(lanHeader);
QLabel* languageLabel = new QLabel(tr("Language"));
lanHeaderLayout->addWidget(languageLabel);
QToolButton* btnLan = new ListBox(lanHeader);
lanHeaderLayout->addWidget(btnLan);
lanHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
//Institution
QWidget* instHeader = new QWidget(this);
mLayout->addWidget(instHeader);
QHBoxLayout* instHeaderLayout = new QHBoxLayout(instHeader);
@@ -72,7 +76,6 @@ GeneralForm::GeneralForm(QWidget* aParent)
instName->setMaximumSize(QSize(300, 32768));
instHeaderLayout->addWidget(instName);
instHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Fixed));
QLabel* institutionAddressLabel = new QLabel(tr("Institution Addr"));
instHeaderLayout->addWidget(institutionAddressLabel);
QLineEdit* instAddr = new ULineEdit(instHeader);
@@ -80,42 +83,111 @@ GeneralForm::GeneralForm(QWidget* aParent)
instAddr->setMaximumSize(QSize(300, 32768));
instHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
//Language
QWidget* lanHeader = new QWidget(this);
mLayout->addWidget(lanHeader);
QHBoxLayout* lanHeaderLayout = new QHBoxLayout(lanHeader);
QLabel* languageLabel = new QLabel(tr("Language"));
lanHeaderLayout->addWidget(languageLabel);
lanHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
QToolButton* btnLan = new ListBox(lanHeader);
lanHeaderLayout->addWidget(btnLan);
lanHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
//Lock Screen
QWidget* lockHeader = new QWidget(this);
mLayout->addWidget(lockHeader);
QHBoxLayout* lockHeaderLayout = new QHBoxLayout(lockHeader);
QLabel* lockScreenLabel = new QLabel(tr("Lock Screen"));
lockHeaderLayout->addWidget(lockScreenLabel);
lockHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
ListBox* lockTime = new ListBox(lockHeader);
lockHeaderLayout->addWidget(lockTime);
lockHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
lockHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
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)
{
LOG_USER_OPERATION("Shut Down")
EventCenter::Default()->triggerEvent(GUIEvents::RequestShutdown, nullptr, nullptr);
}
});
//Scan Protocol
QWidget* scanProtocolHeader = new QWidget(this);
mLayout->addWidget(scanProtocolHeader);
QHBoxLayout* scanProtocalHeaderLayout = new QHBoxLayout(scanProtocolHeader);
QLabel* scanProtocolLabel = new QLabel(tr("Scan Protocol"), this);
scanProtocalHeaderLayout->addWidget(scanProtocolLabel);
scanProtocalHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
ListBox* scanProtocolButton = new ListBox(scanProtocolHeader);
scanProtocolButton->setText(tr(JsonObject::Instance()->defaultProtocal().toStdString().c_str()));
scanProtocalHeaderLayout->addWidget(scanProtocolButton);
scanProtocalHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
//Complete Notify
QWidget* scanCompleteHeader = new QWidget(this);
mLayout->addWidget(scanCompleteHeader);
QHBoxLayout* scanCompleteHeaderLayout = new QHBoxLayout(scanCompleteHeader);
auto scanCompleteButton = new ImageSwitch(this);
auto scanCompleteLabel = new QLabel(this);
scanCompleteLabel->setText(tr("Complete Notify"));
scanCompleteHeaderLayout->addWidget(scanCompleteLabel);
scanCompleteHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
scanCompleteHeaderLayout->addWidget(scanCompleteButton);
scanCompleteButton->setChecked(JsonObject::Instance()->getCompleteNotify());
scanCompleteHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
//Anonymous
QWidget* anonyHeader = new QWidget(this);
mLayout->addWidget(anonyHeader);
QHBoxLayout* anonyHeaderLayout = new QHBoxLayout(anonyHeader);
QLabel* anonyLabel = new QLabel(tr("Anonymous Mode"), this);
anonyHeaderLayout->addWidget(anonyLabel);
anonyHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
ImageSwitch* anonyButton = new ImageSwitch(anonyHeader);
anonyButton->setChecked(JsonObject::Instance()->getAnonymousMode());
anonyHeaderLayout->addWidget(anonyButton);
anonyHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
//Screen Saver
QWidget* screenSaverHeader = new QWidget(this);
mLayout->addWidget(screenSaverHeader);
QHBoxLayout* screenSaverHeaderLayout = new QHBoxLayout(screenSaverHeader);
QLabel* screenSaverLabel = new QLabel(tr("Screen Saver"), this);
screenSaverHeaderLayout->addWidget(screenSaverLabel);
screenSaverHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
ImageSwitch* screenSaverButton = new ImageSwitch(screenSaverHeader);
screenSaverButton->setChecked(JsonObject::Instance()->getScreenSaverMode());
screenSaverHeaderLayout->addWidget(screenSaverButton);
screenSaverHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
//DiskIcon
QWidget* diskHeader = new QWidget(this);
QWidget* diskContent = new QWidget(this);
QWidget* diskLabelContent = new QWidget(this);
mLayout->addWidget(diskHeader);
QVBoxLayout* diskHeaderLayout = new QVBoxLayout(diskHeader);
QHBoxLayout* diskContentLayout = new QHBoxLayout(diskContent);
QVBoxLayout* diskLabelContentLayout = new QVBoxLayout(diskLabelContent);
diskLabelContentLayout->addWidget(mDiskSizeLabel);
diskLabelContentLayout->addWidget(mDiskUsedLabel);
diskContentLayout->addWidget(mDiskIcon);
diskContentLayout->addWidget(diskLabelContent);
auto diskLabel = new QLabel(this);
diskLabel->setText(tr("Disk Storage"));
diskHeaderLayout->addWidget(diskLabel);
diskHeaderLayout->addWidget(diskContent);
mDiskInfoCaller = new QThread(this);
mDiskInfoWorker->moveToThread(mDiskInfoCaller);
connect(mDiskInfoWorker, &DiskInfoWorker::diskInfoBack, this, &GeneralForm::updateDiskInfo);
connect(mDiskInfoWorker, &DiskInfoWorker::diskInfoInit, this, &GeneralForm::initDiskInfo);
connect(mDiskInfoCaller, &QThread::finished, mDiskInfoWorker, &DiskInfoWorker::deleteLater);
mDiskInfoCaller->start();
QMetaObject::invokeMethod(mDiskInfoWorker, "initDiskInfo", Qt::QueuedConnection);
//...
mLayout->addSpacerItem(new QSpacerItem(20, 300, QSizePolicy::Minimum, QSizePolicy::Expanding));
//init
btnLan->setText(JsonObject::Instance()->defaultLanguage());
btnLan->setText(tr(JsonObject::Instance()->defaultLanguage().toStdString().c_str()));
instName->setText(JsonObject::Instance()->institutionName());
instAddr->setText(JsonObject::Instance()->institutionAddr());
lockTime->setText(toTimeString(JsonObject::Instance()->lockScreenTimeout().toInt()));
lockTime->setText(tr(JsonObject::Instance()->defaultLockScreenTime().toStdString().c_str()));
//connection
connect(instName, &QLineEdit::textChanged, [=](const QString& str)
{
@@ -129,30 +201,30 @@ GeneralForm::GeneralForm(QWidget* aParent)
connect(lockTime, &QToolButton::clicked, [=]()
{
//take effect
int second = JsonObject::Instance()->lockScreenTimeout().toInt();
DialogResult result = DialogManager::Default()->requestSelectTime(second);
//int second = JsonObject::Instance()->lockScreenTimeout().toInt();
DialogResult result = DialogManager::Default()->requestSelectLockScreenTime();
if (result.ResultCode == false)
{
return;
}
second = result.ResultData.toInt();
LOG_USER_OPERATION(QString("Set Screen Lock Time to %1 seconds").arg(second))
if(second == 0)
{
JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
lockTime->setText(toTimeString(second));
Locker::getInstance()->setTimer(-1);
Locker::getInstance()->setIsEnable(false);
return;
}
//second = result.ResultData.toInt();
//LOG_USER_OPERATION(QString("Set Screen Lock Time to %1 seconds").arg(second))
// if(second == 0)
// {
// JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
// lockTime->setText(toTimeString(second));
// Locker::getInstance()->setTimer(-1);
// 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));
}
// if (MINIMUM_LOCKTIME < second)
// {
// JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
// Locker::getInstance()->setTimer(second * 1000);
// Locker::getInstance()->setIsEnable(true);
// lockTime->setText(toTimeString(second));
// }
});
@@ -166,7 +238,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
//take effect
JsonObject::Instance()->setDefaultLanguage(language);
LanguageSwitcher::getInstance()->setDefaultLanguage(language);
btnLan->setText(JsonObject::Instance()->defaultLanguage());
btnLan->setText(tr(JsonObject::Instance()->defaultLanguage().toStdString().c_str()));
LOG_USER_OPERATION(QString("Change Language to %1").arg(language))
}
});
@@ -177,5 +249,95 @@ GeneralForm::GeneralForm(QWidget* aParent)
institutionNameLabel->setText(tr("Institution Addr"));
institutionAddressLabel->setText(tr("Institution Addr"));
lockScreenLabel->setText(tr("Lock Screen"));
scanProtocolLabel->setText(tr("Scan Protocol"));
scanCompleteLabel->setText(tr("Complete Notify"));
anonyLabel->setText(tr("Anonymous Mode"));
screenSaverLabel->setText(tr("Screen Saver"));
diskLabel->setText(tr("Disk Storage"));
anonyButton->setChecked(JsonObject::Instance()->getAnonymousMode());
scanProtocolButton->setText(tr(JsonObject::Instance()->defaultProtocal().toStdString().c_str()));
updateStorageSize();
updateStorageUsed();
});
connect(anonyButton, &ImageSwitch::clicked, [=]() {
JsonObject::Instance()->setAnonymousMode(anonyButton->getChecked());
EventCenter::Default()->triggerEvent(AnonymousModeChanged,this,nullptr);
});
connect(screenSaverButton, &ImageSwitch::clicked, [=]() {
JsonObject::Instance()->setScreenSaverMode(screenSaverButton->getChecked());
});
connect(scanProtocolButton, &QPushButton::clicked, [=]()
{
DialogResult result = DialogManager::Default()->requestSelectProtocal();
if (result.ResultCode == QDialog::Accepted)
{
QString pro = result.ResultData.toString();
//take effect
JsonObject::Instance()->setDefaultProtocal(pro);
scanProtocolButton->setText(tr(JsonObject::Instance()->defaultProtocal().toStdString().c_str()));
}
});
connect(scanCompleteButton, &ImageSwitch::clicked, [=]()
{
JsonObject::Instance()->setCompleteNotify(scanCompleteButton->getChecked());
});
}
GeneralForm::~GeneralForm()
{
mDiskInfoCaller->quit();
mDiskInfoCaller->wait();
mDiskInfoCaller->deleteLater();
}
void GeneralForm::initDiskInfo(bool aFlag, double aTotalSize, double aUsedSize)
{
mDiskSizeFlag = aFlag;
mDiskSize = aTotalSize;
mDiskUsedSize = aUsedSize;
mDiskUsedSizeFlag = aFlag;
updateStorageSize();
updateStorageUsed();
QMetaObject::invokeMethod(mDiskIcon, "startAnimation", Qt::DirectConnection);
}
void GeneralForm::updateDiskInfo(bool aFlag, double aUsedSize)
{
mDiskUsedSizeFlag = aFlag;
mDiskUsedSize = aUsedSize;
updateStorageUsed();
QMetaObject::invokeMethod(mDiskIcon, "startAnimation", Qt::DirectConnection);
}
void GeneralForm::updateStorageUsed()
{
if (mDiskUsedSizeFlag)
{
mDiskIcon->setValue(mDiskUsedSize);
mDiskUsedLabel->setText(tr("Used:\t%1G").arg(mDiskUsedSize));
}
else
{
mDiskUsedLabel->setText(tr("Get disk used size fail!"));
}
}
void GeneralForm::updateStorageSize()
{
if (mDiskSizeFlag)
{
mDiskIcon->setMaxValue(mDiskSize);
double aValue = JsonObject::Instance()->storageAlarmSize().toDouble();
mDiskIcon->setAlarmValue(aValue);
mDiskSizeLabel->setText(tr("Total:\t%1G").arg(mDiskSize));
}
else
{
mDiskSizeLabel->setText(tr("Get disk total size fail!"));
}
}

View File

@@ -4,6 +4,9 @@
#include <QWidget>
class QVBoxLayout;
class DiskInfoWorker;
class BatteryWidget;
class QLabel;
class GeneralForm : public QWidget
{
@@ -11,9 +14,27 @@ class GeneralForm : public QWidget
public:
explicit GeneralForm(QWidget* aParent = nullptr);
~GeneralForm();
private:
void updateStorageSize();
void updateStorageUsed();
void updateDiskInfo(bool aFlag, double aUsedSize);
void initDiskInfo(bool aFlag, double aTotalSize, double aUsedSize);
private:
QVBoxLayout* mLayout;
QThread* mDiskInfoCaller;
double mDiskSize;
double mDiskUsedSize;
bool mDiskSizeFlag;
bool mDiskUsedSizeFlag;
DiskInfoWorker* mDiskInfoWorker;
BatteryWidget* mDiskIcon;
QLabel* mDiskSizeLabel;
QLabel* mDiskUsedLabel;
};
#endif // GENERALFORM_H

View File

@@ -0,0 +1,28 @@
#include "HelpForm.h"
#include <QWebEngineView>
#include <QWebChannel>
#include <QWebEnginePage>
#include <QVBoxLayout>
#include <QWebEngineProfile>
HelpForm::HelpForm(QWidget* aParent)
: QWidget(aParent)
, mPdfWidget(new QWebEngineView(this))
{
init();
}
HelpForm::~HelpForm()
{
}
void HelpForm::init()
{
mPdfWidget->setUrl(QUrl("file:///home/sun/GUI/web/web/viewer.html?file=file:///home/sun/GUI/web/web/compressed.tracemonkey-pldi-09.pdf"));
QWebChannel * channel = new QWebChannel(this);
channel->registerObject(QStringLiteral("communicator"), new QObject(this));
mPdfWidget->page()->setWebChannel(channel);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(mPdfWidget);
}

View File

@@ -0,0 +1,23 @@
#ifndef HELPFORM_H
#define HELPFORM_H
#include <QWidget>
class QWebEngineView;
class HelpForm : public QWidget
{
Q_OBJECT
public:
explicit HelpForm(QWidget* aParent = nullptr);
~HelpForm();
private:
void init();
private:
QWebEngineView* mPdfWidget;
};
#endif // HELPFORM_H

View File

@@ -7,6 +7,7 @@
#include <QHBoxLayout>
#include <QStackedWidget>
#include <QStringListModel>
#include <QListWidgetItem>
#include <QListWidget>
#include "ui_TabFormWidget.h"
@@ -18,6 +19,8 @@
#include "json/jsonobject.h"
#include "AboutForm.h"
#include "UserOperationLogForm.h"
#include "SystemCorrectionForm.h"
#include "HelpForm.h"
SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
: TabFormWidget(aParent)
@@ -30,7 +33,7 @@ SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
widget->setObjectName("LeftBtnBar");
widget->setFixedWidth(250);
QStringList menus;
menus << tr("General") << tr("Account") << tr("System") << tr("About") << tr("Operation Log");
menus << tr("System Correction") << tr("Network Settings") << tr("General") << tr("Operation Log") << tr("Account") << tr("About") << tr("Help");
widget->addItems(menus);
widget->setSpacing(3);
for (int i = 0; i < menus.count(); ++i)
@@ -39,7 +42,7 @@ SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
}
layout->addWidget(widget);
//reset visible for AnonymousMode
widget->item(4)->setHidden(JsonObject::Instance()->getAnonymousMode());
widget->item(3)->setHidden(JsonObject::Instance()->getAnonymousMode());
QStackedWidget* stackedWidget = new QStackedWidget(ui->contentWidget);
QWidget* spacerLine = new QWidget(this);
@@ -48,31 +51,44 @@ SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
layout->addWidget(stackedWidget);
ui->commandWidget->hide();
GeneralForm* generalForm = new GeneralForm(ui->commandWidget);
stackedWidget->addWidget(generalForm);
AccountTableForm* acc = new AccountTableForm(ui->commandWidget);
stackedWidget->addWidget(acc);
SystemCorrectionForm* systemCorrectionForm = new SystemCorrectionForm(ui->commandWidget);
stackedWidget->addWidget(systemCorrectionForm);
SystemSettingForm* systemSetting = new SystemSettingForm(ui->commandWidget);
stackedWidget->addWidget(systemSetting);
AboutForm* about = new AboutForm(ui->commandWidget);
stackedWidget->addWidget(about);
GeneralForm* generalForm = new GeneralForm(ui->commandWidget);
stackedWidget->addWidget(generalForm);
UserOperationLogForm* operationLog = new UserOperationLogForm(ui->commandWidget);
stackedWidget->addWidget(operationLog);
AccountTableForm* acc = new AccountTableForm(ui->commandWidget);
stackedWidget->addWidget(acc);
AboutForm* about = new AboutForm(ui->commandWidget);
stackedWidget->addWidget(about);
//HelpForm* help = new HelpForm(ui->commandWidget);
//stackedWidget->addWidget(help);
widget->setCurrentRow(0);
connect(widget, &QListWidget::currentRowChanged, [=](int rowindex) {
connect(widget, &QListWidget::currentRowChanged, [=](int rowindex)
{
if(widget->item(rowindex)->text() == tr("Help") && stackedWidget->widget(rowindex) == nullptr)
{
stackedWidget->addWidget(new HelpForm(ui->commandWidget));
}
stackedWidget->setCurrentIndex(rowindex);
});
connect(EventCenter::Default(), &EventCenter::AnonymousModeChanged, [=]() {
widget->item(4)->setHidden(JsonObject::Instance()->getAnonymousMode());
connect(EventCenter::Default(), &EventCenter::AnonymousModeChanged, [=]()
{
widget->item(3)->setHidden(JsonObject::Instance()->getAnonymousMode());
});
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]()
{
QStringList menus;
menus << tr("General") << tr("Account") << tr("System") << tr("About") << tr("Operation Log");
menus << tr("System Correction") << tr("Network Settings") << tr("General") << tr("Operation Log") << tr("Account") << tr("About") << tr("Help") ;
widget->clear();
widget->addItems(menus);
for (int i = 0; i < menus.count(); ++i)

View File

@@ -0,0 +1,99 @@
#include "SystemCorrectionForm.h"
#include "db/SQLHelper.h"
#include "event/EventCenter.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QDate>
#include <QSpacerItem>
#include <QPushButton>
SystemCorrectionForm::SystemCorrectionForm(QWidget* aParent)
: QWidget(aParent)
{
setObjectName("SystemCorrectionForm");
init();
}
SystemCorrectionForm::~SystemCorrectionForm()
{
}
void SystemCorrectionForm::init()
{
QVBoxLayout* vboxLayout = new QVBoxLayout(this);
QLabel* title = new QLabel(this);
title->setObjectName("SystemCorrectionTitle");
title->setAlignment(Qt::AlignLeft);
title->setText(tr("Scan Preparation"));
vboxLayout->addWidget(title);
QLabel* endline = new QLabel(this);
endline->setObjectName("endline");
endline->setFixedHeight(3);
vboxLayout->addWidget(endline);
QLabel* emptyScanTitle = new QLabel(this);
emptyScanTitle->setObjectName("EmptyScanTitle");
emptyScanTitle->setText(tr("Empty Scan"));
emptyScanTitle->setAlignment(Qt::AlignCenter);
vboxLayout->addWidget(emptyScanTitle);
QLabel* emptyScanDescribe = new QLabel(this);
emptyScanDescribe->setWordWrap(true);
emptyScanDescribe->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
emptyScanDescribe->setText(tr("Empty water scanning involves collecting ultrasound data while the tank is filled with water and free of any objects. It is essential to ensure that the tank is fully filled with water and devoid of any objects before conducting the scan. The purpose of collecting empty water data is to obtain baseline information on the time and energy variations of ultrasound propagation inside the inspection tank. This information is utilized for reconstructing reference data for transmission ultrasound imaging. Additionally, empty water data can be utilized for system status assessment and spatial calibration of the system. Therefore, empty water scanning should be performed regularly, with a frequency of once every month."));
vboxLayout->addWidget(emptyScanDescribe);
endline = new QLabel(this);
endline->setObjectName("endline");
endline->setFixedHeight(3);
vboxLayout->addWidget(endline);
QLabel* currentEmptyScanDate = new QLabel(this);
QDate lastScanDate = SQLHelper::queryValue("SELECT ScanDateTime FROM EScan ORDER BY ScanDateTime DESC LIMIT 1").toDate();
currentEmptyScanDate->setText(tr("Current date for Empty Scanning %1-%2-%3").arg(lastScanDate.year()).arg(lastScanDate.month()).arg(lastScanDate.day()));
vboxLayout->addWidget(currentEmptyScanDate);
QLabel* expirationEmptyScanDate = new QLabel(this);
QDate expirationScanDate = lastScanDate.addMonths(1);
QDate currentDate = QDate::currentDate();
QString dateText = tr("%1-%2-%3").arg(expirationScanDate.year()).arg(expirationScanDate.month()).arg(expirationScanDate.day());;
QString dateFormat = currentDate.daysTo(expirationScanDate) < 3 ? QString("<font color='red'>&nbsp;&nbsp;&nbsp;%1</font>").arg(dateText) : QString(" %1").arg(dateText);
expirationEmptyScanDate->setText(tr("Expiration date for Empty Scanning %1").arg(dateFormat));
vboxLayout->addWidget(expirationEmptyScanDate);
QWidget* emptyScanButtonArea = new QWidget(this);
QHBoxLayout* emptyScanButtonLayout = new QHBoxLayout(emptyScanButtonArea);
QPushButton* emptyScanButton = new QPushButton(this);
emptyScanButton->setText(tr("Excute empty scan"));
emptyScanButton->setFixedWidth(250);
emptyScanButtonLayout->addWidget(emptyScanButton);
emptyScanButtonLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
vboxLayout->addWidget(emptyScanButtonArea);
endline = new QLabel(this);
endline->setObjectName("endline");
endline->setFixedHeight(3);
vboxLayout->addWidget(endline);
vboxLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding));
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]()
{
title->setText(tr("Scan Preparation"));
emptyScanTitle->setText(tr("Empty Scan"));
emptyScanDescribe->setText(tr("Empty water scanning involves collecting ultrasound data while the tank is filled with water and free of any objects. It is essential to ensure that the tank is fully filled with water and devoid of any objects before conducting the scan. The purpose of collecting empty water data is to obtain baseline information on the time and energy variations of ultrasound propagation inside the inspection tank. This information is utilized for reconstructing reference data for transmission ultrasound imaging. Additionally, empty water data can be utilized for system status assessment and spatial calibration of the system. Therefore, empty water scanning should be performed regularly, with a frequency of once every month."));
currentEmptyScanDate->setText(tr("Current date for Empty Scanning %1-%2-%3").arg(lastScanDate.year()).arg(lastScanDate.month()).arg(lastScanDate.day()));
expirationEmptyScanDate->setText(tr("Expiration date for Empty Scanning %1").arg(dateFormat));
});
connect(emptyScanButton, &QPushButton::clicked, []()
{
QString null;
EventCenter::Default()->triggerEvent(RequestEmptyScan, nullptr, (QObject*)&null);
});
}

View File

@@ -0,0 +1,18 @@
#ifndef SYSTEMCORRECTIONFORM_H
#define SYSTEMCORRECTIONFORM_H
#include <QWidget>
class SystemCorrectionForm : public QWidget
{
Q_OBJECT
public:
explicit SystemCorrectionForm(QWidget* aParent = nullptr);
~SystemCorrectionForm();
private:
void init();
};
#endif // SYSTEMCORRECTIONFORM_H

View File

@@ -13,137 +13,93 @@
#include "recon/ReconManager.h"
#include "json/cmdhelper.h"
#include "components/ListBox.h"
#include "components/ImageSwitch.h"
SystemSettingForm::SystemSettingForm(QWidget* parent)
: QWidget(parent)
, mUI(new Ui::SystemSettingForm)
, mDiskInfoCaller(nullptr)
, mDiskSize(0)
, mDiskUsedSize(0)
, mDiskSizeFlag(false)
, mDiskUsedSizeFlag(false)
{
mUI->setupUi(this);
mUI->lbl_size->setText(tr("Loading..."));
mUI->lbl_used->setText(tr("Loading..."));
//style init
mUI->btnDICOM->setObjectName("btnDICOM");
//mUI->btnDICOM->setObjectName("btnDICOM");
mUI->mWorklistButton->setObjectName("worklistSettingsButton");
mUI->mPacsButton->setObjectName("pacsSettingsButton");
mUI->mReconButton->setObjectName("reconSettingsButton");
mUI->mMppsButton->setObjectName("mppsSettingsButton");
mUI->btnNetwork->setObjectName("btnNetwork");
mUI->AnonyButton->setChecked(JsonObject::Instance()->getAnonymousMode());
// mUI->lbl_verify->setFixedWidth(100);
mUI->mWorklistButton->setMaximumWidth(200);
mUI->mPacsButton->setMaximumWidth(200);
mUI->mReconButton->setMaximumWidth(200);
mUI->mMppsButton->setMaximumWidth(200);
mUI->btnNetwork->setMaximumWidth(200);
//data init
mUI->btnPro->setText(JsonObject::Instance()->defaultProtocal());
mUI->btnPro->setObjectName("ListBox");
mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
mUI->btnFlt->setObjectName("ListBox");
// mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
// mUI->btnFlt->setObjectName("ListBox");
QGridLayout* gridLayout = (QGridLayout*)mUI->block10->layout();
auto scanConfirmButton = new ImageSwitch(this);
auto scanConfirmLabel = new QLabel(this);
scanConfirmLabel->setText("Scan Confirm");
gridLayout->addWidget(scanConfirmButton, 4, 2, 1, 1);
gridLayout->addWidget(scanConfirmLabel, 4, 0, 1, 1);
scanConfirmButton->setChecked(JsonObject::Instance()->getScanConfirm());
QFrame* line5 = new QFrame(this);
line5->setFrameShape(QFrame::HLine);
line5->setFrameShadow(QFrame::Sunken);
gridLayout->addWidget(line5, 5, 0);
auto scanCompleteButton = new ImageSwitch(this);
auto scanCompleteLabel = new QLabel(this);
scanCompleteLabel->setText("Complete Notify");
gridLayout->addWidget(scanCompleteButton, 6, 2, 1, 1);
gridLayout->addWidget(scanCompleteLabel, 6, 0, 1, 1);
scanCompleteButton->setChecked(JsonObject::Instance()->getCompleteNotify());
QFrame* line6 = new QFrame(this);
line6->setFrameShape(QFrame::HLine);
line6->setFrameShadow(QFrame::Sunken);
gridLayout->addWidget(line6, 7, 0);
mDiskInfoCaller = QThread::create([=]()
connect(mUI->btnNetwork, &QToolButton::clicked, [=]()
{
double disksize = 0;
mDiskSizeFlag = cmdHelper::Instance()->getDiskSize(disksize);
mDiskSize = disksize;
updateStorageSize();
while (true)
{
double duse = 0;
mDiskUsedSizeFlag = cmdHelper::Instance()->getDiskUsed(duse);
mDiskUsedSize = duse;
updateStorageUsed();
QMetaObject::invokeMethod(mUI->batIcon, "startAnimation", Qt::QueuedConnection);
QThread::msleep(30000);
}
});
mDiskInfoCaller->start();
//connection
connect(mUI->AnonyButton, &ImageSwitch::clicked, [=]() {
JsonObject::Instance()->setAnonymousMode(mUI->AnonyButton->getChecked());
EventCenter::Default()->triggerEvent(AnonymousModeChanged,this,nullptr);
});
connect(scanConfirmButton, &ImageSwitch::clicked, [=]() {
JsonObject::Instance()->setScanConfirm(scanConfirmButton->getChecked());
});
connect(scanCompleteButton, &ImageSwitch::clicked, [=]() {
JsonObject::Instance()->setCompleteNotify(scanCompleteButton->getChecked());
});
connect(mUI->btnNetwork, &QToolButton::clicked, [=]() {
auto result = DialogManager::Default()->requestInputAdminPasswd();
if (result.ResultCode == QDialog::Accepted)
{
JsonObject::Instance()->setPassword(result.ResultData.toString());
// auto result = DialogManager::Default()->requestInputAdminPasswd();
// if (result.ResultCode == QDialog::Accepted)
// {
// JsonObject::Instance()->setPassword(result.ResultData.toString());
// DialogManager::Default()->requestEditNetworkConfig();
// }
DialogManager::Default()->requestEditNetworkConfig();
}
});
connect(mUI->btnDICOM, &QToolButton::clicked, [&]() {
if(DialogManager::Default()->requestEditDicomConfig() == QDialog::Accepted)
connect(mUI->mWorklistButton, &QToolButton::clicked, [&]()
{
DialogManager::Default()->requestWorklistSettings();
});
connect(mUI->mPacsButton, &QToolButton::clicked, [&]()
{
if(DialogManager::Default()->requestPacsSettings() == QDialog::Accepted)
{
auto server = JsonObject::Instance()->getServer(JsonObject::PACS);
emit pacsSettingsSaved(server.name, server.ae, server.ip, server.port.toInt());
}
});
connect(mUI->btnPro, &QPushButton::clicked, [=]()
connect(mUI->mReconButton, &QToolButton::clicked, [&]()
{
DialogResult result = DialogManager::Default()->requestSelectProtocal();
if (result.ResultCode == QDialog::Accepted)
{
QString pro = result.ResultData.toString();
//take effect
JsonObject::Instance()->setDefaultProtocal(pro);
mUI->btnPro->setText(JsonObject::Instance()->defaultProtocal());
}
DialogManager::Default()->requestReconSettings();
});
connect(mUI->btnFlt, &QPushButton::clicked, [=]()
connect(mUI->mMppsButton, &QToolButton::clicked, [&]()
{
DialogResult result = DialogManager::Default()->requestSelectFilter();
if (result.ResultCode == QDialog::Accepted)
{
QString flt = result.ResultData.toString();
//take effect
JsonObject::Instance()->setDefaultFilter(flt);
mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
}
DialogManager::Default()->requestMppsSettings();
});
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]()
{
mUI->retranslateUi(this);
mUI->btnPro->setText(JsonObject::Instance()->defaultProtocal());
mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
mUI->AnonyButton->setChecked(JsonObject::Instance()->getAnonymousMode());
updateStorageSize();
updateStorageUsed();
});
// connect(mUI->btnDICOM, &QToolButton::clicked, [&]() {
// if(DialogManager::Default()->requestEditDicomConfig() == QDialog::Accepted)
// {
// auto server = JsonObject::Instance()->getServer(JsonObject::PACS);
// emit pacsSettingsSaved(server.name, server.ae, server.ip, server.port.toInt());
// }
// });
// connect(mUI->btnFlt, &QPushButton::clicked, [=]()
// {
// DialogResult result = DialogManager::Default()->requestSelectFilter();
// if (result.ResultCode == QDialog::Accepted)
// {
// QString flt = result.ResultData.toString();
// //take effect
// JsonObject::Instance()->setDefaultFilter(flt);
// mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
// }
// });
// connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]()
// {
// mUI->retranslateUi(this);
// mUI->btnFlt->setText(JsonObject::Instance()->defaultFilter());
// });
connect(ReconManager::getInstance(), &ReconManager::setPacsSettingsResponsed, this, &SystemSettingForm::processPacsSettingsResponsed);
connect(this, &SystemSettingForm::pacsSettingsSaved, ReconManager::getInstance(), &ReconManager::setPacsSettings, Qt::QueuedConnection);
@@ -152,37 +108,7 @@ SystemSettingForm::SystemSettingForm(QWidget* parent)
SystemSettingForm::~SystemSettingForm()
{
delete mDiskInfoCaller;
}
void SystemSettingForm::updateStorageUsed()
{
if (mDiskUsedSizeFlag)
{
mUI->batIcon->setValue(mDiskUsedSize);
mUI->lbl_used->setText(tr("used:\t%1G").arg(mDiskUsedSize));
}
else
{
mUI->lbl_used->setText(tr("Get disk used size fail!"));
}
}
void SystemSettingForm::updateStorageSize()
{
//bool flag = AppGlobalValues::StorageFlag();
if (mDiskSizeFlag)
{
//double total_size = AppGlobalValues::StorageSize();
mUI->batIcon->setMaxValue(mDiskSize);
double aValue = JsonObject::Instance()->storageAlarmSize().toDouble();/*(mDiskSize - JsonObject::Instance()->storageAlarmSize().toDouble()) / mDiskSize;*/
mUI->batIcon->setAlarmValue(aValue);
mUI->lbl_size->setText(tr("total:\t%1G").arg(mDiskSize));
}
else
{
mUI->lbl_size->setText(tr("Get disk total size fail!"));
}
}
void SystemSettingForm::processPacsSettingsResponsed(bool aResult, const QVariant& aMessage)

View File

@@ -8,6 +8,8 @@ namespace Ui
class SystemSettingForm;
}
class DiskInfoWorker;
class SystemSettingForm : public QWidget
{
Q_OBJECT
@@ -23,16 +25,7 @@ private slots:
void processPacsSettingsResponsed(bool aResult, const QVariant& aMessage);
private:
void updateStorageSize();
void updateStorageUsed();
Ui::SystemSettingForm* mUI;
QThread* mDiskInfoCaller;
double mDiskSize;
double mDiskUsedSize;
bool mDiskSizeFlag;
bool mDiskUsedSizeFlag;
};
#endif // SYSTEMSETTINGFORM_H

View File

@@ -20,134 +20,6 @@
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QWidget" name="block10" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lbl_protocal">
<property name="text">
<string>Protocal</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lbl_verify">
<property name="text">
<string>Anonymous Mode</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="ImageSwitch" name="AnonyButton" >
</widget>
</item>
<item row="3" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_4">
<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 row="0" column="2">
<widget class="ListBox" name="btnPro">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4">
@@ -170,122 +42,65 @@
</item>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="lbl_filter">
<property name="text">
<string>Worklist Filter</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="ListBox" name="btnFlt">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
<widget class="QToolButton" name="mReconButton">
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnDICOM">
<property name="text">
<string>DICOM</string>
<string>Recon Settings</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Disk Storage</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_3"/>
</widget>
</item>
<item>
<widget class="BatteryWidget" name="batIcon" native="true"/>
<widget class="QToolButton" name="mWorklistButton">
<property name="text">
<string>Worklist Settings</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_6" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_size">
<widget class="QToolButton" name="mPacsButton">
<property name="text">
<string/>
<string>Pacs Settings</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_used">
<widget class="QWidget" name="widget_7" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5"/>
</widget>
</item>
<item>
<widget class="QToolButton" name="mMppsButton">
<property name="text">
<string/>
<string>Mpps Settings</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
@@ -316,26 +131,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ImageSwitch</class>
<extends>QWidget</extends>
<header location="global">components/ImageSwitch.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BatteryWidget</class>
<extends>QWidget</extends>
<header location="global">components/BatteryWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ListBox</class>
<extends>QToolButton</extends>
<header location="global">components/ListBox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

BIN
src/icons/pacssettings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
src/icons/reconsettings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -179,6 +179,33 @@ void JsonObject::setDefaultProtocal(const QString& str)
setJsonString("protocol", "default", str.toStdString().c_str());
}
QStringList JsonObject::lockScreenTimes()
{
if (!loadcfg())
return QStringList();
cJSON* first = cJSON_GetObjectItem((cJSON*)json_root, "general");
if (!first) return QStringList();
cJSON* second = cJSON_GetObjectItem(first, "lockScreenTimes");
if (!second) return QStringList();
std::string times = second->valuestring;
QString str = QString::fromLocal8Bit(QByteArray::fromRawData(times.c_str(), times.size()));
return str.split(";");
}
QString JsonObject::defaultLockScreenTime()
{
char* str = getJsonString("general", "defaultLockScreenTime");
return QString(str);
}
void JsonObject::setDefaultLockScreenTime(const QString& str)
{
setJsonString("general", "defaultLockScreenTime", str.toStdString().c_str());
}
QString JsonObject::defaultFilter()
{
char* str = getJsonString("worklistfilter", "default");
@@ -364,6 +391,8 @@ host JsonObject::getServer(ServerType type)
case JsonObject::RECON:
typeName = "recon";
break;
case JsonObject::MPPS:
typeName = "mpps";
default:
break;
}
@@ -393,6 +422,9 @@ void JsonObject::setServer(ServerType type, const host& list)
case JsonObject::RECON:
typeName = "recon";
break;
case JsonObject::MPPS:
typeName = "mpps";
break;
default:
break;
}
@@ -443,6 +475,8 @@ IpAddr JsonObject::getDefaultIpAddr()
//lhost.ip = IPConfig::getDeviceIP();
obj.ip = QString(getJsonString("address", "ip"));
obj.mask = QString(getJsonString("address", "mask"));
obj.gateway = QString(getJsonString("address", "gateway"));
obj.dhcp = getBool("address","dhcp");
return obj;
}
@@ -450,6 +484,8 @@ void JsonObject::setDefaultIpAddr(const IpAddr& addr)
{
setJsonString("address", "ip", addr.ip.toStdString().c_str());
setJsonString("address", "mask", addr.mask.toStdString().c_str());
setJsonString("address", "gateway", addr.ip.toStdString().c_str());
setBool("address","dhcp", addr.dhcp, true);
}
QList<QStringList> JsonObject::getIpAddrList()
@@ -549,6 +585,16 @@ void JsonObject::setAnonymousMode(bool val)
setBool("general","AnonymousMode", val, true);
}
bool JsonObject::getScreenSaverMode()
{
return getBool("screensaver","open");
}
void JsonObject::setScreenSaverMode(bool aIsOpen)
{
setBool("screensaver","open", aIsOpen, true);
}
QStringList JsonObject::getScreenSaverInfomation()
{
return QString(getJsonString("screensaver", "content")).split(";");

View File

@@ -16,8 +16,10 @@ struct host {
};
struct IpAddr {
bool dhcp;
QString ip;
QString mask;
QString gateway;
};
struct IpRoute
{
@@ -38,7 +40,7 @@ public:
}
enum ServerType
{
WORKLIST, PACS, LOCAL, RECON
WORKLIST, PACS, LOCAL, RECON, MPPS
};
//
@@ -68,6 +70,9 @@ public:
QString defaultProtocal();
void setDefaultProtocal(const QString& str);
QStringList lockScreenTimes();
QString defaultLockScreenTime();
void setDefaultLockScreenTime(const QString& str);
QStringList worklistFilters();
QString defaultFilter();
@@ -97,6 +102,9 @@ public:
bool getAnonymousMode();
void setAnonymousMode(bool val);
bool getScreenSaverMode();
void setScreenSaverMode(bool aIsOpen);
const char* getEmptyScanID();
void setEmptyScanID(const char* id);

View File

@@ -9,7 +9,6 @@ namespace
{
const std::string CRT_FILE = "./cfgs/client.crt";
const std::string KEY_FILE = "./cfgs/client.key";
const int CHECK_RECON_CONNECTION_TIME = 30000;
std::string toReconServerAddress(const QString& aIp, const QString& aPort)
{
@@ -26,12 +25,9 @@ ReconManager* ReconManager::getInstance()
ReconManager::ReconManager(QObject* aParent)
: QObject(aParent)
, mReconClient(new Recon::ReconClient(CRT_FILE, KEY_FILE))
, mTimer(new QTimer(this))
, mIsConnected(false)
{
init();
connect(mTimer, &QTimer::timeout, this, &ReconManager::checkReconConnection);
mTimer->start(CHECK_RECON_CONNECTION_TIME);
}
ReconManager::~ReconManager()

View File

@@ -44,7 +44,6 @@ signals:
private:
Recon::ReconClient* mReconClient;
QTimer* mTimer;
bool mIsConnected;
};

View File

@@ -58,5 +58,8 @@
<file>icons/radio_check.png</file>
<file>icons/radio_uncheck.png</file>
<file>icons/turnoff.png</file>
<file>icons/pacssettings.png</file>
<file>icons/worklistsettings.png</file>
<file>icons/reconsettings.png</file>
</qresource>
</RCC>

View File

@@ -785,6 +785,30 @@ QToolButton#btnNetwork{
qproperty-iconSize:80px 80px;
}
QToolButton#pacsSettingsButton{
qproperty-icon:url(":/icons/pacssettings.png");
qproperty-iconSize:80px 80px;
text-align: center;
}
QToolButton#reconSettingsButton{
qproperty-icon:url(":/icons/reconsettings.png");
qproperty-iconSize:80px 80px;
text-align: center;
}
QToolButton#worklistSettingsButton{
qproperty-icon:url(":/icons/worklistsettings.png");
qproperty-iconSize:80px 80px;
text-align: center;
}
QToolButton#mppsSettingsButton{
qproperty-icon:url(":/icons/worklistsettings.png");
qproperty-iconSize:80px 80px;
text-align: center;
}
/*------AccountTableForm-----------------------------------------------------*/
QWidget#commandWidgetnoBBorder {
min-height: 123px;
@@ -1140,3 +1164,21 @@ QTabBar::tab::disabled {
background: #3c3c3c
}
QWidget#DicomSettingsArea QLabel {
color: #fcfcfc;
font-weight: bold;
font-size: 26px;
}
QWidget#SystemCorrectionForm QLabel#EmptyScanTitle {
color: #fcfcfc;
font-weight: bold;
font-size: 18px;
background: grey;
}
QWidget#SystemCorrectionForm QLabel#SystemCorrectionTitle {
font-weight: bold;
font-size: 30px;
}

View File

@@ -277,6 +277,10 @@
<source>Open pump failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Initialize Failed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DicomCfgDialog</name>
@@ -330,13 +334,32 @@
</message>
</context>
<context>
<name>EditPatientDialog</name>
<name>DicomSettingsArea</name>
<message>
<source>Edit Patient</source>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ID</source>
<source>AE</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Ip</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server AE</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditPatientDialog</name>
<message>
<source>Edit Patient</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -363,10 +386,6 @@
<source>Birth Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Comment</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>F</source>
<translation type="unfinished"></translation>
@@ -379,6 +398,10 @@
<source>Accession Number</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ID </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GUIFormBaseDialog</name>
@@ -434,11 +457,39 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Shut Down</source>
<source>Anonymous Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shut down now ?</source>
<source>Screen Saver</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Complete Notify</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Disk Storage</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Used: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk used size fail!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Total: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk total size fail!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scan Protocol</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -540,6 +591,25 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IpSettingsDialog</name>
<message>
<source>IP Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>IP Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Gateway</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Subnet Mask</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Keyboard</name>
<message>
@@ -741,6 +811,18 @@
<source>Anonymous Mode active!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Login locked. Please retry after %1 minutes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Login failed, username or password error! Remaining retries: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Can&apos;t connect db. Please reboot the device and retry, or call for the service help.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
@@ -769,6 +851,41 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MppsSettingsDialog</name>
<message>
<source>Worklist Settings</source>
<translation type="obsolete">Worklist</translation>
</message>
<message>
<source>AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Ip can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Port can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ip Address is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mpps Settings</source>
<translation type="unfinished">Mpps</translation>
</message>
</context>
<context>
<name>NetworkCfgDialog</name>
<message>
@@ -868,6 +985,37 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PacsSettingsDialog</name>
<message>
<source>PACS Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Ip can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Port can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ip Address is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port is not valid</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PatientDetailForm</name>
<message>
@@ -1072,6 +1220,37 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ReconSettingsDialog</name>
<message>
<source>AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Ip can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Port can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ip Address is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Recon Settings</source>
<translation type="unfinished">Recon</translation>
</message>
</context>
<context>
<name>ReconStateDelegate</name>
<message>
@@ -1192,6 +1371,14 @@ parameters
<source>Confirm Scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Confirm Drainage</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Make sure to open the drain valve ?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ScanSearchCriteriaForm</name>
@@ -1274,10 +1461,6 @@ parameters
<source>Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select</source>
<translation type="unfinished"></translation>
@@ -1349,10 +1532,6 @@ parameters
<source>Account</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>System</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About</source>
<translation type="unfinished"></translation>
@@ -1361,6 +1540,18 @@ parameters
<source>Operation Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Network Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>System Correction</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Help</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShutdownWidget</name>
@@ -1370,13 +1561,40 @@ parameters
</message>
</context>
<context>
<name>SystemSettingForm</name>
<name>SystemCorrectionForm</name>
<message>
<source>Form</source>
<source>Scan Preparation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Protocal</source>
<source>Empty Scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty water scanning involves collecting ultrasound data while the tank is filled with water and free of any objects. It is essential to ensure that the tank is fully filled with water and devoid of any objects before conducting the scan. The purpose of collecting empty water data is to obtain baseline information on the time and energy variations of ultrasound propagation inside the inspection tank. This information is utilized for reconstructing reference data for transmission ultrasound imaging. Additionally, empty water data can be utilized for system status assessment and spatial calibration of the system. Therefore, empty water scanning should be performed regularly, with a frequency of once every month.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Current date for Empty Scanning %1-%2-%3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1-%2-%3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expiration date for Empty Scanning %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Excute empty scan</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SystemSettingForm</name>
<message>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1384,40 +1602,20 @@ parameters
<translation type="unfinished"></translation>
</message>
<message>
<source>Worklist Filter</source>
<translation type="unfinished"></translation>
<source>Recon Settings</source>
<translation type="unfinished">Recon</translation>
</message>
<message>
<source>DICOM</source>
<translation type="unfinished"></translation>
<source>Worklist Settings</source>
<translation type="unfinished">Worklist</translation>
</message>
<message>
<source>Disk Storage</source>
<translation type="unfinished"></translation>
<source>Pacs Settings</source>
<translation type="unfinished">Pacs</translation>
</message>
<message>
<source>Loading...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>used: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk used size fail!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk total size fail!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Anonymous Mode</source>
<translation type="unfinished"></translation>
<source>Mpps Settings</source>
<translation type="unfinished">Mpps</translation>
</message>
</context>
<context>
@@ -1460,4 +1658,35 @@ parameters
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WorklistSettingsDialog</name>
<message>
<source>Worklist Settings</source>
<translation type="unfinished">Worklist</translation>
</message>
<message>
<source>Ip Address is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port is not valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server AE can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Ip can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Port can&apos;t be empty</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
#include "DiskInfoWorker.h"
#include "json/cmdhelper.h"
#include <QTimer>
DiskInfoWorker::DiskInfoWorker(QObject* aParent)
: QObject (aParent)
, mTimer(new QTimer(this))
{
connect(mTimer, &QTimer::timeout, this, &DiskInfoWorker::getDiskInfo);
mTimer->start(30000);
}
DiskInfoWorker::~DiskInfoWorker()
{
}
void DiskInfoWorker::initDiskInfo()
{
double diskSize, diskUsed;
bool flag = cmdHelper::Instance()->getDiskSize(diskSize);
cmdHelper::Instance()->getDiskUsed(diskUsed);
emit diskInfoInit(flag, diskSize, diskUsed);
}
void DiskInfoWorker::getDiskInfo()
{
double diskUsed;
bool flag = cmdHelper::Instance()->getDiskUsed(diskUsed);
emit diskInfoBack(flag, diskUsed);
}

View File

@@ -0,0 +1,27 @@
#ifndef DISKINFOWORKER_H
#define DISKINFOWORKER_H
#include <QObject>
class QTimer;
class DiskInfoWorker : public QObject
{
Q_OBJECT
public:
DiskInfoWorker(QObject* aParent = nullptr);
~DiskInfoWorker();
public slots:
void getDiskInfo();
void initDiskInfo();
signals:
void diskInfoBack(bool aDiskFlag, double aUsedDiskSize);
void diskInfoInit(bool aDiskFlag, double aTotalDiskSize, double aUsedDiskSize);
private:
QTimer* mTimer;
};
#endif // DISKINFOWORKER_H

View File

@@ -0,0 +1,15 @@
#include "InputFormatValidator.h"
#include <QRegularExpression>
bool InputFormatValidator::ValidateIpAddressFormat(const QString& aIpAddress)
{
QRegularExpression regex("^((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]?)$");
return regex.match(aIpAddress).hasMatch();
}
bool InputFormatValidator::ValidatePortFormat(const QString& aPort)
{
QRegularExpression regex("^([1-9]\\d{0,4}|0)$");
return regex.match(aPort).hasMatch();
}

View File

@@ -0,0 +1,16 @@
#ifndef INPUTFORMATVALIDATOR_H
#define INPUTFORMATVALIDATOR_H
#include <QString>
class InputFormatValidator
{
public:
InputFormatValidator() = delete;
static bool ValidateIpAddressFormat(const QString& aIpAddress);
static bool ValidatePortFormat(const QString& aPort);
};
#endif // INPUTFORMATVALIDATOR_H

View File

@@ -2,6 +2,22 @@
#include "event/EventCenter.h"
namespace
{
QString changeLanguageToFileName(const QString& aLanguage)
{
if(aLanguage == "Chinese")
{
return "zh_CN";
}
else if(aLanguage == "English")
{
return "en_US";
}
return "";
}
}
LanguageSwitcher* LanguageSwitcher::getInstance()
{
static LanguageSwitcher instance;
@@ -29,7 +45,7 @@ QTranslator* LanguageSwitcher::getTranslator()
void LanguageSwitcher::setDefaultLanguage(const QString aLanguage)
{
QString language = QString(":/translations/" + aLanguage + ".qm");
QString language = QString(":/translations/" + changeLanguageToFileName(aLanguage) + ".qm");
if (mTranslator->load(language))
{
EventCenter::Default()->triggerEvent(ReloadLanguage, nullptr, nullptr);

6
web/build/pdf.js Normal file

File diff suppressed because one or more lines are too long

20
web/build/pdf.worker.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

BIN
web/web/cmaps/78-H.bcmap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/web/cmaps/78-V.bcmap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/web/cmaps/Add-H.bcmap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/web/cmaps/Add-V.bcmap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More