OpenASIP
2.0
|
#include <AddressSpaceDialog.hh>
Public Member Functions | |
AddressSpaceDialog (wxWindow *parent, TTAMachine::Machine *machine, TTAMachine::AddressSpace *addressSpace) | |
~AddressSpaceDialog () | |
Private Types | |
enum | { ID_NAME = 10000, ID_WIDTH, ID_MIN_ADDRESS, ID_MAX_ADDRESS, ID_BIT_WIDTH, ID_ID_LIST, ID_SPIN_ID, ID_ADD_ID, ID_DELETE_ID, ID_RADIO_MIN_DEC, ID_RADIO_MIN_HEX, ID_RADIO_MAX_DEC, ID_RADIO_MAX_HEX, ID_TEXT, ID_LINE, ID_HELP } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
void | onName (wxCommandEvent &event) |
void | onOK (wxCommandEvent &event) |
void | onHelp (wxCommandEvent &event) |
void | onMinAddress (wxCommandEvent &event) |
void | onMinHex (wxCommandEvent &event) |
void | onMaxAddress (wxCommandEvent &event) |
void | onMaxHex (wxCommandEvent &event) |
void | onMinToDec (wxCommandEvent &event) |
void | onMinToHex (wxCommandEvent &event) |
void | onMaxToDec (wxCommandEvent &event) |
void | onMaxToHex (wxCommandEvent &event) |
void | onBitWidth (wxSpinEvent &event) |
void | onBitWidthText (wxCommandEvent &event) |
void | onAddId (wxCommandEvent &event) |
void | onDeleteId (wxCommandEvent &event) |
void | onSpinId (wxSpinEvent &event) |
void | onIdListSelection (wxListEvent &event) |
void | updateIdLists () |
bool | isFreeId (unsigned id) const |
void | setTexts () |
Private Attributes | |
TTAMachine::Machine * | machine_ |
Machine containing all the address spaces. More... | |
TTAMachine::AddressSpace * | as_ |
Address space to modify with the dialog. More... | |
wxString | name_ |
Name of the address space. More... | |
int | width_ |
The bit width of the minimum addressable word. More... | |
wxString | minAddress_ |
The lowest address in the address space. More... | |
wxString | maxAddress_ |
The highest address in the address space. More... | |
NumberControl * | minControl_ |
Widget for the lowest address hex value. More... | |
NumberControl * | maxControl_ |
Widget for the highest address hex value. More... | |
wxStaticBoxSizer * | nameSizer_ |
Boxsizer containing the name widget. More... | |
wxStaticBoxSizer * | minAddressSizer_ |
Boxsizer containing the min-address widget. More... | |
wxStaticBoxSizer * | maxAddressSizer_ |
Boxsizer containing the max-address widget. More... | |
wxStaticBoxSizer * | widthSizer_ |
Boxsizer containing the width widget. More... | |
wxSpinCtrl * | bitWidthSpinCtrl_ |
SpinCtrl containing the bit width of the max-address. More... | |
wxStaticBoxSizer * | idSizer_ |
Boxsizer containing the address space id widget. More... | |
wxListCtrl * | idListCtrl_ |
List control containing the address space ids. More... | |
wxSpinCtrl * | idSpinCtrl_ |
SpinCtrl containing an address space id. More... | |
std::set< unsigned > | idNumbers_ |
Container for unique id numbers. More... | |
Dialog for editing address space properties.
Definition at line 50 of file AddressSpaceDialog.hh.
|
private |
Definition at line 123 of file AddressSpaceDialog.hh.
AddressSpaceDialog::AddressSpaceDialog | ( | wxWindow * | parent, |
TTAMachine::Machine * | machine, | ||
TTAMachine::AddressSpace * | addressSpace | ||
) |
The Constructor.
parent | Parent window of the dialog. |
addressSpace | The address space to be modified with the dialog. |
Definition at line 82 of file AddressSpaceDialog.cc.
AddressSpaceDialog::~AddressSpaceDialog | ( | ) |
|
private |
Creates the dialog window contents.
This method was generated with wxDesigner, thus the ugly code and too long lines.
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 494 of file AddressSpaceDialog.cc.
References assert, NumberControl::MODE_HEXADECIMAL, and NumberControl::MODE_UNSIGNED.
|
private |
Checks if given id is already reserved by some address space
id | Number that should be checked against reserved ids |
Definition at line 450 of file AddressSpaceDialog.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), and TTAMachine::AddressSpace::numericalIds().
|
private |
|
private |
Reads the range from bitWidth spin-button and updates min- and max ranges.
Definition at line 351 of file AddressSpaceDialog.cc.
References dummy.
|
private |
Reads the range from bitWidth spin-button and updates min- and max ranges.
Definition at line 342 of file AddressSpaceDialog.cc.
|
private |
Deletes selected id number(s) from the address space.
Definition at line 387 of file AddressSpaceDialog.cc.
|
private |
|
private |
Sets state of delete button depending on whether items are selected
Definition at line 436 of file AddressSpaceDialog.cc.
|
private |
Sets the range of the MaxAddress spin-button.
Definition at line 330 of file AddressSpaceDialog.cc.
References MathTools::requiredBits().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Checks whether the name field is empty, and disables OK button of the dialog if it is.
Definition at line 302 of file AddressSpaceDialog.cc.
References assert.
|
private |
Validates input in the controls, and updates the AddressSpace.
Definition at line 226 of file AddressSpaceDialog.cc.
References ProDeTextGenerator::COMP_ADDRESS_SPACE, ProDeTextGenerator::COMP_AN_ADDRESS_SPACE, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_ID_EXISTS, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Sets state of add button depending on whether the number in spin input already exists in some address space
Definition at line 418 of file AddressSpaceDialog.cc.
|
private |
Sets texts for widgets.
Definition at line 134 of file AddressSpaceDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_ADDRESS_SPACE_DIALOG_TITLE, ProDeTextGenerator::TXT_ADDRESS_SPACE_MAX_ADDRESS, ProDeTextGenerator::TXT_ADDRESS_SPACE_MIN_ADDRESS, GUITextGenerator::TXT_BUTTON_ADD_DIALOG, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_LABEL_MAU, and ProDeTextGenerator::TXT_LABEL_NAME.
|
privatevirtual |
Transfers data from the AddressSpace object to the dialog widgets.
Definition at line 180 of file AddressSpaceDialog.cc.
References dummy, and WxConversion::toWxString().
|
private |
Updates the id lists.
Definition at line 211 of file AddressSpaceDialog.cc.
References assert, and WxConversion::toWxString().
|
private |
Address space to modify with the dialog.
Definition at line 87 of file AddressSpaceDialog.hh.
|
private |
SpinCtrl containing the bit width of the max-address.
Definition at line 110 of file AddressSpaceDialog.hh.
|
private |
List control containing the address space ids.
Definition at line 115 of file AddressSpaceDialog.hh.
|
private |
Container for unique id numbers.
Definition at line 120 of file AddressSpaceDialog.hh.
|
private |
Boxsizer containing the address space id widget.
Definition at line 113 of file AddressSpaceDialog.hh.
|
private |
SpinCtrl containing an address space id.
Definition at line 117 of file AddressSpaceDialog.hh.
|
private |
Machine containing all the address spaces.
Definition at line 85 of file AddressSpaceDialog.hh.
|
private |
The highest address in the address space.
Definition at line 95 of file AddressSpaceDialog.hh.
|
private |
Boxsizer containing the max-address widget.
Definition at line 106 of file AddressSpaceDialog.hh.
|
private |
Widget for the highest address hex value.
Definition at line 99 of file AddressSpaceDialog.hh.
|
private |
The lowest address in the address space.
Definition at line 93 of file AddressSpaceDialog.hh.
|
private |
Boxsizer containing the min-address widget.
Definition at line 104 of file AddressSpaceDialog.hh.
|
private |
Widget for the lowest address hex value.
Definition at line 97 of file AddressSpaceDialog.hh.
|
private |
Name of the address space.
Definition at line 89 of file AddressSpaceDialog.hh.
|
private |
Boxsizer containing the name widget.
Definition at line 102 of file AddressSpaceDialog.hh.
|
private |
The bit width of the minimum addressable word.
Definition at line 91 of file AddressSpaceDialog.hh.
|
private |
Boxsizer containing the width widget.
Definition at line 108 of file AddressSpaceDialog.hh.