OpenASIP 2.2
|
#include <OTAFormatListDialog.hh>
Public Member Functions | |
OTAFormatListDialog (wxWindow *parent, TTAMachine::Machine *machine) | |
virtual | ~OTAFormatListDialog () |
Private Types | |
enum | { ID_OTA_FORMAT_LIST = 10000 , ID_OPERATION_LIST , ID_LINE , ID_HELP , ID_ADD_OTA_FORMAT , ID_DELETE_OTA_FORMAT , ID_ADD_OPERATION , ID_EDIT_OPERATION , ID_DELETE_OPERATION , ID_NAME , ID_LABEL_NAME } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
void | updateOperationList () |
void | onOTAFormatSelection (wxListEvent &event) |
void | onOperationSelection (wxListEvent &event) |
void | onOTAFormatName (wxCommandEvent &event) |
void | onAddOTAFormat (wxCommandEvent &event) |
void | onDeleteOTAFormat (wxCommandEvent &event) |
void | onAddOperation (wxCommandEvent &event) |
void | onEditOperation (wxCommandEvent &event) |
void | onDeleteOperation (wxCommandEvent &event) |
void | setTexts () |
bool | validFormatName () const |
TTAMachine::OperationTriggeredFormat * | selectedOTAFormat () |
std::string | selectedOperation () |
Private Attributes | |
TTAMachine::Machine * | machine_ |
Parent machine of the instruction OTAFormats. | |
wxStaticBoxSizer * | OTAFormatSizer_ |
Box sizer around the OTAFormat list. | |
wxStaticBoxSizer * | operationSizer_ |
Box sizer around the operation list. | |
wxListCtrl * | OTAFormatList_ |
Widget for list of OTAFormats. | |
wxListCtrl * | operationList_ |
Widget for list of operations in the selected OTAFormat. | |
wxString | OTAFormatName_ |
Name of the new OTAFormat. | |
Dialog for listing and editing instruction OTAFormats in a machine.
Definition at line 44 of file OTAFormatListDialog.hh.
|
private |
Enumerator | |
---|---|
ID_OTA_FORMAT_LIST | |
ID_OPERATION_LIST | |
ID_LINE | |
ID_HELP | |
ID_ADD_OTA_FORMAT | |
ID_DELETE_OTA_FORMAT | |
ID_ADD_OPERATION | |
ID_EDIT_OPERATION | |
ID_DELETE_OPERATION | |
ID_NAME | |
ID_LABEL_NAME |
Definition at line 80 of file OTAFormatListDialog.hh.
OTAFormatListDialog::OTAFormatListDialog | ( | wxWindow * | parent, |
TTAMachine::Machine * | machine | ||
) |
The Constructor.
parent | Parent window of the dialog. |
machine | Parent machine of the instruction OTAFormats. |
Definition at line 72 of file OTAFormatListDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
This method was generated with wxDesigner.
parent | The dialog window. |
call_fit | If true, fits the contents inside the dialog. |
set_sizer | If true, sets the main sizer as dialog contents. |
Definition at line 417 of file OTAFormatListDialog.cc.
References ID_ADD_OPERATION, ID_ADD_OTA_FORMAT, ID_DELETE_OPERATION, ID_DELETE_OTA_FORMAT, ID_HELP, ID_LABEL_NAME, ID_LINE, ID_NAME, ID_OPERATION_LIST, ID_OTA_FORMAT_LIST, operationSizer_, and OTAFormatSizer_.
|
private |
Handles the add Operation button event.
Definition at line 382 of file OTAFormatListDialog.cc.
References assert, selectedOTAFormat(), and updateOperationList().
|
private |
Handles the Add tempalte button event.
Adds a new OTAFormat to the machine.
Definition at line 304 of file OTAFormatListDialog.cc.
References assert, ProDeTextGenerator::COMP_AN_OTA_FORMAT, ProDeTextGenerator::COMP_MACHINE, ProDeTextGenerator::COMP_OTA_FORMAT, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ProDeTextGenerator::instance(), machine, machine_, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Machine::operationTriggeredFormatNavigator(), OTAFormatName_, RISCVFields::RISCV_B_TYPE_NAME, RISCVFields::RISCV_I_TYPE_NAME, RISCVFields::RISCV_J_TYPE_NAME, RISCVFields::RISCV_R1_TYPE_NAME, RISCVFields::RISCV_R1R_TYPE_NAME, RISCVFields::RISCV_R3R_TYPE_NAME, RISCVFields::RISCV_R_TYPE_NAME, RISCVFields::RISCV_S_TYPE_NAME, RISCVFields::RISCV_U_TYPE_NAME, Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), TransferDataToWindow(), and validFormatName().
|
private |
Handles the delete Operation button event.
Definition at line 397 of file OTAFormatListDialog.cc.
References assert, TTAMachine::OperationTriggeredFormat::removeOperation(), selectedOperation(), selectedOTAFormat(), and updateOperationList().
|
private |
Deletes the selected OTAFormat.
Definition at line 241 of file OTAFormatListDialog.cc.
References dummy, onOTAFormatSelection(), selectedOTAFormat(), and TransferDataToWindow().
|
private |
|
private |
Updates the edit/delete Operation buttons when the Operation selection changes.
Definition at line 228 of file OTAFormatListDialog.cc.
References ID_DELETE_OPERATION, and operationList_.
Referenced by updateOperationList().
|
private |
Enables and disables the Add OTAFormat button when text is entered in the OTAFormat name widget.
Definition at line 360 of file OTAFormatListDialog.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::count(), ID_ADD_OTA_FORMAT, machine_, TTAMachine::Machine::operationTriggeredFormatNavigator(), and OTAFormatName_.
|
private |
Updates the Operation list when the OTAFormat selection changes.
Definition at line 214 of file OTAFormatListDialog.cc.
References ID_DELETE_OTA_FORMAT, OTAFormatList_, and updateOperationList().
Referenced by onDeleteOTAFormat().
|
private |
Returns name of the selected Operation.
Definition at line 276 of file OTAFormatListDialog.cc.
References WidgetTools::lcStringSelection(), and operationList_.
Referenced by onDeleteOperation().
|
private |
Returns pointer to the selected OperationTriggeredFormat.
Definition at line 255 of file OTAFormatListDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, TTAMachine::Machine::operationTriggeredFormatNavigator(), and OTAFormatList_.
Referenced by onAddOperation(), onDeleteOperation(), onDeleteOTAFormat(), and updateOperationList().
|
private |
Sets texts for widgets.
Definition at line 104 of file OTAFormatListDialog.cc.
References ID_ADD_OPERATION, ID_ADD_OTA_FORMAT, ID_DELETE_OPERATION, ID_DELETE_OTA_FORMAT, ID_HELP, ID_LABEL_NAME, ID_OPERATION_LIST, ID_OTA_FORMAT_LIST, GUITextGenerator::instance(), ProDeTextGenerator::instance(), operationSizer_, OTAFormatSizer_, WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_ADD, GUITextGenerator::TXT_BUTTON_ADD_DIALOG, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_COLUMN_NAME, ProDeTextGenerator::TXT_COLUMN_OTA_OPERATION, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_OTA_FORMATS_BOX, ProDeTextGenerator::TXT_OTA_FORMATS_DIALOG_TITLE, and ProDeTextGenerator::TXT_OTA_FORMATS_OPERATIONS_BOX.
|
privatevirtual |
Transfers data from the machine to the dialog widgets.
Definition at line 166 of file OTAFormatListDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, TTAMachine::Machine::operationTriggeredFormatNavigator(), OTAFormatList_, WxConversion::toWxString(), and updateOperationList().
Referenced by onAddOTAFormat(), and onDeleteOTAFormat().
|
private |
Updates the OTAFormat Operation list.
Definition at line 185 of file OTAFormatListDialog.cc.
References dummy, ID_ADD_OPERATION, onOperationSelection(), TTAMachine::OperationTriggeredFormat::operationAtIndex(), TTAMachine::OperationTriggeredFormat::operationCount(), operationList_, selectedOTAFormat(), and WxConversion::toWxString().
Referenced by onAddOperation(), onDeleteOperation(), onOTAFormatSelection(), and TransferDataToWindow().
|
private |
Definition at line 282 of file OTAFormatListDialog.cc.
References OTAFormatName_, RISCVFields::RISCV_B_TYPE_NAME, RISCVFields::RISCV_I_TYPE_NAME, RISCVFields::RISCV_J_TYPE_NAME, RISCVFields::RISCV_R1_TYPE_NAME, RISCVFields::RISCV_R1R_TYPE_NAME, RISCVFields::RISCV_R3R_TYPE_NAME, RISCVFields::RISCV_R_TYPE_NAME, RISCVFields::RISCV_S_TYPE_NAME, and RISCVFields::RISCV_U_TYPE_NAME.
Referenced by onAddOTAFormat().
|
private |
Parent machine of the instruction OTAFormats.
Definition at line 67 of file OTAFormatListDialog.hh.
Referenced by onAddOTAFormat(), onOTAFormatName(), selectedOTAFormat(), and TransferDataToWindow().
|
private |
Widget for list of operations in the selected OTAFormat.
Definition at line 75 of file OTAFormatListDialog.hh.
Referenced by onOperationSelection(), selectedOperation(), and updateOperationList().
|
private |
Box sizer around the operation list.
Definition at line 71 of file OTAFormatListDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Widget for list of OTAFormats.
Definition at line 73 of file OTAFormatListDialog.hh.
Referenced by onOTAFormatSelection(), selectedOTAFormat(), and TransferDataToWindow().
|
private |
Name of the new OTAFormat.
Definition at line 77 of file OTAFormatListDialog.hh.
Referenced by onAddOTAFormat(), onOTAFormatName(), and validFormatName().
|
private |
Box sizer around the OTAFormat list.
Definition at line 69 of file OTAFormatListDialog.hh.
Referenced by createContents(), and setTexts().