#include <layoutManager.hpp>
Collaboration diagram for LayoutManager:
Public Member Functions | |
LayoutManager (MainController *controller, TruthTableManager *tableManager, ForbiddenPatternManager *FPManager, RuleManager *ruleManager) | |
Constructor. | |
virtual | ~LayoutManager () |
Destructor. | |
void | setView (LayoutView *view) |
View setting. | |
void | newLayout (int width, int height, int inputs, int outputs) |
Sets a new space. | |
void | newLayout (LayoutConfig *layoutConfig) |
Sets a new space. | |
void | tableSelected (wxString tableId) |
Selects a truth table. | |
void | inputSelected (int input) |
Selects an input. | |
void | outputSelected (int output) |
Selects an output. | |
bool | tableChecked (wxString tableId, bool checked) |
Checks or unchecks a truth table. | |
bool | ruleChecked (unsigned int rule, bool checked) |
Checks or unchecks a rule. | |
bool | FPChecked (unsigned int FP, bool checked) |
Checks or unchecks a pattern. | |
void | cellChanged (int x, int y) |
Cell status change. | |
void | tablesChanged () |
Updates the truth table data. | |
void | rulesChanged () |
Updates the rule data. | |
void | FPsChanged () |
Updates the forbidden pattern data. | |
LayoutConfig * | getLayout () |
Member accessor. | |
bool | saveFile () |
Saves the space. | |
bool | saveFileAs () |
Saves the space to a new file. | |
void | openFile () |
Opens a space file. | |
bool | openPFile (wxString file) |
Opens a space from a project. | |
bool | saveFilename (wxString file) |
Saves the space to a file. | |
void | assignInput () |
Sets the assigning input mode on. | |
void | assignOutput () |
Sets the assigning output mode on. | |
void | escapePressed () |
Method called when the user presses the escape key. | |
bool | isLayoutModified () |
Modification consult. | |
bool | setInput (wxString table, int input, int x, int y) |
Sets an input. | |
bool | setOutput (wxString table, int output, int x, int y) |
Sets an output. | |
wxString | getFileName () |
Returns the space file name. | |
map< wxString, vector< coordinate > > | getTableInputs () |
Returns the input assignations. | |
map< wxString, vector< coordinate > > | getTableOutputs () |
Returns the output assignations. | |
vector< coordinate > | getTableInput (wxString table) |
Returns the input assignation of a table. | |
vector< coordinate > | getTableOutput (wxString table) |
Returns the output assignation of a table. | |
map< wxString, bool > | getTableEnabled () |
Returns the table selection map. | |
map< unsigned int, bool > | getRuleEnabled () |
Returns the rule selection map. | |
map< unsigned int, bool > | getFPEnabled () |
Returns the pattern selection map. | |
int | getTables () |
Returns the number of tables. | |
int | getRules () |
Returns the number of rules. | |
int | getFPs () |
Returns the number of patterns. | |
void | clean () |
Erases all space information. | |
void | prepareSimulation () |
Checks the simulation data. | |
void | startSimulation () |
Starts the simulation. | |
list< ForbiddenPattern > | getListFPEnabled () |
Returns the patterns checked. | |
list< Rule > | getListRuleEnabled () |
Returns the rules checked. | |
void | elementChanged () |
Observable update method. | |
TruthTable * | getTableSelected () |
Returns the truth table checked. | |
bool | checkLayout () |
Checks the validity of the space to be simulated. | |
void | enableSimulation () |
Enables the simulation GUI access. | |
Private Member Functions | |
void | updateGrids (bool changed) |
Updates the grid on the view. | |
void | updateTTList (wxArrayString tables) |
Updates the truth table list. | |
void | updateFPList (wxArrayString FPs) |
Updates the forbidden pattern list. | |
void | updateRuleList (wxArrayString rules) |
Updates the rule list. | |
void | updateTable () |
void | updateIOList () |
Updates the input/output data. | |
bool | findString (wxArrayString list, wxString item) |
Finds a string on a list of strings. | |
bool | inputAssigned (int x, int y) |
Input assignation check. | |
bool | outputAssigned (int x, int y) |
Output assignation check. | |
bool | findInputAssignment (vector< coordinate > list, int x, int y) |
Finds an input assignation on a list of coordinates. | |
bool | findOutputAssignment (vector< coordinate > list, int x, int y) |
Finds an output assignation on a list of coordinates. | |
void | resetIO () |
Initializes the input/output information. | |
Private Attributes | |
LayoutView * | view |
Presentation class. | |
TruthTableManager * | tableManager |
Truth table manager. | |
ForbiddenPatternManager * | FPManager |
Forbidden pattern manager. | |
RuleManager * | ruleManager |
Rule manager. | |
LayoutConfig * | configuration |
The current space. | |
FileManagerView | fileView |
File system interaction presentation class. | |
LayoutDiskManager * | diskManager |
Data persistance class. | |
MainController * | controller |
Main application controller. | |
wxString | layoutFileName |
Filename of the space. | |
bool | layoutModified |
Has the space been modified after saving? | |
bool | layoutNeedNewFile |
Do we need a filename to save the space or not? | |
map< wxString, vector< coordinate > > | tableInputs |
Assigned input coordinates for the truth tables. | |
map< wxString, vector< coordinate > > | tableOutputs |
Assigned output coordinates for the truth tables. | |
map< wxString, bool > | tableEnabled |
Tables selected. | |
map< unsigned int, bool > | ruleEnabled |
Rules selected. | |
map< unsigned int, bool > | FPEnabled |
Forbidden patterns selected. | |
wxString | currentTable |
Current table selected. | |
int | currentInput |
Current input selected. | |
int | currentOutput |
Current output selected. | |
bool | assigningInput |
Are we assigning an input? | |
bool | assigningOutput |
Are we assigning an output? |
It manages the current space, and comunicates with the other controllers to get information. It also manages the data persistance and presentation layer classes.
Definition at line 50 of file layoutManager.hpp.
|
Constructor.
Definition at line 31 of file layoutManager.cpp. References assigningInput, assigningOutput, configuration, controller, currentInput, currentOutput, currentTable, diskManager, FPManager, layoutFileName, layoutModified, layoutNeedNewFile, ruleManager, and tableManager. |
|
Destructor.
Definition at line 51 of file layoutManager.cpp. References diskManager. |
|
Sets the assigning input mode on.
Definition at line 672 of file layoutManager.cpp. References assigningInput. Referenced by LayoutView::OnAssignInput(). |
|
Sets the assigning output mode on.
Definition at line 679 of file layoutManager.cpp. References assigningOutput. Referenced by LayoutView::OnAssignOutput(). |
|
Cell status change. The assigned inputs and outputs are passed to the space to control the (de)assignation. After the status has changed the (de)assignation is checked again.
Definition at line 76 of file layoutManager.cpp. References assigningInput, assigningOutput, LayoutConfig::cellChanged(), configuration, controller, currentInput, currentOutput, currentTable, MainController::elementChanged(), inputAssigned(), layoutModified, LayoutView::onlyAssign(), outputAssigned(), MainController::setStatusMessage(), tableInputs, tableOutputs, LayoutView::updateCanvas(), updateGrids(), LayoutView::updateInputs(), LayoutView::updateOutputs(), and view. Referenced by LayoutView::OnClick(). Here is the call graph for this function: ![]() |
|
Checks the validity of the space to be simulated.
Definition at line 1206 of file layoutManager.cpp. References tableChecked(), and tableEnabled. Here is the call graph for this function: ![]() |
|
Erases all space information.
Definition at line 1069 of file layoutManager.cpp. References configuration, controller, MainController::elementChanged(), LayoutView::updateGrids(), and view. Referenced by MainController::newFile(). Here is the call graph for this function: ![]() |
|
Observable update method. This method is called whenever an element of the simulation have changed and updates the view. Definition at line 1141 of file layoutManager.cpp. References LayoutView::enableCheckSimulation(), LayoutView::enableStartSimulation(), and view. Referenced by MainController::elementChanged(). Here is the call graph for this function: ![]() |
|
Enables the simulation GUI access.
Definition at line 1243 of file layoutManager.cpp. References LayoutView::enableCheckSimulation(), LayoutView::enableStartSimulation(), and view. Here is the call graph for this function: ![]() |
|
Method called when the user presses the escape key. This key binding is used to get out of the assigning input/output mode Definition at line 689 of file layoutManager.cpp. References assigningInput, assigningOutput, LayoutView::onlyAssign(), and view. Referenced by LayoutView::OnKeyPressed(). Here is the call graph for this function: ![]() |
|
Finds an input assignation on a list of coordinates. This method is used to know if an input other than the current one has been assigned at x, y.
Definition at line 865 of file layoutManager.cpp. References currentInput. Referenced by inputAssigned(). |
|
Finds an output assignation on a list of coordinates. This method is used to know if an output other than the current one has been assigned at x, y.
Definition at line 890 of file layoutManager.cpp. References currentOutput. Referenced by outputAssigned(). |
|
Finds a string on a list of strings.
Definition at line 789 of file layoutManager.cpp. Referenced by updateFPList(), updateRuleList(), and updateTTList(). |
|
Checks or unchecks a pattern.
Definition at line 771 of file layoutManager.cpp. Referenced by LayoutView::OnFPChecked(). |
|
Updates the forbidden pattern data. This method must be called when the forbidden pattern collection changes to update important information. Definition at line 658 of file layoutManager.cpp. References FPManager, and ForbiddenPatternManager::getFPList(). Referenced by MainController::FPsChanged(). Here is the call graph for this function: ![]() |
|
Returns the space file name.
Definition at line 911 of file layoutManager.cpp. References layoutFileName. Referenced by MainController::save(), and MainController::saveFileNames(). |
|
Returns the pattern selection map.
Definition at line 961 of file layoutManager.cpp. Referenced by MainController::savePatterns(). |
|
Returns the number of patterns.
Definition at line 1010 of file layoutManager.cpp. Referenced by MainController::openFPs(). |
|
Member accessor.
Definition at line 483 of file layoutManager.cpp. References configuration. Referenced by SimulationManager::prepareSimulation(), and SimulationManager::simulateRow(). |
|
Returns the patterns checked.
Definition at line 1087 of file layoutManager.cpp. References FPManager, and ForbiddenPatternManager::getFP(). Referenced by SimulationManager::prepareSimulation(). Here is the call graph for this function: ![]() |
|
Returns the rules checked.
Definition at line 1105 of file layoutManager.cpp. References RuleManager::getRule(), and ruleManager. Referenced by SimulationManager::prepareSimulation(). Here is the call graph for this function: ![]() |
|
Returns the rule selection map.
Definition at line 951 of file layoutManager.cpp. Referenced by MainController::saveRules(). |
|
Returns the number of rules.
Definition at line 1000 of file layoutManager.cpp. Referenced by MainController::openRules(). |
|
Returns the table selection map.
Definition at line 941 of file layoutManager.cpp. References tableEnabled. Referenced by MainController::saveTables(). |
|
Returns the input assignation of a table.
Definition at line 1173 of file layoutManager.cpp. References tableInputs. Referenced by SimulationManager::prepareSimulation(). |
|
Returns the input assignations.
Definition at line 921 of file layoutManager.cpp. References tableInputs. Referenced by MainController::saveTables(). |
|
Returns the output assignation of a table.
Definition at line 1189 of file layoutManager.cpp. References tableOutputs. Referenced by SimulationManager::prepareSimulation(). |
|
Returns the output assignations.
Definition at line 931 of file layoutManager.cpp. References tableOutputs. Referenced by MainController::saveTables(). |
|
Returns the number of tables.
Definition at line 990 of file layoutManager.cpp. References tableEnabled. Referenced by MainController::openTables(). |
|
Returns the truth table checked.
Definition at line 1152 of file layoutManager.cpp. References TruthTableManager::getTable(), tableEnabled, and tableManager. Referenced by SimulationManager::prepareSimulation(). Here is the call graph for this function: ![]() |
|
Input assignation check.
Definition at line 838 of file layoutManager.cpp. References findInputAssignment(), and tableInputs. Referenced by cellChanged(). Here is the call graph for this function: ![]() |
|
Selects an input.
Definition at line 806 of file layoutManager.cpp. References currentInput. Referenced by LayoutView::OnInputSelected(). |
|
Modification consult.
Definition at line 826 of file layoutManager.cpp. References layoutModified. Referenced by MainController::open(). |
|
Sets a new space.
Definition at line 422 of file layoutManager.cpp. References configuration, controller, MainController::elementChanged(), LayoutConfig::getGrid(), layoutFileName, layoutNeedNewFile, resetIO(), tableInputs, tableOutputs, tablesChanged(), LayoutView::updateGrids(), LayoutView::updateInputs(), LayoutView::updateOutputs(), and view. Here is the call graph for this function: ![]() |
|
Sets a new space.
Definition at line 386 of file layoutManager.cpp. References configuration, controller, MainController::elementChanged(), LayoutConfig::getGrid(), layoutFileName, layoutModified, layoutNeedNewFile, resetIO(), tableInputs, tableOutputs, tablesChanged(), LayoutView::updateGrids(), LayoutView::updateInputs(), LayoutView::updateOutputs(), and view. Referenced by LayoutDiskManager::returnLayout(). Here is the call graph for this function: ![]() |
|
Opens a space file.
Definition at line 490 of file layoutManager.cpp. References layoutModified, LayoutView::msgYesNo(), saveFile(), and view. Referenced by LayoutView::OnOpen(). Here is the call graph for this function: ![]() |
|
Opens a space from a project.
Definition at line 518 of file layoutManager.cpp. References controller, diskManager, MainController::elementChanged(), layoutFileName, layoutModified, layoutNeedNewFile, and LayoutDiskManager::openLayout(). Here is the call graph for this function: ![]() |
|
Output assignation check.
Definition at line 850 of file layoutManager.cpp. References findOutputAssignment(), and tableOutputs. Referenced by cellChanged(). Here is the call graph for this function: ![]() |
|
Selects an output.
Definition at line 816 of file layoutManager.cpp. References currentOutput. Referenced by LayoutView::OnOutputSelected(). |
|
Checks the simulation data. This method checks the validity of the data to start a simulation. Definition at line 1123 of file layoutManager.cpp. References controller, and MainController::prepareSimulation(). Referenced by LayoutView::OnPrepare(). Here is the call graph for this function: ![]() |
|
Initializes the input/output information.
Definition at line 1251 of file layoutManager.cpp. References tableInputs. Referenced by newLayout(). |
|
Checks or unchecks a rule.
Definition at line 752 of file layoutManager.cpp. Referenced by LayoutView::OnRuleChecked(). |
|
Updates the rule data. This method must be called when the rule collection changes to update important information. Definition at line 640 of file layoutManager.cpp. References RuleManager::getRuleList(), and ruleManager. Referenced by MainController::rulesChanged(). Here is the call graph for this function: ![]() |
|
Saves the space. The user is asked for a file name if the space has not been saved previously. Definition at line 533 of file layoutManager.cpp. References configuration, diskManager, LayoutView::errorMsg(), fileView, layoutFileName, layoutModified, layoutNeedNewFile, FileManagerView::saveFileChoose(), LayoutDiskManager::saveLayout(), and view. Referenced by LayoutView::OnSave(), openFile(), MainController::save(), and MainController::saveAs(). Here is the call graph for this function: ![]() |
|
Saves the space to a new file.
Definition at line 571 of file layoutManager.cpp. References configuration, diskManager, fileView, layoutFileName, layoutModified, layoutNeedNewFile, FileManagerView::saveFileChoose(), LayoutDiskManager::saveLayout(), and view. Referenced by LayoutView::OnSaveAs(). Here is the call graph for this function: ![]() |
|
Saves the space to a file.
Definition at line 972 of file layoutManager.cpp. References configuration, diskManager, layoutFileName, and LayoutDiskManager::saveLayout(). Referenced by MainController::save(). Here is the call graph for this function: ![]() |
|
Sets an input.
Definition at line 1023 of file layoutManager.cpp. References tableInputs. |
|
Sets an output.
Definition at line 1049 of file layoutManager.cpp. References tableOutputs. |
|
View setting. Use this method to assign the view of the controller.
Definition at line 62 of file layoutManager.cpp. References view. |
|
Starts the simulation.
Definition at line 1130 of file layoutManager.cpp. References controller, and MainController::startSimulation(). Referenced by LayoutView::OnStart(). Here is the call graph for this function: ![]() |
|
Checks or unchecks a truth table. Only one table can be checked, so if checked is true, all other tables are unchecked.
Definition at line 727 of file layoutManager.cpp. References tableEnabled. Referenced by checkLayout(), and LayoutView::OnTableChecked(). |
|
Updates the truth table data. This method must be called when the truth table collection changes to update important information. Definition at line 459 of file layoutManager.cpp. References configuration, LayoutConfig::getInputs(), TruthTableManager::getInputs(), LayoutConfig::getOutputs(), TruthTableManager::getOutputs(), TruthTableManager::getTableList(), and tableManager. Referenced by newLayout(), and MainController::tablesChanged(). Here is the call graph for this function: ![]() |
|
Selects a truth table.
Definition at line 708 of file layoutManager.cpp. References tableInputs, tableOutputs, LayoutView::updateCanvas(), LayoutView::updateInputs(), updateIOList(), LayoutView::updateOutputs(), and view. Referenced by LayoutView::OnTableSelected(). Here is the call graph for this function: ![]() |
|
Updates the forbidden pattern list. Some control variables have to be reset according to the new list: init data structures for new patterns and remove the ones from the patterns deleted.
Definition at line 302 of file layoutManager.cpp. References findString(), and FPEnabled. Here is the call graph for this function: ![]() |
|
Updates the grid on the view.
Definition at line 174 of file layoutManager.cpp. References configuration, LayoutConfig::getGrid(), LayoutView::updateGrids(), and view. Referenced by cellChanged(). Here is the call graph for this function: ![]() |
|
Updates the input/output data. This method must be called when a truth table is selected to update i/o information. Definition at line 607 of file layoutManager.cpp. References configuration, TruthTableManager::getInputs(), TruthTableManager::getOutputs(), and tableManager. Referenced by tableSelected(). Here is the call graph for this function: ![]() |
|
Updates the rule list. Some control variables have to be reset according to the new list: init data structures for new rules and remove the ones from the rules deleted.
Definition at line 344 of file layoutManager.cpp. References findString(), and ruleEnabled. Here is the call graph for this function: ![]() |
|
|
|
Updates the truth table list. Some control variables have to be reset according to the new list: init data structures for new tables and remove the ones from the tables deleted.
Definition at line 190 of file layoutManager.cpp. References findString(), and tableInputs. Here is the call graph for this function: ![]() |
|
Are we assigning an input?
Definition at line 141 of file layoutManager.hpp. Referenced by assignInput(), cellChanged(), escapePressed(), and LayoutManager(). |
|
Are we assigning an output?
Definition at line 143 of file layoutManager.hpp. Referenced by assignOutput(), cellChanged(), escapePressed(), and LayoutManager(). |
|
The current space.
Definition at line 111 of file layoutManager.hpp. Referenced by cellChanged(), clean(), getLayout(), LayoutManager(), newLayout(), saveFile(), saveFileAs(), saveFilename(), tablesChanged(), updateGrids(), and updateIOList(). |
|
Main application controller.
Definition at line 117 of file layoutManager.hpp. Referenced by cellChanged(), clean(), LayoutManager(), newLayout(), openPFile(), prepareSimulation(), and startSimulation(). |
|
Current input selected.
Definition at line 137 of file layoutManager.hpp. Referenced by cellChanged(), findInputAssignment(), inputSelected(), and LayoutManager(). |
|
Current output selected.
Definition at line 139 of file layoutManager.hpp. Referenced by cellChanged(), findOutputAssignment(), LayoutManager(), and outputSelected(). |
|
Current table selected.
Definition at line 135 of file layoutManager.hpp. Referenced by cellChanged(), and LayoutManager(). |
|
Data persistance class.
Definition at line 115 of file layoutManager.hpp. Referenced by LayoutManager(), openPFile(), saveFile(), saveFileAs(), saveFilename(), and ~LayoutManager(). |
|
File system interaction presentation class.
Definition at line 113 of file layoutManager.hpp. Referenced by saveFile(), and saveFileAs(). |
|
Forbidden patterns selected.
Definition at line 133 of file layoutManager.hpp. Referenced by updateFPList(). |
|
Forbidden pattern manager.
Definition at line 107 of file layoutManager.hpp. Referenced by FPsChanged(), getListFPEnabled(), and LayoutManager(). |
|
Filename of the space.
Definition at line 119 of file layoutManager.hpp. Referenced by getFileName(), LayoutManager(), newLayout(), openPFile(), saveFile(), saveFileAs(), and saveFilename(). |
|
Has the space been modified after saving?
Definition at line 121 of file layoutManager.hpp. Referenced by cellChanged(), isLayoutModified(), LayoutManager(), newLayout(), openFile(), openPFile(), saveFile(), and saveFileAs(). |
|
Do we need a filename to save the space or not?
Definition at line 123 of file layoutManager.hpp. Referenced by LayoutManager(), newLayout(), openPFile(), saveFile(), and saveFileAs(). |
|
Rules selected.
Definition at line 131 of file layoutManager.hpp. Referenced by updateRuleList(). |
|
Rule manager.
Definition at line 109 of file layoutManager.hpp. Referenced by getListRuleEnabled(), LayoutManager(), and rulesChanged(). |
|
Tables selected.
Definition at line 129 of file layoutManager.hpp. Referenced by checkLayout(), getTableEnabled(), getTables(), getTableSelected(), and tableChecked(). |
|
Assigned input coordinates for the truth tables.
Definition at line 125 of file layoutManager.hpp. Referenced by cellChanged(), getTableInput(), getTableInputs(), inputAssigned(), newLayout(), resetIO(), setInput(), tableSelected(), and updateTTList(). |
|
Truth table manager.
Definition at line 105 of file layoutManager.hpp. Referenced by getTableSelected(), LayoutManager(), tablesChanged(), and updateIOList(). |
|
Assigned output coordinates for the truth tables.
Definition at line 127 of file layoutManager.hpp. Referenced by cellChanged(), getTableOutput(), getTableOutputs(), newLayout(), outputAssigned(), setOutput(), and tableSelected(). |
|
Presentation class.
Definition at line 103 of file layoutManager.hpp. Referenced by cellChanged(), clean(), elementChanged(), enableSimulation(), escapePressed(), newLayout(), openFile(), saveFile(), saveFileAs(), setView(), tableSelected(), and updateGrids(). |