OpenASIP
2.0
|
#include <BusDialog.hh>
Public Member Functions | |
BusDialog (wxWindow *parent, TTAMachine::Bus *bus) | |
virtual | ~BusDialog () |
Private Types | |
enum | { ID_BUS_NAME = 10000, ID_BUS_WIDTH, ID_SI_WIDTH, ID_SI_EXTENSION, ID_TRUE_GUARD, ID_FALSE_GUARD, ID_SEGMENT_LIST, ID_SEGMENT_NAME, ID_SEGMENT_UP, ID_SEGMENT_DOWN, ID_ADD_SEGMENT, ID_DELETE_SEGMENT, ID_RF_GUARD_LIST, ID_ADD_RF_GUARD, ID_EDIT_RF_GUARD, ID_DELETE_RF_GUARD, ID_FU_GUARD_LIST, ID_ADD_FU_GUARD, ID_EDIT_FU_GUARD, ID_DELETE_FU_GUARD, ID_HELP, ID_LABEL_BUS_NAME, ID_LABEL_BUS_WIDTH, ID_LABEL_WIDTH, ID_LABEL_SI_WIDTH, ID_LABEL_SEGMENT_NAME } |
enumerated IDs for dialog controls More... | |
Private Member Functions | |
virtual bool | TransferDataToWindow () |
void | onOK (wxCommandEvent &) |
void | onHelp (wxCommandEvent &event) |
void | onBusName (wxCommandEvent &) |
void | onAddSegment (wxCommandEvent &) |
void | onSegmentName (wxCommandEvent &) |
void | onSegmentSelection (wxListEvent &) |
void | onSegmentRightClick (wxListEvent &event) |
void | onDeleteSegment (wxCommandEvent &) |
void | onSegmentUp (wxCommandEvent &) |
void | onSegmentDown (wxCommandEvent &) |
void | setTexts () |
void | onRFGuardSelection (wxListEvent &) |
void | onAddRFGuard (wxCommandEvent &) |
void | onDeleteRFGuard (wxCommandEvent &) |
void | onEditRFGuard (wxCommandEvent &) |
void | onFUGuardSelection (wxListEvent &) |
void | onAddFUGuard (wxCommandEvent &) |
void | onDeleteFUGuard (wxCommandEvent &) |
void | onEditFUGuard (wxCommandEvent &) |
void | onUnconditionalGuard (wxCommandEvent &) |
void | onWidth (wxSpinEvent &) |
void | updateSegmentList () |
void | updateGuardLists () |
void | onRFGuardRightClick (wxListEvent &event) |
void | onActivateRFGuard (wxListEvent &event) |
void | onFUGuardRightClick (wxListEvent &event) |
void | onActivateFUGuard (wxListEvent &event) |
TTAMachine::Segment * | selectedSegment () const |
TTAMachine::RegisterGuard * | selectedRFGuard () const |
TTAMachine::PortGuard * | selectedFUGuard () const |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
Private Attributes | |
TTAMachine::Bus * | bus_ |
Transport Bus to edit. More... | |
wxString | name_ |
Name of the bus. More... | |
int | width_ |
Width of the bus. More... | |
int | immWidth_ |
Short immediate width. More... | |
wxString | newSegName_ |
Name for a new segment. More... | |
wxListCtrl * | segList_ |
List widget for the segment list. More... | |
wxCheckBox * | alwaysTrueGuard_ |
Check box for always true unconditional guard. More... | |
wxCheckBox * | alwaysFalseGuard_ |
Check box for always false unconditional guard. More... | |
wxRadioBox * | immediateExtensionBox_ |
Radio box for immediate extension. More... | |
wxListCtrl * | rfGuardList_ |
Register file guard list control. More... | |
wxListCtrl * | fuGuardList_ |
Function unit port guard list control. More... | |
wxStaticBoxSizer * | busSizer_ |
Static boxsizer for the bus properties. More... | |
wxStaticBoxSizer * | siSizer_ |
Static boxsizer for the short immediate properties. More... | |
wxStaticBoxSizer * | registerGuardSizer_ |
Static boxsizer for the register guard properties. More... | |
wxStaticBoxSizer * | portGuardSizer_ |
Static boxsizer for the port guard properties. More... | |
wxStaticBoxSizer * | segmentSizer_ |
Static boxsizer for the segment properties. More... | |
vector< TTAMachine::RegisterGuard * > | registerGuards_ |
list of register guards More... | |
vector< TTAMachine::PortGuard * > | portGuards_ |
list of port guards More... | |
Dialog for querying transport bus parameters from the user.
Definition at line 54 of file BusDialog.hh.
|
private |
enumerated IDs for dialog controls
Definition at line 138 of file BusDialog.hh.
BusDialog::BusDialog | ( | wxWindow * | parent, |
TTAMachine::Bus * | bus | ||
) |
The Constructor.
parent | Parent window of the dialog. |
bus | Transport bus to be modified with the dialog. |
Definition at line 122 of file BusDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
This method was generated with wxDesigner. Don't modify manually, all chnages will be lost if the code is regenerated.
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 1178 of file BusDialog.cc.
|
private |
Handles left mouse button double clicks on the FUGuard list.
Definition at line 1160 of file BusDialog.cc.
References dummy.
|
private |
Handles left mouse button double clicks on the RFGuard list.
Definition at line 1123 of file BusDialog.cc.
References dummy.
|
private |
Creates and shows an empty function unit port guard dialog for adding function unit port guards.
Definition at line 998 of file BusDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), ProDeTextGenerator::MSG_ERROR_CANNOT_FU_GUARD, Texts::TextGenerator::text(), and WxConversion::toWxString().
|
private |
Creates and shows a register file guard dialog for adding register file guards.
Definition at line 898 of file BusDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), ProDeTextGenerator::MSG_ERROR_CANNOT_RF_GUARD, Texts::TextGenerator::text(), and WxConversion::toWxString().
|
private |
Adds a new segment to the segment list.
Definition at line 567 of file BusDialog.cc.
References assert, ProDeTextGenerator::COMP_A_SEGMENT, ProDeTextGenerator::COMP_BUS, ProDeTextGenerator::COMP_SEGMENT, ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Enables and disables OK button based on input in the bus name widget.
Definition at line 617 of file BusDialog.cc.
References assert.
|
private |
Deletes selected function unit port guards from the function unit port guards list.
Definition at line 1032 of file BusDialog.cc.
References dummy.
|
private |
Deletes selected register file guards from the register file guards list.
Definition at line 922 of file BusDialog.cc.
|
private |
Deletes the selected segment from the bus.
The Segments before and after the deleted segments are connected to each other.
Definition at line 735 of file BusDialog.cc.
|
private |
Handles the 'Edit FUGuard' button event.
Opens a FUGuardDialog with the selected guard's attributes set.
Definition at line 1047 of file BusDialog.cc.
|
private |
Handles the 'Edit RFGuard' button event.
Opens a RFGuardDialog with the selected guard's attributes set.
Definition at line 958 of file BusDialog.cc.
|
private |
Opens a pop-up menu when right mouse button was pressed on the FU guard list.
event | Information about right mouse click event. |
Definition at line 1136 of file BusDialog.cc.
References ProDeTextGenerator::instance(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_LABEL_BUTTON_DELETE, and ProDeTextGenerator::TXT_LABEL_BUTTON_EDIT.
|
private |
Disables and enables Edit and Delete buttons under the register file guard list.
If a guard is selected, buttons are enabled. If no guard is selected the buttons will be disabled.
Definition at line 1081 of file BusDialog.cc.
|
private |
|
private |
Validates input in the controls, and updates the Bus object.
Definition at line 797 of file BusDialog.cc.
References ProDeTextGenerator::COMP_A_BUS, ProDeTextGenerator::COMP_AN_IMM_SLOT, ProDeTextGenerator::COMP_BUS, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeConstants::EXTENSION_ZERO, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), ProDeTextGenerator::MSG_ERROR_BUS_IT_SLOT_WIDTH, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Opens a pop-up menu when right mouse button was pressed on the register file guard list.
event | Information about right mouse click event. |
Definition at line 1099 of file BusDialog.cc.
References ProDeTextGenerator::instance(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_LABEL_BUTTON_DELETE, and ProDeTextGenerator::TXT_LABEL_BUTTON_EDIT.
|
private |
Disables and enables Edit and Delete buttons under the register file guard list.
If a guard is selected, buttons are enabled. If no guard is selected the buttons will be disabled.
Definition at line 978 of file BusDialog.cc.
|
private |
Moves selected segment one position down in the segment chain.
Definition at line 775 of file BusDialog.cc.
References assert, TTAMachine::Segment::destinationSegment(), TTAMachine::Segment::hasDestinationSegment(), TTAMachine::Segment::moveAfter(), TTAMachine::Segment::name(), and WxConversion::toWxString().
|
private |
Enables and disables add segment button based on input in the segment name widget.
Definition at line 676 of file BusDialog.cc.
References assert.
|
private |
Opens a pop-up menu when right mouse button was pressed.
event | Information about right mouse click event. |
Definition at line 712 of file BusDialog.cc.
References ProDeTextGenerator::instance(), Texts::TextGenerator::text(), WxConversion::toWxString(), and ProDeTextGenerator::TXT_LABEL_BUTTON_DELETE.
|
private |
Disables segment deletion and move buttons if no segment is selected.
Definition at line 693 of file BusDialog.cc.
|
private |
Moves selected segment one position up in the segment chain.
Definition at line 752 of file BusDialog.cc.
References assert, TTAMachine::Segment::hasSourceSegment(), TTAMachine::Segment::moveBefore(), TTAMachine::Segment::name(), TTAMachine::Segment::sourceSegment(), and WxConversion::toWxString().
|
private |
Handles the unconditional guard deletion/creation when true/false guard checkbox values are toggled.
Definition at line 635 of file BusDialog.cc.
References Exception::errorMessage(), ProDeTextGenerator::instance(), TTAMachine::Guard::isInverted(), ProDeTextGenerator::MSG_ERROR, Texts::TextGenerator::text(), and WxConversion::toWxString().
|
private |
Sets the immediate width range when the bus width is modified.
Definition at line 1063 of file BusDialog.cc.
|
private |
Returns pointer to the selected fu port guard.
Definition at line 522 of file BusDialog.cc.
References assert.
|
private |
Returns pointer to the selected register file guard.
Definition at line 543 of file BusDialog.cc.
References assert.
|
private |
Returns pointer to the selected segment.
Returns NULL if no segment is selected.
Definition at line 501 of file BusDialog.cc.
References WxConversion::toString().
|
private |
Definition at line 192 of file BusDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_BUS_BUS_BOX, ProDeTextGenerator::TXT_BUS_DIALOG_TITLE, ProDeTextGenerator::TXT_BUS_PORT_GUARD_BOX, ProDeTextGenerator::TXT_BUS_REGISTER_GUARD_BOX, ProDeTextGenerator::TXT_BUS_SEGMENTS_BOX, ProDeTextGenerator::TXT_BUS_SI_BOX, GUITextGenerator::TXT_BUTTON_ADD, GUITextGenerator::TXT_BUTTON_ADD_DIALOG, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, ProDeTextGenerator::TXT_BUTTON_DOWN, GUITextGenerator::TXT_BUTTON_EDIT_DIALOG, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_BUTTON_UP, ProDeTextGenerator::TXT_COLUMN_INDEX, ProDeTextGenerator::TXT_COLUMN_INVERTED, ProDeTextGenerator::TXT_COLUMN_NAME, ProDeTextGenerator::TXT_COLUMN_PORT, ProDeTextGenerator::TXT_LABEL_EXTENSION, ProDeTextGenerator::TXT_LABEL_FALSE_GUARD, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_LABEL_TRUE_GUARD, ProDeTextGenerator::TXT_LABEL_WIDTH, ProDeTextGenerator::TXT_RADIO_EXTENSION_SIGN, and ProDeTextGenerator::TXT_RADIO_EXTENSION_ZERO.
|
privatevirtual |
Transfers the data from the bus model to the dialog controls.
Definition at line 337 of file BusDialog.cc.
References dummy, ProDeConstants::EXTENSION_SIGN, ProDeConstants::EXTENSION_ZERO, and WxConversion::toWxString().
|
private |
Updates the guard lists.
Definition at line 412 of file BusDialog.cc.
References assert, TTAMachine::Guard::isInverted(), ListCompareFunction(), TTAMachine::Port::name(), TTAMachine::Component::name(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::PortGuard::port(), TTAMachine::RegisterGuard::registerFile(), TTAMachine::RegisterGuard::registerIndex(), and WxConversion::toWxString().
|
private |
Updates the segment list control.
Definition at line 486 of file BusDialog.cc.
References WxConversion::toWxString().
|
private |
Check box for always false unconditional guard.
Definition at line 112 of file BusDialog.hh.
|
private |
Check box for always true unconditional guard.
Definition at line 110 of file BusDialog.hh.
|
private |
Transport Bus to edit.
Definition at line 97 of file BusDialog.hh.
|
private |
Static boxsizer for the bus properties.
Definition at line 121 of file BusDialog.hh.
|
private |
Function unit port guard list control.
Definition at line 118 of file BusDialog.hh.
|
private |
Radio box for immediate extension.
Definition at line 114 of file BusDialog.hh.
|
private |
Short immediate width.
Definition at line 103 of file BusDialog.hh.
|
private |
Name of the bus.
Definition at line 99 of file BusDialog.hh.
|
private |
Name for a new segment.
Definition at line 105 of file BusDialog.hh.
|
private |
list of port guards
Definition at line 135 of file BusDialog.hh.
|
private |
Static boxsizer for the port guard properties.
Definition at line 127 of file BusDialog.hh.
|
private |
list of register guards
Definition at line 133 of file BusDialog.hh.
|
private |
Static boxsizer for the register guard properties.
Definition at line 125 of file BusDialog.hh.
|
private |
Register file guard list control.
Definition at line 116 of file BusDialog.hh.
|
private |
List widget for the segment list.
Definition at line 108 of file BusDialog.hh.
|
private |
Static boxsizer for the segment properties.
Definition at line 129 of file BusDialog.hh.
|
private |
Static boxsizer for the short immediate properties.
Definition at line 123 of file BusDialog.hh.
|
private |
Width of the bus.
Definition at line 101 of file BusDialog.hh.