OpenASIP 2.2
|
#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. | |
wxString | name_ |
Name of the bus. | |
int | width_ |
Width of the bus. | |
int | immWidth_ |
Short immediate width. | |
wxString | newSegName_ |
Name for a new segment. | |
wxListCtrl * | segList_ |
List widget for the segment list. | |
wxCheckBox * | alwaysTrueGuard_ |
Check box for always true unconditional guard. | |
wxCheckBox * | alwaysFalseGuard_ |
Check box for always false unconditional guard. | |
wxRadioBox * | immediateExtensionBox_ |
Radio box for immediate extension. | |
wxListCtrl * | rfGuardList_ |
Register file guard list control. | |
wxListCtrl * | fuGuardList_ |
Function unit port guard list control. | |
wxStaticBoxSizer * | busSizer_ |
Static boxsizer for the bus properties. | |
wxStaticBoxSizer * | siSizer_ |
Static boxsizer for the short immediate properties. | |
wxStaticBoxSizer * | registerGuardSizer_ |
Static boxsizer for the register guard properties. | |
wxStaticBoxSizer * | portGuardSizer_ |
Static boxsizer for the port guard properties. | |
wxStaticBoxSizer * | segmentSizer_ |
Static boxsizer for the segment properties. | |
vector< TTAMachine::RegisterGuard * > | registerGuards_ |
list of register guards | |
vector< TTAMachine::PortGuard * > | portGuards_ |
list of port guards | |
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.
References busSizer_, ID_ADD_FU_GUARD, ID_ADD_RF_GUARD, ID_ADD_SEGMENT, ID_BUS_NAME, ID_BUS_WIDTH, ID_DELETE_FU_GUARD, ID_DELETE_RF_GUARD, ID_DELETE_SEGMENT, ID_EDIT_FU_GUARD, ID_EDIT_RF_GUARD, ID_FALSE_GUARD, ID_FU_GUARD_LIST, ID_HELP, ID_LABEL_BUS_NAME, ID_LABEL_BUS_WIDTH, ID_LABEL_SEGMENT_NAME, ID_LABEL_SI_WIDTH, ID_RF_GUARD_LIST, ID_SEGMENT_DOWN, ID_SEGMENT_LIST, ID_SEGMENT_NAME, ID_SEGMENT_UP, ID_SI_EXTENSION, ID_SI_WIDTH, ID_TRUE_GUARD, portGuardSizer_, registerGuardSizer_, segmentSizer_, and siSizer_.
|
private |
Handles left mouse button double clicks on the FUGuard list.
Definition at line 1160 of file BusDialog.cc.
References dummy, and onEditFUGuard().
|
private |
Handles left mouse button double clicks on the RFGuard list.
Definition at line 1123 of file BusDialog.cc.
References dummy, and onEditRFGuard().
|
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 bus_, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), ProDeTextGenerator::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), ProDeTextGenerator::MSG_ERROR_CANNOT_FU_GUARD, Texts::TextGenerator::text(), WxConversion::toWxString(), and updateGuardLists().
|
private |
Creates and shows a register file guard dialog for adding register file guards.
Definition at line 898 of file BusDialog.cc.
References bus_, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), TTAMachine::Component::machine(), ProDeTextGenerator::MSG_ERROR_CANNOT_RF_GUARD, TTAMachine::Machine::registerFileNavigator(), Texts::TextGenerator::text(), WxConversion::toWxString(), and updateGuardLists().
|
private |
Adds a new segment to the segment list.
Definition at line 567 of file BusDialog.cc.
References assert, bus_, ProDeTextGenerator::COMP_A_SEGMENT, ProDeTextGenerator::COMP_BUS, ProDeTextGenerator::COMP_SEGMENT, TTAMachine::Bus::hasSegment(), ID_SEGMENT_NAME, ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, newSegName_, Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), and updateSegmentList().
|
private |
Enables and disables OK button based on input in the bus name widget.
Definition at line 617 of file BusDialog.cc.
|
private |
Deletes selected function unit port guards from the function unit port guards list.
Definition at line 1032 of file BusDialog.cc.
References dummy, onFUGuardSelection(), selectedFUGuard(), and updateGuardLists().
|
private |
Deletes selected register file guards from the register file guards list.
Definition at line 922 of file BusDialog.cc.
References assert, dummy, onRFGuardSelection(), registerGuards_, rfGuardList_, and updateGuardLists().
|
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.
References assert, dummy, onSegmentSelection(), selectedSegment(), and updateSegmentList().
|
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.
References bus_, selectedFUGuard(), and updateGuardLists().
Referenced by onActivateFUGuard().
|
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.
References bus_, selectedRFGuard(), and updateGuardLists().
Referenced by onActivateRFGuard().
|
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 fuGuardList_, ID_DELETE_FU_GUARD, ID_EDIT_FU_GUARD, 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.
References fuGuardList_, ID_DELETE_FU_GUARD, and ID_EDIT_FU_GUARD.
Referenced by onDeleteFUGuard().
|
private |
|
private |
Validates input in the controls, and updates the Bus object.
Definition at line 797 of file BusDialog.cc.
References bus_, TTAMachine::Machine::busNavigator(), 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(), immediateExtensionBox_, TTAMachine::Machine::immediateSlotNavigator(), immWidth_, ProDeTextGenerator::instance(), TTAMachine::Machine::instructionTemplateNavigator(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), ProDeTextGenerator::MSG_ERROR_BUS_IT_SLOT_WIDTH, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), name_, TTAMachine::Bus::setImmediateWidth(), TTAMachine::Bus::setName(), TTAMachine::Bus::setSignExtends(), TTAMachine::Bus::setWidth(), TTAMachine::Bus::setZeroExtends(), Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), and width_.
|
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 ID_DELETE_RF_GUARD, ID_EDIT_RF_GUARD, ProDeTextGenerator::instance(), rfGuardList_, 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.
References ID_DELETE_RF_GUARD, ID_EDIT_RF_GUARD, and rfGuardList_.
Referenced by onDeleteRFGuard().
|
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(), segList_, selectedSegment(), WxConversion::toWxString(), and updateSegmentList().
|
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, ID_ADD_SEGMENT, and newSegName_.
|
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 ID_DELETE_SEGMENT, ProDeTextGenerator::instance(), segList_, 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.
References ID_DELETE_SEGMENT, ID_SEGMENT_DOWN, ID_SEGMENT_UP, and segList_.
Referenced by onDeleteSegment().
|
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(), segList_, selectedSegment(), TTAMachine::Segment::sourceSegment(), WxConversion::toWxString(), and updateSegmentList().
|
private |
Handles the unconditional guard deletion/creation when true/false guard checkbox values are toggled.
Definition at line 635 of file BusDialog.cc.
References alwaysFalseGuard_, alwaysTrueGuard_, bus_, Exception::errorMessage(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), ID_FALSE_GUARD, 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.
References ID_BUS_WIDTH, and ID_SI_WIDTH.
Referenced by TransferDataToWindow().
|
private |
Returns pointer to the selected fu port guard.
Definition at line 522 of file BusDialog.cc.
References assert, fuGuardList_, and portGuards_.
Referenced by onDeleteFUGuard(), and onEditFUGuard().
|
private |
Returns pointer to the selected register file guard.
Definition at line 543 of file BusDialog.cc.
References assert, registerGuards_, and rfGuardList_.
Referenced by onEditRFGuard().
|
private |
Returns pointer to the selected segment.
Returns NULL if no segment is selected.
Definition at line 501 of file BusDialog.cc.
References bus_, segList_, TTAMachine::Bus::segment(), and WxConversion::toString().
Referenced by onDeleteSegment(), onSegmentDown(), and onSegmentUp().
|
private |
Definition at line 192 of file BusDialog.cc.
References busSizer_, ID_ADD_FU_GUARD, ID_ADD_RF_GUARD, ID_ADD_SEGMENT, ID_DELETE_FU_GUARD, ID_DELETE_RF_GUARD, ID_DELETE_SEGMENT, ID_EDIT_FU_GUARD, ID_EDIT_RF_GUARD, ID_FALSE_GUARD, ID_FU_GUARD_LIST, ID_HELP, ID_LABEL_BUS_NAME, ID_LABEL_BUS_WIDTH, ID_LABEL_SEGMENT_NAME, ID_LABEL_SI_WIDTH, ID_RF_GUARD_LIST, ID_SEGMENT_DOWN, ID_SEGMENT_LIST, ID_SEGMENT_UP, ID_SI_EXTENSION, ID_TRUE_GUARD, immediateExtensionBox_, GUITextGenerator::instance(), ProDeTextGenerator::instance(), portGuardSizer_, registerGuardSizer_, segmentSizer_, WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), siSizer_, 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 bus_, dummy, ProDeConstants::EXTENSION_SIGN, ProDeConstants::EXTENSION_ZERO, ID_BUS_WIDTH, ID_SI_WIDTH, immediateExtensionBox_, TTAMachine::Bus::immediateWidth(), immWidth_, TTAMachine::Component::name(), name_, onWidth(), TTAMachine::Bus::signExtends(), WxConversion::toWxString(), updateGuardLists(), updateSegmentList(), TTAMachine::Bus::width(), and width_.
|
private |
Updates the guard lists.
Definition at line 412 of file BusDialog.cc.
References alwaysFalseGuard_, alwaysTrueGuard_, assert, bus_, fuGuardList_, TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAMachine::Guard::isInverted(), ListCompareFunction(), TTAMachine::Component::name(), TTAMachine::Port::name(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::PortGuard::port(), portGuards_, TTAMachine::RegisterGuard::registerFile(), registerGuards_, TTAMachine::RegisterGuard::registerIndex(), rfGuardList_, and WxConversion::toWxString().
Referenced by onAddFUGuard(), onAddRFGuard(), onDeleteFUGuard(), onDeleteRFGuard(), onEditFUGuard(), onEditRFGuard(), and TransferDataToWindow().
|
private |
Updates the segment list control.
Definition at line 486 of file BusDialog.cc.
References bus_, TTAMachine::Segment::name(), segList_, TTAMachine::Bus::segment(), TTAMachine::Bus::segmentCount(), and WxConversion::toWxString().
Referenced by onAddSegment(), onDeleteSegment(), onSegmentDown(), onSegmentUp(), and TransferDataToWindow().
|
private |
Check box for always false unconditional guard.
Definition at line 112 of file BusDialog.hh.
Referenced by onUnconditionalGuard(), and updateGuardLists().
|
private |
Check box for always true unconditional guard.
Definition at line 110 of file BusDialog.hh.
Referenced by onUnconditionalGuard(), and updateGuardLists().
|
private |
Transport Bus to edit.
Definition at line 97 of file BusDialog.hh.
Referenced by onAddFUGuard(), onAddRFGuard(), onAddSegment(), onEditFUGuard(), onEditRFGuard(), onOK(), onUnconditionalGuard(), selectedSegment(), TransferDataToWindow(), updateGuardLists(), and updateSegmentList().
|
private |
Static boxsizer for the bus properties.
Definition at line 121 of file BusDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Function unit port guard list control.
Definition at line 118 of file BusDialog.hh.
Referenced by onFUGuardRightClick(), onFUGuardSelection(), selectedFUGuard(), and updateGuardLists().
|
private |
Radio box for immediate extension.
Definition at line 114 of file BusDialog.hh.
Referenced by onOK(), setTexts(), and TransferDataToWindow().
|
private |
Short immediate width.
Definition at line 103 of file BusDialog.hh.
Referenced by onOK(), and TransferDataToWindow().
|
private |
Name of the bus.
Definition at line 99 of file BusDialog.hh.
Referenced by onBusName(), onOK(), and TransferDataToWindow().
|
private |
Name for a new segment.
Definition at line 105 of file BusDialog.hh.
Referenced by onAddSegment(), and onSegmentName().
|
private |
list of port guards
Definition at line 135 of file BusDialog.hh.
Referenced by selectedFUGuard(), and updateGuardLists().
|
private |
Static boxsizer for the port guard properties.
Definition at line 127 of file BusDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
list of register guards
Definition at line 133 of file BusDialog.hh.
Referenced by onDeleteRFGuard(), selectedRFGuard(), and updateGuardLists().
|
private |
Static boxsizer for the register guard properties.
Definition at line 125 of file BusDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Register file guard list control.
Definition at line 116 of file BusDialog.hh.
Referenced by onDeleteRFGuard(), onRFGuardRightClick(), onRFGuardSelection(), selectedRFGuard(), and updateGuardLists().
|
private |
List widget for the segment list.
Definition at line 108 of file BusDialog.hh.
Referenced by onSegmentDown(), onSegmentRightClick(), onSegmentSelection(), onSegmentUp(), selectedSegment(), and updateSegmentList().
|
private |
Static boxsizer for the segment properties.
Definition at line 129 of file BusDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Static boxsizer for the short immediate properties.
Definition at line 123 of file BusDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Width of the bus.
Definition at line 101 of file BusDialog.hh.
Referenced by onOK(), and TransferDataToWindow().