33 #include <wx/valgen.h>
34 #include <boost/format.hpp>
101 const std::
string& pathName,
102 const std::
string& modName) :
103 wxDialog(parent, -1, _T(""),
105 wxDefaultSize, wxRESIZE_BORDER, DIALOG_NAME),
106 operation_(operation), pathName_(pathName), modName_(modName), clock_(0) {
108 createContents(
this,
true,
true);
110 for (
int i = 0; i < operation_->numberOfInputs(); i++) {
112 inputs_[i]->setString(
"0");
115 for (
int i = 0; i < operation_->numberOfOutputs(); i++) {
117 outputs_[i]->setString(
"0");
120 inputList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_INPUT_LIST));
121 outputList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_OUTPUT_LIST));
123 format_ =
dynamic_cast<wxChoice*
>(
FindWindow(ID_FORMAT));
138 format_->SetSelection(0);
144 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
155 assert(behaviorProxy_ != NULL);
156 behaviorProxy_->setAlwaysReloadBehavior(
false);
191 return wxWindow::TransferDataToWindow();
275 for (
unsigned int i = 0; i <
inputs_.size(); i++) {
283 for (
unsigned int i = 0; i <
outputs_.size(); i++) {
300 if (
inputList_->GetSelectedItemCount() != 1) {
312 TransferDataFromWindow();
314 if (inputString !=
"") {
341 for (
size_t i = 0; i <
inputs_.size(); i++) {
345 for (
size_t i = 0; i <
outputs_.size(); i++) {
355 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
366 vector<SimValue*> outputs;
367 vector<DataObject> inputs;
368 for (
size_t i = 0; i <
inputs_.size(); i++) {
377 *
operation_, inputs, outputs, context, result)) {
390 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
405 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
415 vector<SimValue*> outputs;
420 for (
size_t i = 0; i <
inputs_.size(); i++) {
422 string value =
inputs_[i]->stringValue();
424 outputs.push_back(sim);
427 for (
size_t i = 0; i <
outputs_.size(); i++) {
429 string value =
outputs_[i]->stringValue();
431 outputs.push_back(sim);
438 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
455 GetSize(&width, &height);
472 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
486 OSEdInformer* informer = wxGetApp().mainFrame()->informer();
503 for (
size_t i = 0; i <
inputs_.size(); i++) {
519 for (
size_t i =
inputs_.size(); i < upperBound; i++) {
547 if (floatString.find(
".") == string::npos) {
587 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
589 wxBoxSizer *item1 =
new wxBoxSizer( wxHORIZONTAL );
591 wxStaticBox *item3 =
new wxStaticBox( parent, -1, wxT(
"Input values") );
592 wxStaticBoxSizer *item2 =
new wxStaticBoxSizer( item3, wxVERTICAL );
595 wxListCtrl *item4 =
new wxListCtrl( parent,
ID_INPUT_LIST, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER );
596 item2->Add( item4, 1, wxGROW|wxALL, 5 );
598 wxBoxSizer *item5 =
new wxBoxSizer( wxHORIZONTAL );
601 parent,
ID_VALUE, wxDefaultPosition, wxSize(200, -1),
606 item5->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
608 wxButton *item7 =
new wxButton( parent,
ID_BUTTON_UPDATE, wxT(
"Update"), wxDefaultPosition, wxDefaultSize, 0 );
609 item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
611 item2->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
613 item1->Add( item2, 1, wxGROW|wxALL, 5 );
615 wxStaticBox *item9 =
new wxStaticBox( parent, -1, wxT(
"Output values") );
616 wxStaticBoxSizer *item8 =
new wxStaticBoxSizer( item9, wxVERTICAL );
619 wxListCtrl *item10 =
new wxListCtrl( parent,
ID_OUTPUT_LIST, wxDefaultPosition, wxSize(200,120), wxLC_REPORT|wxSUNKEN_BORDER );
620 item8->Add( item10, 1, wxGROW|wxALL, 5 );
622 item1->Add( item8, 1, wxGROW|wxALL, 5 );
624 wxGridSizer *item11 =
new wxGridSizer( 2, 0, 0 );
638 wxStaticText *item16 =
new wxStaticText( parent,
ID_TEXT_CLOCK, wxT(
"Clock count:"), wxDefaultPosition, wxDefaultSize, 0 );
639 item11->Add( item16, 0, wxALIGN_CENTER|wxALL, 5 );
641 wxStaticText *item17 =
new wxStaticText( parent,
ID_TEXT_CLOCK_VALUE, wxT(
"0"), wxDefaultPosition, wxDefaultSize, 0 );
642 item11->Add( item17, 0, wxALIGN_CENTER|wxALL, 5 );
644 item1->Add( item11, 0, wxGROW|wxALL, 5 );
646 item0->Add( item1, 1, wxGROW|wxALL, 5 );
648 wxBoxSizer *item18 =
new wxBoxSizer( wxHORIZONTAL );
650 wxStaticText *item19 =
new wxStaticText( parent,
ID_FORMAT_TEXT, wxT(
"Format:"), wxDefaultPosition, wxDefaultSize, 0 );
651 item18->Add( item19, 0, wxALIGN_CENTER|wxALL, 5 );
653 wxString *strs20 = (wxString*) NULL;
654 wxChoice *item20 =
new wxChoice( parent,
ID_FORMAT, wxDefaultPosition, wxSize(130,-1), 0, strs20, 0 );
655 item18->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
657 item0->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
659 wxBoxSizer *item21 =
new wxBoxSizer( wxHORIZONTAL );
661 wxButton *item22 =
new wxButton( parent,
ID_BUTTON_RESET, wxT(
"Reset"), wxDefaultPosition, wxDefaultSize, 0 );
662 item21->Add( item22, 0, wxALIGN_CENTER|wxALL, 5 );
664 wxButton *item23 =
new wxButton( parent,
ID_BUTTON_TRIGGER, wxT(
"Trigger"), wxDefaultPosition, wxDefaultSize, 0 );
665 item21->Add( item23, 0, wxALIGN_CENTER|wxALL, 5 );
667 wxButton *item25 =
new wxButton( parent,
ID_BUTTON_ADVANCE_LOCK, wxT(
"Advance Clock"), wxDefaultPosition, wxDefaultSize, 0 );
668 item21->Add( item25, 0, wxALIGN_CENTER|wxALL, 5 );
671 item21->Add( item26, 0, wxALIGN_CENTER|wxALL, 5 );
673 wxButton *item27 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
674 item21->Add( item27, 0, wxALIGN_CENTER|wxALL, 5 );
676 item0->Add( item21, 0, wxALIGN_CENTER|wxALL, 5 );
680 parent->SetSizer( item0 );
682 item0->SetSizeHints( parent );
698 static const char *xpm_data[] = {
720 wxBitmap bitmap( xpm_data );
726 static const char *xpm_data[] = {
748 wxBitmap bitmap( xpm_data );
754 static const char *xpm_data[] = {
776 wxBitmap bitmap( xpm_data );