OpenASIP  2.0
OSEdTreeView.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file OSEdTreeView.cc
26  *
27  * Definition of OSEdTreeView class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #include <boost/format.hpp>
34 
35 #include "OSEdTreeView.hh"
36 #include "WxConversion.hh"
37 #include "OperationContainer.hh"
38 #include "MapTools.hh"
39 #include "OSEdConstants.hh"
40 #include "InformationDialog.hh"
41 #include "OSEd.hh"
42 #include "GUICommand.hh"
43 #include "OSEdTextGenerator.hh"
44 #include "Environment.hh"
45 #include "DropDownMenu.hh"
46 #include "OperationModule.hh"
47 #include "CommandRegistry.hh"
48 #include "Operation.hh"
49 #include "OSEdInfoView.hh"
50 #include "OperationIndex.hh"
51 #include "TCEString.hh"
52 #include "OperationBehavior.hh"
53 #include "ObjectState.hh"
54 
55 using std::string;
56 using std::vector;
57 using boost::format;
58 
59 BEGIN_EVENT_TABLE(OSEdTreeView, wxTreeCtrl)
62  EVT_RIGHT_DOWN(OSEdTreeView::onDropDownMenu)
64 
65 /**
66  * Constructor.
67  *
68  * @param parent. Parent window.
69  * @param infoView Info view controlled by tree view.
70  */
71 OSEdTreeView::OSEdTreeView(wxWindow* parent, OSEdInfoView* infoView) :
72  wxTreeCtrl(parent, OSEdConstants::CMD_TREE_ITEM), infoView_(infoView) {
73 }
74 
75 /**
76  * Destructor.
77  */
79 }
80 
81 /**
82  * Constructs the tree structure.
83  *
84  * If errors occurs while constructing the tree structure, the error
85  * messages are collected and returned.
86  *
87  * @return Results of erronous modules.
88  */
89 vector<string>
91 
92  vector<string> results;
94  OperationSerializer& serializer =
96 
97  wxTreeItemId root = AddRoot(_T("root"));
98  vector<string> paths = Environment::osalPaths();
99 
100  for (size_t i = 0; i < paths.size(); i++) {
101  // add path
102  string pathName = paths[i];
103  wxTreeItemId path =
104  AppendItem(root, WxConversion::toWxString(pathName));
105 
106  if (FileSystem::fileExists(pathName)) {
107  SetItemBold(path);
108  }
109 
110  paths_[pathName] = path;
111  int modules = 0;
112  try {
113  modules = opIndex.moduleCount(pathName);
114  } catch (const PathNotFound& p) {
115  // no modules in this path
116  continue;
117  }
118  for (int j = 0; j < modules; j++) {
119  // add module
120  OperationModule& mod = opIndex.module(j, pathName);
121  wxTreeItemId module =
122  AppendItem(path, WxConversion::toWxString(mod.name()));
123 
124  modules_.insert(std::pair<std::string, wxTreeItemId>(mod.name(), module));
125 
126  int operations = 0;
127 
128  // test that operation properties can be loaded
129  try {
130  operations = opIndex.operationCount(mod);
131  serializer.setSourceFile(mod.propertiesModule());
132  ObjectState* tree = serializer.readState();
133  if (tree->childCount() > 0) {
135  temp.loadState(tree->child(0));
136  }
137  delete tree;
138  } catch (const Exception& e) {
139  results.push_back(mod.propertiesModule() + ":\n");
140  results.push_back(e.errorMessage() + "\n");
141  results.push_back("\n");
142  }
143 
144  for (int k = 0; k < operations; k++) {
145  // add operation
146  string opName = opIndex.operationName(k, mod);
147  wxTreeItemId oper =
148  AppendItem(module, WxConversion::toWxString(opName));
149 
150  //operations_[opIndex.operationName(k, mod)] = oper;
151  operations_.insert(std::pair<std::string, wxTreeItemId>(opIndex.operationName(k, mod), oper));
152  }
153  SortChildren(module);
154  }
155  SortChildren(path);
156  }
157  infoView_->pathView();
158  return results;
159 }
160 
161 /**
162  * Handles the event when item is selected on tree.
163  *
164  * If selected item is a path, path view is shown. If selected
165  * item is a module, module view is shown. If selected item is an operation,
166  * operation view is shown.
167  *
168  * @param event The event to be handled.
169  */
170 void
171 OSEdTreeView::onItemSelected(wxTreeEvent& event) {
172 
173  OSEdMainFrame* mainFrame = wxGetApp().mainFrame();
175  wxTreeItemId id = event.GetItem();
176 
177  if (isPath(id)) {
178  string path = MapTools::keyForValue<string>(paths_, id);
180  mainFrame->statusBar()->
181  SetStatusText(WxConversion::toWxString(fmt.str()));
182  infoView_->moduleView(path);
183  } else if (isModule(id)) {
184  string moduleName = MapTools::keyForValue<string>(modules_, id);
186  mainFrame->statusBar()->
187  SetStatusText(WxConversion::toWxString(fmt.str()));
188  string pathName = pathOfModule(id);
189  infoView_->operationView(pathName, moduleName);
190  } else if (isOperation(id)) {
191 
192  string opName = MapTools::keyForValue<string>(operations_, id);
193  format fmt =
195 
196  mainFrame->statusBar()->
197  SetStatusText(WxConversion::toWxString(fmt.str()));
198 
199  string modName = moduleOfOperation(id);
200  string pathName = pathOfModule(GetItemParent(id));
201  infoView_->operationPropertyView(opName, modName, pathName);
202  } else {
203  mainFrame->statusBar()->SetStatusText(_T(""));
204  // root is selected
205  infoView_->pathView();
206  }
207  wxGetApp().mainFrame()->updateMenuBar();
208 }
209 
210 /**
211  * Handles the event when item is selected on tree by double-clicking
212  * with mouse.
213  *
214  * Double clicking an operation opens an operation property dialog, where
215  * operation properties can be modified.
216  *
217  * @param event Event to be handled.
218  */
219 void
220 OSEdTreeView::onItemClicked(wxTreeEvent& event) {
221  wxTreeItemId id = event.GetItem();
222  if (isOperation(id)) {
223  // operation is clicked, lets open the property dialog
224  OSEdMainFrame* mainFrame = wxGetApp().mainFrame();
225  CommandRegistry* registry = mainFrame->registry();
226  GUICommand* command =
228  command->setParentWindow(mainFrame);
229  command->Do();
230  delete command;
231  }
232 }
233 
234 /**
235  * Handles the event when right mouse button is clicked.
236  *
237  * A different drop down menu is showed, depending on where mouse button is
238  * clicked.
239  *
240  * @param event Event to be handled.
241  */
242 void
243 OSEdTreeView::onDropDownMenu(wxMouseEvent& event) {
244 
245  // coordinates of mouse click
247  OSEdMainFrame* mainFrame = wxGetApp().mainFrame();
248  wxPoint pos = event.GetPosition();
249  int flags = wxTREE_HITTEST_ONITEMLABEL;
250  wxTreeItemId id = HitTest(pos, flags);
251 
252  // mouse is not clicked on a tree item
253  if (!id.IsOk()) {
254  return;
255  }
256 
257  SelectItem(id);
258  DropDownMenu* menu = NULL;
259  if (isPath(id)) {
260 
262  mainFrame->statusBar()->
263  SetStatusText(WxConversion::toWxString(fmt.str()));
265  PopupMenu(menu, pos);
266  } else if (isModule(id)) {
267 
269  mainFrame->statusBar()->
270  SetStatusText(WxConversion::toWxString(fmt.str()));
272  PopupMenu(menu, pos);
273  } else if (isOperation(id)) {
274 
275  format fmt =
277  mainFrame->statusBar()->
278  SetStatusText(WxConversion::toWxString(fmt.str()));
280  PopupMenu(menu, pos);
281  } else {
282  mainFrame->statusBar()->SetStatusText(_T("Cannot open"));
283  }
284  delete menu;
285 }
286 
287 /**
288  * Returns true if tree node with given id is a path.
289  *
290  * @param id Id of the tree node.
291  * @return True if id is a path.
292  */
293 bool
294 OSEdTreeView::isPath(wxTreeItemId id) const {
295  return MapTools::containsValue(paths_, id);
296 }
297 
298 /**
299  * Returns true if tree node with given id is a module.
300  *
301  * @param id Id of the tree node.
302  * @return True if id is a module.
303  */
304 bool
305 OSEdTreeView::isModule(wxTreeItemId id) const {
306  return MapTools::containsValue(modules_, id);
307 }
308 
309 /**
310  * Return true if tree node with given id is an operation.
311  *
312  * @param id Id of the tree node.
313  * @return True if id is an operation.
314  */
315 bool
316 OSEdTreeView::isOperation(wxTreeItemId id) const {
318 }
319 
320 /**
321  * Returns the selected operation.
322  *
323  * If no operation is selected, NULL is returned.
324  *
325  * @return The selected operation.
326  */
327 Operation*
329 
330  Iter it = operations_.begin();
331  string opName = "";
332  string modName = "";
333  string pathName = "";
334 
335  // get the name of the selected operation, its module and its path.
336  while(it != operations_.end()) {
337  if (IsSelected((*it).second)) {
338  opName = (*it).first;
339  wxTreeItemId opId = (*it).second;
340 
341  wxTreeItemId moduleId = GetItemParent(opId);
342  wxTreeItemId pathId = GetItemParent(moduleId);
343 
344  modName = WxConversion::toString(GetItemText(moduleId));
345  pathName = WxConversion::toString(GetItemText(pathId));
346 
347  break;
348  }
349  it++;
350  }
351 
352  // if no operation was selected in a tree view, let's look from
353  // the info view
354  if (opName == "") {
355  opName = infoView_->selectedOperation();
356  if (opName == "") {
357  return NULL;
358  } else {
359 
360  modName = selectedModule();
361  assert(modName != "");
362 
363  pathName = pathOfModule(selectedModuleId());
364  assert(pathName != "");
365  }
366  }
367 
368  Operation* op = OperationContainer::operation(pathName, modName, opName);
369  return op;
370 }
371 
372 /**
373  * Returns the id of selected operation.
374  *
375  * @throw NotAvailable If no operation is selected.
376  * @return The id of selected operation.
377  */
378 wxTreeItemId
380  Iter it = operations_.begin();
381  // first look from the tree view
382  while (it != operations_.end()) {
383  if (IsSelected((*it).second)) {
384  return (*it).second;
385  }
386  it++;
387  }
388 
389  string name = infoView_->selectedOperation();
390  it = operations_.begin();
391  while (it != operations_.end()) {
392  if ((*it).first == name) {
393  return (*it).second;
394  }
395  it++;
396  }
397  throw NotAvailable(__FILE__, __LINE__, __func__);
398 }
399 
400 /**
401  * Returns the module of an operation with a given id.
402  *
403  * @param id The id of operation.
404  * @return The name of the module.
405  */
406 string
408  wxTreeItemId modId = GetItemParent(id);
409  string moduleName = MapTools::keyForValue<string>(modules_, modId);
410  return moduleName;
411 }
412 
413 /**
414  * Returns the id of the module of the operation with a given id.
415  *
416  * @param id The id of the operation.
417  * @return The id of the module.
418  */
419 wxTreeItemId
421  return GetItemParent(id);
422 }
423 
424 /**
425  * Returns the path of the module with given id.
426  *
427  * @param id The id of the module.
428  * @return The name of the path.
429  */
430 string
431 OSEdTreeView::pathOfModule(wxTreeItemId id) {
432  wxTreeItemId pathId = GetItemParent(id);
433  std::string path = MapTools::keyForValue<string>(paths_, pathId);
434  return path;
435 }
436 
437 /**
438  * Returns the id of the path in which module with given id belongs to.
439  *
440  * @param id Id of the module.
441  * @return The id of the path.
442  */
443 wxTreeItemId
445  return GetItemParent(id);
446 }
447 
448 /**
449  * Returns the selected path.
450  *
451  * If not path is selected, an empty string is returned.
452  *
453  * @return The selected path, or an empty string.
454  */
455 string
457 
458  Iter it = paths_.begin();
459 
460  // first look from the tree view
461  while (it != paths_.end()) {
462  if (IsSelected((*it).second)) {
463  return (*it).first;
464  }
465  it++;
466  }
467 
468  // then info view
469  string path = infoView_->selectedPath();
470  return path;
471 }
472 
473 /**
474  * Returns the id of selected path.
475  *
476  * @throw NotAvailable If path is not selected.
477  * @return Id of selected path.
478  */
479 wxTreeItemId
481  Iter it = paths_.begin();
482 
483  // first look from the tree view
484  while (it != paths_.end()) {
485  if (IsSelected((*it).second)) {
486  return (*it).second;
487  }
488  it++;
489  }
490 
491  // then look from the info view
492  string path = infoView_->selectedPath();
493  if (path != "") {
494  try {
495  wxTreeItemId id = paths_[path];
496  return id;
497  } catch (const KeyNotFound& k) {
498  assert(false);
499  }
500  }
501 
502  throw NotAvailable(__FILE__, __LINE__, __func__);
503 }
504 
505 /**
506  * Returns the selected module.
507  *
508  * If no module is selected, an empty string is returned.
509  *
510  * @return The selected module or an empty string.
511  */
512 string
514 
515  IterM it = modules_.begin();
516 
517  // first look from the tree view
518  while (it != modules_.end()) {
519  if (IsSelected((*it).second)) {
520  return (*it).first;
521  }
522  it++;
523  }
524 
525  // then look from the info view
526  string module = infoView_->selectedModule();
527  return module;
528 }
529 
530 /**
531  * Returns the id of selected module.
532  *
533  * @throw NotAvailable If no module is selected.
534  * @return The id of selected module.
535  */
536 wxTreeItemId
538  if (MapTools::containsValue(modules_, GetSelection())) {
539  return GetSelection();
540  }
541 
542  IterM it = modules_.begin();
543  // first search the selected module from tree view
544  while (it != modules_.end()) {
545  if (IsSelected((*it).second)) {
546  return (*it).second;
547  }
548  it++;
549  }
550 
551  // no module in tree view selected, look from the info view
552  string module = infoView_->selectedModule();
553  if (module != "") {
554  try {
555  it = modules_.find(module);
556  wxTreeItemId id = it->second;
557  return id;
558  } catch (const KeyNotFound& k) {
559  assert(false);
560  }
561  }
562 
563  throw NotAvailable(__FILE__, __LINE__, __func__);
564 }
565 
566 /**
567  * Adds an item to the tree.
568  *
569  * @param parent Parent id.
570  * @param item The item to be added.
571  */
572 void
573 OSEdTreeView::addItem(wxTreeItemId parent, std::string item) {
574  wxTreeItemId id = AppendItem(parent, WxConversion::toWxString(item));
575  if (isPath(parent)) {
576  modules_.insert(std::pair<std::string, wxTreeItemId>(item, id));
577  } else if (isModule(parent)) {
578  operations_.insert(std::pair<std::string, wxTreeItemId>(item, id));
579  //operations_[item] = id;
580  } else {
581  assert(false);
582  }
583 }
584 
585 /**
586  * Changes the text of the item.
587  *
588  * @param id Id of the item to be changed.
589  * @param text New label.
590  */
591 void
592 OSEdTreeView::changeText(wxTreeItemId id, const std::string& text) {
593 
594  if (isOperation(id)) {
595  string key = MapTools::keyForValue<string>(operations_, id);
596  Iter it = operations_.find(key);
597  operations_.erase(it);
598  operations_.insert(std::pair<std::string, wxTreeItemId>(text, id));
599  //operations_[text] = id;
600  } else if (isModule(id)) {
601  string key = MapTools::keyForValue<string>(modules_, id);
602  IterM it = modules_.find(key);
603  modules_.erase(it);
604  modules_.insert(std::pair<std::string, wxTreeItemId>(text, id));
605  } else if (isPath(id)) {
606  string key = MapTools::keyForValue<string>(paths_, id);
607  Iter it = paths_.find(key);
608  paths_.erase(it);
609  paths_[text] = id;
610  }
611  SetItemText(id, WxConversion::toWxString(text));
612 }
613 
614 /**
615  * Removes an item from the tree view.
616  *
617  * Collapses the parent and set the parent selected.
618  *
619  * @param id The id of the item to be removed.
620  */
621 void
622 OSEdTreeView::removeItem(wxTreeItemId id) {
623 
624  wxTreeItemId parent = GetItemParent(id);
625  Collapse(parent);
626  SelectItem(parent);
627  DeleteChildren(id);
628  Delete(id);
629 
630  // remove the item from the inner data structure also
631  if (isOperation(id)) {
632  string key = MapTools::keyForValue<string>(operations_, id);
633  Iter it = operations_.find(key);
634  operations_.erase(it);
635  } else if (isModule(id)) {
636  string key = MapTools::keyForValue<string>(modules_, id);
637  IterM it = modules_.find(key);
638  modules_.erase(it);
639  Iter ot = operations_.begin();
640  while (ot != operations_.end()) {
641  if (GetItemParent((*ot).second) == id) {
642  Iter next = ot;
643  next++;
644  operations_.erase(ot);
645  ot = next;
646  } else {
647  ot++;
648  }
649  }
650  } else if (isPath(id)) {
651  // paths can not be erased
652  assert(false);
653  }
654 }
655 
656 /**
657  * Returns pointer to info view.
658  *
659  * @return Pointer to info view.
660  */
663  return infoView_;
664 }
665 
666 /**
667  * Updates the treeview.
668  */
669 void
671 
672  Iter it = paths_.begin();
673  while (it != paths_.end()) {
674  if (IsSelected((*it).second)) {
675  infoView_->moduleView((*it).first);
676  return;
677  }
678  it++;
679  }
680 
681  IterM itm = modules_.begin();
682  while (itm != modules_.end()) {
683  if (IsSelected((*itm).second)) {
684  wxTreeItemId pathId = GetItemParent((*itm).second);
685  string pathName = WxConversion::toString(GetItemText(pathId));
686  infoView_->operationView(pathName, (*itm).first);
687  return;
688  }
689  itm++;
690  }
691 
692  it = operations_.begin();
693  while (it != operations_.end()) {
694  if (IsSelected((*it).second)) {
695  wxTreeItemId modId = GetItemParent((*it).second);
696  wxTreeItemId pathId = GetItemParent(modId);
697 
698  string modName = WxConversion::toString(GetItemText(modId));
699  string pathName = WxConversion::toString(GetItemText(pathId));
700 
701  infoView_->operationPropertyView((*it).first, modName, pathName);
702  return;
703  }
704  it++;
705  }
706 
707  infoView_->pathView();
708 }
709 
710 /**
711  * Returns true if a path is selected.
712  *
713  * @return True, if a path is selected.
714  */
715 bool
717  if (MapTools::containsValue(paths_, GetSelection()) ||
718  infoView_->selectedPath() != "") {
719 
720  return true;
721  }
722  return false;
723 }
724 
725 /**
726  * Returns true if a module is selected.
727  *
728  * @return True, if a module is selected.
729  */
730 bool
732  if (MapTools::containsValue(modules_, GetSelection()) ||
733  infoView_->selectedModule() != "") {
734  return true;
735  }
736  return false;
737 }
738 
739 /**
740  * Returns true if an operation is selected.
741  *
742  * @return True, if an operation is selected.
743  */
744 bool
746  if (MapTools::containsValue(operations_, GetSelection()) ||
747  infoView_->selectedOperation() != "") {
748 
749  return true;
750  }
751  return false;
752 }
753 
DropDownMenu::MENU_OPERATION
@ MENU_OPERATION
Operation menu.
Definition: DropDownMenu.hh:53
DropDownMenu::MENU_MODULE
@ MENU_MODULE
Module menu.
Definition: DropDownMenu.hh:52
GUICommand::setParentWindow
void setParentWindow(wxWindow *view)
Definition: GUICommand.cc:64
OSEdInfoView::operationView
void operationView(const std::string &path, const std::string &mod)
Definition: OSEdInfoView.cc:161
OSEdInfoView::selectedPath
std::string selectedPath()
Definition: OSEdInfoView.cc:493
OSEdTreeView::selectedModule
std::string selectedModule()
Definition: OSEdTreeView.cc:513
OSEdTreeView::selectedModuleId
wxTreeItemId selectedModuleId()
Definition: OSEdTreeView.cc:537
WxConversion::toWxString
static wxString toWxString(const std::string &source)
OSEdTreeView::removeItem
void removeItem(wxTreeItemId id)
Definition: OSEdTreeView.cc:622
OSEdTreeView::pathOfModule
std::string pathOfModule(wxTreeItemId id)
Definition: OSEdTreeView.cc:431
OSEdTreeView::isPath
bool isPath(wxTreeItemId id) const
Definition: OSEdTreeView.cc:294
CommandRegistry.hh
OperationContainer::operationSerializer
static OperationSerializer & operationSerializer()
Definition: OperationContainer.cc:111
OSEdTreeView::moduleIdOfOperation
wxTreeItemId moduleIdOfOperation(wxTreeItemId id)
Definition: OSEdTreeView.cc:420
DropDownMenu::MENU_PATH
@ MENU_PATH
Path menu.
Definition: DropDownMenu.hh:51
OSEdTreeView::addItem
void addItem(wxTreeItemId parent, std::string item)
Definition: OSEdTreeView.cc:573
MapTools.hh
OSEdTreeView::selectedPathId
wxTreeItemId selectedPathId()
Definition: OSEdTreeView.cc:480
OSEdInfoView::selectedModule
std::string selectedModule()
Definition: OSEdInfoView.cc:510
OSEdTextGenerator::TXT_STATUS_MODULE_SELECTED
@ TXT_STATUS_MODULE_SELECTED
Status bar text when module is selected.
Definition: OSEdTextGenerator.hh:215
ObjectState
Definition: ObjectState.hh:59
OSEd.hh
OSEdConstants::CMD_PROPERTIES
@ CMD_PROPERTIES
Operation properties command id.
Definition: OSEdConstants.hh:94
OSEdTreeView::infoView
OSEdInfoView * infoView() const
Definition: OSEdTreeView.cc:662
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
OSEdInfoView.hh
GUICommand::Do
virtual bool Do()=0
NotAvailable
Definition: Exception.hh:728
OSEdConstants.hh
CommandRegistry::createCommand
GUICommand * createCommand(const int id)
Definition: CommandRegistry.cc:69
OSEdInfoView::moduleView
void moduleView(const std::string &name)
Definition: OSEdInfoView.cc:129
OSEdInfoView::pathView
void pathView()
Definition: OSEdInfoView.cc:98
OSEdInfoView::selectedOperation
std::string selectedOperation()
Definition: OSEdInfoView.cc:526
PathNotFound
Definition: Exception.hh:242
GUICommand.hh
TCEString.hh
assert
#define assert(condition)
Definition: Application.hh:86
OperationModule::propertiesModule
virtual std::string propertiesModule() const
Definition: OperationModule.cc:121
GUICommand
Definition: GUICommand.hh:43
OSEdTreeView::onDropDownMenu
void onDropDownMenu(wxMouseEvent &event)
Definition: OSEdTreeView.cc:243
OSEdTreeView::infoView_
OSEdInfoView * infoView_
An info window controlled by tree view.
Definition: OSEdTreeView.hh:102
OSEdTreeView::onItemSelected
void onItemSelected(wxTreeEvent &event)
Definition: OSEdTreeView.cc:171
OSEdTreeView
Definition: OSEdTreeView.hh:54
OSEdTreeView::selectedPath
std::string selectedPath()
Definition: OSEdTreeView.cc:456
InformationDialog.hh
OperationIndex.hh
OperationSerializer::readState
virtual ObjectState * readState()
Definition: OperationSerializer.cc:118
OSEdTreeView::moduleOfOperation
std::string moduleOfOperation(wxTreeItemId id)
Definition: OSEdTreeView.cc:407
OSEdConstants
Definition: OSEdConstants.hh:45
__func__
#define __func__
Definition: Application.hh:67
OSEdTreeView::isOperationSelected
bool isOperationSelected() const
Definition: OSEdTreeView.cc:745
ObjectState.hh
OSEdTreeView::isPathSelected
bool isPathSelected() const
Definition: OSEdTreeView.cc:716
CommandRegistry
Definition: CommandRegistry.hh:47
OSEdTreeView::pathIdOfModule
wxTreeItemId pathIdOfModule(wxTreeItemId id)
Definition: OSEdTreeView.cc:444
OSEdTreeView::changeText
void changeText(wxTreeItemId id, const std::string &text)
Definition: OSEdTreeView.cc:592
OSEdInfoView
Definition: OSEdInfoView.hh:47
Operation::loadState
virtual void loadState(const ObjectState *state)
Definition: Operation.cc:480
OSEdTreeView::isModule
bool isModule(wxTreeItemId id) const
Definition: OSEdTreeView.cc:305
OperationSerializer
Definition: OperationSerializer.hh:49
OSEdTreeView::isModuleSelected
bool isModuleSelected() const
Definition: OSEdTreeView.cc:731
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
Operation.hh
OSEdTreeView::selectedOperation
Operation * selectedOperation()
Definition: OSEdTreeView.cc:328
Environment.hh
ObjectState::childCount
int childCount() const
OSEdTreeView::IterM
std::multimap< std::string, wxTreeItemId >::iterator IterM
Definition: OSEdTreeView.hh:86
OperationSerializer::setSourceFile
void setSourceFile(const std::string &filename)
Definition: OperationSerializer.cc:536
Exception
Definition: Exception.hh:54
OSEdMainFrame::registry
CommandRegistry * registry() const
Definition: OSEdMainFrame.cc:251
OSEdInfoView::operationPropertyView
void operationPropertyView(const std::string &opName, const std::string &modName, const std::string &pathName)
Definition: OSEdInfoView.cc:202
Environment::osalPaths
static std::vector< std::string > osalPaths()
Definition: Environment.cc:519
Operation
Definition: Operation.hh:59
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
OSEdTreeView.hh
OSEdConstants::CMD_TREE_ITEM
@ CMD_TREE_ITEM
Id for tree events.
Definition: OSEdConstants.hh:105
OSEdTreeView::onItemClicked
void onItemClicked(wxTreeEvent &event)
Definition: OSEdTreeView.cc:220
OSEdMainFrame
Definition: OSEdMainFrame.hh:49
OperationBehavior.hh
NullOperationBehavior::instance
static NullOperationBehavior & instance()
Definition: OperationBehavior.hh:95
OperationIndex::moduleCount
int moduleCount() const
DropDownMenu
Definition: DropDownMenu.hh:44
MapTools::containsValue
static bool containsValue(const MapType &aMap, const ValueType &aValue)
FileSystem::fileExists
static bool fileExists(const std::string fileName)
OperationModule
Definition: OperationModule.hh:46
OSEdTreeView::operations_
std::multimap< std::string, wxTreeItemId > operations_
Operations of operation data base.
Definition: OSEdTreeView.hh:108
OSEdTreeView::update
void update()
Definition: OSEdTreeView.cc:670
OperationIndex
Definition: OperationIndex.hh:58
OSEdTextGenerator::instance
static OSEdTextGenerator & instance()
Definition: OSEdTextGenerator.cc:214
OSEdTreeView::selectedOperationId
wxTreeItemId selectedOperationId()
Definition: OSEdTreeView.cc:379
OSEdTextGenerator::TXT_STATUS_PATH_SELECTED
@ TXT_STATUS_PATH_SELECTED
Status bar text when path is selected.
Definition: OSEdTextGenerator.hh:213
OSEdTreeView::Iter
std::map< std::string, wxTreeItemId >::iterator Iter
Iterators for the maps.
Definition: OSEdTreeView.hh:85
OSEdTextGenerator
Definition: OSEdTextGenerator.hh:42
OSEdTreeView::constructTree
std::vector< std::string > constructTree()
Definition: OSEdTreeView.cc:90
WxConversion.hh
KeyNotFound
Definition: Exception.hh:285
OperationContainer::operation
static Operation * operation(const std::string &path, const std::string &module, const std::string &oper)
Definition: OperationContainer.cc:173
OSEdTreeView::paths_
std::map< std::string, wxTreeItemId > paths_
Paths of the operation data base.
Definition: OSEdTreeView.hh:104
OperationModule::name
virtual std::string name() const
Definition: OperationModule.cc:160
OSEdTreeView::~OSEdTreeView
virtual ~OSEdTreeView()
Definition: OSEdTreeView.cc:78
OperationIndex::operationCount
int operationCount(const OperationModule &om)
Definition: OperationIndex.cc:363
WxConversion::toString
static std::string toString(const wxString &source)
OSEdTextGenerator.hh
OSEdMainFrame::statusBar
wxStatusBar * statusBar() const
Definition: OSEdMainFrame.cc:271
OSEdTreeView::modules_
std::multimap< std::string, wxTreeItemId > modules_
Modules of the operation data base.
Definition: OSEdTreeView.hh:106
OperationContainer::operationIndex
static OperationIndex & operationIndex()
Definition: OperationContainer.cc:94
OperationIndex::module
OperationModule & module(int i)
OperationIndex::operationName
std::string operationName(int i, const OperationModule &om)
Definition: OperationIndex.cc:337
OperationModule.hh
END_EVENT_TABLE
END_EVENT_TABLE() using namespace IDF
DropDownMenu.hh
OSEdTreeView::isOperation
bool isOperation(wxTreeItemId id) const
Definition: OSEdTreeView.cc:316
OperationContainer.hh
OSEdTextGenerator::TXT_STATUS_OPERATION_SELECTED
@ TXT_STATUS_OPERATION_SELECTED
Status bar text when operation is selected.
Definition: OSEdTextGenerator.hh:217