Go to the documentation of this file.
36 #include <wx/cmdline.h>
37 #include <wx/imagpng.h>
52 #include "tce_config.h"
68 wxApp(), mainFrame_(NULL), commandRegistry_(NULL), simulation_(NULL),
96 const wxCmdLineEntryDesc cmdLineDesc[] = {
98 #if wxCHECK_VERSION(3,0,0)
99 { wxCMD_LINE_PARAM, NULL, NULL,
"input file",
101 { wxCMD_LINE_PARAM, NULL, NULL, _T(
"input file"),
104 wxCMD_LINE_VAL_STRING,
105 (wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL) },
106 { wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0 }
109 wxCmdLineParser parser(cmdLineDesc);
110 parser.SetCmdLine(argc, argv);
113 std::string machineToLoad =
"";
114 std::string programToLoad =
"";
116 if (parser.GetParamCount() == 1) {
118 }
else if (parser.GetParamCount() == 2) {
121 }
else if (parser.GetParamCount() > 2) {
124 std::cout <<
"Usage: proxim [program file]" << endl;
125 std::cout <<
" proxim [machine file] [program file]" << endl;
132 wxImage::AddHandler(
new wxPNGHandler);
141 _T(
"TTA Processor Simulator"), wxDefaultPosition, wxSize(800, 600));
152 if (machineToLoad !=
"") {
155 if (interpreter->
result().size() > 0) {
156 wxString message = _T(
"Error loading machine file '");
158 message.Append(_T(
"'.\n"));
166 if (programToLoad !=
"") {
169 if (interpreter->
result().size() > 0) {
170 wxString message = _T(
"Error loading program file '");
172 message.Append(_T(
"'.\n"));
233 bool optionsOK =
false;
253 cerr <<
"Error loading config file " << configFile <<
":" << endl
255 <<
"Default options will be used." << endl;
static const std::string COMMAND_NAME_NEXTI
Name of the next instruction command.
static wxString toWxString(const std::string &source)
GUIOptions * options_
Options defining toolbar, keyboard shortcuts etc.
void setSourceFile(const std::string &fileName)
virtual std::string result()
void addToolbarButton(ToolbarButton *button)
static const std::string CONFIGURATION_NAME
Configuration file top-level element name.
SimulatorInterpreter * interpreter()
ProximSimulationThread * simulation()
ProximMainFrame * mainFrame_
The application main frame.
static const std::string COMMAND_NAME_OPEN_PROGRAM
Name of the open program command.
void setToolbarVisibility(bool visible)
ObjectState * readState()
static TCEString userConfPath(const std::string &fileName)
static const std::string PROXIM_TITLE
Application title.
static const std::string SCL_LOAD_MACHINE
Command for loading a new machine in the simulator.
static const std::string COMMAND_NAME_STEPI
Name of the step instruction command.
static const std::string COMMAND_NAME_KILL
Name of the kill command.
void setSchemaFile(const std::string &fileName)
static const std::string COMMAND_NAME_FIND
Name of the find command.
CommandRegistry & commandRegistry()
void addSeparator(int position)
virtual bool interpret(const std::string &commandLine)
@ TEXT
Buttons contains only text.
void setFileName(const std::string &fileName)
void addKeyboardShortcut(KeyboardShortcut *shortcut)
static const std::string COMMAND_NAME_OPEN_MACHINE
Name of the open machine command.
void setToolbarLayout(ToolbarLayout layout)
void setUseSchema(bool useSchema)
virtual void validate() const
std::string errorMessage() const
static const std::string DIRECTORY_SEPARATOR
void initialize(ProximMainFrame *gui)
static const std::string COMMAND_NAME_RUN
Name of the run command.
static TCEString confPath(const std::string &fileName)
void createDefaultOptions()
ProximSimulationThread * simulation_
The simulation thread running the simulator backend.
static const std::string SCL_LOAD_PROGRAM
Command for loading a new program in the simulator.
static const std::string COMMAND_NAME_RESUME
Name of the resume command.
static const std::string CONFIG_FILE_NAME
Name of the config file.
static std::string toString(const wxString &source)
static std::string TCEVersionString()
static const std::string SCHEMA_FILE_NAME
Name of the xml-schema file.
static std::string dataDirPath(const std::string &prog)
CommandRegistry * commandRegistry_
The application command registry.
static char ** toCStringArray(size_t elements, wxChar **source)