add battery

This commit is contained in:
xueyan hu
2022-01-11 16:58:03 +08:00
parent 7bf85c0b4f
commit 3a517696e0
20 changed files with 1353 additions and 430 deletions

View File

@@ -29,7 +29,7 @@
"storagepolicy": {
"alarm": "false",
"dataexpired": "NoneExpired",
"threshold": "70"
"mininum": "85"
},
"waitinglist": {
"waitinglistDefaultDate": "1900-01-01"

View File

@@ -1,14 +1,11 @@
#include "aboutwidget.h"
#include "aboutwidget.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QHBoxLayout>
#include <QPushButton>
#include "event/EventCenter.h"
#include <QStringList>
#include <QProcess>
#include<stdio.h>
#define BUFFER_LENGTH 100
#include "json/cmdhelper.h"
AboutWidget::AboutWidget(QWidget* parent)
: QWidget(parent)
@@ -115,12 +112,12 @@ void AboutWidget::initUi()
pSUSEVer = new QLabel(this);
pSUSEVer->setText(getLinuxVersion());
pSUSEVer->setText(cmdHelper::Instance()->getLinuxVersion());
pMainLayout->addWidget(pSUSEVer);
pMainLayout->addSpacing(subContentSpacing);
pDcmtkVer = new QLabel(this);
pDcmtkVer->setText(getDCMTKVersion());
pDcmtkVer->setText(cmdHelper::Instance()->getDCMTKVersion());
pMainLayout->addWidget(pDcmtkVer);
pDcmtkCopyright = new QLabel(this);
pDcmtkCopyright->setObjectName("normal");
@@ -155,79 +152,6 @@ void AboutWidget::initUi()
});
}
bool AboutWidget::execResult(const char* cmd, std::string& result) {
#ifndef WIN32
FILE* fp = nullptr;
if (!(fp = popen(cmd, "r")))
{
result.append(strerror(errno));
pclose(fp);
return false;
}
char buffer[BUFFER_LENGTH];
memset(buffer, 0, BUFFER_LENGTH);
while (fgets(buffer, BUFFER_LENGTH, fp))
{
result.append(buffer, strlen(buffer) - 1);
}
pclose(fp);
return true;
#else
return false;
#endif // WIN32
}
QString AboutWidget::getLinuxVersion()
{
std::string str;
if (execResult("cat /proc/version", str))
{
QString qstr = QString::fromStdString(str);
return qstr.section(')', 0, 0).append(")");
}
return QString("Unable to get Linux version!");
}
QString AboutWidget::getDCMTKVersion()
{
std::string str;
if (execResult2("zypper info dcmtk", str))
{
QString qstr = QString::fromStdString(str);
QStringList strList = qstr.split('\n');
for (int i = 0; i < strList.size(); i++)
{
if (strList.at(i).contains("Version"))
{
QStringList strList2 = strList.at(i).split(':');
return QString("DCMTK %1").arg(strList2[1]);
}
}
};
return QString("Unable to get DCMTK version!");
}
bool AboutWidget::execResult2(const char* cmd, std::string& result)
{
QProcess* myProcess = new QProcess;
QStringList args;
args << "-c" << cmd;
connect(myProcess, SIGNAL(finished(int)), myProcess, SLOT(deleteLater()));
myProcess->start("/bin/sh", args);
if (!myProcess->waitForFinished() || myProcess->exitCode() != 0) {
return false;
}
result.append(myProcess->readAllStandardOutput());
return true;
}
void AboutWidget::openHelpFile()
{
QString userManulFile = QCoreApplication::applicationDirPath() + "/userManual.pdf";
@@ -243,4 +167,4 @@ void AboutWidget::openHelpFile()
// box.setMessage(tr("can't find the user manual file!"));
// box.exec();
//}
}
}

View File

@@ -1,4 +1,4 @@
#ifndef _ABOUTWIDGET_H_
#ifndef _ABOUTWIDGET_H_
#define _ABOUTWIDGET_H_
#include <QObject>
@@ -27,12 +27,6 @@ private slots:
private:
void initUi();
bool execResult(const char* cmd, std::string& result);
bool execResult2(const char* cmd, std::string& result);
QString getLinuxVersion();
QString getDCMTKVersion();
//QString queryVersion(const QString& packName);
};

421
src/components/battery.cpp Normal file
View File

