#include <truthTableManager.hpp>
Collaboration diagram for TruthTableManager:
Public Member Functions | |
TruthTableManager (MainController *controller) | |
Constructor. | |
virtual | ~TruthTableManager () |
Destructor. | |
wxArrayString | getTableList () |
Returns the table names list. | |
void | setView (TruthTableView *view) |
Sets the table view. | |
void | newTable (wxString name, int inputs, int outputs) |
Creates a new table. | |
void | newTable (TruthTable *table) |
Creates a new table. | |
void | tableSelected (wxString TableId) |
Selects a table. | |
void | tableChanged (vector< bool > input, int output) |
Changes the status of the selected table. | |
void | removeTable () |
Deletes the selected table. | |
bool | saveFile () |
Saves the table collection. | |
bool | saveFileAs () |
Saves the collection to a specified file. | |
void | openFile () |
Opens a truth table file. | |
bool | openPFile (wxString file) |
Opens a truth table file for a new project. | |
bool | saveFilename (wxString file) |
Saves the table collection to the file. | |
int | getInputs (wxString tableId) |
Returns the input number of a table. | |
int | getOutputs (wxString tableId) |
Returns the output number of a table. | |
bool | isModified () |
Modified status. | |
wxString | getFileName () |
Returns the tables file name. | |
void | clean () |
Deletes all the tables and information. | |
TruthTable * | getTable (wxString id) |
Returns a truth table. | |
Private Member Functions | |
void | updateTable () |
Updates the table on the view to the selected one. | |
void | updateList () |
Updates the table list on the view. | |
bool | appendTables (bool mustDeleteTables, bool newFile) |
Opens the tables from a file, adding them to the collection. | |
void | deleteTables () |
Deletes all the tables from the collection. | |
Private Attributes | |
TruthTableView * | view |
Presentation layer. | |
FileManagerView | fileView |
FIle system presentation layer. | |
MainController * | controller |
Main application controller. | |
TruthTableDiskManager * | diskManager |
Data persistance controller. | |
map< wxString, TruthTable * > | tableList |
The truth table collection. | |
wxString | currentTable |
Current truth table selected. | |
wxString | fileName |
File name for the collection. | |
bool | modified |
Has the collection been modified after saving? | |
bool | needNewFile |
Do we need a filename to save the collection? |
This class is the main controller for the truth table collection. It manages it's view and data persistance layers and also provides services to the other controllers.
Definition at line 47 of file truthTableManager.hpp.
|
Constructor.
Definition at line 29 of file truthTableManager.cpp. References controller, currentTable, diskManager, fileName, modified, and needNewFile. |
|
Destructor.
Definition at line 41 of file truthTableManager.cpp. References diskManager. |
|
Opens the tables from a file, adding them to the collection. The actual tables are conserved or deleted.
Definition at line 352 of file truthTableManager.cpp. References controller, currentTable, deleteTables(), diskManager, MainController::elementChanged(), fileName, fileView, modified, FileManagerView::openFileChoose(), TruthTableDiskManager::openTables(), TruthTableView::selectTable(), tableSelected(), updateList(), and view. Here is the call graph for this function: ![]() |
|
Deletes all the tables and information.
Definition at line 501 of file truthTableManager.cpp. References controller, currentTable, deleteTables(), fileName, modified, TruthTableView::selectTable(), MainController::tablesChanged(), tableSelected(), updateList(), and view. Referenced by MainController::newFile(). Here is the call graph for this function: ![]() |
|
Deletes all the tables from the collection.
Definition at line 337 of file truthTableManager.cpp. References controller, currentTable, MainController::elementChanged(), and tableList. Referenced by appendTables(), clean(), openFile(), and openPFile(). Here is the call graph for this function: ![]() |
|
Returns the tables file name.
Definition at line 468 of file truthTableManager.cpp. References fileName. Referenced by MainController::save(), and MainController::saveFileNames(). |
|
Returns the input number of a table.
Definition at line 422 of file truthTableManager.cpp. References tableList. Referenced by LayoutManager::tablesChanged(), and LayoutManager::updateIOList(). |
|
Returns the output number of a table.
Definition at line 440 of file truthTableManager.cpp. References tableList. Referenced by LayoutManager::tablesChanged(), and LayoutManager::updateIOList(). |
|
Returns a truth table.
Definition at line 518 of file truthTableManager.cpp. References tableList. Referenced by LayoutManager::getTableSelected(). |
|
Returns the table names list.
Definition at line 404 of file truthTableManager.cpp. References tableList. Referenced by LayoutManager::tablesChanged(). |
|
Modified status.
Definition at line 458 of file truthTableManager.cpp. References modified. Referenced by MainController::open(). |
|
Creates a new table.
Definition at line 385 of file truthTableManager.cpp. References TruthTableView::errorMsg(), TruthTable::getName(), tableList, and view. Here is the call graph for this function: ![]() |
|
Creates a new table.
Definition at line 77 of file truthTableManager.cpp. References TruthTableView::errorMsg(), tableList, and view. Referenced by TruthTableDiskManager::returnTables(). Here is the call graph for this function: ![]() |
|
Opens a truth table file.
Definition at line 273 of file truthTableManager.cpp. References deleteTables(), modified, TruthTableView::msgYesNo(), saveFile(), tableList, and view. Referenced by TruthTableView::OnOpen(). Here is the call graph for this function: ![]() |
|
Opens a truth table file for a new project.
Definition at line 322 of file truthTableManager.cpp. References controller, currentTable, deleteTables(), diskManager, MainController::elementChanged(), fileName, TruthTableDiskManager::openTables(), TruthTableView::selectTable(), tableSelected(), updateList(), and view. Here is the call graph for this function: ![]() |
|
Deletes the selected table.
Definition at line 128 of file truthTableManager.cpp. References currentTable, and tableList. Referenced by TruthTableView::OnRemove(). |
|
Saves the table collection. If the collection has not been saved before, the user is asked to select a file name. Otherwise, the last file name is used.
Definition at line 186 of file truthTableManager.cpp. References diskManager, fileName, fileView, modified, needNewFile, FileManagerView::saveFileChoose(), TruthTableDiskManager::saveTables(), tableList, and view. Referenced by TruthTableView::OnSave(), openFile(), MainController::save(), and MainController::saveAs(). Here is the call graph for this function: ![]() |
|
Saves the collection to a specified file.
Definition at line 234 of file truthTableManager.cpp. References fileName, fileView, FileManagerView::saveFileChoose(), tableList, and view. Referenced by TruthTableView::OnSaveAs(). Here is the call graph for this function: ![]() |
|
Saves the table collection to the file.
Definition at line 479 of file truthTableManager.cpp. References tableList. Referenced by MainController::save(). |
|
Sets the table view.
Definition at line 51 of file truthTableManager.cpp. References view. |
|
Changes the status of the selected table.
Definition at line 167 of file truthTableManager.cpp. References controller, currentTable, MainController::elementChanged(), modified, and tableList. Referenced by TruthTableView::OnClick(). Here is the call graph for this function: ![]() |
|
Selects a table.
Definition at line 120 of file truthTableManager.cpp. References currentTable, and updateTable(). Referenced by appendTables(), clean(), TruthTableView::OnSelection(), and openPFile(). Here is the call graph for this function: ![]() |
|
Updates the table list on the view.
Definition at line 105 of file truthTableManager.cpp. References tableList. Referenced by appendTables(), clean(), and openPFile(). |
|
Updates the table on the view to the selected one.
Definition at line 58 of file truthTableManager.cpp. References currentTable, tableList, TruthTableView::updateTable(), and view. Referenced by tableSelected(). Here is the call graph for this function: ![]() |
|
Main application controller.
Definition at line 77 of file truthTableManager.hpp. Referenced by appendTables(), clean(), deleteTables(), openPFile(), tableChanged(), and TruthTableManager(). |
|
Current truth table selected.
Definition at line 83 of file truthTableManager.hpp. Referenced by appendTables(), clean(), deleteTables(), openPFile(), removeTable(), tableChanged(), tableSelected(), TruthTableManager(), and updateTable(). |
|
Data persistance controller.
Definition at line 79 of file truthTableManager.hpp. Referenced by appendTables(), openPFile(), saveFile(), TruthTableManager(), and ~TruthTableManager(). |
|
File name for the collection.
Definition at line 85 of file truthTableManager.hpp. Referenced by appendTables(), clean(), getFileName(), openPFile(), saveFile(), saveFileAs(), and TruthTableManager(). |
|
FIle system presentation layer.
Definition at line 75 of file truthTableManager.hpp. Referenced by appendTables(), saveFile(), and saveFileAs(). |
|
Has the collection been modified after saving?
Definition at line 87 of file truthTableManager.hpp. Referenced by appendTables(), clean(), isModified(), openFile(), saveFile(), tableChanged(), and TruthTableManager(). |
|
Do we need a filename to save the collection?
Definition at line 89 of file truthTableManager.hpp. Referenced by saveFile(), and TruthTableManager(). |
|
The truth table collection.
Definition at line 81 of file truthTableManager.hpp. Referenced by deleteTables(), getInputs(), getOutputs(), getTable(), getTableList(), newTable(), openFile(), removeTable(), saveFile(), saveFileAs(), saveFilename(), tableChanged(), updateList(), and updateTable(). |
|
Presentation layer.
Definition at line 73 of file truthTableManager.hpp. Referenced by appendTables(), clean(), newTable(), openFile(), openPFile(), saveFile(), saveFileAs(), setView(), and updateTable(). |