--- /dev/null
+/* XPM */
+static char * showTree_xpm[] = {
+"16 16 8 1",
+" c None",
+". c #0EE555",
+"+ c #0DE454",
+"@ c #0DE153",
+"# c #0DE354",
+"$ c #000000",
+"% c #077E2E",
+"& c #066726",
+" . . ",
+" .. . ... ",
+" .. .. ... ",
+" ... ...... ...",
+" ............ ",
+". ........... ",
+".............. ",
+".......+..... ",
+" ..+@#.... ",
+" $%& ...",
+" $$$$ ",
+" $$$$ ",
+" $$$$ ",
+" $$$$$ ",
+" $$$$$$$$ ",
+" $$$$$$$$ "};
const int ID_CHANGENAME = 1027;
const int ID_EDITPROPERTIES = 1028; // RaC 2nd HackFest
+ const int ID_SHOWTREE = 1029; // CFT
}
// namespace bbtk
#endif
wxBitmap bmp_undo(undo_xpm);
wxBitmap bmp_redo(redo_xpm);
wxBitmap bmp_editProperties(editProperties_xpm);
+ wxBitmap bmp_showTree(showTree_xpm);
wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
//Adds a tool btn to the toolbar
toolbar->AddSeparator();
toolbar->AddTool(ID_EDITPROPERTIES, _T("Edit diagram properties"),bmp_editProperties, wxNullBitmap, wxITEM_NORMAL, _T("Edit diagram properties"), _T("Edit diagram properties"));
toolbar->EnableTool(ID_EDITPROPERTIES, false);
+
+ toolbar->AddTool(ID_SHOWTREE, _T("Show tree"),bmp_showTree, wxNullBitmap, wxITEM_NORMAL, _T("Show tree"), _T("Show tree"));
toolbar->EnableTool(ID_UNDO, false);
toolbar->EnableTool(ID_REDO, false);
Connect(ID_REDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnRedo));
Connect(ID_CHANGENAME, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnChangeName));
Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties));
+ Connect(ID_SHOWTREE,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowTree));
}
//=========================================================================
{
if (_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName)
{
+
_actualPkgBrowserPkgName = packageName;
_actualPkgBrowserBoxName = boxName;
BlackBoxDescriptor::Pointer descriptor;
std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
- k = _pkgBrowser->GetFactory()->GetPackage(packageName);
+ k = _pkgBrowser->GetFactory()->GetPackage(_actualPkgBrowserPkgName);
mapDesc = k->GetDescriptorMap();
- descriptor = mapDesc[boxName];
- std::vector<std::string> temp;
- descriptor->GetBoxesInside(tree,temp,1);
-
-
+ descriptor = mapDesc[_actualPkgBrowserBoxName];
+/*
+ tree.treeTour(0);
-/*CFT
- for(int i = 0 ; i < temp.size() ; i++){
- std::cout<< " "<< temp[i] << std::endl;
- }
+ tree.deleteTree();
+ descriptor->GetBoxesInside(tree, 0);
- if(temp.size()>=1){
- std::cout<< "CAJAS # " << (temp.size()- 3) << std::endl;
- for(int i = 0 ; i < temp.size()-1 ; i++){
- if(i<3){std::cout<< " "<< temp[i] << std::endl;}
- else{std::cout<< i+1 << " "<< temp[i] << " " <<temp[i+1] << std::endl;}
- }
- }
- if (temp.size()==0){
- std::cout<< " Not Complex " << std::endl;
- }
+ //tree.treeTour(0);
+ //std::vector<std::string> boxesDiagram = _sceneM->boxesDiagram;
+ //for(int i=0;i<boxesDiagram.size();i++){
+ // std::cout<<"caja: "<<boxesDiagram[i]<<std::endl;
+ //}
+
+ _actualPkgBrowserPkgName = "";
+ _actualPkgBrowserBoxName = "";
*/
/*
Package::Pointer k;
void wxGUIEditorGraphicBBS::OnChangeName(wxCommandEvent& event){
}
+//=========================================================================
+
+void wxGUIEditorGraphicBBS::OnShowTree(wxCommandEvent& event){
+ std::cout << "wxGUIEditorGraphicBBS::OnShowTree"<<std::endl;
+if (_actualPkgBrowserPkgName !="" || _actualPkgBrowserBoxName != "")
+ {
+ Package::Pointer k;
+//EED ComplexBlackBoxDescriptor::Pointer descriptor;
+ BlackBoxDescriptor::Pointer descriptor;
+
+ std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
+ k = _pkgBrowser->GetFactory()->GetPackage(_actualPkgBrowserPkgName);
+ mapDesc = k->GetDescriptorMap();
+ descriptor = mapDesc[_actualPkgBrowserBoxName];
+
+ tree.treeTour(0);
+
+ tree.deleteTree();
+
+ descriptor->GetBoxesInside(tree, 0);
+
+ _actualPkgBrowserPkgName = "";
+ _actualPkgBrowserBoxName = "";
+ }
+else
+ {
+ std::cout<<"Select a Box"<<std::endl;
+ }
+}
//=========================================================================
//=========================================================================
void wxGUIEditorGraphicBBS::OnClickBtnBox(wxCommandEvent& event)
{
+ std::cout<<"wxGUIEditorGraphicBBS::OnClickBtnBox"<<std::endl;
BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected();
if (bbDes != NULL) {
std::string typeName = bbDes->GetTypeName();
//=========================================================================
void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event)
{
+ std::cout<<"wxGUIEditorGraphicBBS::OnClickBtnComplexBox"<<std::endl;
wxToolBar* toolbar = GetToolBar();
bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
if (temp) {
_tabsMgr->SetCategory(category);
}
+//=========================================================================
+void wxGUIEditorGraphicBBS::setCurrentDiagramMessageKind(std::string kind){
+ _tabsMgr->SetMessageKind(kind);
+}
+
+//=========================================================================
+void wxGUIEditorGraphicBBS::setCurrentDiagramMessageLevel(std::string level){
+ _tabsMgr->SetMessageLevel(level);
+}
+
//=========================================================================
std::string wxGUIEditorGraphicBBS::getCurrentDiagramDescription()
{
return _tabsMgr->GetCategory();
}
-
+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageKind(){
+ return _tabsMgr->GetMessageKind();
+}
+
+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageLevel(){
+ return _tabsMgr->GetMessageLevel();
+}
+
//=========================================================================
bool wxGUIEditorGraphicBBS::isCurrentDiagramComplexBox()
{
#include "wxart_undo.xpm"
#include "wxart_redo.xpm"
#include "wxart_editProperties.xpm"
+#include "wxart_showTree.xpm"
//Includes creaMaracasVisu
void OnRedo(wxCommandEvent& event);
void OnChangeName(wxCommandEvent& event);
void OnEditDiagramProperties(wxCommandEvent& event);
+ void OnShowTree(wxCommandEvent& event); //CFT
void OnEditComplexBoxScript(wxCommandEvent& event);
void setCurrentDiagramDescription(std::string description);
void setCurrentDiagramAuthor(std::string author);
void setCurrentDiagramCategory(std::string category);
+ void setCurrentDiagramMessageKind(std::string kind);
+ void setCurrentDiagramMessageLevel(std::string level);
std::string getCurrentDiagramDescription();
std::string getCurrentDiagramAuthor();
std::string getCurrentDiagramCategory();
-
+ std::string getCurrentDiagramMessageKind();
+ std::string getCurrentDiagramMessageLevel();
private:
std::string _currentBBGversion;
NodeTreeC tree;
+ wxVtkSceneManager *_sceneM;
protected:
{
//=========================================================================
- wxDiagramPropertiesEditionDialog::wxDiagramPropertiesEditionDialog(wxGUIEditorGraphicBBS *parent, NodeTreeC tree):wxDialog(parent,wxID_ANY,_T("Diagram Properties"), wxDefaultPosition, wxSize(450, 580),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+ wxDiagramPropertiesEditionDialog::wxDiagramPropertiesEditionDialog(wxGUIEditorGraphicBBS *parent, NodeTreeC tree):wxDialog(parent,wxID_ANY,_T("Diagram Properties"), wxDefaultPosition, wxSize(500, 650),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
_parent = parent;
_tree = tree;
wxTreeItemId itemId = _treeBox->AddRoot(p, -1,-1,NULL);
constructBoxTree(_tree, itemId);
- _treeBox->ExpandAll();
- _tree.treeTour();
- //CFT end
+ _treeBox->ExpandAll();
+ //_tree.treeTour(0);
+ //CFT END
+//CFT
+//COMBOBOX OF MESSAGE
+/*
+Kind Level Nature
+Interpreter 0 Messages of the interpreter
+all 0 Minimum level for all kind of messages
+change 0 Box i/o changes related messages
+code 0 If positive then codes of the messages are displayed
+config 0 Configuration related messages
+connection 0 Connections related messages
+data 0 Data related messages
+debug 0 Debug messages
+echo 1 Level>0 : Prints the output of the 'print' commands of the user.
+ Level>1 : Prints the command being interpreted
+error 0 Error messages
+gui 0 Graphical user interface related messages
+help 1 Help messages
+kernel 0 Messages generated by the core classes of the lib
+max 9 Maximum level for all kind of messages
+object 0 object memory related messages
+output 1 Output messages
+package 0 Packages related messages
+process 0 Messages related to box processing
+qt 0 Qt related messages
+warning 1 Warning messages
+widget 0 Widgets related messages
+wx
+*/
+ _diagramMessageKind = new wxComboBox(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(100,-1) );
+ _diagramMessageKind->Append (wxT("Interpreter"));
+ _diagramMessageKind->Append (wxT("all"));
+ _diagramMessageKind->Append (wxT("change"));
+ _diagramMessageKind->Append (wxT("code"));
+ _diagramMessageKind->Append (wxT("config"));
+ _diagramMessageKind->Append (wxT("connection"));
+ _diagramMessageKind->Append (wxT("data"));
+ _diagramMessageKind->Append (wxT("debug"));
+ _diagramMessageKind->Append (wxT("echo"));
+ _diagramMessageKind->Append (wxT("error"));
+ _diagramMessageKind->Append (wxT("help"));
+ _diagramMessageKind->Append (wxT("kernel"));
+ _diagramMessageKind->Append (wxT("max"));
+ _diagramMessageKind->Append (wxT("object"));
+ _diagramMessageKind->Append (wxT("output"));
+ _diagramMessageKind->Append (wxT("package"));
+ _diagramMessageKind->Append (wxT("process"));
+ _diagramMessageKind->Append (wxT("qt"));
+ _diagramMessageKind->Append (wxT("warning"));
+ _diagramMessageKind->Append (wxT("widget"));
+ _diagramMessageKind->Append (wxT("wx"));
+ _diagramMessageKind->SetEditable(false);
+
+ _diagramMessageLevel = new wxComboBox(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(100,-1) );
+ _diagramMessageLevel->Append (wxT("0"));
+ _diagramMessageLevel->Append (wxT("1"));
+ _diagramMessageLevel->Append (wxT("2"));
+ _diagramMessageLevel->Append (wxT("3"));
+ _diagramMessageLevel->Append (wxT("4"));
+ _diagramMessageLevel->Append (wxT("5"));
+ _diagramMessageLevel->Append (wxT("6"));
+ _diagramMessageLevel->Append (wxT("7"));
+ _diagramMessageLevel->Append (wxT("8"));
+ _diagramMessageLevel->Append (wxT("9"));
+ _diagramMessageLevel->SetEditable(false);
+
+//CFT END
// SELECTION CONSTANTS
// 0 - Application
int currentType = (_parent->isCurrentDiagramComplexBox()==false)? 0 : 1;
_diagramType->Select(currentType);
+ _diagramMessageKind->Select(currentType);
+ _diagramMessageLevel->Select(currentType);
wxStaticText *type = new wxStaticText(panel, -1, wxT("Type"));
wxStaticText *author = new wxStaticText(panel, -1, wxT("Author"));
wxStaticText *category = new wxStaticText(panel, -1, wxT("Categories"));
wxStaticText *description = new wxStaticText(panel, -1, wxT("Description"));
+ wxStaticText *messageKind = new wxStaticText(panel, -1, wxT("Message kind"));
+ wxStaticText *messageLevel = new wxStaticText(panel, -1, wxT("Message level"));
_txtAuthor = new wxTextCtrl(panel, -1);
_txtCategory = new wxTextCtrl(panel, -1);
fgsizer->Add(description, 1, wxEXPAND);
fgsizer->Add(_txtDescription, 1, wxEXPAND);
//cft
+ fgsizer->Add(messageKind);
+ fgsizer->Add(_diagramMessageKind, 1, wxEXPAND);
+ fgsizer->Add(messageLevel);
+ fgsizer->Add(_diagramMessageLevel, 1, wxEXPAND);
fgsizer->Add(tree);
fgsizer->Add(_treeBox, 1, wxEXPAND);
//cft end
- fgsizer->Add(okButton, 1, wxEXPAND);
+ fgsizer->Add(okButton, 1, wxEXPAND);
fgsizer->Add(closeButton, 1, wxEXPAND);
fgsizer->AddGrowableRow(3, 1);
void wxDiagramPropertiesEditionDialog::onClickOk(wxCommandEvent& event)
{
-
+ printf("RaC wxDiagramPropertiesEditionDialog::onClickOk\n");
std::string txtAuthor = wx2std(_txtAuthor->GetValue());
std::string txtCategory = wx2std(_txtCategory->GetValue());
std::string txtDescription = wx2std(_txtDescription->GetValue());
else if (selection == 1)
_parent->enableComplexBox();
+
+ //Message
+ std::string kindSelected = wx2std(_diagramMessageKind->GetStringSelection());
+ std::string levelSelected = wx2std(_diagramMessageLevel->GetStringSelection());
+ _parent->setCurrentDiagramMessageKind(kindSelected);
+ _parent->setCurrentDiagramMessageLevel(levelSelected);
Close(true);
}
wxTextCtrl *_txtCategory;
wxTextCtrl *_txtDescription;
wxComboBox *_diagramType;
+ wxComboBox *_diagramMessageKind;
+ wxComboBox *_diagramMessageLevel;
wxTreeCtrl *_treeBox;
NodeTreeC _tree;
protected:
{
return _sceneManager->GetCategory();
}
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetMessageKind()
+ {
+ return _sceneManager->GetMessageKind();
+ }
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetMessageLevel()
+ {
+ return _sceneManager->GetMessageLevel();
+ }
//=========================================================================
void wxGEditorTabPanel::SetCbName(std::string cbName)
{
_sceneManager->SetDescription( description );
}
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetMessageKind(std::string kind)
+ {
+ _sceneManager->SetMessageKind( kind );
+ }
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetMessageLevel(std::string level)
+ {
+ _sceneManager->SetMessageLevel( level );
+ }
//=========================================================================
//DFCH
void wxGEditorTabPanel::SetFullPath( const std::string& fullpath )
void SetAuthor(std::string author);
void SetCategory(std::string category);
void SetDescription(std::string description);
+ void SetMessageKind(std::string kind);
+ void SetMessageLevel(std::string level);
//Getters
std::string GetFullPath( );
std::string GetFileName( );
std::string GetAuthor();
std::string GetDescription();
std::string GetCategory();
+ std::string GetMessageKind();
+ std::string GetMessageLevel();
//=========================================================================
return _actual->GetCategory();
}
+ //=========================================================================
+ std::string wxTabPanelsManager::GetMessageKind()
+ {
+ return _actual->GetMessageKind();
+ }
+
+ //=========================================================================
+ std::string wxTabPanelsManager::GetMessageLevel()
+ {
+ return _actual->GetMessageLevel();
+ }
+
//=========================================================================
void wxTabPanelsManager::SetCbName(std::string cbName)
{
_actual->SetDescription( description );
}
+
+ //=========================================================================
+ void wxTabPanelsManager::SetMessageKind(std::string kind){
+ _actual->SetMessageKind(kind);
+ }
+
+
+ //=========================================================================
+ void wxTabPanelsManager::SetMessageLevel(std::string level){
+ _actual->SetMessageLevel(level);
+ }
+
//=========================================================================
bool wxTabPanelsManager::TryToOpenScriptApplication(std::string packageName ,std::string boxType)
{
void SetAuthor(std::string author);
void SetCategory(std::string category);
void SetDescription(std::string description);
+ void SetMessageKind(std::string kind);
+ void SetMessageLevel(std::string level);
std::string GetCbName();
std::string GetCbPackageName();
std::string GetAuthor();
std::string GetDescription();
std::string GetCategory();
+ std::string GetMessageKind();
+ std::string GetMessageLevel();
void SetNameTabPanel(wxString tabpanelname);
std::string GetNameTabPanel();
_Author = "Author ??";
_Category = "<VOID>";
_Description = "Description ??";
+ _MessageKind = " ";
+ _MessageLevel = " ";
_bugTextActor_text = "void";
_bugTextActor_status = 0;
//=========================================================================
std::string wxVtkSceneManager::getDiagramBBS(bool wln) {
+ std::cout << "wxVtkSceneManager::getDiagramBBS" << std::endl;
bool existsExec = false;
std::vector<std::string> packages;
script += "\n";
//ups2
-
+
script += LineNumber(wln, lnNmbr);
script += "author \"";
script += _Author;
script += "# Complex input ports\n";
script += complexInputs;
+ script += LineNumber(wln, lnNmbr);
+ script += "message ";
+ script += _MessageKind;
+ script += " ";
+ script += _MessageLevel;
+ script += "\n";
+
for (i = 0; i < (int) execBoxes.size(); i++) {
script += LineNumber(wln, lnNmbr);
script += "exec ";
//=========================================================================
std::string wxVtkSceneManager::saveComplexBoxBBS() {
+ std::cout<<"wxVtkSceneManager::saveComplexBoxBBS"<<std::endl;
std::vector<std::string> packages;
std::vector<int> boxes;
std::vector<int> connections;
script += "\n";
+ script += "message ";
+ script += _MessageKind;
+ script += " ";
+ script += _MessageLevel;
+ script += "\n";
+
for (i = 0; i < (int) execBoxes.size(); i++) {
script += "exec ";
int id = execBoxes[i];
sprintf(buffer, "%d", bsize);
content += buffer;
content += "\n";
-
+
for (int i = 0; i < bsize; i++) {
int id = boxes[i];
+ std::cout<<"id "<<id<<std::endl;//CFT
GObjectController *cont = _controllers[id];
+ std::cout<<"nombre: "<<cont->getStatusText()<<std::endl;//CFT
+ std::cout<<"tipo: "<<cont->getModel()->getBBTKType()<<std::endl;//CFT
+ //boxesDiagram[i] = cont->getModel()->getBBTKType();//CFT
+ std::cout<<"nname: "<<cont->getModel()->getBBTKName()<<std::endl;//CFT
+ std::cout<<"categorie: "<<GetCategory()<<std::endl;//CFT
+ std::cout<<"type: "<<cont->getModel()->getGObjectType()<<std::endl;//CFT
cont->getModel()->save(content);
}
//=========================================================================
+void wxVtkSceneManager::SetMessageKind(std::string kind) {
+ _MessageKind = kind;
+
+}
+
+//=========================================================================
+
+std::string wxVtkSceneManager::GetMessageKind(){
+ return _MessageKind;
+}
+
+//=========================================================================
+
+void wxVtkSceneManager::SetMessageLevel(std::string Level){
+ _MessageLevel = Level;
+}
+
+//=========================================================================
+
+std::string wxVtkSceneManager::GetMessageLevel(){
+ return _MessageLevel;
+}
+
+//=========================================================================
+
std::vector< std::string> wxVtkSceneManager::GetExternalInputsNames()
{
void SetAuthor(std::string author);
void SetCategory(std::string category);
void SetDescription(std::string description);
+ void SetMessageKind(std::string kind);
+ void SetMessageLevel(std::string Level);
std::string GetCbName();
std::string GetCbPackageName();
std::string GetAuthor();
std::string GetCategory();
std::string GetDescription();
+ std::string GetMessageKind();
+ std::string GetMessageLevel();
// RaC2012 2nd HackFest
// External Inputs was the complex inputs in previous versions
void printAll( int com, int sta );
-
+ std::vector<std::string> boxesDiagram;//CFT
+
private:
std::string _cbName;
std::string _Author;
std::string _Category;
std::string _Description;
+ std::string _MessageKind;
+ std::string _MessageLevel;
//wxPanel that uses the manager
wxGEditorTabPanel *_parent;