/////////////////////////////////
/// IMPORTANT!! FOR SAVE&LOAD PROCESSES THE VERSION IS VERY IMPORTANT.
/// RaC 2012 2nd Hackfest
- _currentBBGversion="1.5";
+ _currentBBGversion="1.6";
}
//=========================================================================
} else {
std::string pathfilenamebbs = pathfilename;
pathfilenamebbs[pathfilenamebbs.length() - 1] = 's';
-
if (_tabsMgr->isActualDiagramComplexBox() == false) {
std::string name = _tabsMgr->GetNameTabPanel();
if(name[name.length() - 1] == '*')
SaveActualDiagram(pathfilename);
SaveActualComplexBox(pathfilenamebbs);
} //if isActualDiagramComplexBox
- std::string pathfilenamepy = pathfilenamebbs;
- pathfilenamepy.replace( pathfilenamepy.length()-3, 3 , "py");
- std::string cmdPy("source ~/.bashrc; bbs2 "+pathfilenamebbs+" "+pathfilenamepy);
- printf("EED wxGUIEditorGraphicBBS::OnSaveActualDiagram cmd:%s\n", cmdPy.c_str() );
- system( cmdPy.c_str() );
- std::string pathfilenamejs = pathfilenamebbs;
- pathfilenamejs.replace( pathfilenamejs.length()-3, 3 , "js");
- std::string cmdjs("source ~/.bashrc; bbs2 "+pathfilenamebbs+" "+pathfilenamejs);
- printf("EED wxGUIEditorGraphicBBS::OnSaveActualDiagram cmd:%s\n", cmdjs.c_str() );
- system( cmdjs.c_str() );
- }
+ if ((getCurrentDiagramExportFormat()==1) || (getCurrentDiagramExportFormat()==2) ) // 1:All 2:bbs,Python
+ {
+ std::string pathfilenamepy = pathfilenamebbs;
+ pathfilenamepy.replace( pathfilenamepy.length()-3, 3 , "py");
+ std::string cmdPy("source ~/.bashrc; bbs2 "+pathfilenamebbs+" "+pathfilenamepy);
+ printf("EED wxGUIEditorGraphicBBS::OnSaveActualDiagram cmd:%s\n", cmdPy.c_str() );
+ system( cmdPy.c_str() );
+ } // ExportFormat 1 or 2 All and Python
+ if ((getCurrentDiagramExportFormat()==1) || (getCurrentDiagramExportFormat()==3) ) // 1:All 3:bbs,JavaScript
+ {
+ std::string pathfilenamejs = pathfilenamebbs;
+ pathfilenamejs.replace( pathfilenamejs.length()-3, 3 , "js");
+ std::string cmdjs("source ~/.bashrc; bbs2 "+pathfilenamebbs+" "+pathfilenamejs);
+ printf("EED wxGUIEditorGraphicBBS::OnSaveActualDiagram cmd:%s\n", cmdjs.c_str() );
+ system( cmdjs.c_str() );
+ } // ExportFormat 1 or 3 All and JavaScript
+ } // if pathfilename empty
}
//=========================================================================
//DFCH
_tabsMgr->SetAuthor(author);
}
+//=========================================================================
+void wxGUIEditorGraphicBBS::setCurrentDiagramExportFormat(int exportformat)
+{
+ _tabsMgr->SetExportFormat( exportformat );
+}
+
//=========================================================================
void wxGUIEditorGraphicBBS::setCurrentDiagramCategory(std::string category)
{
return _tabsMgr->GetAuthor();
}
+//=========================================================================
+int wxGUIEditorGraphicBBS::getCurrentDiagramExportFormat()
+{
+ return _tabsMgr->GetExportFormat();
+}
+
//=========================================================================
std::string wxGUIEditorGraphicBBS::getCurrentDiagramCategory()
{
void setCurrentDiagramDescription(std::string description);
void setCurrentDiagramAuthor(std::string author);
+ void setCurrentDiagramExportFormat(int exportformat);
void setCurrentDiagramCategory(std::string category);
void setCurrentDiagramMessageKind(std::string kind);
void setCurrentDiagramMessageLevel(std::string level);
std::string getCurrentDiagramDescription();
std::string getCurrentDiagramAuthor();
+ int getCurrentDiagramExportFormat();
std::string getCurrentDiagramCategory();
std::string getCurrentDiagramMessageKind();
std::string getCurrentDiagramMessageLevel();
const int ID_COMBO = 1;
wxPanel *panel = new wxPanel(this, -1);
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
- wxFlexGridSizer *fgsizer = new wxFlexGridSizer(8, 2, 9, 25);
+ wxFlexGridSizer *fgsizer = new wxFlexGridSizer(9, 2, 9, 25);
//CFT
wxStaticText *tree = new wxStaticText(panel, -1, wxT("Tree of Box"));
_diagramMessageLevel->Append (wxT("9"));
_diagramMessageLevel->SetEditable(false);
+
+ _exportFormatCB = new wxComboBox(panel, -1, wxT("bbs"), wxDefaultPosition, wxSize(100,-1) );
+ _exportFormatCB->Append (wxT("bbs"));
+ _exportFormatCB->Append (wxT("All (bbs Pyyhon JavaScript)"));
+ _exportFormatCB->Append (wxT("bbs Python"));
+ _exportFormatCB->Append (wxT("bbs JavaScript"));
+ _exportFormatCB->SetEditable(false);
+ _exportFormatCB->Select( _parent->getCurrentDiagramExportFormat() );
+
+
//CFT END
// SELECTION CONSTANTS
_diagramMessageLevel->Select(currentLevel);
wxStaticText *type = new wxStaticText(panel, -1, wxT("Type"));
+ wxStaticText *exportFormat = new wxStaticText(panel, -1, wxT("Export Format"));
wxStaticText *author = new wxStaticText(panel, -1, wxT("Author"));
wxStaticText *category = new wxStaticText(panel, -1, wxT("Categories"));
wxStaticText *description = new wxStaticText(panel, -1, wxT("Description"));
_txtDescription->SetValue(crea::std2wx(_parent->getCurrentDiagramDescription()));
fgsizer->Add(type);
- fgsizer->Add(_diagramType, 1, wxEXPAND);
+ fgsizer->Add(_diagramType , 1, wxEXPAND);
fgsizer->Add(author);
- fgsizer->Add(_txtAuthor, 1, wxEXPAND);
+ fgsizer->Add(_txtAuthor , 1, wxEXPAND);
+ fgsizer->Add(exportFormat);
+ fgsizer->Add(_exportFormatCB , 1, wxEXPAND);
fgsizer->Add(category);
fgsizer->Add(_txtCategory, 1, wxEXPAND);
fgsizer->Add(description, 1, wxEXPAND);
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());
+ std::string txtAuthor = wx2std(_txtAuthor->GetValue());
+ std::string txtCategory = wx2std(_txtCategory->GetValue());
+ std::string txtDescription = wx2std(_txtDescription->GetValue());
_parent->setCurrentDiagramAuthor(txtAuthor);
_parent->setCurrentDiagramCategory(txtCategory);
_parent->setCurrentDiagramDescription(txtDescription);
// 0 - Application
// 1 - Complex box
int selection = _diagramType->GetSelection();
- if(selection == 0)
- _parent->disableComplexBox();
- else if (selection == 1)
- _parent->enableComplexBox();
-
-
+ if(selection == 0)
+ {
+ _parent->disableComplexBox();
+ }else {
+ if (selection == 1)
+ {
+ _parent->enableComplexBox();
+ } // if selection 1
+ } // if selection 0
+
+ // Export Formats constants
+ // 0 - bbs
+ // 1 - ALL - bbs & py & js
+ // 2 - bbs & py
+ // 3 - bbs & js
+ _parent->setCurrentDiagramExportFormat( _exportFormatCB->GetSelection() );
+
+
//Message
std::string kindSelected = wx2std(_diagramMessageKind->GetStringSelection());
std::string levelSelected = wx2std(_diagramMessageLevel->GetStringSelection());
void OnComboBoxSelected(wxCommandEvent& event);
private:
- wxAuiManager *_dialogAUIMgr;
- wxPanel *_panel;
- wxGUIEditorGraphicBBS *_parent;
- wxTextCtrl *_txtAuthor;
- wxTextCtrl *_txtCategory;
- wxTextCtrl *_txtDescription;
- wxComboBox *_diagramType;
- wxComboBox *_diagramMessageKind;
- wxComboBox *_diagramMessageLevel;
- wxTreeCtrl *_treeBox;
- NodeTreeC _tree;
+ wxAuiManager *_dialogAUIMgr;
+ wxPanel *_panel;
+ wxGUIEditorGraphicBBS *_parent;
+ wxTextCtrl *_txtAuthor;
+ wxTextCtrl *_txtCategory;
+ wxTextCtrl *_txtDescription;
+ wxComboBox *_diagramType;
+ wxComboBox *_diagramMessageKind;
+ wxComboBox *_diagramMessageLevel;
+ wxComboBox *_exportFormatCB;
+ wxTreeCtrl *_treeBox;
+ NodeTreeC _tree;
protected:
};
return _sceneManager->GetAuthor();
}
+ //=========================================================================
+ int wxGEditorTabPanel::GetExportFormat()
+ {
+ return _sceneManager->GetExportFormat();
+ }
+
//=========================================================================
std::string wxGEditorTabPanel::GetDescription()
{
_sceneManager->SetCbPackageName( packagename );
}
-
//=========================================================================
void wxGEditorTabPanel::SetAuthor(std::string author)
{
_sceneManager->SetAuthor( author );
}
+ //=========================================================================
+ void wxGEditorTabPanel::SetExportFormat(int exportformat)
+ {
+ _sceneManager->SetExportFormat( exportformat );
+ }
//=========================================================================
void wxGEditorTabPanel::SetCategory(std::string category)
void SetCbName(std::string cbName);
void SetCbPackageName(std::string packagename);
void SetAuthor(std::string author);
+ void SetExportFormat(int exportformat);
void SetCategory(std::string category);
void SetDescription(std::string description);
void SetMessageKind(std::string kind);
std::string GetCbName();
std::string GetCbPackageName();
std::string GetAuthor();
+ int GetExportFormat();
std::string GetDescription();
std::string GetCategory();
std::string GetMessageKind();
{
return _actual->getUndoState(stun);
}
- //=========================================================================
+
+ //=========================================================================
unsigned short wxTabPanelsManager::getRedoState(std::string &stre) //FCY
{
return _actual->getRedoState(stre);
}
- //=========================================================================
+ //=========================================================================
bool wxTabPanelsManager::isActualDiagramComplexBox()
{
return _actual->isComplexBox();
}
//=========================================================================
-
void wxTabPanelsManager::setActualDiagramComplexBox(bool val)
{
_actual->setComplexBox(val);
}
//=========================================================================
-
void wxTabPanelsManager::addActualDiagramComplexInputPort(std::string portName)
{
_actual->addComplexInputPort(portName);
return _actual->GetAuthor();
}
+ //=========================================================================
+ int wxTabPanelsManager::GetExportFormat()
+ {
+ return _actual->GetExportFormat();
+ }
+
+
//=========================================================================
std::string wxTabPanelsManager::GetDescription()
{
_actual->SetCbPackageName( packagename );
}
-
- //=========================================================================
+ //=========================================================================
void wxTabPanelsManager::SetAuthor(std::string author)
{
_actual->SetAuthor( author );
}
+ //=========================================================================
+ void wxTabPanelsManager::SetExportFormat(int exportformat)
+ {
+ _actual->SetExportFormat( exportformat );
+ }
//=========================================================================
void wxTabPanelsManager::SetCategory(std::string category)
void SetCbName(std::string cbName);
void SetCbPackageName(std::string packagename);
void SetAuthor(std::string author);
+ void SetExportFormat(int exportformat);
void SetCategory(std::string category);
void SetDescription(std::string description);
void SetMessageKind(std::string kind);
std::string GetCbName();
std::string GetCbPackageName();
std::string GetAuthor();
+ int GetExportFormat();
std::string GetDescription();
std::string GetCategory();
std::string GetMessageKind();
_cbName = "ComplexBoxName";
_cbPackageName = "PackageName";
_Author = "Author ??";
+ _ExportFormat = 0;
_Category = "<VOID>";
_Description = "Description ??";
_MessageKind = "-";
content += GetAuthor();
content += "\n";
+ content += "EXPORTFORMAT:";
+ sprintf(buffer, "%d", GetExportFormat()) ;
+ content += buffer;
+ content += "\n";
+
//Print info IF COMPLEX BOX
content += "COMPLEXBOX:";
if (_isComplexBox) {
}
if (line == "# - BBTKGEditor v 1.5 BBG BlackBox Diagram file") {
version = line.substr(18, 3);
+ }
+ if (line == "# - BBTKGEditor v 1.6 BBG BlackBox Diagram file") {
+ version = line.substr(18, 3);
}
} else if (line == "APP_START") {
start = true;
result = strtok(authorTmp, delims);
result = strtok(NULL, delims);
SetAuthor(result);
+
+ if(version >= "1.6")
+ {
+ getCleanLine(inputStream, line);//EXPORTFORMAT:<0:bbs 1:ALL 2:bbs,Python 3:bbs,JavaScript>
+ char authorTmp[255];
+ strcpy(authorTmp, line.c_str());
+ result = strtok(authorTmp, delims);
+ result = strtok(NULL, delims);
+ int exportformatTMP;
+ std::istringstream inps(result);
+ inps >> exportformatTMP;
+ SetExportFormat( exportformatTMP );
+ }
+
}
//----------
}
//=========================================================================
-std::string wxVtkSceneManager::GetCbPackageName() {
+std::string wxVtkSceneManager::GetCbPackageName()
+{
return _cbPackageName;
}
//=========================================================================
-void wxVtkSceneManager::SetAuthor(std::string author) {
- _Author = author;
- if (_Author == "") {
- _Author = "<author of the box>";
- }
+void wxVtkSceneManager::SetAuthor(std::string author)
+{
+ _Author = author;
+ if (_Author == "")
+ {
+ _Author = "<author of the box>";
+ }
}
//=========================================================================
-std::string wxVtkSceneManager::GetAuthor() {
- return _Author;
+std::string wxVtkSceneManager::GetAuthor()
+{
+ return _Author;
+}
+
+//=========================================================================
+void wxVtkSceneManager::SetExportFormat(int exportformat)
+{
+ _ExportFormat = exportformat;
+}
+
+//=========================================================================
+int wxVtkSceneManager::GetExportFormat()
+{
+ return _ExportFormat;
}
//=========================================================================
-void wxVtkSceneManager::SetCategory(std::string category) {
+void wxVtkSceneManager::SetCategory(std::string category)
+{
_Category = category;
- if (_Category == "") {
+ if (_Category == "")
+ {
_Category = "<category of the box>";
}
}
//=========================================================================
-std::string wxVtkSceneManager::GetCategory() {
+std::string wxVtkSceneManager::GetCategory()
+{
return _Category;
}
void SetCbName(std::string cbNane);
void SetCbPackageName(std::string packagename);
void SetAuthor(std::string author);
+ void SetExportFormat(int exportformat);
void SetCategory(std::string category);
void SetDescription(std::string description);
void SetMessageKind(std::string kind);
std::string GetCbName();
std::string GetCbPackageName();
std::string GetAuthor();
+ int GetExportFormat();
std::string GetCategory();
std::string GetDescription();
std::string GetMessageKind();
std::string _cbName;
std::string _cbPackageName;
std::string _Author;
+ int _ExportFormat; // 0:bbs 1:All: 2:bbs,Python 3:bbs,JavaScript
std::string _Category;
std::string _Description;
std::string _MessageKind;