1 #ifndef CLI_CONTROLLER_H_
2 #define CLI_CONTROLLER_H_
24 #include "adapt2rfp/adapt2rfp.h"
29 #include <QMessageBox>
52 static std::shared_ptr<CliController>
Create(
const std::string& workspace,
bool quiet);
59 static std::shared_ptr<CliController>
Create(std::shared_ptr<Ws::CliWorkspace> workspace,
bool quiet);
96 CliController(std::shared_ptr<Ws::CliWorkspace> workspace_model,
bool quiet);
101 bool IsQuiet()
const;
112 void SigIntHandler(
int sig);
117 #if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
118 void SigQtHandler(QtMsgType type,
const QMessageLogContext&,
const QString&);
120 void SigQtHandler(QtMsgType type,
const char* msg);
126 static void UserError(
const std::string& msg);
131 static void UserMessage(
const std::string& msg);
139 void SimulationInfo(
const std::string& message,
const InfoMessageReason& reason);
142 void SimulationError(
const std::string& error);
147 using SigIntHandlerType = void (
int);
150 using SigIntAdaptorType = UA_CoMP_Adapt2rfp::Adaptor<SigIntHandlerType>;
153 #if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
154 using SigQtHandlerType = void (QtMsgType,
const QMessageLogContext&,
const QString&);
156 using SigQtHandlerType = void (QtMsgType,
const char*);
160 using SigQtAdaptorType = UA_CoMP_Adapt2rfp::Adaptor<SigQtHandlerType>;
164 std::shared_ptr<Ws::CliWorkspace> m_workspace_model;
170 SigIntAdaptorType m_sig_int_adaptor;
173 SigQtAdaptorType m_sig_qt_adaptor;
181 #endif // end_of_include_guard
A CliConverterTask represents an invocation of the converter from the command line.
Interface/Implementation for CliTask.
virtual ~CliController()
Virtual destructor.
Namespace for SimPT shell package.
static std::shared_ptr< CliController > Create(const std::string &workspace, bool quiet)
Create controller.
InfoMessageReason
Enumeration for the reason of an emitted InfoMessage from the project.
Command line interface application controller.
Interfaces for simulator session.
Timings GetTimings() const
Execution timings in duration units specified in Timeable base class.
int Execute(CliConverterTask task)
Execute converter task.
void Terminate()
Request termination of the simulation.
Interface/Implementation for CliConverterTask.
see the online Qt documentation
A CliTask represents an invocation of the program from the command line.
void TerminationRequested()
Private signal, to be used for signaling that the simulation should stop.
Utility class to for timing.