61 lines
1.6 KiB
C
61 lines
1.6 KiB
C
|
#ifndef UIFunctionBase_H
|
||
|
#define UIFunctionBase_H
|
||
|
#include <QObject>
|
||
|
#include "nlohmann/json.hpp"
|
||
|
#include "StabilityModel.h"
|
||
|
#include "StructureModel.h"
|
||
|
#include "CertiModel.h"
|
||
|
#include "Error.h"
|
||
|
#include "PathUtil.h"
|
||
|
#include <QObject>
|
||
|
#include "MessageHandle.h"
|
||
|
#include "CmdDefine.h"
|
||
|
#include "QtToWebFunction.h"
|
||
|
|
||
|
|
||
|
using json = nlohmann::json;
|
||
|
class UIFunctionBase:public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
UIFunctionBase();
|
||
|
~UIFunctionBase();
|
||
|
|
||
|
void reSetStabilityModel();
|
||
|
void reSetStructureModel();
|
||
|
void reSetCertiModel();
|
||
|
|
||
|
StabilityModel* getStabilityModelPtr();
|
||
|
StructureModel* getStructureModelPtr();
|
||
|
CertiModel* getCertiModelPtr();
|
||
|
|
||
|
virtual void from(const json& j);
|
||
|
virtual void to(json);
|
||
|
|
||
|
int command_stream_modeling_async(std::string cmdstring);
|
||
|
|
||
|
int open_select_file_dlg(QString& outSelectFilePath,QString& outFileName, QString strfilter = "csx files(*.csx)");
|
||
|
|
||
|
int open_save_as_dlg(QString& outSelectFilePath,QString outFileFitle = "Text Files (*.csx);;All Files (*)");
|
||
|
|
||
|
void addShowWindowsLog(QString strLog);
|
||
|
|
||
|
void update_2d_json(const QString& message);
|
||
|
|
||
|
void cmd_update_ui_state(const QString& message);
|
||
|
|
||
|
void update_ui_state();
|
||
|
|
||
|
void setCurentUsingFilePath(QString path);
|
||
|
QString getCurentUsingFilePath();
|
||
|
protected:
|
||
|
bool getMessageString(const QString& message, std::string& cmdstring, QString& outLog, bool& isCancel);
|
||
|
protected:
|
||
|
static StabilityModel* m_pStabilityModer;
|
||
|
static StructureModel* m_pStructureModer;
|
||
|
static CertiModel* m_pCertiModer;
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif // ElectricSubUIFunction_H
|