]> Creatis software - bbtkGEditor.git/commitdiff
Clean code for Python
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Thu, 16 Nov 2023 16:18:22 +0000 (17:18 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Thu, 16 Nov 2023 16:18:22 +0000 (17:18 +0100)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx

index f019a5caf0e622ed0034ff52f943faeba9f9a0fd..02c8c3f1d0e70f91667a081101e9430018bc82e3 100644 (file)
@@ -963,10 +963,14 @@ void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event) {
                        SaveActualDiagram(pathfilename);
                        SaveActualComplexBox(pathfilenamebbs);
                } //if isActualDiagramComplexBox
-        std::string cmdPy("source ~/.bashrc;  bbs2 "+pathfilenamebbs+" py" );
+        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 cmdjs("source ~/.bashrc;  bbs2 "+pathfilenamebbs+" js" );
+        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() );
        }
index 6684df147262a642dcd5d4a33ef4ab30588cbef0..efb1439428e855a87277153dd4c4bef69c5aedbd 100644 (file)
@@ -1601,7 +1601,6 @@ std::string wxVtkSceneManager::getDiagramBBS(bool wln) {
 //=========================================================================
 
 std::string wxVtkSceneManager::saveComplexBoxBBS() {
-       std::cout<<"wxVtkSceneManager::saveComplexBoxBBS"<<std::endl;
        std::vector<std::string> packages;
        std::vector<int> boxes;
        std::vector<int> connections;
@@ -1883,41 +1882,45 @@ void wxVtkSceneManager::saveDiagram(std::string &content)
                content += GetCbPackageName();
                content += "\n";
 
-               /* CHANGE TO THE VERSION 1.4 RaC2012 2nd HackFest
-                * External inputs are possible for applications and complex boxes
-               //Print info complex input ports
-               std::vector<int> inputs = getComplexInputPorts();
-               int insize = inputs.size();
-               content += "COMPLEXINPUTS:";
-               sprintf(buffer, "%d", insize);
-               content += buffer;
-               content += "\n";
+        /* CHANGE TO THE VERSION 1.4 RaC2012 2nd HackFest
+         * External inputs are possible for applications and complex boxes
+        //Print info complex input ports
+        std::vector<int> inputs = getComplexInputPorts();
+        int insize = inputs.size();
+        content += "COMPLEXINPUTS:";
+        sprintf(buffer, "%d", insize);
+        content += buffer;
+        content += "\n";
+
+        for (int i = 0; i < insize; i++) {
+            int id = inputs[i];
+            GObjectController *cont = _controllers[id];
+            cont->getModel()->save(content);
+        }
+        */
+
+        //Print info complex output ports
+        std::vector<int> outputs = getComplexOutputPorts();
+        int outsize = outputs.size();
+        content += "COMPLEXOUTPUTS:";
+        sprintf(buffer, "%d", outsize);
+        content += buffer;
+        content += "\n";
+
+        for (int i = 0; i < outsize; i++) {
+            int id = outputs[i];
+            GObjectController *cont = _controllers[id];
+            cont->getModel()->save(content);
+        }
+
 
-               for (int i = 0; i < insize; i++) {
-                       int id = inputs[i];
-                       GObjectController *cont = _controllers[id];
-                       cont->getModel()->save(content);
-               }
-               */
-
-               //Print info complex output ports
-               std::vector<int> outputs = getComplexOutputPorts();
-               int outsize = outputs.size();
-               content += "COMPLEXOUTPUTS:";
-               sprintf(buffer, "%d", outsize);
-               content += buffer;
-               content += "\n";
 
-               for (int i = 0; i < outsize; i++) {
-                       int id = outputs[i];
-                       GObjectController *cont = _controllers[id];
-                       cont->getModel()->save(content);
-               }
        } // _isComplexBox
        else {
                content += "FALSE\n";
        }
 
+    
        // CHANGE TO THE VERSION 1.4 RaC2012 2nd HackFest
        // External inputs are possible for applications and complex boxes
        std::vector<int> inputs = getComplexInputPorts();