12 #include <gdkmm/event.h> 14 #include "../views/MainWindowView.h" 25 :
Model(parent), view(view) {
42 if ((e->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)) !=
127 auto accessible = (*labelArray)[1][index].get_accessible();
131 accessible->set_role(Atk::ROLE_NOTIFICATION);
132 accessible->notify_state_change(ATK_STATE_SHOWING,
true);
146 for (
long unsigned int i = 0; i < 16; i++) {
147 (*labelArray)[1][i].set_text(newValues[i]);
151 std::string reg = i != 15 ? std::string(
"Register ")
152 .append(std::to_string(i))
154 :
"Program Counter stores ";
157 (*labelArray)[1][i].get_accessible()->set_name(
158 reg + std::regex_replace(newValues[i], std::regex(
"^0x0{0,7}"),
""));
163 newValues[newValues.size() - 1]);
181 const std::array<std::string, 16>
void refreshViews()
Handles updating this particular view. Reads register values from Jimulator, sets the label values of...
std::array< std::array< Gtk::Label, 16 >, 2 > *const getLabels()
Return a reference to the member array of labels, labelArray.
DisassemblyModel *const getDisassemblyModel()
Gets the disassemblyModel member variable.
RegistersView *const getView() const
Returns the view for this model.
RegistersView *const view
The view this model represents.
virtual void changeJimulatorState(const JimulatorState newState) override
Handles changes in the Jimulator state.
KoMo2Model *const getParent() const
Returns the parent pointer.
KoMo2Model *const parent
All models have a parent model - KoMo2Model, the most senior model in the hierarchy, sets its parent to self.
Stores data and functions related to the displaying of the KoMo2 GUI element - no particular logic or...
JimulatorState
Describe the 5 states of Jimulator.
virtual const bool handleKeyPress(const GdkEventKey *const e) override
Handles any key press events.
A file containing the definition of the KoMo2Model class.
The superclass for all other Model classes. Uses a pure virtual function, so is abastract. Keeps KoMo2Model as a friend so it alone can call setJimulatorState. This class provides basic data that are needed by all other.
The logical model of the entire application. All other models should be member variables of this mode...
const std::array< std::string, 16 > getRegisterValueFromJimulator() const
Gets the register values out of Jimulator.
void setPCValue(const std::string val)
Updates the value of PCValue.
void setModel(RegistersModel *const val)
Sets the model for this view.
RegistersModel(RegistersView *const view, KoMo2Model *const parent)
Constructs a new registers model object.
const std::array< std::string, 16 > getJimulatorRegisterValues()
Queries a register in Jimulator to get it's current value.