@@ -0,0 +1,421 @@
#pragma execution_character_set("utf-8")
#include "battery.h"
#include <QPainter>
#include <QTimer>
#include <QDebug>
Battery::Battery(QWidget* parent) : QWidget(parent)
{
minValue = 0;
maxValue = 100;
value = 0;
alarmValue = 90;
step = 0.5;
borderWidth = 5;
borderRadius = 8;
bgRadius = 5;
headRadius = 3;
borderColorStart = QColor(100, 100, 100);
borderColorEnd = QColor(80, 80, 80);
alarmColorStart = QColor(250, 118, 113);
alarmColorEnd = QColor(204, 38, 38);
normalColorStart = QColor(50, 205, 51);
normalColorEnd = QColor(60, 179, 133);
isForward = false;
currentValue = 0;
timer = new QTimer(this);
timer->setInterval(10);
connect(timer, SIGNAL(timeout()), this, SLOT(updateValue()));
this->setFixedSize(sizeHint());
}
Battery::~Battery()
{
if (timer->isActive()) {
timer->stop();
}
}
void Battery::paintEvent(QPaintEvent*)
{
//绘制准备工作,启用反锯齿
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
//绘制边框
drawBorder(&painter);
//绘制背景
drawBg(&painter);
//绘制头部
//drawHead(&painter);
}
void Battery::drawBorder(QPainter* painter)
{
painter->save();
//double headWidth = width() / 15;
double batteryWidth = width() - borderWidth;
//绘制电池边框
QPointF topLeft(borderWidth, borderWidth);
QPointF bottomRight(batteryWidth, height() - borderWidth);
batteryRect = QRectF(topLeft, bottomRight);
painter->setPen(QPen(borderColorStart, borderWidth));
painter->setBrush(Qt::NoBrush);
painter->drawRoundedRect(batteryRect, borderRadius, borderRadius);
painter->restore();
}
void Battery::drawBg(QPainter* painter)
{
if (value == minValue) {
return;
}
painter->save();
QLinearGradient batteryGradient(QPointF(0, 0), QPointF(0, height()));
if (currentValue >= alarmValue) {
batteryGradient.setColorAt(0.0, alarmColorStart);
batteryGradient.setColorAt(1.0, alarmColorEnd);
}
else {
batteryGradient.setColorAt(0.0, normalColorStart);
batteryGradient.setColorAt(1.0, normalColorEnd);
}
int margin = qMin(width(), height()) / 20;
//double unit = (batteryRect.width() - (margin * 2)) / 100;
//double width = currentValue * unit;
//QPointF topLeft(batteryRect.topLeft().x() + margin, batteryRect.topLeft().y() + margin);
//QPointF bottomRight(width + margin + borderWidth, batteryRect.bottomRight().y() - margin);
double unit = (batteryRect.height() - (margin * 2)) / maxValue;
double height = (maxValue - currentValue) * unit;
QPointF topLeft(batteryRect.topLeft().x() + margin, margin + height);
QPointF bottomRight(batteryRect.bottomRight().x() - margin, batteryRect.bottomRight().y() - margin);
QRectF rect(topLeft, bottomRight);
painter->setPen(Qt::NoPen);
painter->setBrush(batteryGradient);
painter->drawRoundedRect(rect, bgRadius, bgRadius);
painter->restore();
}
void Battery::drawHead(QPainter* painter)
{
painter->save();
QPointF headRectTopLeft(batteryRect.topRight().x(), height() / 3);
QPointF headRectBottomRight(width(), height() - height() / 3);
QRectF headRect(headRectTopLeft, headRectBottomRight);
QLinearGradient headRectGradient(headRect.topLeft(), headRect.bottomLeft());
headRectGradient.setColorAt(0.0, borderColorStart);
headRectGradient.setColorAt(1.0, borderColorEnd);
painter->setPen(Qt::NoPen);
painter->setBrush(headRectGradient);
painter->drawRoundedRect(headRect, headRadius, headRadius);
painter->restore();
}
void Battery::updateValue()
{
if (isForward) {
currentValue -= step;
if (currentValue <= value) {
currentValue = value;
timer->stop();
}
}
else {
currentValue += step;
if (currentValue >= value) {
currentValue = value;
timer->stop();
}
}
this->update();
}
double Battery::getMinValue() const
{
return this->minValue;
}
double Battery::getMaxValue() const
{
return this->maxValue;
}
double Battery::getValue() const
{
return this->value;
}
double Battery::getAlarmValue() const
{
return this->alarmValue;
}
double Battery::getStep() const
{
return this->step;
}
int Battery::getBorderWidth() const
{
return this->borderWidth;
}
int Battery::getBorderRadius() const
{
return this->borderRadius;
}
int Battery::getBgRadius() const
{
return this->bgRadius;
}
int Battery::getHeadRadius() const
{
return this->headRadius;
}
QColor Battery::getBorderColorStart() const
{
return this->borderColorStart;
}
QColor Battery::getBorderColorEnd() const
{
return this->borderColorEnd;
}
QColor Battery::getAlarmColorStart() const
{
return this->alarmColorStart;
}
QColor Battery::getAlarmColorEnd() const
{
return this->alarmColorEnd;
}
QColor Battery::getNormalColorStart() const
{
return this->normalColorStart;
}
QColor Battery::getNormalColorEnd() const
{
return this->normalColorEnd;
}
QSize Battery::sizeHint() const
{
return QSize(90, 120);
}
QSize Battery::minimumSizeHint() const
{
return QSize(10, 30);
}
void Battery::setRange(double minValue, double maxValue)
{
//如果最小值大于或者等于最大值则不设置
if (minValue >= maxValue) {
return;
}
this->minValue = minValue;
this->maxValue = maxValue;
//如果目标值不在范围值内,则重新设置目标值
//值小于最小值则取最小值,大于最大值则取最大值
if (value < minValue) {
setValue(minValue);
}
else if (value > maxValue) {
setValue(maxValue);
}
this->update();
}
void Battery::setRange(int minValue, int maxValue)
{
setRange((double)minValue, (double)maxValue);
}
void Battery::setMinValue(double minValue)
{
setRange(minValue, maxValue);
}
void Battery::setMaxValue(double maxValue)
{
setRange(minValue, maxValue);
}
void Battery::setValue(double value)
{
//值和当前值一致则无需处理
if (value == this->value) {
return;
}
//值小于最小值则取最小值,大于最大值则取最大值
if (value < minValue) {
value = minValue;
}
else if (value > maxValue) {
value = maxValue;
}
if (value > currentValue) {
isForward = false;
}
else if (value < currentValue) {
isForward = true;
}
else {
this->value = value;
this->update();
return;
}
this->value = value;
this->update();
emit valueChanged(value);
timer->stop();
timer->start();
}
void Battery::setValue(int value)
{
setValue((double)value);
}
void Battery::setAlarmValue(double alarmValue)
{
if (this->alarmValue != alarmValue) {
this->alarmValue = alarmValue;
this->update();
}
}
void Battery::setAlarmValue(int alarmValue)
{
setAlarmValue((double)alarmValue);
}
void Battery::setStep(double step)
{
if (this->step != step) {
this->step = step;
this->update();
}
}
void Battery::setStep(int step)
{
setStep((double)step);
}
void Battery::setBorderWidth(int borderWidth)
{
if (this->borderWidth != borderWidth) {
this->borderWidth = borderWidth;
this->update();
}
}
void Battery::setBorderRadius(int borderRadius)
{
if (this->borderRadius != borderRadius) {
this->borderRadius = borderRadius;
this->update();
}
}
void Battery::setBgRadius(int bgRadius)
{
if (this->bgRadius != bgRadius) {
this->bgRadius = bgRadius;
this->update();
}
}
void Battery::setHeadRadius(int headRadius)
{
if (this->headRadius != headRadius) {
this->headRadius = headRadius;
this->update();
}
}
void Battery::setBorderColorStart(const QColor& borderColorStart)
{
if (this->borderColorStart != borderColorStart) {
this->borderColorStart = borderColorStart;
this->update();
}
}
void Battery::setBorderColorEnd(const QColor& borderColorEnd)
{
if (this->borderColorEnd != borderColorEnd) {
this->borderColorEnd = borderColorEnd;
this->update();
}
}
void Battery::setAlarmColorStart(const QColor& alarmColorStart)
{
if (this->alarmColorStart != alarmColorStart) {
this->alarmColorStart = alarmColorStart;
this->update();
}
}
void Battery::setAlarmColorEnd(const QColor& alarmColorEnd)
{
if (this->alarmColorEnd != alarmColorEnd) {
this->alarmColorEnd = alarmColorEnd;
this->update();
}
}
void Battery::setNormalColorStart(const QColor& normalColorStart)
{
if (this->normalColorStart != normalColorStart) {
this->normalColorStart = normalColorStart;
this->update();
}
}
void Battery::setNormalColorEnd(const QColor& normalColorEnd)
{
if (this->normalColorEnd != normalColorEnd) {
this->normalColorEnd = normalColorEnd;
this->update();
}
}

154
src/components/battery.h Normal file
View File

