![]() |
KoMo2
1.0.0
A modern ARM emulator GUI.
|
The logical model of the entire application. All other models should be member variables of this model. More...
#include <KoMo2Model.h>
Public Member Functions | |
| KoMo2Model (MainWindowView *const mainWindow, const std::string argv0, const std::string manual, const int refreshRate) | |
| Construct a new KoMo2Model - this constructor initialises the mainWindow pointer, as well as the absolutePathToProjectRoot member. It then constructs a member compileLoadModel, and sets the compile buttons on click events. More... | |
| virtual void | changeJimulatorState (const JimulatorState newState) override |
Changes the Jimulator state and calls each child models own changeJimulatorState function. More... | |
| const bool | refreshViews () |
| Refreshes the views. May be called on a looping timer. More... | |
| const std::string | getAbsolutePathToProjectRoot () const |
Gets the absolutePathToProjectRoot member variable. More... | |
| MainWindowView *const | getMainWindow () const |
Gets the mainWindow member variable. More... | |
| CompileLoadModel *const | getCompileLoadModel () |
Gets the compileLoadModel member variable. More... | |
| ControlsModel *const | getControlsModel () |
Gets the controlsModel member variable. More... | |
| RegistersModel *const | getRegistersModel () |
Gets the RegistersModel member variable. More... | |
| TerminalModel *const | getTerminalModel () |
Gets the terminalModel member variable. More... | |
| DisassemblyModel *const | getDisassemblyModel () |
Gets the disassemblyModel member variable. More... | |
Public Member Functions inherited from Model | |
| Model (KoMo2Model *const parent) | |
| Constructs a new Model object - just assigns the parent variable. More... | |
| KoMo2Model *const | getParent () const |
| Returns the parent pointer. More... | |
Private Member Functions | |
| virtual const bool | handleKeyPress (const GdkEventKey *const e) override |
| Passes the key press event off to other child models. More... | |
| KoMo2Model (const KoMo2Model &)=delete | |
| KoMo2Model (const KoMo2Model &&)=delete | |
| KoMo2Model & | operator= (const KoMo2Model &)=delete |
| KoMo2Model & | operator= (const KoMo2Model &&)=delete |
Private Attributes | |
| MainWindowView *const | mainWindow |
| A pointer to the main window view. | |
| const std::string | absolutePathToProjectRoot |
| The absolute path to the project root directory. | |
| CompileLoadModel | compileLoadModel |
| The data model for the compile and load functionality of the program, represented by the browse and compile and load buttons in the view. | |
| ControlsModel | controlsModel |
| The data model for the controls and status functionality of the program, represented by the series of buttons and labels running along the top of the view. | |
| RegistersModel | registersModel |
| The data model for the registers view. Represented by the table of values on the left hand side of the main view. | |
| TerminalModel | terminalModel |
| The data model associated with the terminal view. Represented by the input box and text view at the bottom of the view. | |
| DisassemblyModel | disassemblyModel |
| The data model associated with the disassembly view. Represents the rows of memory values that take up the majority of the view. | |
| const unsigned int | refreshRate |
| Defines how often the the refreshViews function should be called when KoMo2 is in the JimulatorState::RUNNING state. | |
Additional Inherited Members | |
Protected Member Functions inherited from Model | |
| template<class T1 , class T2 > | |
| void | setButtonListener (Gtk::Button *const button, const T1 b, const T2 c) |
| Connect any button to any member function of. More... | |
| void | setButtonState (Gtk::Button *const button, const bool state, Gtk::Image *const img=nullptr, const std::string newTooltip="", const std::string newLabelText="") const |
Sets the state of a button to some boolean - the assumption is that if a button is not meant to be sensitive (get_sensitive() == false) then it should also not have a tooltip or many other attributes. You can also optionally update the buttons image, tooltip text, and label text. More... | |
| JimulatorState | getJimulatorState () const |
| Return the jimulatorState member object. More... | |
The logical model of the entire application. All other models should be member variables of this model.
This model exists in case separate models pertaining to different GUI elements need to logically interact - for example, the control bar at the top of the KoMo2 GUI window has buttons (controllers) which operate Jimulator, which will cause some function to run in this class (model) which in turn will have to affect the program memory window GUI element (view).
This model is in keeping with the MVC design pattern, where this class is the Model, and the main KoMo2 window contains all of the Controllers and Views.
Definition at line 34 of file KoMo2Model.h.
| KoMo2Model::KoMo2Model | ( | MainWindowView *const | mainWindow, |
| const std::string | argv0, | ||
| const std::string | manual, | ||
| const int | refreshRate | ||
| ) |
Construct a new KoMo2Model - this constructor initialises the mainWindow pointer, as well as the absolutePathToProjectRoot member. It then constructs a member compileLoadModel, and sets the compile buttons on click events.
| mainWindow | A pointer to the mainWindow view object. |
| argv0 | The absolutePathToProjectRoot - parsed from argv[0]. |
| manual | A URI that describes where the user manual can be found. |
| refreshRate | An integer that describes how many milliseconds should be taken between refreshes when KoMo2 is in the JimulatorState::RUNNING state. |
Definition at line 28 of file KoMo2Model.cpp.
|
overridevirtual |
Changes the Jimulator state and calls each child models own changeJimulatorState function.
| newState | The state to change into. |
Implements Model.
Definition at line 97 of file KoMo2Model.cpp.
| const std::string KoMo2Model::getAbsolutePathToProjectRoot | ( | ) | const |
Gets the absolutePathToProjectRoot member variable.
Definition at line 178 of file KoMo2Model.cpp.
| CompileLoadModel *const KoMo2Model::getCompileLoadModel | ( | ) |
Gets the compileLoadModel member variable.
compileLoadModel. Definition at line 143 of file KoMo2Model.cpp.
| ControlsModel *const KoMo2Model::getControlsModel | ( | ) |
Gets the controlsModel member variable.
controlsModel. Definition at line 150 of file KoMo2Model.cpp.
| DisassemblyModel *const KoMo2Model::getDisassemblyModel | ( | ) |
Gets the disassemblyModel member variable.
disassemblyModel. Definition at line 164 of file KoMo2Model.cpp.
| MainWindowView *const KoMo2Model::getMainWindow | ( | ) | const |
Gets the mainWindow member variable.
MainWindow. Definition at line 136 of file KoMo2Model.cpp.
| RegistersModel *const KoMo2Model::getRegistersModel | ( | ) |
Gets the RegistersModel member variable.
RegistersModel. Definition at line 157 of file KoMo2Model.cpp.
| TerminalModel *const KoMo2Model::getTerminalModel | ( | ) |
Gets the terminalModel member variable.
terminalModel. Definition at line 171 of file KoMo2Model.cpp.
|
overrideprivatevirtual |
Passes the key press event off to other child models.
| e | The key press event. |
Implements Model.
Definition at line 84 of file KoMo2Model.cpp.
| const bool KoMo2Model::refreshViews | ( | ) |
Refreshes the views. May be called on a looping timer.
Definition at line 56 of file KoMo2Model.cpp.
1.8.11