Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ac282c2d0 | ||
|
|
5d02c34fba | ||
|
|
37b67b99da | ||
|
|
aecc6d6943 | ||
|
|
86ab0c5c06 | ||
|
|
305c934858 |
@@ -3,7 +3,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "log/LogFileTableModel.h"
|
#include "log/LogFileTableModel.h"
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "src/dialogs/SelectDialog.h"
|
#include "src/dialogs/SelectDialog.h"
|
||||||
#include "windows/MainWindow.h"
|
#include "windows/MainWindow.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
|
|
||||||
QString fileNameToDate(QString fileName)
|
QString fileNameToDate(QString fileName)
|
||||||
{
|
{
|
||||||
return fileName.split("log/UserOperationLog/")[1].replace("-op.log", "");
|
return fileName.split("log/UserOperationLog/")[1].replace("-op.log", "");
|
||||||
@@ -25,51 +26,51 @@ QString dateToFileName(QString date)
|
|||||||
UserOperationLogForm::UserOperationLogForm(QWidget* parent)
|
UserOperationLogForm::UserOperationLogForm(QWidget* parent)
|
||||||
: QWidget (parent)
|
: QWidget (parent)
|
||||||
{
|
{
|
||||||
layout = new QVBoxLayout(this);
|
mLayout = new QVBoxLayout(this);
|
||||||
QWidget* header = new QWidget(this);
|
QWidget* header = new QWidget(this);
|
||||||
QHBoxLayout* headerLayout = new QHBoxLayout(header);
|
QHBoxLayout* headerLayout = new QHBoxLayout(header);
|
||||||
QLabel* logdate = new QLabel(tr("Log Date:"));
|
QLabel* logdate = new QLabel(tr("Log Date:"));
|
||||||
headerLayout->addWidget(logdate);
|
headerLayout->addWidget(logdate);
|
||||||
btn = new QPushButton(header);
|
mDateButton = new QPushButton(header);
|
||||||
headerLayout->addWidget(btn, 0, Qt::AlignLeft);
|
headerLayout->addWidget(mDateButton, 0, Qt::AlignLeft);
|
||||||
headerLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
headerLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||||
|
|
||||||
model = new LogFileTableModel(this);
|
mModel = new LogFileTableModel(this);
|
||||||
model->setHeader(QStringList()<< tr("Operation Date") << tr("Operation Time") << tr("User") << tr("Operation"));
|
mModel->setHeader(QStringList()<< tr("Operation Date") << tr("Operation Time") << tr("User") << tr("Operation"));
|
||||||
loadUserOperationLog();
|
loadUserOperationLog();
|
||||||
table = new SlideTableView(this);
|
mLogTable = new SlideTableView(this);
|
||||||
layout->addWidget(header);
|
mLayout->addWidget(header);
|
||||||
layout->addWidget(table);
|
mLayout->addWidget(mLogTable);
|
||||||
table->setModel(model);
|
mLogTable->setModel(mModel);
|
||||||
table->setAlternatingRowColors(true);
|
mLogTable->setAlternatingRowColors(true);
|
||||||
table->setSelectionMode(QAbstractItemView::NoSelection);
|
mLogTable->setSelectionMode(QAbstractItemView::NoSelection);
|
||||||
table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
mLogTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
table->verticalHeader()->setDefaultSectionSize(38);
|
mLogTable->verticalHeader()->setDefaultSectionSize(38);
|
||||||
table->horizontalHeader()->setStretchLastSection(true);
|
mLogTable->horizontalHeader()->setStretchLastSection(true);
|
||||||
table->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
mLogTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
table->setColumnWidth(0, 250);
|
mLogTable->setColumnWidth(0, 250);
|
||||||
table->setColumnWidth(1, 250);
|
mLogTable->setColumnWidth(1, 250);
|
||||||
table->setColumnWidth(2, 200);
|
mLogTable->setColumnWidth(2, 200);
|
||||||
table->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }");;
|
mLogTable->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }");;
|
||||||
|
|
||||||
//暂时先放构造函数,之后需要移除,等需要时再调用
|
//暂时先放构造函数,之后需要移除,等需要时再调用
|
||||||
|
|
||||||
connect(btn, &QPushButton::clicked, [=]() {
|
connect(mDateButton, &QPushButton::clicked, [=]() {
|
||||||
auto files = UserOperationLog::getHistoryLogFiles();
|
auto files = UserOperationLog::getHistoryLogFiles();
|
||||||
QStringList dates;
|
QStringList dates;
|
||||||
for (auto f : files)
|
for (auto f : files)
|
||||||
{
|
{
|
||||||
dates << fileNameToDate(f);
|
dates << fileNameToDate(f);
|
||||||
}
|
}
|
||||||
if (!dialog) {
|
if (!mSelectDateDialog) {
|
||||||
dialog = new SelectDialog(this);
|
mSelectDateDialog = new SelectDialog(this);
|
||||||
dialog->setWindowModality(Qt::WindowModal);
|
mSelectDateDialog->setWindowModality(Qt::WindowModal);
|
||||||
}
|
}
|
||||||
dialog->setValues(dates);
|
mSelectDateDialog->setValues(dates);
|
||||||
if (!selectedDateStr.isEmpty()) dialog->setSelectedValue(selectedDateStr);
|
if (!mSelectedDateStr.isEmpty()) mSelectDateDialog->setSelectedValue(mSelectedDateStr);
|
||||||
if (dialog->exec() == QDialog::Accepted)
|
if (mSelectDateDialog->exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
QString date = dialog->getSelectedValue();
|
QString date = mSelectDateDialog->getSelectedValue();
|
||||||
QString f = dateToFileName(date);
|
QString f = dateToFileName(date);
|
||||||
this->loadUserOperationLog(f, date);
|
this->loadUserOperationLog(f, date);
|
||||||
}
|
}
|
||||||
@@ -77,32 +78,32 @@ UserOperationLogForm::UserOperationLogForm(QWidget* parent)
|
|||||||
|
|
||||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||||
logdate->setText(tr("Log Date:"));
|
logdate->setText(tr("Log Date:"));
|
||||||
model->setHeader(QStringList()<< tr("Operation Date") << tr("Operation Time") << tr("User") << tr("Operation"));
|
mModel->setHeader(QStringList()<< tr("Operation Date") << tr("Operation Time") << tr("User") << tr("Operation"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UserOperationLogForm::~UserOperationLogForm() {
|
UserOperationLogForm::~UserOperationLogForm() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UserOperationLogForm::loadUserOperationLog()
|
||||||
void UserOperationLogForm::loadUserOperationLog() {
|
{
|
||||||
|
QString filePath = LogManager::getInstance()->getCurrentUserOperationLogFile();
|
||||||
QString filePath = UserOperationLog::Default()->currentLogFile();
|
mDateButton->setText(fileNameToDate(filePath));
|
||||||
btn->setText(fileNameToDate(filePath));
|
|
||||||
loadUserOperationLog(filePath, fileNameToDate(filePath));
|
loadUserOperationLog(filePath, fileNameToDate(filePath));
|
||||||
selectedDateStr = fileNameToDate(filePath);
|
mSelectedDateStr = fileNameToDate(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserOperationLogForm::loadUserOperationLog(const QString& fileName, const QString& date) {
|
void UserOperationLogForm::loadUserOperationLog(const QString& fileName, const QString& date) {
|
||||||
selectedDateStr = date;
|
mSelectedDateStr = date;
|
||||||
model->setFileName(dateToFileName(date));
|
mModel->setFileName(dateToFileName(date));
|
||||||
btn->setText(date);
|
mDateButton->setText(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserOperationLogForm::showEvent(QShowEvent *aEvent)
|
void UserOperationLogForm::showEvent(QShowEvent *aEvent)
|
||||||
{
|
{
|
||||||
loadUserOperationLog("", selectedDateStr);
|
loadUserOperationLog("", mSelectedDateStr);
|
||||||
QWidget::showEvent(aEvent);
|
QWidget::showEvent(aEvent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ protected:
|
|||||||
void showEvent(QShowEvent *aEvent) override;
|
void showEvent(QShowEvent *aEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTableView* table = nullptr;
|
QTableView* mLogTable = nullptr;
|
||||||
QPushButton* btn = nullptr;
|
QPushButton* mDateButton = nullptr;
|
||||||
LogFileTableModel* model = nullptr;
|
LogFileTableModel* mModel = nullptr;
|
||||||
SelectDialog* dialog = nullptr;
|
SelectDialog* mSelectDateDialog = nullptr;
|
||||||
QVBoxLayout* layout = nullptr;
|
QVBoxLayout* mLayout = nullptr;
|
||||||
QString selectedDateStr;
|
QString mSelectedDateStr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -194,9 +194,9 @@ void CoordinateXYWidget::updateStopFlash()
|
|||||||
void CoordinateXYWidget::startFlash()
|
void CoordinateXYWidget::startFlash()
|
||||||
{
|
{
|
||||||
show();
|
show();
|
||||||
connect(mTimer,&QTimer::timeout,this, &CoordinateXYWidget::updateFlash);
|
// connect(mTimer,&QTimer::timeout,this, &CoordinateXYWidget::updateFlash);
|
||||||
mStopGradientEnd = 1;
|
// mStopGradientEnd = 1;
|
||||||
mTimer->start(20);
|
// mTimer->start(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoordinateXYWidget::stopFlash()
|
void CoordinateXYWidget::stopFlash()
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ CoordinateZWidget::CoordinateZWidget(QWidget* aParent)
|
|||||||
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::quitAutoLocate, this, &CoordinateZWidget::quit);
|
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::quitAutoLocate, this, &CoordinateZWidget::quit);
|
||||||
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::autoLocateZUpdated, this, &CoordinateZWidget::setBlinkPoint);
|
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::autoLocateZUpdated, this, &CoordinateZWidget::setBlinkPoint);
|
||||||
hide();
|
hide();
|
||||||
|
mBlinkPoint.setY(204);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoordinateZWidget::paintEvent(QPaintEvent* aEvent)
|
void CoordinateZWidget::paintEvent(QPaintEvent* aEvent)
|
||||||
@@ -116,9 +117,9 @@ void CoordinateZWidget::setBlinkPoint(int aZ)
|
|||||||
void CoordinateZWidget::startFlash()
|
void CoordinateZWidget::startFlash()
|
||||||
{
|
{
|
||||||
show();
|
show();
|
||||||
connect(mTimer,&QTimer::timeout,this, &CoordinateZWidget::updateFlash);
|
// connect(mTimer,&QTimer::timeout,this, &CoordinateZWidget::updateFlash);
|
||||||
mStopGradientEnd = 1;
|
// mStopGradientEnd = 1;
|
||||||
mTimer->start(20);
|
// mTimer->start(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoordinateZWidget::stopFlash()
|
void CoordinateZWidget::stopFlash()
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "dialogs/MultyMessageDialog.h"
|
#include "dialogs/MultyMessageDialog.h"
|
||||||
#include "UsctStateManager.h"
|
#include "UsctStateManager.h"
|
||||||
#include "utilities/ScanProcessSequence.h"
|
#include "utilities/ScanProcessSequence.h"
|
||||||
#include "log/SystemOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
|
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
|
||||||
|
|
||||||
@@ -211,11 +211,7 @@ void DeviceManager::initDevice()
|
|||||||
mSetSimulatorModeAction->setSendData("{ \"code\":0, \"info\":\"1\"}");
|
mSetSimulatorModeAction->setSendData("{ \"code\":0, \"info\":\"1\"}");
|
||||||
mSetSimulatorModeAction->execute();
|
mSetSimulatorModeAction->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
mSetHeartBeatAction->setSendData("{ \"code\":0, \"info\":\"0\"}");
|
|
||||||
mSetHeartBeatAction->execute();
|
|
||||||
mSoftwareVersion = "DMS Version Loading";
|
mSoftwareVersion = "DMS Version Loading";
|
||||||
mGetSoftwareVersionAction->execute();
|
|
||||||
|
|
||||||
mCheckInitStatusTimer = startTimer(500);
|
mCheckInitStatusTimer = startTimer(500);
|
||||||
}
|
}
|
||||||
@@ -229,6 +225,10 @@ void DeviceManager::initGUI(bool aIsInitSucceed)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSetHeartBeatAction->setSendData("{ \"code\":0, \"info\":\"0\"}");
|
||||||
|
mSetHeartBeatAction->execute();
|
||||||
|
mGetSoftwareVersionAction->execute();
|
||||||
|
|
||||||
if(aIsInitSucceed)
|
if(aIsInitSucceed)
|
||||||
{
|
{
|
||||||
if(getDeviceStatus() != DeviceStatus::Rready)
|
if(getDeviceStatus() != DeviceStatus::Rready)
|
||||||
@@ -428,7 +428,8 @@ void DeviceManager::prepareFinishScan(bool isNormalFinish, const QString& aReaso
|
|||||||
|
|
||||||
if(isCompleteNotify)
|
if(isCompleteNotify)
|
||||||
{
|
{
|
||||||
QString msg = tr("Scan completed!");
|
QString msg = ScanProcessSequence::getInstance()->getScanPositionSize() == 2 ? tr("Scan completed! Please prepare for the next scan. \n"
|
||||||
|
"Click the confirm button after lying down.") : tr("Scan completed!") ;
|
||||||
TRIGGER_EVENT(InvokeOperationEnd, nullptr, (QObject *)&msg);
|
TRIGGER_EVENT(InvokeOperationEnd, nullptr, (QObject *)&msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -468,6 +469,7 @@ void DeviceManager::stopFullScan()
|
|||||||
if(!result.mIsSucessful)
|
if(!result.mIsSucessful)
|
||||||
{
|
{
|
||||||
THROW_ERROR(result.mData);
|
THROW_ERROR(result.mData);
|
||||||
|
prepareFinishScan(false, "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,6 +648,7 @@ QString DeviceManager::getSoftwareVersion()
|
|||||||
void DeviceManager::processReceiveDMSInfoResult(int aServerID, int aActionID, const QString& aContents)
|
void DeviceManager::processReceiveDMSInfoResult(int aServerID, int aActionID, const QString& aContents)
|
||||||
{
|
{
|
||||||
qDebug()<<"processReceiveDMSInfoResult " <<aServerID << aActionID << aContents;
|
qDebug()<<"processReceiveDMSInfoResult " <<aServerID << aActionID << aContents;
|
||||||
|
LOG_SYS_OPERATION(QString("DMS -> GUI : %1-%2, Message:%3").arg(aServerID).arg(aActionID).arg(aContents));
|
||||||
switch(aServerID)
|
switch(aServerID)
|
||||||
{
|
{
|
||||||
case USRV_SCAN :
|
case USRV_SCAN :
|
||||||
@@ -772,7 +775,6 @@ void DeviceManager::processAlarm(const QString& aAlarm)
|
|||||||
int alarmCode = jsonObj["code"].toInt();
|
int alarmCode = jsonObj["code"].toInt();
|
||||||
QString alarm = tr("Error: ") + QString::number(alarmCode);
|
QString alarm = tr("Error: ") + QString::number(alarmCode);
|
||||||
qDebug()<<"processAlarm : "<<alarmCode;
|
qDebug()<<"processAlarm : "<<alarmCode;
|
||||||
LOG_SYS_OPERATION("Dms alarm reported. code: " + alarm)
|
|
||||||
if(alarmCode >= 400 && alarmCode < 500)
|
if(alarmCode >= 400 && alarmCode < 500)
|
||||||
{
|
{
|
||||||
if(mIsScanning)
|
if(mIsScanning)
|
||||||
@@ -807,7 +809,7 @@ void DeviceManager::processGetSoftwareVersion(const QString& aSoftwareVersion)
|
|||||||
|
|
||||||
void DeviceManager::scanTimeout()
|
void DeviceManager::scanTimeout()
|
||||||
{
|
{
|
||||||
prepareFinishScan(false, "Dms connection timeout!");
|
prepareFinishScan(false, tr("DMS connection error"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceStatus DeviceManager::getDeviceStatus()
|
DeviceStatus DeviceManager::getDeviceStatus()
|
||||||
@@ -860,7 +862,6 @@ bool DeviceManager::startFullScan(const QString& aPatientInfo)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mCurrentScanMeasurementID = jsonObj["measurement id"].toString();
|
mCurrentScanMeasurementID = jsonObj["measurement id"].toString();
|
||||||
//LOG_SYS_OPERATION("Start full scan succeed.")
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1321,7 +1322,7 @@ void DeviceManager::stopScanProcess()
|
|||||||
AppGlobalValues::setInProcessing(false);
|
AppGlobalValues::setInProcessing(false);
|
||||||
mIsScanning = false;
|
mIsScanning = false;
|
||||||
LOG_SYS_OPERATION("Stop scan process.")
|
LOG_SYS_OPERATION("Stop scan process.")
|
||||||
stopAutoLocate();
|
//stopAutoLocate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DeviceManager::startAutoLocate()
|
bool DeviceManager::startAutoLocate()
|
||||||
@@ -1331,25 +1332,27 @@ bool DeviceManager::startAutoLocate()
|
|||||||
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
|
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto result = mStartAutoLocateAction->execute();
|
emit startAutoLocateResult(true);
|
||||||
if(result.mIsSucessful)
|
emit autolocatePositionEffective();
|
||||||
{
|
return true;
|
||||||
mIsAutoLocating = true;
|
// auto result = mStartAutoLocateAction->execute();
|
||||||
QJsonObject jsonObj = toJsonObject(result.mData);
|
// if(result.mIsSucessful)
|
||||||
if(jsonObj["code"].toInt() == 0 )
|
// {
|
||||||
{
|
// mIsAutoLocating = true;
|
||||||
emit startAutoLocateResult(true);
|
// QJsonObject jsonObj = toJsonObject(result.mData);
|
||||||
mEffectivePositionCount = 0;
|
// if(jsonObj["code"].toInt() == 0 )
|
||||||
mGetAutoLocatePositionTimer = startTimer(1000);
|
// {
|
||||||
//LOG_SYS_OPERATION("Start auto locate succeed.")
|
// emit startAutoLocateResult(true);
|
||||||
return true;
|
// mEffectivePositionCount = 0;
|
||||||
}
|
// mGetAutoLocatePositionTimer = startTimer(1000);
|
||||||
}
|
// return true;
|
||||||
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
|
// }
|
||||||
QString errorMessage = tr("Start auto locate failed");
|
// }
|
||||||
THROW_ERROR(errorMessage)
|
// TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
|
||||||
LOG_SYS_OPERATION("Start auto locate failed.")
|
// QString errorMessage = tr("Start auto locate failed");
|
||||||
return false;
|
// THROW_ERROR(errorMessage)
|
||||||
|
// LOG_SYS_OPERATION("Start auto locate failed.")
|
||||||
|
// return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceManager::stopAutoLocate()
|
void DeviceManager::stopAutoLocate()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "DmsAsyncAction.h"
|
#include "DmsAsyncAction.h"
|
||||||
#include "dms_mq.h"
|
#include "dms_mq.h"
|
||||||
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ bool DmsAsyncAction::execute()
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
LOG_SYS_OPERATION(QString("GUI -> DMS : %1-%2, Message:%3").arg(mServerId).arg(mActionId).arg(mSendData));
|
||||||
mTimer->start();
|
mTimer->start();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "DmsSyncAction.h"
|
#include "DmsSyncAction.h"
|
||||||
#include "dms_mq.h"
|
#include "dms_mq.h"
|
||||||
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -45,8 +46,10 @@ DmsSyncActionResult DmsSyncAction::execute()
|
|||||||
DmsSyncActionResult result(false, "mq error");
|
DmsSyncActionResult result(false, "mq error");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
LOG_SYS_OPERATION(QString("GUI -> DMS : %1-%2, Message:%3").arg(mServerId).arg(mActionId).arg(mSendData));
|
||||||
if(!waitUntilSignalReceived())
|
if(!waitUntilSignalReceived())
|
||||||
{
|
{
|
||||||
|
LOG_SYS_OPERATION(QString("GUI -> DMS : %1-%2, Time out.").arg(mServerId).arg(mActionId));
|
||||||
DmsSyncActionResult result(false, "time out");
|
DmsSyncActionResult result(false, "time out");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "UsctStateManager.h"
|
#include "UsctStateManager.h"
|
||||||
|
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "log/SystemOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "appvals/AppGlobalValues.h"
|
#include "appvals/AppGlobalValues.h"
|
||||||
|
|
||||||
UsctStateManager* UsctStateManager::getInstance()
|
UsctStateManager* UsctStateManager::getInstance()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <QRegExpValidator>
|
#include <QRegExpValidator>
|
||||||
|
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "db/SQLHelper.h"
|
#include "db/SQLHelper.h"
|
||||||
#include "models/User.h"
|
#include "models/User.h"
|
||||||
#include "components/ULineEdit.h"
|
#include "components/ULineEdit.h"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "components/ULineEdit.h"
|
#include "components/ULineEdit.h"
|
||||||
#include "models/User.h"
|
#include "models/User.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
ChangePasswordFormDialog::ChangePasswordFormDialog(QWidget* parent, Qt::WindowFlags f)
|
ChangePasswordFormDialog::ChangePasswordFormDialog(QWidget* parent, Qt::WindowFlags f)
|
||||||
: GUIFormBaseDialog(parent, f)
|
: GUIFormBaseDialog(parent, f)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
GUIMessageDialog::GUIMessageDialog(QWidget *parent)
|
GUIMessageDialog::GUIMessageDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include "components/ULineEdit.h"
|
#include "components/ULineEdit.h"
|
||||||
#include "action/GetWorkListAction.h"
|
#include "action/GetWorkListAction.h"
|
||||||
#include "action/ActionCreator.h"
|
#include "action/ActionCreator.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
|
|
||||||
GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTableView, QWidget* aParent, Qt::WindowFlags aFlags)
|
GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTableView, QWidget* aParent, Qt::WindowFlags aFlags)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "utilities/InputFormatValidator.h"
|
#include "utilities/InputFormatValidator.h"
|
||||||
#include "device/networkmanager.h"
|
#include "device/networkmanager.h"
|
||||||
#include "DialogManager.h"
|
#include "DialogManager.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "components/ErrorLabel.h"
|
#include "components/ErrorLabel.h"
|
||||||
#include "dialogs/DicomSettingsArea.h"
|
#include "dialogs/DicomSettingsArea.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "PacsSettingsDialog.h"
|
#include "PacsSettingsDialog.h"
|
||||||
#include "dialogs/DicomSettingsArea.h"
|
#include "dialogs/DicomSettingsArea.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "components/ErrorLabel.h"
|
#include "components/ErrorLabel.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "dialogs/DicomSettingsArea.h"
|
#include "dialogs/DicomSettingsArea.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "recon/ReconManager.h"
|
#include "recon/ReconManager.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "components/ErrorLabel.h"
|
#include "components/ErrorLabel.h"
|
||||||
#include "dialogs/DicomSettingsArea.h"
|
#include "dialogs/DicomSettingsArea.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "forms/scan/PatientInformationForm.h"
|
#include "forms/scan/PatientInformationForm.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "dialogs/DialogManager.h"
|
#include "dialogs/DialogManager.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "device/DeviceManager.h"
|
#include "device/DeviceManager.h"
|
||||||
#include "dicom/WorkListManager.h"
|
#include "dicom/WorkListManager.h"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "db/SQLHelper.h"
|
#include "db/SQLHelper.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "dialogs/DialogManager.h"
|
#include "dialogs/DialogManager.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "components/VerticalTextToolButton.h"
|
#include "components/VerticalTextToolButton.h"
|
||||||
#include "PatientAddDateDelegate.h"
|
#include "PatientAddDateDelegate.h"
|
||||||
#include "dicom/WorkListManager.h"
|
#include "dicom/WorkListManager.h"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "models/User.h"
|
#include "models/User.h"
|
||||||
#include "components/SlideTableView.h"
|
#include "components/SlideTableView.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
AccountTableForm::AccountTableForm(QWidget* aParent)
|
AccountTableForm::AccountTableForm(QWidget* aParent)
|
||||||
: QWidget(aParent)
|
: QWidget(aParent)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include "components/ListBox.h"
|
#include "components/ListBox.h"
|
||||||
#include "components/ImageSwitch.h"
|
#include "components/ImageSwitch.h"
|
||||||
#include "components/BatteryWidget.h"
|
#include "components/BatteryWidget.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "utilities/DiskInfoWorker.h"
|
#include "utilities/DiskInfoWorker.h"
|
||||||
#include "utilities/GetLockScreenTimeHelper.h"
|
#include "utilities/GetLockScreenTimeHelper.h"
|
||||||
#include "utilities/GetProtocalHelper.h"
|
#include "utilities/GetProtocalHelper.h"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "db/SQLHelper.h"
|
#include "db/SQLHelper.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "dialogs/DialogManager.h"
|
#include "dialogs/DialogManager.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ JsonObject::JsonObject()
|
|||||||
|
|
||||||
JsonObject::~JsonObject()
|
JsonObject::~JsonObject()
|
||||||
{
|
{
|
||||||
savecfg();
|
//savecfg();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonObject::init()
|
void JsonObject::init()
|
||||||
|
|||||||
47
src/log/LogManager.cpp
Normal file
47
src/log/LogManager.cpp
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#include "LogManager.h"
|
||||||
|
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
|
LogManager* LogManager::getInstance()
|
||||||
|
{
|
||||||
|
static LogManager instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogManager::LogManager()
|
||||||
|
: QObject()
|
||||||
|
, mThread(new QThread())
|
||||||
|
, mSysLog(new SystemOperationLog())
|
||||||
|
, mUserLog(new UserOperationLog())
|
||||||
|
{
|
||||||
|
mSysLog->moveToThread(mThread);
|
||||||
|
mUserLog->moveToThread(mThread);
|
||||||
|
connect(this, &LogManager::doWriteSystemOperationLog, mSysLog, &SystemOperationLog::log);
|
||||||
|
connect(this, &LogManager::doWriteUserOperationLog, mUserLog, &UserOperationLog::log);
|
||||||
|
mThread->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
LogManager::~LogManager()
|
||||||
|
{
|
||||||
|
mThread->quit();
|
||||||
|
mThread->wait();
|
||||||
|
|
||||||
|
delete mUserLog;
|
||||||
|
delete mSysLog;
|
||||||
|
mThread->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogManager::writeSystemOperationLog(const QString& aMessage)
|
||||||
|
{
|
||||||
|
emit doWriteSystemOperationLog(aMessage, QDateTime::currentDateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogManager::writeUserOperationLog(const QString& aMessage)
|
||||||
|
{
|
||||||
|
emit doWriteUserOperationLog(aMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LogManager::getCurrentUserOperationLogFile()
|
||||||
|
{
|
||||||
|
return mUserLog->currentLogFile();
|
||||||
|
}
|
||||||
41
src/log/LogManager.h
Normal file
41
src/log/LogManager.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef LOGMANAGER_H
|
||||||
|
#define LOGMANAGER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "SystemOperationLog.h"
|
||||||
|
#include "UserOperationLog.h"
|
||||||
|
|
||||||
|
class QThread;
|
||||||
|
|
||||||
|
#define LOG_SYS_OPERATION(...)\
|
||||||
|
LogManager::getInstance()->writeSystemOperationLog(__VA_ARGS__);
|
||||||
|
|
||||||
|
|
||||||
|
#define LOG_USER_OPERATION(...)\
|
||||||
|
LogManager::getInstance()->writeUserOperationLog(__VA_ARGS__);
|
||||||
|
|
||||||
|
class LogManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static LogManager* getInstance();
|
||||||
|
void writeSystemOperationLog(const QString& aMessage);
|
||||||
|
void writeUserOperationLog(const QString& aMessage);
|
||||||
|
QString getCurrentUserOperationLogFile();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void doWriteSystemOperationLog(const QString& aMessage, const QDateTime& aOperationDate);
|
||||||
|
void doWriteUserOperationLog(const QString& aMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
LogManager();
|
||||||
|
~LogManager();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QThread* mThread;
|
||||||
|
SystemOperationLog* mSysLog;
|
||||||
|
UserOperationLog* mUserLog;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LOGMANAGER_H
|
||||||
@@ -10,15 +10,9 @@ namespace
|
|||||||
const QString SYS_LOG_SUFFIX = "-sys.log";
|
const QString SYS_LOG_SUFFIX = "-sys.log";
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemOperationLog* SystemOperationLog::getInstance()
|
|
||||||
{
|
|
||||||
static SystemOperationLog instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SystemOperationLog::SystemOperationLog()
|
SystemOperationLog::SystemOperationLog()
|
||||||
: mCurrentFileName()
|
: QObject()
|
||||||
|
, mCurrentFileName()
|
||||||
, mLogFile()
|
, mLogFile()
|
||||||
, mStreamOut()
|
, mStreamOut()
|
||||||
{
|
{
|
||||||
@@ -50,7 +44,7 @@ SystemOperationLog::~SystemOperationLog()
|
|||||||
void SystemOperationLog::reloadFile()
|
void SystemOperationLog::reloadFile()
|
||||||
{
|
{
|
||||||
QString newFileName = LOG_DIR + QDate::currentDate().toString("/yyyy-MM-dd") + SYS_LOG_SUFFIX;
|
QString newFileName = LOG_DIR + QDate::currentDate().toString("/yyyy-MM-dd") + SYS_LOG_SUFFIX;
|
||||||
if (newFileName == mCurrentFileName && !AppGlobalValues::InProcessing().toBool()) return;
|
if (newFileName == mCurrentFileName) return;
|
||||||
mLogFile.close();
|
mLogFile.close();
|
||||||
mLogFile.setFileName(newFileName);
|
mLogFile.setFileName(newFileName);
|
||||||
if (mLogFile.exists())
|
if (mLogFile.exists())
|
||||||
@@ -64,9 +58,8 @@ void SystemOperationLog::reloadFile()
|
|||||||
mStreamOut.setDevice(&mLogFile);
|
mStreamOut.setDevice(&mLogFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemOperationLog::log(const QString &aOperationText)
|
void SystemOperationLog::log(const QString &aOperationText, const QDateTime& aOperationDate)
|
||||||
{
|
{
|
||||||
reloadFile();
|
reloadFile();
|
||||||
QDateTime now = QDateTime::currentDateTime();
|
mStreamOut << aOperationDate.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<aOperationText<<endl;
|
||||||
mStreamOut << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<aOperationText<<endl;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,21 @@
|
|||||||
#ifndef SYSTEMOPERATIONLOG_H
|
#ifndef SYSTEMOPERATIONLOG_H
|
||||||
#define SYSTEMOPERATIONLOG_H
|
#define SYSTEMOPERATIONLOG_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
#define LOG_SYS_OPERATION(...)\
|
class SystemOperationLog : public QObject
|
||||||
SystemOperationLog::getInstance()->log(__VA_ARGS__);
|
|
||||||
|
|
||||||
class SystemOperationLog
|
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static SystemOperationLog* getInstance();
|
SystemOperationLog();
|
||||||
void log(const QString& aOperationText);
|
~SystemOperationLog();
|
||||||
void reloadFile();
|
void reloadFile();
|
||||||
|
|
||||||
private:
|
public slots:
|
||||||
SystemOperationLog();
|
void log(const QString& aOperationText, const QDateTime& aOperationDate);
|
||||||
~SystemOperationLog();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mCurrentFileName;
|
QString mCurrentFileName;
|
||||||
|
|||||||
@@ -12,6 +12,24 @@ namespace
|
|||||||
const QString logDir = "./log/UserOperationLog";
|
const QString logDir = "./log/UserOperationLog";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UserOperationLog::UserOperationLog()
|
||||||
|
: QObject()
|
||||||
|
, currentFileName()
|
||||||
|
, logFile()
|
||||||
|
, out()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
UserOperationLog::~UserOperationLog()
|
||||||
|
{
|
||||||
|
if (logFile.isOpen())
|
||||||
|
{
|
||||||
|
logFile.flush();
|
||||||
|
logFile.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UserOperationLog::init() {
|
void UserOperationLog::init() {
|
||||||
QDir log_dir("./");
|
QDir log_dir("./");
|
||||||
if (!log_dir.exists("log")) log_dir.mkdir("log");
|
if (!log_dir.exists("log")) log_dir.mkdir("log");
|
||||||
@@ -44,33 +62,20 @@ QString addSpace(const char* str)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString getOperationName(UserOperation operation)
|
|
||||||
{
|
|
||||||
switch (operation) {
|
|
||||||
#define ADD_OPERATION(name)\
|
|
||||||
case name: return addSpace(#name);
|
|
||||||
USER_OPERATIONS()
|
|
||||||
#undef ADD_OPERATION
|
|
||||||
default:
|
|
||||||
return "unknow error";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void UserOperationLog::log(const QString& aOperationText)
|
void UserOperationLog::log(const QString& aOperationText)
|
||||||
{
|
{
|
||||||
reloadFile();
|
reloadFile();
|
||||||
QDateTime now = QDateTime::currentDateTime();
|
QDateTime now = QDateTime::currentDateTime();
|
||||||
AppGlobalValues::setLastOperationTime(now);
|
AppGlobalValues::setLastOperationTime(now);
|
||||||
QString UserName = (!User::Current() || User::Current()->getUserCode().isEmpty())?"anonymous":User::Current()->getUserCode();
|
QString UserName = (!User::Current() || User::Current()->getUserCode().isEmpty())?"anonymous":User::Current()->getUserCode();
|
||||||
out << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<UserName<<"\t"<<aOperationText<<endl;
|
QString operationText = aOperationText;
|
||||||
|
out << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<UserName<<"\t"<<operationText.replace("\n","\\n")<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserOperationLog::reloadFile() {
|
void UserOperationLog::reloadFile() {
|
||||||
QString newFileName = logDir + QDate::currentDate().toString("/yyyy-MM-dd")+QString("-op.log");
|
QString newFileName = logDir + QDate::currentDate().toString("/yyyy-MM-dd")+QString("-op.log");
|
||||||
//inprocessing 暂时没有使用
|
//inprocessing 暂时没有使用
|
||||||
if (newFileName == currentFileName && !AppGlobalValues::InProcessing().toBool()) return;
|
if (newFileName == currentFileName) return;
|
||||||
logFile.close();
|
logFile.close();
|
||||||
logFile.setFileName(newFileName);
|
logFile.setFileName(newFileName);
|
||||||
if (logFile.exists())
|
if (logFile.exists())
|
||||||
|
|||||||
@@ -1,53 +1,18 @@
|
|||||||
#ifndef GUI_USEROPERATIONLOG_H
|
#ifndef GUI_USEROPERATIONLOG_H
|
||||||
#define GUI_USEROPERATIONLOG_H
|
#define GUI_USEROPERATIONLOG_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
#define USER_OPERATIONS()\
|
class UserOperationLog : public QObject
|
||||||
ADD_OPERATION(Login)\
|
{
|
||||||
ADD_OPERATION(Logout)\
|
Q_OBJECT
|
||||||
ADD_OPERATION(ChangePassword)\
|
|
||||||
ADD_OPERATION(ChangeUserName)\
|
|
||||||
ADD_OPERATION(AddPatient)\
|
|
||||||
ADD_OPERATION(ChangePatientInfo)\
|
|
||||||
ADD_OPERATION(DeletePatient)\
|
|
||||||
ADD_OPERATION(SelectPatient)\
|
|
||||||
ADD_OPERATION(StartRefresh)\
|
|
||||||
ADD_OPERATION(StopScan)\
|
|
||||||
ADD_OPERATION(StopPreview)\
|
|
||||||
ADD_OPERATION(StartPreview)\
|
|
||||||
ADD_OPERATION(StartScan)\
|
|
||||||
ADD_OPERATION(ConfirmError)\
|
|
||||||
ADD_OPERATION(AdminChangeAcountInformation)
|
|
||||||
|
|
||||||
#define LOG_USER_OPERATION(...)\
|
|
||||||
UserOperationLog::Default()->log(__VA_ARGS__);
|
|
||||||
|
|
||||||
|
|
||||||
enum UserOperation{
|
|
||||||
#define ADD_OPERATION(name) name,\
|
|
||||||
|
|
||||||
USER_OPERATIONS()
|
|
||||||
#undef ADD_OPERATION
|
|
||||||
};
|
|
||||||
class UserOperationLog {
|
|
||||||
public:
|
public:
|
||||||
UserOperationLog(){}
|
UserOperationLog();
|
||||||
~UserOperationLog(){
|
~UserOperationLog();
|
||||||
if (logFile.isOpen())
|
|
||||||
{
|
|
||||||
logFile.flush();
|
|
||||||
logFile.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
static UserOperationLog* Default(){
|
|
||||||
static UserOperationLog d;
|
|
||||||
return &d;
|
|
||||||
}
|
|
||||||
static void cleanHistoryLog();
|
static void cleanHistoryLog();
|
||||||
|
|
||||||
static QStringList getHistoryLogFiles();
|
static QStringList getHistoryLogFiles();
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTimer>
|
|
||||||
#include "log/UserOperationLog.h"
|
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <src/device/DeviceManager.h>
|
#include <src/device/DeviceManager.h>
|
||||||
#include "dialogs/DialogManager.h"
|
#include "dialogs/DialogManager.h"
|
||||||
@@ -20,7 +18,7 @@
|
|||||||
#include "utilities/TouchScreenSignalSender.h"
|
#include "utilities/TouchScreenSignalSender.h"
|
||||||
#include "keyboard/KeyboardManager.h"
|
#include "keyboard/KeyboardManager.h"
|
||||||
#include "appvals/AppGlobalValues.h"
|
#include "appvals/AppGlobalValues.h"
|
||||||
#include "log/SystemOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
|
|
||||||
QString loadFontFromFile(QString path)
|
QString loadFontFromFile(QString path)
|
||||||
@@ -95,9 +93,8 @@ int main(int argc, char* argv[])
|
|||||||
AppGlobalValues::setDBconnected(false);
|
AppGlobalValues::setDBconnected(false);
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
DialogManager::Default()->init(&w);
|
DialogManager::Default()->init(&w);
|
||||||
UserOperationLog::Default()->init();
|
LogManager::getInstance();
|
||||||
LOG_USER_OPERATION("GUI Started");
|
LOG_USER_OPERATION("GUI Started");
|
||||||
SystemOperationLog::getInstance();
|
|
||||||
|
|
||||||
QObject::connect(TouchScreenSignalSender::getInstance(), SIGNAL(touchScreen()), Locker::getInstance(), SLOT(refreshTimer()));
|
QObject::connect(TouchScreenSignalSender::getInstance(), SIGNAL(touchScreen()), Locker::getInstance(), SLOT(refreshTimer()));
|
||||||
// QList<Qt::GestureType> gestures;
|
// QList<Qt::GestureType> gestures;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "ReconManager.h"
|
#include "ReconManager.h"
|
||||||
#include "ReconClient.h"
|
#include "ReconClient.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "log/SystemOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "QDebug"
|
#include "QDebug"
|
||||||
|
|||||||
@@ -370,6 +370,11 @@ progress:99%</source>
|
|||||||
<source>Error: </source>
|
<source>Error: </source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Scan completed! Please prepare for the next scan.
|
||||||
|
Click the confirm button after lying down.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DicomCfgDialog</name>
|
<name>DicomCfgDialog</name>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@
|
|||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "dialogs/DialogManager.h"
|
#include "dialogs/DialogManager.h"
|
||||||
#include "models/User.h"
|
#include "models/User.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/LogManager.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "components/ULineEdit.h"
|
#include "components/ULineEdit.h"
|
||||||
#include "appvals/AppGlobalValues.h"
|
#include "appvals/AppGlobalValues.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user