@@ -0,0 +1,154 @@
#ifndef BATTERY_H
#define BATTERY_H
/**
* 电池电量控件 作者:feiyangqingyun(QQ:517216493) 2016-10-23
* 1. 可设置电池电量,动态切换电池电量变化。
* 2. 可设置电池电量警戒值。
* 3. 可设置电池电量正常颜色和报警颜色。
* 4. 可设置边框渐变颜色。
* 5. 可设置电量变化时每次移动的步长。
* 6. 可设置边框圆角角度、背景进度圆角角度、头部圆角角度。
*/
#include <QWidget>
#ifdef quc
class Q_DECL_EXPORT Battery : public QWidget
#else
class Battery : public QWidget
#endif
{
Q_OBJECT
Q_PROPERTY(double minValue READ getMinValue WRITE setMinValue)
Q_PROPERTY(double maxValue READ getMaxValue WRITE setMaxValue)
Q_PROPERTY(double value READ getValue WRITE setValue)
Q_PROPERTY(double alarmValue READ getAlarmValue WRITE setAlarmValue)
Q_PROPERTY(double step READ getStep WRITE setStep)
Q_PROPERTY(int borderWidth READ getBorderWidth WRITE setBorderWidth)
Q_PROPERTY(int borderRadius READ getBorderRadius WRITE setBorderRadius)
Q_PROPERTY(int bgRadius READ getBgRadius WRITE setBgRadius)
Q_PROPERTY(int headRadius READ getHeadRadius WRITE setHeadRadius)
Q_PROPERTY(QColor borderColorStart READ getBorderColorStart WRITE setBorderColorStart)
Q_PROPERTY(QColor borderColorEnd READ getBorderColorEnd WRITE setBorderColorEnd)
Q_PROPERTY(QColor alarmColorStart READ getAlarmColorStart WRITE setAlarmColorStart)
Q_PROPERTY(QColor alarmColorEnd READ getAlarmColorEnd WRITE setAlarmColorEnd)
Q_PROPERTY(QColor normalColorStart READ getNormalColorStart WRITE setNormalColorStart)
Q_PROPERTY(QColor normalColorEnd READ getNormalColorEnd WRITE setNormalColorEnd)
public:
explicit Battery(QWidget *parent = 0);
~Battery();
protected:
void paintEvent(QPaintEvent *);
void drawBorder(QPainter *painter);
void drawBg(QPainter *painter);
void drawHead(QPainter *painter);
private slots:
void updateValue();
private:
double minValue; //最小值
double maxValue; //最大值
double value; //目标电量
double alarmValue; //电池电量警戒值
double step; //每次移动的步长
int borderWidth; //边框粗细
int borderRadius; //边框圆角角度
int bgRadius; //背景进度圆角角度
int headRadius; //头部圆角角度
QColor borderColorStart; //边框渐变开始颜色
QColor borderColorEnd; //边框渐变结束颜色
QColor alarmColorStart; //电池低电量时的渐变开始颜色
QColor alarmColorEnd; //电池低电量时的渐变结束颜色
QColor normalColorStart; //电池正常电量时的渐变开始颜色
QColor normalColorEnd; //电池正常电量时的渐变结束颜色
bool isForward; //是否往前移
double currentValue; //当前电量
QRectF batteryRect; //电池主体区域
QTimer *timer; //绘制定时器
public:
double getMinValue() const;
double getMaxValue() const;
double getValue() const;
double getAlarmValue() const;
double getStep() const;
int getBorderWidth() const;
int getBorderRadius() const;
int getBgRadius() const;
int getHeadRadius() const;
QColor getBorderColorStart() const;
QColor getBorderColorEnd() const;
QColor getAlarmColorStart() const;
QColor getAlarmColorEnd() const;
QColor getNormalColorStart() const;
QColor getNormalColorEnd() const;
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置范围值
void setRange(double minValue, double maxValue);
void setRange(int minValue, int maxValue);
//设置最大最小值
void setMinValue(double minValue);
void setMaxValue(double maxValue);
//设置电池电量值
void setValue(double value);
void setValue(int value);
//设置电池电量警戒值
void setAlarmValue(double alarmValue);
void setAlarmValue(int alarmValue);
//设置步长
void setStep(double step);
void setStep(int step);
//设置边框粗细
void setBorderWidth(int borderWidth);
//设置边框圆角角度
void setBorderRadius(int borderRadius);
//设置背景圆角角度
void setBgRadius(int bgRadius);
//设置头部圆角角度
void setHeadRadius(int headRadius);
//设置边框渐变颜色
void setBorderColorStart(const QColor &borderColorStart);
void setBorderColorEnd(const QColor &borderColorEnd);
//设置电池电量报警时的渐变颜色
void setAlarmColorStart(const QColor &alarmColorStart);
void setAlarmColorEnd(const QColor &alarmColorEnd);
//设置电池电量正常时的渐变颜色
void setNormalColorStart(const QColor &normalColorStart);
void setNormalColorEnd(const QColor &normalColorEnd);
Q_SIGNALS:
void valueChanged(double value);
};
#endif // BATTERY_H

View File

@@ -17,276 +17,289 @@
TRIGGER_EVENT(GUIEvents::GUIErrorRaise, nullptr, (QObject*)&errormsg);
const char * getStatusString(int status)
const char* getStatusString(int status)
{
switch (status) {
case SCANNING:
return "SCANNING";
case READY:
return "Ready";
case BUSY:
return "BUSY";
case ERROR:
return "ERROR";
}
return "";
switch (status) {
case SCANNING:
return "SCANNING";
case READY:
return "Ready";
case BUSY:
return "BUSY";
case ERROR:
return "ERROR";
}
return "";
}
std::string getJsonFromPatInf(QObject* obj)
{
return ((QString*)obj)->toStdString();
return ((QString*)obj)->toStdString();
}
void ErrorCallback(const char * msg)
void ErrorCallback(const char* msg)
{
DeviceManager::Default()->setErrorOccurred(true);
printf("Error Callback , message:%s\r\n", msg);
QString m(msg);
THROW_ERROR(m);
DeviceManager::Default()->setErrorOccurred(true);
printf("Error Callback , message:%s\r\n", msg);
QString m(msg);
THROW_ERROR(m);
}
void DeviceManager::initDevice() {
InitLib(ErrorCallback);
InitLib(ErrorCallback);
deviceInfTimerID = startTimer(1000);
deviceInfTimerID = startTimer(1000);
diskInfTimerID = startTimer(60000);
// empty scan
connect(EventCenter::Default(),&EventCenter::RequestEmptyScan,[=](QObject* sender, QObject* detail){
std::string json= getJsonFromPatInf(detail);
// qDebug()<<json.c_str();
// void * jss = malloc(json.size());
// memcpy(jss,json.c_str(),json.size());
// processScan((char*)jss,true);
processScan(json.c_str(),true);
});
// Patient scan
connect(EventCenter::Default(),&EventCenter::RequestPatientScan,[=](QObject* sender, QObject* detail){
std::string json= getJsonFromPatInf(detail);
qDebug()<<json.c_str();
if (!json.empty())
{
// void * jss = malloc(json.size());
// memcpy(jss,json.c_str(),json.size());
// processScan((char*)jss);
processScan(json.c_str());
}
});
// stop
connect(EventCenter::Default(),&EventCenter::RequestStop,[=]() {
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "Stop request status, status:%s" << getStatusString(inf.status);
// empty scan
connect(EventCenter::Default(), &EventCenter::RequestEmptyScan, [=](QObject* sender, QObject* detail) {
std::string json = getJsonFromPatInf(detail);
// qDebug()<<json.c_str();
// void * jss = malloc(json.size());
// memcpy(jss,json.c_str(),json.size());
// processScan((char*)jss,true);
processScan(json.c_str(), true);
});
// Patient scan
connect(EventCenter::Default(), &EventCenter::RequestPatientScan, [=](QObject* sender, QObject* detail) {
std::string json = getJsonFromPatInf(detail);
qDebug() << json.c_str();
if (!json.empty())
{
// void * jss = malloc(json.size());
// memcpy(jss,json.c_str(),json.size());
// processScan((char*)jss);
processScan(json.c_str());
}
});
// stop
connect(EventCenter::Default(), &EventCenter::RequestStop, [=]() {
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "Stop request status, status:%s" << getStatusString(inf.status);
// check device status=========================================
//device is ready return
if (inf.status != SCANNING) {
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
return;
}
// if (inf.status == BUSY) {
// QString msg("Device is busy, Stop operation fail!");
// THROW_ERROR(msg);
// return;
// };
AppGlobalValues::setInProcessing(true);
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
//ScanControl fail
qDebug() << "Request stop!";
if (timerID != -1)killTimer(timerID);
if (ScanControl(STOP)) {
qDebug() << "Stop fail!";
QString msg("Stop operation fail!");
THROW_ERROR(msg);
qDebug() << "Error thrown!";
lastStatus = -1;
previewing = false;
QString s("%1 %2");
s = s.arg(QDateTime::currentDateTime().toString("yyyy/MM/dd HH:mm:ss"), msg);
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject *) &msg);
return;
}
lastStatus = -1;
previewing = false;
QString s("%1 %2");
s = s.arg(QDateTime::currentDateTime().toString("yyyy/MM/dd HH:mm:ss"), ("Scan Stopped!"));
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject *) &s);
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, nullptr);
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
AppGlobalValues::setInProcessing(false);
});
// check device status=========================================
//device is ready return
if (inf.status != SCANNING) {
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
return;
}
// if (inf.status == BUSY) {
// QString msg("Device is busy, Stop operation fail!");
// THROW_ERROR(msg);
// return;
// };
AppGlobalValues::setInProcessing(true);
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
//ScanControl fail
qDebug() << "Request stop!";
if (timerID != -1)killTimer(timerID);
if (ScanControl(STOP)) {
qDebug() << "Stop fail!";
QString msg("Stop operation fail!");
THROW_ERROR(msg);
qDebug() << "Error thrown!";
lastStatus = -1;
previewing = false;
QString s("%1 %2");
s = s.arg(QDateTime::currentDateTime().toString("yyyy/MM/dd HH:mm:ss"), msg);
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject*)&msg);
return;
}
lastStatus = -1;
previewing = false;
QString s("%1 %2");
s = s.arg(QDateTime::currentDateTime().toString("yyyy/MM/dd HH:mm:ss"), ("Scan Stopped!"));
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject*)&s);
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, nullptr);
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
AppGlobalValues::setInProcessing(false);
});
// preview
connect(EventCenter::Default(),&EventCenter::RequestPreviewScan,[=](){
// check device status=========================================
qDebug()<<"GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "PreviewScan request status, status:" << getStatusString(inf.status);
if (inf.status==READY)
{
AppGlobalValues::setInProcessing(true);
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
//ScanControl
qDebug()<<"Request preview!";
if(!ScanControl(PREVIEW_SCAN))
{
qDebug()<<"Preview success!";
lastStatus = SCANNING;
previewing = true;
// timerID = startTimer(500);
TRIGGER_EVENT(GUIEvents::ResponsePreview, nullptr, nullptr);
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, nullptr);
QString s("Device Previewing!");
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject*)&s);
return;
}
}
qDebug()<<"Preview fail!";
QString msg(inf.status!=READY?"Can't start preview,Device is not ready!":"Start preview operation fail!");
THROW_ERROR(msg);
qDebug()<<"Error thrown!";
});
// preview
connect(EventCenter::Default(), &EventCenter::RequestPreviewScan, [=]() {
// check device status=========================================
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "PreviewScan request status, status:" << getStatusString(inf.status);
if (inf.status == READY)
{
AppGlobalValues::setInProcessing(true);
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
//ScanControl
qDebug() << "Request preview!";
if (!ScanControl(PREVIEW_SCAN))
{
qDebug() << "Preview success!";
lastStatus = SCANNING;
previewing = true;
// timerID = startTimer(500);
TRIGGER_EVENT(GUIEvents::ResponsePreview, nullptr, nullptr);
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, nullptr);
QString s("Device Previewing!");
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject*)&s);
return;
}
}
qDebug() << "Preview fail!";
QString msg(inf.status != READY ? "Can't start preview,Device is not ready!" : "Start preview operation fail!");
THROW_ERROR(msg);
qDebug() << "Error thrown!";
});
previewDataCaller = QThread::create([=](){
while (!endLoop)
{
if (!previewing) {
QThread::sleep(3);
continue;
}
// check device status=========================================
qDebug()<<"GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "GetPreviewData request status, status:" << getStatusString(inf.status);
// device is preview scanning, try get preview data
if (inf.status==SCANNING) {
qDebug() << "Preview data reader read start!";
const char *data = GetPreviewData();
if (!data)continue;
qDebug() << "Preview data reader read end!";
QByteArray bytes = QByteArray::fromRawData(data, 140 * 140);
//double check
if (!previewing) {
qDebug()<<"Preview data reader long sleep!";
QThread::sleep(3);
continue;
}
qDebug() << "Preview data response event start!";
TRIGGER_EVENT(GUIEvents::ResponsePreviewData, nullptr, (QObject *) (&bytes));
qDebug() << "Preview data response event end!";
}
QThread::msleep(100);
}
});
previewDataCaller->start();
previewDataCaller = QThread::create([=]() {
while (!endLoop)
{
if (!previewing) {
QThread::sleep(3);
continue;
}
// check device status=========================================
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "GetPreviewData request status, status:" << getStatusString(inf.status);
// device is preview scanning, try get preview data
if (inf.status == SCANNING) {
qDebug() << "Preview data reader read start!";
const char* data = GetPreviewData();
if (!data)continue;
qDebug() << "Preview data reader read end!";
QByteArray bytes = QByteArray::fromRawData(data, 140 * 140);
//double check
if (!previewing) {
qDebug() << "Preview data reader long sleep!";
QThread::sleep(3);
continue;
}
qDebug() << "Preview data response event start!";
TRIGGER_EVENT(GUIEvents::ResponsePreviewData, nullptr, (QObject*)(&bytes));
qDebug() << "Preview data response event end!";
}
QThread::msleep(100);
}
});
previewDataCaller->start();
}
void DeviceManager::timerEvent(QTimerEvent *event) {
//scanning progress timer
if (event->timerId() !=deviceInfTimerID)
{
//error exit, callback error
if (errorOccurred)
{
// qDebug() << "Error occurred, exit progress timer";
// QString msg("Error occurred, exit current operation!");
// THROW_ERROR(msg);
goto exitTimer;
}
// previewing exit
if (previewing)
{
QString msg("Device is previewing, exit current operation!");
THROW_ERROR(msg);
goto exitTimer;
} else {
// check device status=========================================
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "Scanning request status, status:" << getStatusString(inf.status);
//设备正常扫描中
if (inf.status == SCANNING) {
lastStatus = SCANNING;
//normal scan
QVariant var(inf.progress);
qDebug() << "Normal scan, invoke InvokeOperationProgress:" << inf.progress;
TRIGGER_EVENT(GUIEvents::InvokeOperationProgress, nullptr, (QObject *) &var);
return;
} else {
//未发生错误并且,之前状态是扫描,代表正常扫描完成
if (lastStatus == SCANNING) {
qDebug() << "Scan finished";
QVariant var(true);
qDebug() << "InvokeOperationEnd";
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, (QObject *) &var);
AppGlobalValues::setInProcessing(false);
lastStatus = -1;
previewing = false;
QString s("%1 %2");
s = s.arg(QDateTime::currentDateTime().toString("yyyy/MM/dd HH:mm:ss")).arg("Scan finished");
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject *) &s);
}
//一般不会出现其他情况
else {
QString msg("Unknown error in scanning progress timer");
THROW_ERROR(msg);
}
}
}
exitTimer:
qDebug() << "Scanning progress Timer exit";
killTimer(timerID);
timerID=-1;
lastStatus = -1;
previewing = false;
return;
} else{
void DeviceManager::timerEvent(QTimerEvent* event) {
if (event->timerId() == deviceInfTimerID) {
QString temp = QString(GetDeviceInfo(MEAN_TEMPERATURE));
TRIGGER_EVENT(GUIEvents::ResponseDeviceTemperature, nullptr, (QObject*)&temp);
return;
}
if (event->timerId() == diskInfTimerID)
{
TRIGGER_EVENT(GUIEvents::ResponseDeviceStoragement, nullptr, nullptr);
return;
}
//scanning progress timer
{
//error exit, callback error
if (errorOccurred)
{
// qDebug() << "Error occurred, exit progress timer";
// QString msg("Error occurred, exit current operation!");
// THROW_ERROR(msg);
goto exitTimer;
}
// previewing exit
if (previewing)
{
QString msg("Device is previewing, exit current operation!");
THROW_ERROR(msg);
goto exitTimer;
}
else {
// check device status=========================================
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "Scanning request status, status:" << getStatusString(inf.status);
//设备正常扫描中
if (inf.status == SCANNING) {
lastStatus = SCANNING;
//normal scan
QVariant var(inf.progress);
qDebug() << "Normal scan, invoke InvokeOperationProgress:" << inf.progress;
TRIGGER_EVENT(GUIEvents::InvokeOperationProgress, nullptr, (QObject*)&var);
return;
}
else {
//未发生错误并且,之前状态是扫描,代表正常扫描完成
if (lastStatus == SCANNING) {
qDebug() << "Scan finished";
QVariant var(true);
qDebug() << "InvokeOperationEnd";
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, (QObject*)&var);
AppGlobalValues::setInProcessing(false);
lastStatus = -1;
previewing = false;
QString s("%1 %2");
s = s.arg(QDateTime::currentDateTime().toString("yyyy/MM/dd HH:mm:ss")).arg("Scan finished");
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject*)&s);
}
//一般不会出现其他情况
else {
QString msg("Unknown error in scanning progress timer");
THROW_ERROR(msg);
}
}
}
exitTimer:
qDebug() << "Scanning progress Timer exit";
killTimer(timerID);
timerID = -1;
lastStatus = -1;
previewing = false;
return;
}
}
void DeviceManager::processScan(const char *json, bool empty) {
//clear last error state first
errorOccurred = false;
// check device status=========================================
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "Scan start request status, status:" << getStatusString(inf.status);
if (inf.status != READY) {
QString errmsg("Device is not ready, start scan operation fail!status is %1");
errmsg = errmsg.arg(getStatusString(inf.status));
THROW_ERROR(errmsg);
return;
}
static QString msg = "Start scan...";
AppGlobalValues::setInProcessing(true);
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, (QObject *) &msg);
qDebug() << "SetScanInfo>>>>>>>>>>>>>>>>>>>>";
int ret = SetScanInfo(json, empty ? 1 : 0);
if (ret) {
qDebug() << ">>>>>>>>>>>>>>>>>>>>SetScanInfo failed";
QString errmsg("Transfer patient information fail!");
qDebug() << "Error thrown";
THROW_ERROR(errmsg);
return;
}
qDebug() << ">>>>>>>>>>>>>>>>>>>>SetScanInfo success";
//ScanControl fail
qDebug() << "ScanControl start>>>>>>>>>>>>>>>>>>>>>";
if (!ScanControl(SCAN)) {
qDebug() << ">>>>>>>>>>>>>>>>>>>>>ScanControl success";
//set current state
lastStatus = SCANNING;
previewing = false;
qDebug() << "Start progress timer";
timerID = startTimer(300);
return;
}
QString errmsg("ScanControl start fail!");
THROW_ERROR(errmsg);
qDebug() << ">>>>>>>>>>>>>>>>>>>>>ScanControl failed";
void DeviceManager::processScan(const char* json, bool empty) {
//clear last error state first
errorOccurred = false;
// check device status=========================================
qDebug() << "GetStatus";
StatusInfo inf = GetStatus();
qDebug() << "Scan start request status, status:" << getStatusString(inf.status);
if (inf.status != READY) {
QString errmsg("Device is not ready, start scan operation fail!status is %1");
errmsg = errmsg.arg(getStatusString(inf.status));
THROW_ERROR(errmsg);
return;
}
static QString msg = "Start scan...";
AppGlobalValues::setInProcessing(true);
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, (QObject*)&msg);
qDebug() << "SetScanInfo>>>>>>>>>>>>>>>>>>>>";
int ret = SetScanInfo(json, empty ? 1 : 0);
if (ret) {
qDebug() << ">>>>>>>>>>>>>>>>>>>>SetScanInfo failed";
QString errmsg("Transfer patient information fail!");
qDebug() << "Error thrown";
THROW_ERROR(errmsg);
return;
}
qDebug() << ">>>>>>>>>>>>>>>>>>>>SetScanInfo success";
//ScanControl fail
qDebug() << "ScanControl start>>>>>>>>>>>>>>>>>>>>>";
if (!ScanControl(SCAN)) {
qDebug() << ">>>>>>>>>>>>>>>>>>>>>ScanControl success";
//set current state
lastStatus = SCANNING;
previewing = false;
qDebug() << "Start progress timer";
timerID = startTimer(300);
return;
}
QString errmsg("ScanControl start fail!");
THROW_ERROR(errmsg);
qDebug() << ">>>>>>>>>>>>>>>>>>>>>ScanControl failed";
}

View File

@@ -7,34 +7,35 @@
#include <QObject>
#include <QThread>
class DeviceManager:public QObject {
Q_OBJECT
class DeviceManager :public QObject {
Q_OBJECT
public:
static DeviceManager* Default(){
static DeviceManager manager;
return &manager;
}
void initDevice();
void setErrorOccurred(bool v){
errorOccurred = v;
}
bool getErrorOccurred(){
return errorOccurred;
}
static DeviceManager* Default() {
static DeviceManager manager;
return &manager;
}
void initDevice();
void setErrorOccurred(bool v) {
errorOccurred = v;
}
bool getErrorOccurred() {
return errorOccurred;
}
protected:
void timerEvent(QTimerEvent* event) override ;
void timerEvent(QTimerEvent* event) override;
private:
void processScan(const char * json,bool empty = false);
int timerID = -1;
int deviceInfTimerID = -1;
int lastStatus=-1;
bool previewing = false;
bool endLoop = false;
bool errorOccurred = false;
QThread* previewDataCaller;
void processScan(const char* json, bool empty = false);
int timerID = -1;
int deviceInfTimerID = -1;
int diskInfTimerID = -1;
int lastStatus = -1;
bool previewing = false;
bool endLoop = false;
bool errorOccurred = false;
QThread* previewDataCaller;
};

View File

@@ -16,6 +16,7 @@ ADD_EVENT_VALUE(RequestEmptyScan)\
ADD_EVENT_VALUE(RequestPatientScan)\
ADD_EVENT_VALUE(RequestStop)\
ADD_EVENT_VALUE(ResponseDeviceTemperature)\
ADD_EVENT_VALUE(ResponseDeviceStoragement)\
ADD_EVENT_VALUE(ResponsePreview)\
ADD_EVENT_VALUE(ResponsePreviewData)\
ADD_EVENT_VALUE(ResponseStop)\
@@ -30,27 +31,27 @@ ADD_EVENT_VALUE(ReloadLanguage)\
ADD_EVENT_VALUE(WarnStateFlagChange)\
ADD_EVENT_VALUE(GUIErrorRaise)
enum GUIEvents{
enum GUIEvents {
#define ADD_EVENT_VALUE(val) val,
ADD_EVENT()
ADD_EVENT()
#undef ADD_EVENT_VALUE
};
class EventCenter:public QObject {
Q_OBJECT
class EventCenter :public QObject {
Q_OBJECT
public:
static EventCenter* Default(){
static EventCenter instance;
return &instance;
}
void triggerEvent(GUIEvents event,QObject* sender,QObject* data);
signals:
#define ADD_EVENT_VALUE(val)\
static EventCenter* Default() {
static EventCenter instance;
return &instance;
}
void triggerEvent(GUIEvents event, QObject* sender, QObject* data);
signals:
#define ADD_EVENT_VALUE(val)\
void val(QObject* sender,QObject* data);
ADD_EVENT()
#undef ADD_EVENT_VALUE
ADD_EVENT()
#undef ADD_EVENT_VALUE
};

115
src/json/cmdhelper.cpp Normal file
View File

@@ -0,0 +1,115 @@
#include "cmdhelper.h"
#include <stdio.h>
#include <QProcess>
#define BUFFER_LENGTH 100
cmdHelper::cmdHelper(QObject* parent) : QObject(parent)
{
}
QString cmdHelper::getLinuxVersion()
{
std::string str;
if (cmdHelper::Instance()->exec("cat /proc/version", str))
{
QString qstr = QString::fromStdString(str);
return qstr.section(')', 0, 0).append(")");
}
return QString("Unable to get Linux version!");
}
QString cmdHelper::getDCMTKVersion()
{
std::string str;
if (cmdHelper::Instance()->exec2("zypper info dcmtk", str))
{
QString qstr = QString::fromStdString(str);
QStringList strList = qstr.split('\n');
for (int i = 0; i < strList.size(); i++)
{
if (strList.at(i).contains("Version"))
{
QStringList strList2 = strList.at(i).split(':');
return QString("DCMTK %1").arg(strList2[1]);
}
}
};
return QString("Unable to get DCMTK version!");
}
bool cmdHelper::getDiskSize(double& size)
{
std::string str;
if (cmdHelper::Instance()->exec2("df /home/usct/data -h", str))
{
QString qstr = QString::fromStdString(str);
QStringList strList = qstr.split('\n');
strList[1].replace(QRegExp("[\\s]+"), " ");
QStringList strList2 = strList[1].split(" ");
int pos = strList2[1].lastIndexOf(QChar('G'));
size = strList2[1].left(pos).toDouble();
return true;
};
return false;
}
bool cmdHelper::getDiskUsed(double& used)
{
std::string str;
if (cmdHelper::Instance()->exec2("df /home/usct/data -h", str))
{
QString qstr = QString::fromStdString(str);
QStringList strList = qstr.split('\n');
strList[1].replace(QRegExp("[\\s]+"), " ");
QStringList strList2 = strList[1].split(" ");
int pos = strList2[2].lastIndexOf(QChar('G'));
used = strList2[2].left(pos).toDouble();
return true;
};
return false;
}
bool cmdHelper::exec(const char* cmd, std::string& result) {
#ifndef WIN32
FILE* fp = nullptr;
if (!(fp = popen(cmd, "r")))
{
result.append(strerror(errno));
pclose(fp);
return false;
}
char buffer[BUFFER_LENGTH];
memset(buffer, 0, BUFFER_LENGTH);
while (fgets(buffer, BUFFER_LENGTH, fp))
{
result.append(buffer, strlen(buffer) - 1);
}
pclose(fp);
return true;
#else
return false;
#endif // WIN32
}
bool cmdHelper::exec2(const char* cmd, std::string& result)
{
QProcess* myProcess = new QProcess;
QStringList args;
args << "-c" << cmd;
connect(myProcess, SIGNAL(finished(int)), myProcess, SLOT(deleteLater()));
myProcess->start("/bin/sh", args);
if (!myProcess->waitForFinished() || myProcess->exitCode() != 0) {
return false;
}
result.append(myProcess->readAllStandardOutput());
return true;
}

28
src/json/cmdhelper.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef CMDHELPER_H
#define CMDHELPER_H
#include <QObject>
#include <QString>
class cmdHelper : public QObject
{
Q_OBJECT
public:
static cmdHelper* Instance()
{
static cmdHelper obj;
return &obj;
}
bool getDiskSize(double& size);
bool getDiskUsed(double& used);
QString getLinuxVersion();
QString getDCMTKVersion();
private:
bool exec(const char* cmd, std::string& result);
bool exec2(const char* cmd, std::string& result);
explicit cmdHelper(QObject* parent = nullptr);
};
#endif // CMDHEPLER_H

View File

@@ -226,6 +226,12 @@ void JsonObject::setLockScreenTimeout(const QString& str)
setJsonString("general", "lockscreen", str.toStdString().c_str());
}
QString JsonObject::storageAlarmSize()
{
char* str = getJsonString("storagepolicy", "mininum");
return QString(str);
}
bool JsonObject::loadcfg()
{
if (m_bLoaded)
@@ -233,7 +239,7 @@ bool JsonObject::loadcfg()
std::ifstream inFile(strProductFileName);
if (!inFile.is_open())
{
return -1;
return false;
}
std::stringstream ss;
ss << inFile.rdbuf();
@@ -257,7 +263,7 @@ bool JsonObject::savecfg()
std::ofstream outFile(strProductFileName);
if (!outFile.is_open())
{
return -1;
return false;
}
char* strJsonData = cJSON_Print((cJSON*)json_root);

View File

@@ -41,6 +41,9 @@ public:
WORKLIST, PACS, LOCAL, RECON
};
//
QString storageAlarmSize();
//
//for login
void setDefaultUser(const QString& str);
QString defaultUser();
@@ -96,6 +99,7 @@ public:
QList<QStringList> getIpRouteList();
void setIpRouteList(const QList<QStringList>& list);
private:
void setJsonString(const char* catergory, const char* stringName, const char* stringValue, bool save = true);
char* getJsonString(const char* catergory, const char* stringName);

View File

@@ -18,13 +18,40 @@
#include "json/jsonobject.h"
#include "event/EventCenter.h"
#include "device/DeviceManager.h"
#include "json/cmdhelper.h"
systemSettingForm::systemSettingForm(QWidget* parent) :
QWidget(parent),
ui(new Ui::systemSettingForm)
{
ui->setupUi(this);
//[step]
//1)get total size and setMaxValue
//2)calculate percent(total-85)/total*100 and setAlarmValue
//3)get used size and setValue
double dsize;
if (cmdHelper::Instance()->getDiskSize(dsize))
{
m_disksize = dsize;
}
else
{
m_disksize = -1.0;
}
updateDiskSize();
double duse;
if (cmdHelper::Instance()->getDiskUsed(duse))
{
m_diskuse = duse;
}
else
{
m_diskuse = -1.0;
}
updateDiskUse();
//style init
//ui->btn_dicom->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
ui->btn_dicom->setIcon(QIcon(":/icons/dicomsettings.png"));
@@ -49,6 +76,19 @@ systemSettingForm::systemSettingForm(QWidget* parent) :
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
ui->btnFlt->setObjectName("BigBtn");
connect(EventCenter::Default(), &EventCenter::ResponseDeviceStoragement, [=](QObject*) {
double duse;
if (cmdHelper::Instance()->getDiskUsed(duse))
{
m_diskuse = duse;
}
else
{
m_diskuse = -1.0;
}
updateDiskUse();
});
//connection
connect(ui->swt_verify, &ImageSwitch::clicked, [=]() {
if (ui->swt_verify->getChecked())
@@ -113,20 +153,43 @@ systemSettingForm::systemSettingForm(QWidget* parent) :
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
ui->swt_verify->setChecked(true);
updateDiskSize();
updateDiskUse();
});
}
void systemSettingForm::updateDiskSize()
{
if (m_disksize != -1.0)
{
ui->batIcon->setMaxValue(m_disksize);
double aValue = (m_disksize - JsonObject::Instance()->storageAlarmSize().toDouble()) / m_disksize;
ui->batIcon->setAlarmValue(aValue);
ui->lbl_size->setText(tr("total:\t%1G").arg(m_disksize));
}
else
{
ui->lbl_size->setText(tr("Get disk total size fail!"));
}
}
void systemSettingForm::updateDiskUse()
{
if (m_diskuse != -1.0)
{
ui->batIcon->setValue(m_disksize);
ui->lbl_used->setText(tr("used:\t%1G").arg(m_disksize));
}
else
{
ui->lbl_used->setText(tr("Get disk used size fail!"));
}
}
systemSettingForm::~systemSettingForm()
{
delete ui;
}
//void systemSettingForm::changeEvent(QEvent* event)
//{
// if (event->type() == QEvent::LanguageChange)
// {
// ui->retranslateUi(this);
// }
//}

View File

@@ -27,6 +27,12 @@ private:
Ui::systemSettingForm* ui;
SelectDialog* sd_protocal = nullptr;
SelectDialog* sd_filter = nullptr;
double m_disksize = -1.0;
double m_diskuse = -1.0;
void updateDiskSize();
void updateDiskUse();
};
#endif // SYSTEMSETTINGFORM_H

View File

@@ -162,7 +162,7 @@
</item>
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QToolButton" name="btn_network">
<property name="text">
@@ -264,6 +264,49 @@
</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">
<item>
<widget class="Battery" name="batIcon" native="true"/>
</item>
<item>
<widget class="QWidget" name="widget_6" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="lbl_size">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_used">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
@@ -292,6 +335,12 @@
<header location="global">components/imageswitch.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Battery</class>
<extends>QWidget</extends>
<header location="global">components/battery.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@@ -781,5 +781,25 @@ parameters
<source>DICOM</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Disk Storage</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>used: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk total size fail!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk used size fail!</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -781,5 +781,25 @@ parameters
<source>DICOM</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Disk Storage</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>used: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk total size fail!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Get disk used size fail!</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -4,68 +4,68 @@
<context>
<name>AboutWidget</name>
<message>
<location filename="../aboutwidget.cpp" line="58"/>
<location filename="../aboutwidget.cpp" line="148"/>
<location filename="../aboutwidget.cpp" line="55"/>
<location filename="../aboutwidget.cpp" line="145"/>
<source>HJ-USCT-01 V1.0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="62"/>
<location filename="../aboutwidget.cpp" line="149"/>
<location filename="../aboutwidget.cpp" line="59"/>
<location filename="../aboutwidget.cpp" line="146"/>
<source>?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="134"/>
<location filename="../aboutwidget.cpp" line="131"/>
<source>cJSON</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="150"/>
<location filename="../aboutwidget.cpp" line="147"/>
<source>Copyright © 2017-2020 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="75"/>
<location filename="../aboutwidget.cpp" line="151"/>
<location filename="../aboutwidget.cpp" line="72"/>
<location filename="../aboutwidget.cpp" line="148"/>
<source>GUI Software V1.3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="68"/>
<location filename="../aboutwidget.cpp" line="65"/>
<source>Copyright © 2017-2022 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="80"/>
<location filename="../aboutwidget.cpp" line="152"/>
<location filename="../aboutwidget.cpp" line="77"/>
<location filename="../aboutwidget.cpp" line="149"/>
<source>Embedded Software V1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="85"/>
<location filename="../aboutwidget.cpp" line="153"/>
<location filename="../aboutwidget.cpp" line="82"/>
<location filename="../aboutwidget.cpp" line="150"/>
<source>Reconstruction Software V1.2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="91"/>
<location filename="../aboutwidget.cpp" line="154"/>
<location filename="../aboutwidget.cpp" line="88"/>
<location filename="../aboutwidget.cpp" line="151"/>
<source>FEB Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="97"/>
<location filename="../aboutwidget.cpp" line="94"/>
<source>Qt 5.12.0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="127"/>
<location filename="../aboutwidget.cpp" line="124"/>
<source>Copyright (c) 1994-2021, OFFIS e.V.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="138"/>
<location filename="../aboutwidget.cpp" line="135"/>
<source>Copyright (c) 2009-2017 Dave Gamble</source>
<translation type="unfinished"></translation>
</message>
@@ -850,6 +850,33 @@ parameters
<translation></translation>
</message>
</context>
<context>
<name>cmdHelper</name>
<message>
<source>total: %1</source>
<translation type="vanished">:%1</translation>
</message>
<message>
<source>total: %1G</source>
<translation type="vanished">:\t%1G</translation>
</message>
<message>
<source>Get disk total size fail!</source>
<translation type="vanished"></translation>
</message>
<message>
<source>used: %1G</source>
<translation type="vanished">:\t%1G</translation>
</message>
<message>
<source>Get disk used size fail!</source>
<translation type="vanished">使</translation>
</message>
<message>
<source>used: %1</source>
<translation type="vanished">%1</translation>
</message>
</context>
<context>
<name>dicomCfgDialog</name>
<message>
@@ -1067,7 +1094,7 @@ parameters
<context>
<name>systemSettingForm</name>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="230"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="281"/>
<source>Form</source>
<translation></translation>
</message>
@@ -1076,21 +1103,26 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="231"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="282"/>
<source>Protocal</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="235"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="286"/>
<source>Worklist Filter</source>
<translation>Worklist过滤器</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="289"/>
<source>Disk Storage</source>
<translation></translation>
</message>
<message>
<source>...</source>
<translation type="vanished">DICOM</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="233"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="284"/>
<source>Auto Verify</source>
<translation></translation>
</message>
@@ -1099,7 +1131,7 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="234"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="285"/>
<source>IP</source>
<translation></translation>
</message>
@@ -1116,9 +1148,29 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="237"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="288"/>
<source>DICOM</source>
<translation></translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="170"/>
<source>total: %1G</source>
<translation>:\t%1G</translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="174"/>
<source>Get disk total size fail!</source>
<translation></translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="183"/>
<source>used: %1G</source>
<translation>:\t%1G</translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="187"/>
<source>Get disk used size fail!</source>
<translation>使</translation>
</message>
</context>
</TS>

View File

@@ -4,68 +4,68 @@
<context>
<name>AboutWidget</name>
<message>
<location filename="../aboutwidget.cpp" line="58"/>
<location filename="../aboutwidget.cpp" line="148"/>
<location filename="../aboutwidget.cpp" line="55"/>
<location filename="../aboutwidget.cpp" line="145"/>
<source>HJ-USCT-01 V1.0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="62"/>
<location filename="../aboutwidget.cpp" line="149"/>
<location filename="../aboutwidget.cpp" line="59"/>
<location filename="../aboutwidget.cpp" line="146"/>
<source>?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="134"/>
<location filename="../aboutwidget.cpp" line="131"/>
<source>cJSON</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="150"/>
<location filename="../aboutwidget.cpp" line="147"/>
<source>Copyright © 2017-2020 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="75"/>
<location filename="../aboutwidget.cpp" line="151"/>
<location filename="../aboutwidget.cpp" line="72"/>
<location filename="../aboutwidget.cpp" line="148"/>
<source>GUI Software V1.3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="68"/>
<location filename="../aboutwidget.cpp" line="65"/>
<source>Copyright © 2017-2022 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="80"/>
<location filename="../aboutwidget.cpp" line="152"/>
<location filename="../aboutwidget.cpp" line="77"/>
<location filename="../aboutwidget.cpp" line="149"/>
<source>Embedded Software V1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="85"/>
<location filename="../aboutwidget.cpp" line="153"/>
<location filename="../aboutwidget.cpp" line="82"/>
<location filename="../aboutwidget.cpp" line="150"/>
<source>Reconstruction Software V1.2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="91"/>
<location filename="../aboutwidget.cpp" line="154"/>
<location filename="../aboutwidget.cpp" line="88"/>
<location filename="../aboutwidget.cpp" line="151"/>
<source>FEB Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="97"/>
<location filename="../aboutwidget.cpp" line="94"/>
<source>Qt 5.12.0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="127"/>
<location filename="../aboutwidget.cpp" line="124"/>
<source>Copyright (c) 1994-2021, OFFIS e.V.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwidget.cpp" line="138"/>
<location filename="../aboutwidget.cpp" line="135"/>
<source>Copyright (c) 2009-2017 Dave Gamble</source>
<translation type="unfinished"></translation>
</message>
@@ -850,6 +850,33 @@ parameters
<translation></translation>
</message>
</context>
<context>
<name>cmdHelper</name>
<message>
<source>total: %1</source>
<translation type="vanished">:%1</translation>
</message>
<message>
<source>total: %1G</source>
<translation type="vanished">:\t%1G</translation>
</message>
<message>
<source>Get disk total size fail!</source>
<translation type="vanished"></translation>
</message>
<message>
<source>used: %1G</source>
<translation type="vanished">:\t%1G</translation>
</message>
<message>
<source>Get disk used size fail!</source>
<translation type="vanished">使</translation>
</message>
<message>
<source>used: %1</source>
<translation type="vanished">%1</translation>
</message>
</context>
<context>
<name>dicomCfgDialog</name>
<message>
@@ -1067,7 +1094,7 @@ parameters
<context>
<name>systemSettingForm</name>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="230"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="281"/>
<source>Form</source>
<translation></translation>
</message>
@@ -1076,21 +1103,26 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="231"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="282"/>
<source>Protocal</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="235"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="286"/>
<source>Worklist Filter</source>
<translation>Worklist过滤器</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="289"/>
<source>Disk Storage</source>
<translation></translation>
</message>
<message>
<source>...</source>
<translation type="vanished">DICOM</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="233"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="284"/>
<source>Auto Verify</source>
<translation></translation>
</message>
@@ -1099,7 +1131,7 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="234"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="285"/>
<source>IP</source>
<translation></translation>
</message>
@@ -1116,9 +1148,29 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="237"/>
<location filename="../../out/build/x64-Debug/ui_systemsettingform.h" line="288"/>
<source>DICOM</source>
<translation></translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="170"/>
<source>total: %1G</source>
<translation>:\t%1G</translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="174"/>
<source>Get disk total size fail!</source>
<translation></translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="183"/>
<source>used: %1G</source>
<translation>:\t%1G</translation>
</message>
<message>
<location filename="../systemsettingform.cpp" line="187"/>
<source>Get disk used size fail!</source>
<translation>使</translation>
</message>
</context>
</TS>