diff --git a/README.md b/README.md index fb4cef27..b8b41202 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ After the run with CalculiX the results will be automatically converted for Para Here you can find the source code and a build for linux. -This component was build with Cubit 2023.8! +This component was build with Cubit 2024.3! -Tested with Cubit 2023.8 and 2023.11 on Ubuntu 22.04 +Tested with Cubit 2024.3 on Ubuntu 22.04 # Key Features Definition of: diff --git a/build/libcalculix_comp.ccl b/build/libcalculix_comp.ccl index eda7a9eb..35db3610 100755 Binary files a/build/libcalculix_comp.ccl and b/build/libcalculix_comp.ccl differ diff --git a/build/libcalculix_plugin.ccm b/build/libcalculix_plugin.ccm index 0ffed138..e10a215f 100755 Binary files a/build/libcalculix_plugin.ccm and b/build/libcalculix_plugin.ccm differ diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 00000000..200371be --- /dev/null +++ b/changelog.txt @@ -0,0 +1,2 @@ +2024-04-01 deprecating ccx2paraview +2024-04-01 Update from Cubit 2023.11 to 2024.3 diff --git a/examples/Welding/shrinkage_model.jou b/examples/Welding/shrinkage_model.jou new file mode 100644 index 00000000..a9a8ef95 --- /dev/null +++ b/examples/Welding/shrinkage_model.jou @@ -0,0 +1,125 @@ +#!cubit + +# the model is a rebuild of https://github.com/calculix/CalculiX-Examples/tree/master/Thermal/Thermal%20distortion but without contact definitions + +reset + +#{tf = 10} +#{bf = 100} +#{length = 500} +#{tw = 10} +#{hw = 100} +#{a = 7} +#{dls = 25} + +# flange +create brick x {bf} y {tf} z {length/2} +# web +create brick x {tw/2} y {hw} z {length/2} +# seam +create brick x {a/sqrt(2)} y {a/sqrt(2)} z {length/2-dls} +webcut volume 3 with plane xplane offset 0 rotate 45 about z center 0 0 0 +delete volume 3 +compress + +#move to position +move Vertex 7 location 0 0 0 include_merged +move Vertex 15 location 0 {tf} 0 include_merged +move Vertex 18 location {tw/2} {tf} 0 include_merged + + +#we will first merge all together and mesh and then unmerge the web and the flange +imprint vol all +merge vol all +#vol all size auto factor 5 +mesh vol all +#unmerge all +unmerge vol all +#reconnect with seam +merge vol 1 3 +merge vol 2 3 + +#create blocks +block 1 add volume 1 +block 1 name "flange" +block 2 add volume 2 +block 2 name "web" +block 3 add volume 3 +block 3 name "seam" + +#block all element type hex8 +#hex 20 is way more accurate, you can play with the auto size factor and hex8 to see the difference +block all element type hex20 +# hex20 will be c3d20 but can also be modified +#ccx block all element_type C3D20R + +# create nodesets for boundary conditions +nodeset 1 add surface 10 4 +nodeset 1 name "symm_x" +nodeset 2 add surface 2 8 16 +nodeset 2 name "symm_z" +nodeset 3 add vertex 7 +nodeset 3 name "fixed_y" +nodeset 4 add volume 3 +nodeset 4 name "seam_temp" +nodeset 5 add volume all +nodeset 5 name "initial_temp" + +#material +create material "steel" property_group "CalculiX-FEA" +modify material "steel" scalar_properties "CCX_ELASTIC_USE_CARD" 1 +modify material "steel" scalar_properties "CCX_ELASTIC_ISO_USE_CARD" 1 +modify material "steel" matrix_property "CCX_ELASTIC_ISO_MODULUS_VS_POISSON_VS_TEMPERATURE" 210000 0.3 0 +modify material "steel" scalar_properties "CCX_PLASTIC_ISO_USE_CARD" 1 +modify material "steel" scalar_properties "CCX_DENSITY_USE_CARD" 1 +modify material "steel" matrix_property "CCX_DENSITY_DENSITY" 7.9e-06 0 +modify material "steel" scalar_properties "CCX_SPECIFIC_HEAT_USE_CARD" 1 +modify material "steel" matrix_property "CCX_SPECIFIC_HEAT_SPECIFIC_HEAT" 5e+08 0 +modify material "steel" scalar_properties "CCX_EXPANSION_USE_CARD" 1 +modify material "steel" scalar_properties "CCX_EXPANSION_ISO_USE_CARD" 1 +modify material "steel" matrix_property "CCX_EXPANSION_ISO_A_TEMPERATURE" 1.2e-05 0 +modify material "steel" scalar_properties "CCX_CONDUCTIVITY_USE_CARD" 1 +modify material "steel" scalar_properties "CCX_CONDUCTIVITY_ISO_USE_CARD" 1 +modify material "steel" matrix_property "CCX_CONDUCTIVITY_ISO_K_TEMPERATURE" 50 0 + +#sections +ccx create section solid block all material 1 + +#boundary conditions +create temperature on nodeset 5 value 0 #will be used as initial condition +create temperature on nodeset 4 value -1000 #our seam temperature +ccx modify temperature 2 keyword_type temp +create displacement on nodeset 1 dof 1 dof 6 fix 0 #x symm +create displacement on nodeset 2 dof 3 dof 4 fix 0 #z symm +create displacement on nodeset 3 dof 2 fix 0 dof 5 #fixed point in y + +#initial conditions +ccx create initialcondition temperature +ccx modify initialcondition 1 temperature bc_id 1 + +#outputs +ccx create fieldoutput name "fo_node" node +ccx modify fieldoutput 1 node +ccx modify fieldoutput 1 node key_on U NT +ccx modify fieldoutput 1 node key_off CP DEPF DEPT DTF HCRI KEQ MACH MAXU MF PNT POT PRF PS PSF PT PTF PU RF RFL SEN TS TSF TT TTF TURB V VF +ccx create fieldoutput name "fo_element" element +ccx modify fieldoutput 2 element +ccx modify fieldoutput 2 element key_on E S +ccx modify fieldoutput 2 element key_off CEEQ ECD EMFB EMFE ENER ERR HER HFL HFLF MAXE MAXS ME PEEQ PHS SF SMID SNEG SPOS SVF SDV THE ZZS + +# add homogeneous bc +ccx hbc add bc displacement 1 +ccx hbc add bc displacement 2 +ccx hbc add bc displacement 3 + +# create step +ccx create step name "static" static +ccx step 1 add bc temperature 2 +ccx step 1 add fieldoutput 1 +ccx step 1 add fieldoutput 2 + +#job +ccx create job name "shrinkage_model" +ccx run job 1 +ccx wait job 1 +ccx result paraview job 1 diff --git a/examples/bolted_connection/bolted_connection.jou b/examples/bolted_connection/bolted_connection.jou index 6219091c..dc98ce6e 100644 --- a/examples/bolted_connection/bolted_connection.jou +++ b/examples/bolted_connection/bolted_connection.jou @@ -1,3 +1,5 @@ +#!cubit + reset create brick x 40 y 20 z 5 volume 1 copy move x 20 z -5.001 @@ -142,11 +144,3 @@ mesh vol all #ccx result load job 1 #ccx use logfile core on #ccx result convert job 1 partial block 1 2 3 - - - - - - - - diff --git a/examples/contact_press_fitting/contact_press_fitting.jou b/examples/contact_press_fitting/contact_press_fitting.jou index 1a9b39c4..27e4ab10 100644 --- a/examples/contact_press_fitting/contact_press_fitting.jou +++ b/examples/contact_press_fitting/contact_press_fitting.jou @@ -1,3 +1,5 @@ +#!cubit + reset create cylinder height 1 radius 2 create cylinder height 1 radius 0.996 @@ -52,4 +54,4 @@ vol all size 0.2 mesh vol all ccx run job 1 no_conversion ccx wait job 1 -ccx result convert job 1 partial \ No newline at end of file +ccx result convert job 1 partial diff --git a/journal_files/first_run.jou b/examples/first_run.jou similarity index 98% rename from journal_files/first_run.jou rename to examples/first_run.jou index f0601533..a96ffc5a 100644 --- a/journal_files/first_run.jou +++ b/examples/first_run.jou @@ -1,3 +1,4 @@ +#!cubit reset #beam geometry create brick x 100 y 10 z 10 @@ -73,4 +74,4 @@ ccx create job name "first_run" ccx run job 1 ccx wait job 1 ccx result cgx job 1 -ccx result paraview job 1 \ No newline at end of file +ccx result paraview job 1 diff --git a/examples/model_change/model_change.py b/examples/model_change/model_change.py index 52bdfc04..8346920a 100644 --- a/examples/model_change/model_change.py +++ b/examples/model_change/model_change.py @@ -1,5 +1,4 @@ #!python -#!python from numpy import cos,sin,arccos import numpy as np import cubit diff --git a/examples/nonlinear buckling cylindrical shell/nonlinear buckling cylindrical shell.jou b/examples/nonlinear buckling cylindrical shell/nonlinear buckling cylindrical shell.jou index 71fa880f..608e604a 100644 --- a/examples/nonlinear buckling cylindrical shell/nonlinear buckling cylindrical shell.jou +++ b/examples/nonlinear buckling cylindrical shell/nonlinear buckling cylindrical shell.jou @@ -1,8 +1,10 @@ +#!cubit + reset create curve arc radius 200 center location 0 0 0 normal 0 0 1 start angle 0 stop angle 360 sweep curve 1 vector 0 0 1 distance 400 -surface 1 size 15 +surface 1 size 30 mesh surface 1 block 1 add surface 1 @@ -54,10 +56,10 @@ ccx modify fieldoutput 2 element output_2d ccx modify fieldoutput 2 element key_on E S ccx modify fieldoutput 2 element key_off CEEQ ECD EMFB EMFE ENER ERR HER HFL HFLF MAXE MAXS ME PEEQ PHS SF SMID SNEG SPOS SVF SDV THE ZZS -ccx create historyoutput name "ho_1" element -ccx modify historyoutput 1 element block 1 -ccx modify historyoutput 1 element key_on S E -ccx modify historyoutput 1 element key_off SVF ME PEEQ CEEQ ENER SDV HFL HFLF COORD ELSE ELKE EVOL EMAS EBHE CENT +#ccx create historyoutput name "ho_1" element +#ccx modify historyoutput 1 element block 1 +#ccx modify historyoutput 1 element key_on S E +#ccx modify historyoutput 1 element key_off SVF ME PEEQ CEEQ ENER SDV HFL HFLF COORD ELSE ELKE EVOL EMAS EBHE CENT ccx create step name "buckle" buckle ccx modify step 1 buckle bucklingfactors 5 accuracy 1e-8 solver pardiso @@ -73,18 +75,17 @@ ccx wait job 1 ccx delete step 1 modify material "Steel" scalar_properties "CCX_PLASTIC_USE_CARD" 1 -modify material "Steel" matrix_property "CCX_PLASTIC_ISO_YIELD_STRESS_VS_STRAIN_VS_TEMPERATURE" 4e+2 0 0 4.2e+2 0.02 0 5e+2 0.2 0 6e+2 0.5 0 +modify material "Steel" matrix_property "CCX_PLASTIC_ISO_YIELD_STRESS_VS_STRAIN_VS_TEMPERATURE" 4e+2 0 0 modify material "Alu" scalar_properties "CCX_PLASTIC_USE_CARD" 1 -modify material "Alu" matrix_property "CCX_PLASTIC_ISO_YIELD_STRESS_VS_STRAIN_VS_TEMPERATURE" 1.6e+2 0 0 3.4e+2 0.02 0 -modify displacement 2 dof 3 fix -50 - +modify material "Alu" matrix_property "CCX_PLASTIC_ISO_YIELD_STRESS_VS_STRAIN_VS_TEMPERATURE" 1.6e+2 0 0 +modify displacement 2 dof 3 fix -20 ccx create step name "nonlinear" static ccx modify step 1 parameter nlgeom_yes ccx modify step 1 static totaltimeatstart 0 initialtimeincrement 0.01 timeperiodofstep 1 minimumtimeincrement 1e-5 maximumtimeincrement 0.1 solver pardiso ccx step 1 add bc displacement 1 2 ccx step 1 add fieldoutput 1 2 -ccx step 1 add historyoutput 1 +#ccx step 1 add historyoutput 1 ccx result project job 1 totalincrement 2 scale 1 #ccx result project job 1 totalincrement 3 scale 0.5 @@ -93,6 +94,4 @@ ccx result project job 1 totalincrement 2 scale 1 #ccx result project job 1 totalincrement 6 scale 0.0625 ccx create job name "nonlinear" -#ccx run job 2 - - +#ccx run job 2 \ No newline at end of file diff --git a/examples/door_lock/Door_Lock_Assembly.sat b/examples/unfinished/door_lock/Door_Lock_Assembly.sat similarity index 100% rename from examples/door_lock/Door_Lock_Assembly.sat rename to examples/unfinished/door_lock/Door_Lock_Assembly.sat diff --git a/examples/door_lock/door_lock.jou b/examples/unfinished/door_lock/door_lock.jou similarity index 100% rename from examples/door_lock/door_lock.jou rename to examples/unfinished/door_lock/door_lock.jou diff --git a/examples/metal_forming/metal_forming.jou b/examples/unfinished/metal_forming/metal_forming.jou similarity index 81% rename from examples/metal_forming/metal_forming.jou rename to examples/unfinished/metal_forming/metal_forming.jou index cdaaee12..95b1e69c 100644 --- a/examples/metal_forming/metal_forming.jou +++ b/examples/unfinished/metal_forming/metal_forming.jou @@ -1,3 +1,5 @@ +#!cubit + reset # creating geometry #blank @@ -83,6 +85,15 @@ merge all mesh surface all + +#create vertices for reference points +create vertex x 25 y 35 z 0 +create vertex x 25 y 35 z 0 +create vertex x 85 y 35 z 0 +create vertex x 85 y 35 z 0 + +mesh vertex all + #sections ccx create section solid block 1 material 1 ccx create section solid block 2 material 2 @@ -92,12 +103,20 @@ ccx create section solid block 4 material 2 #nodesets nodeset 1 add curve 2 nodeset 1 name "nset_blank_symmetry" -nodeset 2 add surface 12 13 14 +nodeset 2 add curve 13 14 18 nodeset 2 name "nset_punch" -nodeset 3 add surface 16 17 18 +nodeset 3 add curve 27 28 32 nodeset 3 name "nset_holder" nodeset 4 add surface 20 21 22 nodeset 4 name "nset_die" +nodeset 5 add vertex 68 +nodeset 5 name "rp1_punch" +nodeset 6 add vertex 69 +nodeset 6 name "rp2_punch" +nodeset 7 add vertex 70 +nodeset 7 name "rp1_holder" +nodeset 8 add vertex 71 +nodeset 8 name "rp2_holder" #sidesets sideset 1 add curve 1 3 @@ -109,6 +128,10 @@ sideset 3 name "Part_Holder" sideset 4 add curve 66 64 45 70 68 sideset 4 name "Part_Die" +# constraints +ccx create constraint rigid body nodeset 2 ref 68 rot 69 +ccx create constraint rigid body nodeset 3 ref 70 rot 71 + #contact ccx create surfaceinteraction name "ContactType" linear slopeK 1e6 sigmaINF 3 c0 1e-2 ccx modify surfaceinteraction 1 friction mu 0.1 lambda 1 @@ -116,23 +139,28 @@ ccx modify surfaceinteraction 1 friction mu 0.1 lambda 1 ccx create contactpair surfaceinteraction 1 surfacetosurface master 2 slave 1 ccx create contactpair surfaceinteraction 1 surfacetosurface master 3 slave 1 ccx create contactpair surfaceinteraction 1 surfacetosurface master 4 slave 1 -#ccx modify contactpair 1 surfacetosurface adjust 0.01 -#ccx modify contactpair 2 surfacetosurface adjust 0.01 -#ccx modify contactpair 3 surfacetosurface adjust 0.01 #bcs -create displacement name "blank_step1" on nodeset 1 dof 1 dof 2 dof 3 fix -create displacement name "blank_step2" on nodeset 1 dof 1 dof 3 fix -ccx modify displacement 2 op new -create displacement name 'punch_fix' on nodeset 2 dof 1 dof 2 dof 3 fix -create displacement name 'punch_move' on nodeset 2 dof 2 fix -40 +#blank +create displacement name "blank" on nodeset 1 dof 1 dof 3 fix +#punch +create displacement name 'punch_fix_rp1' on nodeset 5 dof 1 dof 2 dof 3 fix +create displacement name 'punch_fix_rp2' on nodeset 6 dof 1 dof 2 dof 3 fix +create displacement name 'punch_move_rp1' on nodeset 5 dof 2 fix -40 modify displacement 4 dof 1 fix 0 modify displacement 4 dof 3 fix 0 -create displacement name 'holder_move' on nodeset 3 dof 2 fix -2.15e-3 +#holder +create displacement name 'holder_move_rp1' on nodeset 7 dof 2 fix -2.5e-3 +create displacement name 'holder_move_rp2' on nodeset 8 dof 1 dof 2 dof 3 fix modify displacement 5 dof 1 fix 0 modify displacement 5 dof 3 fix 0 +#create displacement name 'holder_force_rp1' on nodeset 7 dof 1 dof 3 fix +#die create displacement name 'die_fix' on nodeset 4 dof 1 dof 2 dof 3 fix +#loads +#create force on nodeset 7 force value 100 direction 0 -1 0 + #outputs ccx create fieldoutput name "nout" node ccx modify fieldoutput 1 node frequency 5 @@ -164,23 +192,17 @@ ccx modify historyoutput 3 contact key_off ccx create step name "hold" static ccx modify step 1 parameter nlgeom_yes ccx modify step 1 static initialtimeincrement 0.1 timeperiodofstep 1 minimumtimeincrement 1e-6 maximumtimeincrement 0.1 -ccx step 1 add bc displacement 1 3 5 6 +ccx step 1 add bc displacement 1 2 3 5 6 7 +#ccx step 1 add load force 1 ccx step 1 add fieldoutput 1 2 3 -ccx step 1 add historyoutput 1 2 3 - -ccx create step name "release_blank" static -ccx modify step 2 parameter nlgeom_yes -ccx modify step 2 static initialtimeincrement 0.1 timeperiodofstep 1 minimumtimeincrement 1e-6 maximumtimeincrement 0.1 -ccx step 2 add bc displacement 2 3 5 6 -ccx step 2 add fieldoutput 1 2 3 -ccx step 2 add historyoutput 1 2 3 +#ccx step 1 add historyoutput 1 2 3 ccx create step name "move_punch" static -ccx modify step 3 parameter nlgeom_yes inc 1000 -ccx modify step 3 static initialtimeincrement 0.00125 timeperiodofstep 1 minimumtimeincrement 1e-6 maximumtimeincrement 0.0025 -ccx step 3 add bc displacement 4 -ccx step 3 add fieldoutput 1 2 3 -ccx step 3 add historyoutput 1 2 3 +ccx modify step 2 parameter nlgeom_yes inc 1000 +ccx modify step 2 static initialtimeincrement 0.00125 timeperiodofstep 1 minimumtimeincrement 1e-6 maximumtimeincrement 0.0025 +ccx step 2 add bc displacement 5 +ccx step 2 add fieldoutput 1 2 3 +#ccx step 2 add historyoutput 1 2 3 ccx create job name "forming" -#ccx run job 1 \ No newline at end of file +#ccx run job 1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6620a32..3e867ba4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,9 +5,10 @@ project(Cubit-CalculiX) #set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2022.4/bin") #set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2023.4/cmake") #set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2023.6/cmake") -set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2023.8/cmake") +#set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2023.8/cmake") #set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2023.10/cmake") #set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2023.11/cmake") +set(CMAKE_PREFIX_PATH "/opt/Coreform-Cubit-2024.3/cmake") #set(CMAKE_PREFIX_PATH "C:/Program Files/Coreform Cubit 2023.8/cmake") #set(CMAKE_PREFIX_PATH "C:/Program Files/Coreform Cubit 2023.11/cmake") diff --git a/src/CalculiXComp.cpp b/src/CalculiXComp.cpp index 74cbbe19..c66400b9 100644 --- a/src/CalculiXComp.cpp +++ b/src/CalculiXComp.cpp @@ -210,8 +210,6 @@ void CalculiXComp::restore_settings() ccx_uo.mPathCGXName = "Path to CGX"; config.read_entry("PathParaView", ccx_uo.mPathParaView); ccx_uo.mPathParaViewName = "Path to ParaView"; - config.read_entry("Pathccx2paraview", ccx_uo.mPathccx2paraview); - ccx_uo.mPathccx2paraviewName = "Path to ccx2paraview"; config.read_entry("PathIcons", ccx_uo.mPathIcons); ccx_uo.mPathIconsName = "Path to Icons"; } @@ -225,7 +223,6 @@ void CalculiXComp::save_settings() config.write_num_entry("SolverThreads", ccx_uo.mSolverThreads); config.write_entry("PathCGX", ccx_uo.mPathCGX); config.write_entry("PathParaView", ccx_uo.mPathParaView); - config.write_entry("Pathccx2paraview", ccx_uo.mPathccx2paraview); config.write_entry("PathIcons", ccx_uo.mPathIcons); } diff --git a/src/CalculiXPlugin.cpp b/src/CalculiXPlugin.cpp index cfc9c8bc..8c779ae9 100644 --- a/src/CalculiXPlugin.cpp +++ b/src/CalculiXPlugin.cpp @@ -93,7 +93,6 @@ #include "ccxJobDeleteCommand.hpp" #include "ccxRunJobCommand.hpp" #include "ccxWaitJobCommand.hpp" -#include "ccxResultccx2paraviewJobCommand.hpp" #include "ccxResultCGXJobCommand.hpp" #include "ccxResultParaViewJobCommand.hpp" #include "ccxResultLoadJobCommand.hpp" @@ -212,7 +211,6 @@ std::vector CalculiXPlugin::get_keys() keys.push_back("ccxRunJobCommand"); keys.push_back("ccxWaitJobCommand"); keys.push_back("ccxKillJobCommand"); - keys.push_back("ccxResultccx2paraviewJobCommand"); keys.push_back("ccxResultCGXJobCommand"); keys.push_back("ccxResultParaViewJobCommand"); keys.push_back("ccxResultLoadJobCommand"); @@ -511,9 +509,6 @@ CubitCommand* CalculiXPlugin::create_command(const std::string &key) else if(key == "ccxWaitJobCommand") return new ccxWaitJobCommand(); - - else if(key == "ccxResultccx2paraviewJobCommand") - return new ccxResultccx2paraviewJobCommand(); else if(key == "ccxResultCGXJobCommand") return new ccxResultCGXJobCommand(); diff --git a/src/Commands/CMakeLists.txt b/src/Commands/CMakeLists.txt index 4334eb21..1a2d6a51 100644 --- a/src/Commands/CMakeLists.txt +++ b/src/Commands/CMakeLists.txt @@ -195,8 +195,6 @@ set(CMD_SRC ${CMAKE_CURRENT_LIST_DIR}/ccxResultConvertJobCommand.hpp ${CMAKE_CURRENT_LIST_DIR}/ccxResultProjectJobCommand.cpp ${CMAKE_CURRENT_LIST_DIR}/ccxResultProjectJobCommand.hpp - ${CMAKE_CURRENT_LIST_DIR}/ccxResultccx2paraviewJobCommand.cpp - ${CMAKE_CURRENT_LIST_DIR}/ccxResultccx2paraviewJobCommand.hpp ${CMAKE_CURRENT_LIST_DIR}/ccxResultCGXJobCommand.cpp ${CMAKE_CURRENT_LIST_DIR}/ccxResultCGXJobCommand.hpp ${CMAKE_CURRENT_LIST_DIR}/ccxResultParaViewJobCommand.cpp diff --git a/src/Commands/ccxResultccx2paraviewJobCommand.cpp b/src/Commands/ccxResultccx2paraviewJobCommand.cpp deleted file mode 100644 index 94cc3612..00000000 --- a/src/Commands/ccxResultccx2paraviewJobCommand.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "ccxResultccx2paraviewJobCommand.hpp" -#include "CubitInterface.hpp" -#include "CubitMessage.hpp" -#include "CalculiXCoreInterface.hpp" - -ccxResultccx2paraviewJobCommand::ccxResultccx2paraviewJobCommand() -{} - -ccxResultccx2paraviewJobCommand::~ccxResultccx2paraviewJobCommand() -{} - -std::vector ccxResultccx2paraviewJobCommand::get_syntax() -{ - std::vector syntax_list; - - std::string syntax = "ccx "; - syntax.append("result ccx2paraview job '>"); - syntax_list.push_back(syntax); - - return syntax_list; -} - -std::vector ccxResultccx2paraviewJobCommand::get_syntax_help() -{ - std::vector help(1); - help[0] = "ccx result ccx2paraview job "; - - return help; -} - -std::vector ccxResultccx2paraviewJobCommand::get_help() -{ - std::vector help; - return help; -} - -bool ccxResultccx2paraviewJobCommand::execute(CubitCommandData &data) -{ - CalculiXCoreInterface ccx_iface; - - std::string output; - - int job_id; - - data.get_value("job_id", job_id); - - if (!ccx_iface.result_ccx2paraview_job(job_id)) - { - output = "Failed!\n"; - PRINT_ERROR(output.c_str()); - } - - return true; -} \ No newline at end of file diff --git a/src/Commands/ccxResultccx2paraviewJobCommand.hpp b/src/Commands/ccxResultccx2paraviewJobCommand.hpp deleted file mode 100644 index 9f10a11e..00000000 --- a/src/Commands/ccxResultccx2paraviewJobCommand.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef CCXRESULTCCX2PARAVIEWJOBCOMMAND_HPP -#define CCXRESULTCCX2PARAVIEWJOBCOMMAND_HPP - -#include "CubitCommandInterface.hpp" - -class ccxResultccx2paraviewJobCommand : public CubitCommand -{ -public: - ccxResultccx2paraviewJobCommand(); - ~ccxResultccx2paraviewJobCommand(); - - std::vector get_syntax(); - std::vector get_syntax_help(); - std::vector get_help(); - bool execute(CubitCommandData &data); -}; - -#endif // CCXRESULTCCX2PARAVIEWJOBCOMMAND_HPP \ No newline at end of file diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index daab044b..0db6c170 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -61,4 +61,6 @@ set(CORE_SRC ${CMAKE_CURRENT_LIST_DIR}/CoreTimer.hpp ${CMAKE_CURRENT_LIST_DIR}/CoreCustomLines.cpp ${CMAKE_CURRENT_LIST_DIR}/CoreCustomLines.hpp + ${CMAKE_CURRENT_LIST_DIR}/CoreDraw.cpp + ${CMAKE_CURRENT_LIST_DIR}/CoreDraw.hpp PARENT_SCOPE) \ No newline at end of file diff --git a/src/Core/CalculiXCore.cpp b/src/Core/CalculiXCore.cpp index ec50be02..6bb1a8e6 100644 --- a/src/Core/CalculiXCore.cpp +++ b/src/Core/CalculiXCore.cpp @@ -2092,11 +2092,6 @@ bool CalculiXCore::set_job_conversion(int job_id, int conversion) return jobs->set_job_conversion(job_id,conversion); } -bool CalculiXCore::result_ccx2paraview_job(int job_id) -{ - return jobs->result_ccx2paraview_job(job_id); -} - bool CalculiXCore::result_cgx_job(int job_id) { return jobs->result_cgx_job(job_id); diff --git a/src/Core/CalculiXCore.hpp b/src/Core/CalculiXCore.hpp index aa584f53..c7c91eec 100644 --- a/src/Core/CalculiXCore.hpp +++ b/src/Core/CalculiXCore.hpp @@ -150,7 +150,6 @@ class CalculiXCore bool wait_job(int job_id); // runs job bool kill_job(int job_id); // runs job bool set_job_conversion(int job_id, int conversion); // sets the paraview conversion value for the job - bool result_ccx2paraview_job(int job_id); // converts the result with ccx2paraview bool result_cgx_job(int job_id); // opens the results with cgx bool result_paraview_job(int job_id); // opens the results with paraview std::vector get_job_data(int job_id); diff --git a/src/Core/CalculiXCoreInterface.cpp b/src/Core/CalculiXCoreInterface.cpp index 4ab9ac92..39b7be36 100644 --- a/src/Core/CalculiXCoreInterface.cpp +++ b/src/Core/CalculiXCoreInterface.cpp @@ -505,11 +505,6 @@ bool CalculiXCoreInterface::set_job_conversion(int job_id, int conversion) return ccx_core.set_job_conversion(job_id,conversion); } -bool CalculiXCoreInterface::result_ccx2paraview_job(int job_id) -{ - return ccx_core.result_ccx2paraview_job(job_id); -} - bool CalculiXCoreInterface::result_cgx_job(int job_id) { return ccx_core.result_cgx_job(job_id); diff --git a/src/Core/CalculiXCoreInterface.hpp b/src/Core/CalculiXCoreInterface.hpp index 24afc378..b1205c84 100644 --- a/src/Core/CalculiXCoreInterface.hpp +++ b/src/Core/CalculiXCoreInterface.hpp @@ -117,7 +117,6 @@ class CalculiXCoreInterface bool wait_job(int job_id); // runs job bool kill_job(int job_id); // runs job bool set_job_conversion(int job_id, int conversion); // sets the paraview conversion value for the job - bool result_ccx2paraview_job(int job_id); // converts the result with ccx2paraview bool result_cgx_job(int job_id); // opens the results with cgx bool result_paraview_job(int job_id); // opens the results with paraview std::vector get_job_data(int job_id); diff --git a/src/Core/CoreDraw.cpp b/src/Core/CoreDraw.cpp new file mode 100644 index 00000000..73f3e3dc --- /dev/null +++ b/src/Core/CoreDraw.cpp @@ -0,0 +1,9 @@ +#include "CoreDraw.hpp" +#include "CubitInterface.hpp" +#include "CalculiXCoreInterface.hpp" + +CoreDraw::CoreDraw() +{} + +CoreDraw::~CoreDraw() +{} diff --git a/src/Core/CoreDraw.hpp b/src/Core/CoreDraw.hpp new file mode 100644 index 00000000..a2a8defa --- /dev/null +++ b/src/Core/CoreDraw.hpp @@ -0,0 +1,27 @@ +#ifndef COREDRAW_HPP +#define COREDRAW_HPP + +#include +#include + +class CalculiXCoreInterface; + +// class for drawing of loads and bcs + +//draw polygon location pos -1 -1 0 location pos 1 -1 0 location pos 1 1 0 location pos -1 1 0 color yellow no_flush +//draw line location pos -1 0 0 location pos 1 0 0 color blue no_flush +//draw line location pos 0 -1 0 location pos 0 1 0 color blue no_flush +//draw location pos 0 0 0 color red no_flush +//graphics flush + +class CoreDraw +{ + +public: + CoreDraw(); + ~CoreDraw(); + + CalculiXCoreInterface *ccx_iface; +}; + +#endif // COREDRAW_HPP \ No newline at end of file diff --git a/src/Core/CoreJobs.cpp b/src/Core/CoreJobs.cpp index ddf26460..51eb2413 100644 --- a/src/Core/CoreJobs.cpp +++ b/src/Core/CoreJobs.cpp @@ -3,8 +3,6 @@ #include "CubitInterface.hpp" #include "CubitMessage.hpp" -#include "PyBroker.hpp" - #include "CubitProcess.hpp" #include "CubitString.hpp" #include "ProgressTool.hpp" @@ -523,43 +521,6 @@ bool CoreJobs::check_zombie() return true; } -bool CoreJobs::result_ccx2paraview_job(int job_id) -{ - std::string log; - std::string filepath; - std::vector cmd; - - if (access(ccx_uo.mPathccx2paraview.toStdString().c_str(), F_OK) == 0) - { - }else{ - log = "ccx2paraview not found! checked path \"" + ccx_uo.mPathccx2paraview.toStdString() + "\" \n"; - PRINT_INFO("%s", log.c_str()); - return false; - } - - int job_data_id; - job_data_id = get_jobs_data_id_from_job_id(job_id); - if (job_data_id != -1) - { - if (std::stoi(jobs_data[job_data_id][3])>1) - { - std::string shellstr; - shellstr = "rm " + jobs_data[job_data_id][1] + "*vtk"; - system(shellstr.c_str()); - - filepath = jobs_data[job_data_id][1] + ".frd"; - cmd.push_back("import subprocess"); - cmd.push_back("print('Converting Results... GUI may freeze. This can take some time.')"); - cmd.push_back("returned_value = subprocess.call(\"python3 " + ccx_uo.mPathccx2paraview.toStdString() + " " + filepath + " vtk\",shell=True)"); - cmd.push_back("if returned_value==0: print('Finished')\nelse:print('Error occurred!')"); - PyBroker::run_script(cmd); - jobs_data[job_data_id][6] = "3"; - } - } - - return true; -} - bool CoreJobs::result_cgx_job(int job_id) { std::string filepath; @@ -646,23 +607,6 @@ bool CoreJobs::result_paraview_job(int job_id) shellstr = "nohup " + ccx_uo.mPathParaView.toStdString() + " --data=" + filepath + " &"; system(shellstr.c_str()); - log = "Opening Results with Paraview for Job " + jobs_data[job_data_id][1] + " with ID " + jobs_data[job_data_id][0] + "\n"; - //log.append(filepath + " \n"); - //log.append(arg + " \n"); - PRINT_INFO("%s", log.c_str()); - } - if ((std::stoi(jobs_data[job_data_id][3])>1) && (jobs_data[job_data_id][6] == "3")) - { - filepath = jobs_data[job_data_id][1] + ".vtk"; - if (access(filepath.c_str(), W_OK) != 0) - { - filepath = jobs_data[job_data_id][1] + "...vtk"; - } - - std::string shellstr; - shellstr = "nohup " + ccx_uo.mPathParaView.toStdString() + " --data=" + filepath + " &"; - system(shellstr.c_str()); - log = "Opening Results with Paraview for Job " + jobs_data[job_data_id][1] + " with ID " + jobs_data[job_data_id][0] + "\n"; //log.append(filepath + " \n"); //log.append(arg + " \n"); diff --git a/src/Core/CoreJobs.hpp b/src/Core/CoreJobs.hpp index e0f7a725..51be9d65 100644 --- a/src/Core/CoreJobs.hpp +++ b/src/Core/CoreJobs.hpp @@ -22,7 +22,7 @@ class CoreJobs // jobs_data[0][3] status -1 no process, 1 process running, 2 process finished, 3 process killed, 4 process finished with errors, 5 process running currently waiting // jobs_data[0][4] process id // jobs_data[0][5] Output Console data id - // jobs_data[0][6] converted to paraview -1 false, 1 true linked, 2 true unlinked, 3 ccx2paraview + // jobs_data[0][6] converted to paraview -1 false, 1 true linked, 2 true unlinked // jobs_data[0][7] .cvg data id // jobs_data[0][8] .sta data id // jobs_data[0][9] auto conversion 1, no conversion -1 @@ -49,7 +49,7 @@ class CoreJobs bool check_jobs(); // checks for changes of job processes bool get_cvgsta(int job_id); // gets filedata of .cvg and .sta bool check_zombie(); // checks for zombie processes - bool result_ccx2paraview_job(int job_id); // converts the result with ccx2paraview + //bool result_ccx2paraview_job(int job_id); // converts the result with ccx2paraview bool result_cgx_job(int job_id); // opens the results with cgx bool result_paraview_job(int job_id); // opens the results with paraview int get_jobs_data_id_from_job_id(int job_id); // searches for the job_id in the jobs_data and returns the indices or -1 if it fails diff --git a/src/Core/CoreResultsVtkWriter.cpp b/src/Core/CoreResultsVtkWriter.cpp index 76e9c88b..6bbbf8fb 100644 --- a/src/Core/CoreResultsVtkWriter.cpp +++ b/src/Core/CoreResultsVtkWriter.cpp @@ -1018,6 +1018,7 @@ int CoreResultsVtkWriter::get_step_increment(double total_time) int CoreResultsVtkWriter::get_max_step_increment() { + // for dat file int increment = 0; double last_total_time = 0; for (size_t i = 0; i < dat_all->total_times.size(); i++) @@ -1026,6 +1027,19 @@ int CoreResultsVtkWriter::get_max_step_increment() { ++increment; } + + /* + if (ccx_iface->to_string_scientific(double(int(dat_all->total_times[i]*100000))/100000,5)!=ccx_iface->to_string_scientific(double(int(last_total_time*100000))/100000,5)) + { + this->stopwatch(ccx_iface->to_string_scientific(double(int(dat_all->total_times[i]*100000))/100000,5)); + ++increment; + }else if (ccx_iface->to_string_scientific(dat_all->total_times[i],5)!=ccx_iface->to_string_scientific(last_total_time,5)) + { + this->stopwatch(ccx_iface->to_string_scientific(dat_all->total_times[i],5)); + ++increment; + } + */ + last_total_time = dat_all->total_times[i]; } return increment; diff --git a/src/ExportManager.cpp b/src/ExportManager.cpp index 9091491f..da6e3b30 100644 --- a/src/ExportManager.cpp +++ b/src/ExportManager.cpp @@ -1,73 +1,88 @@ -/*! - * \file ExportManager.cpp - * \brief - * Contains the implementation of the ExportManager class. - * \author Michael Plooster - * \date 27 Mar 2014 - */ - -#include "ExportManager.hpp" -#include "Claro.hpp" -#include "ClaroFileMenu.hpp" -#include "CommandWindow.hpp" - -ExportManager::ExportManager(QObject *parent) : - QObject(parent) -{} - -ExportManager::~ExportManager() -{} - -void ExportManager::add_export_types() -{ - Claro *gui = Claro::instance(); - if(gui) - { - // Get the file menu - ClaroFileMenu *file_menu = gui->file_menu(); - - // Add my filters to the export dialog. Note that you can add multiple - // export filters at once by separating the list with semicolons. - QString filter_names = "MyExport (*.me);;AnotherExport (*.ae)"; - QObject *filter = file_menu->add_export(filter_names.toUtf8().data(), - "mycomp"); - - // Connect the filter to the method that will handle the export - connect(filter, SIGNAL(filterSelected(const QString&, const QString&)), - this, SLOT(handle_export(const QString&, const QString&))); - } -} - -void ExportManager::remove_export_types() -{ - Claro *gui = Claro::instance(); - if(gui) - { - ClaroFileMenu *file_menu = gui->file_menu(); - file_menu->remove_component_items("mycomp"); - } -} - -void ExportManager::handle_export(const QString &filename, const QString &filter) -{ - // Handle the export with the given filename and filter. At this point, I - // could create an export dialog to give the user more options or simply - // send an export command (provided I have implemented a command plugin for - // my export command). - - CommandWindow* cw = Claro::instance()->command_line(); - QString message = "The \"" + filter + "\" filter was selected "; - message += "with the filename \"" + filename + "\"\n"; - cw->print_data(message); - - // Here we can do things specific to the export type, based on the filter - // that was selected. - if(filter.contains("MyExport")) - { - cw->print_data("MyExport is not implemented.\n"); - } - else if(filter.contains("AnotherExport")) - { - cw->print_data("AnotherExport is not implemented.\n"); - } -} +/*! + * \file ExportManager.cpp + * \brief + * Contains the implementation of the ExportManager class. + * \author Michael Plooster + * \date 27 Mar 2014 + */ + +#include "ExportManager.hpp" +#include "Claro.hpp" +#include "ClaroFileMenu.hpp" +#include "CommandWindow.hpp" +#include "ImportExportHandler.hpp" + +class ExportHandler : public ImportExportHandler +{ +public: + ExportManager* mIO; + ExportHandler(ExportManager* io) + : ImportExportHandler("mycomp"), mIO(io) + {} + + void io_handler(const QString& fileName, const QString& filter) + { + mIO->handle_export(fileName, filter); + } +}; + +ExportManager::ExportManager(QObject *parent) : + QObject(parent) +{ + mExportHandler = new ExportHandler(this); +} + +ExportManager::~ExportManager() +{ + delete mExportHandler; +} + +void ExportManager::add_export_types() +{ + Claro *gui = Claro::instance(); + if(gui) + { + // Get the file menu + ClaroFileMenu *file_menu = gui->file_menu(); + + // Add my filters to the export dialog. Note that you can add multiple + // export filters at once by separating the list with semicolons. + QString filter_names = "MyExport (*.me);;AnotherExport (*.ae)"; + mExportHandler->mFilters = filter_names; + file_menu->add_export(mExportHandler); + } +} + +void ExportManager::remove_export_types() +{ + Claro *gui = Claro::instance(); + if(gui) + { + ClaroFileMenu *file_menu = gui->file_menu(); + file_menu->remove_component_items("mycomp"); + } +} + +void ExportManager::handle_export(const QString &filename, const QString &filter) +{ + // Handle the export with the given filename and filter. At this point, I + // could create an export dialog to give the user more options or simply + // send an export command (provided I have implemented a command plugin for + // my export command). + + CommandWindow* cw = Claro::instance()->command_line(); + QString message = "The \"" + filter + "\" filter was selected "; + message += "with the filename \"" + filename + "\"\n"; + cw->print_data(message); + + // Here we can do things specific to the export type, based on the filter + // that was selected. + if(filter.contains("MyExport")) + { + cw->print_data("MyExport is not implemented.\n"); + } + else if(filter.contains("AnotherExport")) + { + cw->print_data("AnotherExport is not implemented.\n"); + } +} diff --git a/src/ExportManager.hpp b/src/ExportManager.hpp index 43b7c2c3..8b8b5db9 100644 --- a/src/ExportManager.hpp +++ b/src/ExportManager.hpp @@ -1,38 +1,42 @@ -/*! - * \file ExportManager.hpp - * \brief - * Provides an example showing how to add custom file filters - * to the export dialog in the file menu. - * \author Michael Plooster - * \date 27 Mar 2014 - */ - -#ifndef EXPORTMANAGER_HPP -#define EXPORTMANAGER_HPP - -#include - -class ExportManager : public QObject -{ - Q_OBJECT - -public: - ExportManager(QObject* parent = 0); - ~ExportManager(); - - //! Add my custom export file types to the file menu - void add_export_types(); - - //! Remove my custom export file types from the file menu - void remove_export_types(); - -public slots: - //! Called when one of my export filters has been selected - //! \param filename The filename selected by the user. By the time this function - //! is called, if a file with the given name already exists, the user has - //! already indicated they wish to overwrite it. - //! \param filter The specific filter that was selected. - void handle_export(const QString& filename, const QString& filter); -}; - -#endif // EXPORTMANAGER_HPP +/*! + * \file ExportManager.hpp + * \brief + * Provides an example showing how to add custom file filters + * to the export dialog in the file menu. + * \author Michael Plooster + * \date 27 Mar 2014 + */ + +#ifndef EXPORTMANAGER_HPP +#define EXPORTMANAGER_HPP + +#include + +class ExportHandler; + +class ExportManager : public QObject +{ + Q_OBJECT + +public: + ExportManager(QObject* parent = 0); + ~ExportManager(); + + //! Add my custom export file types to the file menu + void add_export_types(); + + //! Remove my custom export file types from the file menu + void remove_export_types(); + +public slots: + //! Called when one of my export filters has been selected + //! \param filename The filename selected by the user. By the time this function + //! is called, if a file with the given name already exists, the user has + //! already indicated they wish to overwrite it. + //! \param filter The specific filter that was selected. + void handle_export(const QString& filename, const QString& filter); +private: + ExportHandler* mExportHandler; +}; + +#endif // EXPORTMANAGER_HPP diff --git a/src/GUI/AmplitudesCreatePanel.cpp b/src/GUI/AmplitudesCreatePanel.cpp index 77643611..295c9131 100644 --- a/src/GUI/AmplitudesCreatePanel.cpp +++ b/src/GUI/AmplitudesCreatePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" AmplitudesCreatePanel::AmplitudesCreatePanel(QWidget *parent) : @@ -138,15 +137,8 @@ void AmplitudesCreatePanel::on_pushButton_apply_clicked(bool) widget_5->update({"Time","Amplitude"},matrix); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/AmplitudesDeletePanel.cpp b/src/GUI/AmplitudesDeletePanel.cpp index 78e06231..35f629bc 100644 --- a/src/GUI/AmplitudesDeletePanel.cpp +++ b/src/GUI/AmplitudesDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" AmplitudesDeletePanel::AmplitudesDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void AmplitudesDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/AmplitudesModifyPanel.cpp b/src/GUI/AmplitudesModifyPanel.cpp index 4a65cd3c..c5fd5909 100644 --- a/src/GUI/AmplitudesModifyPanel.cpp +++ b/src/GUI/AmplitudesModifyPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" AmplitudesModifyPanel::AmplitudesModifyPanel(QWidget *parent) : @@ -155,15 +154,9 @@ void AmplitudesModifyPanel::on_pushButton_apply_clicked(bool) widget_5->update({"Time","Amplitude"},matrix); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + for (size_t i = 0; i < commands.size(); i++) + { + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/BCsDisplacementsModifyPanel.cpp b/src/GUI/BCsDisplacementsModifyPanel.cpp index 4bee942f..1db037fa 100644 --- a/src/GUI/BCsDisplacementsModifyPanel.cpp +++ b/src/GUI/BCsDisplacementsModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" BCsDisplacementsModifyPanel::BCsDisplacementsModifyPanel(QWidget *parent) : @@ -193,15 +192,8 @@ void BCsDisplacementsModifyPanel::on_pushButton_apply_clicked(bool) checkBox_9->setChecked(false); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/BCsTemperaturesModifyPanel.cpp b/src/GUI/BCsTemperaturesModifyPanel.cpp index 1105458d..03927eb8 100644 --- a/src/GUI/BCsTemperaturesModifyPanel.cpp +++ b/src/GUI/BCsTemperaturesModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" BCsTemperaturesModifyPanel::BCsTemperaturesModifyPanel(QWidget *parent) : @@ -129,15 +128,8 @@ void BCsTemperaturesModifyPanel::on_pushButton_apply_clicked(bool) comboBox_4->setCurrentIndex(0); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/CCXBlocksElementTypePanel.cpp b/src/GUI/CCXBlocksElementTypePanel.cpp index 65495fd1..4c3fc23c 100644 --- a/src/GUI/CCXBlocksElementTypePanel.cpp +++ b/src/GUI/CCXBlocksElementTypePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" #include "PickWidget.hpp" @@ -350,7 +349,7 @@ void CCXBlocksElementTypePanel::on_pushButton_apply_clicked(bool) commands.push_back(command); PickWidget_1->setText(""); } - + /* // We must send the Cubit commands through the Claro framework, so first we need to translate // the commands into the python form that Claro will understand. ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); @@ -362,4 +361,9 @@ void CCXBlocksElementTypePanel::on_pushButton_apply_clicked(bool) // Send the translated commands Claro::instance()->send_gui_commands(commands); } + */ + for (size_t i = 0; i < commands.size(); i++) + { + CubitInterface::cmd(commands[i].toStdString().c_str()); + } } diff --git a/src/GUI/ConstraintsCreateRigidBodyPanel.cpp b/src/GUI/ConstraintsCreateRigidBodyPanel.cpp index ea06a303..d8fe5cec 100644 --- a/src/GUI/ConstraintsCreateRigidBodyPanel.cpp +++ b/src/GUI/ConstraintsCreateRigidBodyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ConstraintsCreateRigidBodyPanel::ConstraintsCreateRigidBodyPanel(QWidget *parent) : @@ -115,16 +114,9 @@ void ConstraintsCreateRigidBodyPanel::on_pushButton_apply_clicked(bool) lineEdit_4->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/ConstraintsCreateTiePanel.cpp b/src/GUI/ConstraintsCreateTiePanel.cpp index 10e4159a..f9636768 100644 --- a/src/GUI/ConstraintsCreateTiePanel.cpp +++ b/src/GUI/ConstraintsCreateTiePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ConstraintsCreateTiePanel::ConstraintsCreateTiePanel(QWidget *parent) : @@ -97,16 +96,9 @@ void ConstraintsCreateTiePanel::on_pushButton_apply_clicked(bool) lineEdit_3->setText(""); lineEdit_4->setText(""); } - - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/ConstraintsDeletePanel.cpp b/src/GUI/ConstraintsDeletePanel.cpp index 4d1b84df..ed4cfa4d 100644 --- a/src/GUI/ConstraintsDeletePanel.cpp +++ b/src/GUI/ConstraintsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ConstraintsDeletePanel::ConstraintsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void ConstraintsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/ConstraintsModifyRigidBodyPanel.cpp b/src/GUI/ConstraintsModifyRigidBodyPanel.cpp index 174134e2..aeb42b70 100644 --- a/src/GUI/ConstraintsModifyRigidBodyPanel.cpp +++ b/src/GUI/ConstraintsModifyRigidBodyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ConstraintsModifyRigidBodyPanel::ConstraintsModifyRigidBodyPanel(QWidget *parent) : @@ -135,16 +134,9 @@ void ConstraintsModifyRigidBodyPanel::on_pushButton_apply_clicked(bool) lineEdit_4->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/ConstraintsModifyTiePanel.cpp b/src/GUI/ConstraintsModifyTiePanel.cpp index b4262c91..ff20726e 100644 --- a/src/GUI/ConstraintsModifyTiePanel.cpp +++ b/src/GUI/ConstraintsModifyTiePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ConstraintsModifyTiePanel::ConstraintsModifyTiePanel(QWidget *parent) : @@ -120,15 +119,8 @@ void ConstraintsModifyTiePanel::on_pushButton_apply_clicked(bool) lineEdit_4->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/ContactPairsCreatePanel.cpp b/src/GUI/ContactPairsCreatePanel.cpp index e5e1eb1d..04fafedc 100644 --- a/src/GUI/ContactPairsCreatePanel.cpp +++ b/src/GUI/ContactPairsCreatePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ContactPairsCreatePanel::ContactPairsCreatePanel(QWidget *parent) : @@ -139,16 +138,9 @@ void ContactPairsCreatePanel::on_pushButton_apply_clicked(bool) lineEdit_6->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/ContactPairsDeletePanel.cpp b/src/GUI/ContactPairsDeletePanel.cpp index 0c22b39a..f598a08c 100644 --- a/src/GUI/ContactPairsDeletePanel.cpp +++ b/src/GUI/ContactPairsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ContactPairsDeletePanel::ContactPairsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void ContactPairsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/ContactPairsModifyPanel.cpp b/src/GUI/ContactPairsModifyPanel.cpp index fc060979..6547c2dd 100644 --- a/src/GUI/ContactPairsModifyPanel.cpp +++ b/src/GUI/ContactPairsModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" ContactPairsModifyPanel::ContactPairsModifyPanel(QWidget *parent) : @@ -162,16 +161,9 @@ void ContactPairsModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_6->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/CustomLinesCreatePanel.cpp b/src/GUI/CustomLinesCreatePanel.cpp index aaeae4cf..ebb093b2 100644 --- a/src/GUI/CustomLinesCreatePanel.cpp +++ b/src/GUI/CustomLinesCreatePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" CustomLinesCreatePanel::CustomLinesCreatePanel(QWidget *parent) : QWidget(parent), @@ -120,16 +119,9 @@ void CustomLinesCreatePanel::on_pushButton_apply_clicked(bool) lineEdit_5->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/CustomLinesDeletePanel.cpp b/src/GUI/CustomLinesDeletePanel.cpp index 18089c57..c82db3c8 100644 --- a/src/GUI/CustomLinesDeletePanel.cpp +++ b/src/GUI/CustomLinesDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" CustomLinesDeletePanel::CustomLinesDeletePanel(QWidget *parent) : @@ -64,15 +63,9 @@ void CustomLinesDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/CustomLinesModifyPanel.cpp b/src/GUI/CustomLinesModifyPanel.cpp index 6bb28d38..20d445b7 100644 --- a/src/GUI/CustomLinesModifyPanel.cpp +++ b/src/GUI/CustomLinesModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" CustomLinesModifyPanel::CustomLinesModifyPanel(QWidget *parent) : QWidget(parent), @@ -143,16 +142,9 @@ void CustomLinesModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_5->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/FieldOutputsCreatePanel.cpp b/src/GUI/FieldOutputsCreatePanel.cpp index 753bfdbc..890c0201 100644 --- a/src/GUI/FieldOutputsCreatePanel.cpp +++ b/src/GUI/FieldOutputsCreatePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" FieldOutputsCreatePanel::FieldOutputsCreatePanel(QWidget *parent) : @@ -90,15 +89,8 @@ void FieldOutputsCreatePanel::on_pushButton_apply_clicked(bool) comboBox_2->setCurrentIndex(0); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/FieldOutputsDeletePanel.cpp b/src/GUI/FieldOutputsDeletePanel.cpp index 5888e3a7..564cb47a 100644 --- a/src/GUI/FieldOutputsDeletePanel.cpp +++ b/src/GUI/FieldOutputsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" FieldOutputsDeletePanel::FieldOutputsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void FieldOutputsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/FieldOutputsModifyContactPanel.cpp b/src/GUI/FieldOutputsModifyContactPanel.cpp index 7a647e90..58ad4662 100644 --- a/src/GUI/FieldOutputsModifyContactPanel.cpp +++ b/src/GUI/FieldOutputsModifyContactPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" FieldOutputsModifyContactPanel::FieldOutputsModifyContactPanel(QWidget *parent) : @@ -196,15 +195,8 @@ void FieldOutputsModifyContactPanel::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/FieldOutputsModifyElementPanel.cpp b/src/GUI/FieldOutputsModifyElementPanel.cpp index 3048d6c0..9fb048b5 100644 --- a/src/GUI/FieldOutputsModifyElementPanel.cpp +++ b/src/GUI/FieldOutputsModifyElementPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" FieldOutputsModifyElementPanel::FieldOutputsModifyElementPanel(QWidget *parent) : @@ -303,15 +302,8 @@ void FieldOutputsModifyElementPanel::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/FieldOutputsModifyNodePanel.cpp b/src/GUI/FieldOutputsModifyNodePanel.cpp index bbc60fed..b05721dd 100644 --- a/src/GUI/FieldOutputsModifyNodePanel.cpp +++ b/src/GUI/FieldOutputsModifyNodePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" FieldOutputsModifyNodePanel::FieldOutputsModifyNodePanel(QWidget *parent) : @@ -307,16 +306,9 @@ void FieldOutputsModifyNodePanel::on_pushButton_apply_clicked(bool) checkBox_keys[i]->setChecked(false); } } - - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/HBCsManagement.cpp b/src/GUI/HBCsManagement.cpp index 4c077e29..708e64e5 100644 --- a/src/GUI/HBCsManagement.cpp +++ b/src/GUI/HBCsManagement.cpp @@ -5,7 +5,6 @@ #include "CubitMessage.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" HBCsManagement::HBCsManagement() { @@ -372,16 +371,9 @@ void HBCsManagement::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } this->update(); diff --git a/src/GUI/HistoryOutputsCreatePanel.cpp b/src/GUI/HistoryOutputsCreatePanel.cpp index a5f22d49..73f8c00a 100644 --- a/src/GUI/HistoryOutputsCreatePanel.cpp +++ b/src/GUI/HistoryOutputsCreatePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" HistoryOutputsCreatePanel::HistoryOutputsCreatePanel(QWidget *parent) : @@ -90,15 +89,8 @@ void HistoryOutputsCreatePanel::on_pushButton_apply_clicked(bool) comboBox_2->setCurrentIndex(0); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/HistoryOutputsDeletePanel.cpp b/src/GUI/HistoryOutputsDeletePanel.cpp index 38457d05..79b70d55 100644 --- a/src/GUI/HistoryOutputsDeletePanel.cpp +++ b/src/GUI/HistoryOutputsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" HistoryOutputsDeletePanel::HistoryOutputsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void HistoryOutputsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/HistoryOutputsModifyContactPanel.cpp b/src/GUI/HistoryOutputsModifyContactPanel.cpp index 37eabdf5..12a5c125 100644 --- a/src/GUI/HistoryOutputsModifyContactPanel.cpp +++ b/src/GUI/HistoryOutputsModifyContactPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" HistoryOutputsModifyContactPanel::HistoryOutputsModifyContactPanel(QWidget *parent) : @@ -228,15 +227,8 @@ void HistoryOutputsModifyContactPanel::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/HistoryOutputsModifyElementPanel.cpp b/src/GUI/HistoryOutputsModifyElementPanel.cpp index 196f1915..6bac22b2 100644 --- a/src/GUI/HistoryOutputsModifyElementPanel.cpp +++ b/src/GUI/HistoryOutputsModifyElementPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" HistoryOutputsModifyElementPanel::HistoryOutputsModifyElementPanel(QWidget *parent) : @@ -228,15 +227,8 @@ void HistoryOutputsModifyElementPanel::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/HistoryOutputsModifyNodePanel.cpp b/src/GUI/HistoryOutputsModifyNodePanel.cpp index 89729b19..bcca11df 100644 --- a/src/GUI/HistoryOutputsModifyNodePanel.cpp +++ b/src/GUI/HistoryOutputsModifyNodePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" HistoryOutputsModifyNodePanel::HistoryOutputsModifyNodePanel(QWidget *parent) : @@ -228,15 +227,8 @@ void HistoryOutputsModifyNodePanel::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/InitialConditionsCreatePanel.cpp b/src/GUI/InitialConditionsCreatePanel.cpp index d84ac48b..9f8f4d09 100644 --- a/src/GUI/InitialConditionsCreatePanel.cpp +++ b/src/GUI/InitialConditionsCreatePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" InitialConditionsCreatePanel::InitialConditionsCreatePanel(QWidget *parent) : @@ -85,15 +84,8 @@ void InitialConditionsCreatePanel::on_pushButton_apply_clicked(bool) comboBox_2->setCurrentIndex(0); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/InitialConditionsDeletePanel.cpp b/src/GUI/InitialConditionsDeletePanel.cpp index fdfb0b06..5d0a59c3 100644 --- a/src/GUI/InitialConditionsDeletePanel.cpp +++ b/src/GUI/InitialConditionsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" InitialConditionsDeletePanel::InitialConditionsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void InitialConditionsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/InitialConditionsModifyPanel.cpp b/src/GUI/InitialConditionsModifyPanel.cpp index 45c04e5d..eda317aa 100644 --- a/src/GUI/InitialConditionsModifyPanel.cpp +++ b/src/GUI/InitialConditionsModifyPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" InitialConditionsModifyPanel::InitialConditionsModifyPanel(QWidget *parent) : @@ -98,16 +97,9 @@ void InitialConditionsModifyPanel::on_pushButton_apply_clicked(bool) comboBox_2->setCurrentIndex(0); lineEdit_3->setText(""); } - - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + for (size_t i = 0; i < commands.size(); i++) + { + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/JobsActionsPanel.cpp b/src/GUI/JobsActionsPanel.cpp index a4edd77f..fec569bb 100644 --- a/src/GUI/JobsActionsPanel.cpp +++ b/src/GUI/JobsActionsPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" JobsActionsPanel::JobsActionsPanel(QWidget *parent) : @@ -42,12 +41,6 @@ JobsActionsPanel::JobsActionsPanel(QWidget *parent) : HBoxLayout_pushButton_result_cgx = new QHBoxLayout(); horizontal_spacer_pushButton_result_cgx = new QSpacerItem(1,1,QSizePolicy::Expanding,QSizePolicy::Minimum); - pushButton_result_ccx2paraview = new QPushButton(); - pushButton_result_ccx2paraview->setText("ccx2paraview"); - pushButton_result_ccx2paraview->setFixedWidth(buttonWidth); - HBoxLayout_pushButton_result_ccx2paraview = new QHBoxLayout(); - horizontal_spacer_pushButton_result_ccx2paraview = new QSpacerItem(1,1,QSizePolicy::Expanding,QSizePolicy::Minimum); - pushButton_result_paraview = new QPushButton(); pushButton_result_paraview->setText("Result Paraview"); pushButton_result_paraview->setFixedWidth(buttonWidth); @@ -62,7 +55,6 @@ JobsActionsPanel::JobsActionsPanel(QWidget *parent) : VBoxLayout->addLayout(HBoxLayout_pushButton_run); VBoxLayout->addLayout(HBoxLayout_pushButton_kill); VBoxLayout->addLayout(HBoxLayout_pushButton_result_cgx); - VBoxLayout->addLayout(HBoxLayout_pushButton_result_ccx2paraview); VBoxLayout->addLayout(HBoxLayout_pushButton_result_paraview); VBoxLayout->addItem(vertical_spacer); @@ -78,16 +70,12 @@ JobsActionsPanel::JobsActionsPanel(QWidget *parent) : HBoxLayout_pushButton_result_cgx->addItem(horizontal_spacer_pushButton_result_cgx); HBoxLayout_pushButton_result_cgx->addWidget(pushButton_result_cgx); - HBoxLayout_pushButton_result_ccx2paraview->addItem(horizontal_spacer_pushButton_result_ccx2paraview); - HBoxLayout_pushButton_result_ccx2paraview->addWidget(pushButton_result_ccx2paraview); - HBoxLayout_pushButton_result_paraview->addItem(horizontal_spacer_pushButton_result_paraview); HBoxLayout_pushButton_result_paraview->addWidget(pushButton_result_paraview); QObject::connect(pushButton_run, SIGNAL(clicked(bool)),this, SLOT(on_pushButton_run_clicked(bool))); QObject::connect(pushButton_kill, SIGNAL(clicked(bool)),this, SLOT(on_pushButton_kill_clicked(bool))); QObject::connect(pushButton_result_cgx, SIGNAL(clicked(bool)),this, SLOT(on_pushButton_result_cgx_clicked(bool))); - QObject::connect(pushButton_result_ccx2paraview, SIGNAL(clicked(bool)),this, SLOT(on_pushButton_result_ccx2paraview_clicked(bool))); QObject::connect(pushButton_result_paraview, SIGNAL(clicked(bool)),this, SLOT(on_pushButton_result_paraview_clicked(bool))); isInitialized = true; @@ -112,16 +100,9 @@ void JobsActionsPanel::on_pushButton_run_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } @@ -141,16 +122,9 @@ void JobsActionsPanel::on_pushButton_kill_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } @@ -170,45 +144,9 @@ void JobsActionsPanel::on_pushButton_result_cgx_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } -} - -void JobsActionsPanel::on_pushButton_result_ccx2paraview_clicked(bool) -{ - QStringList commands; - QString command = ""; - - if ((lineEdit_1->text()!="")) - { - command.append("ccx result ccx2paraview job " + lineEdit_1->text()); - } - - if (command != "") - { - commands.push_back(command); - lineEdit_1->setText(""); - } - - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } @@ -228,15 +166,8 @@ void JobsActionsPanel::on_pushButton_result_paraview_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/JobsActionsPanel.hpp b/src/GUI/JobsActionsPanel.hpp index c8f00bc1..879566ff 100644 --- a/src/GUI/JobsActionsPanel.hpp +++ b/src/GUI/JobsActionsPanel.hpp @@ -29,7 +29,6 @@ private slots: void on_pushButton_run_clicked(bool); void on_pushButton_kill_clicked(bool); void on_pushButton_result_cgx_clicked(bool); - void on_pushButton_result_ccx2paraview_clicked(bool); void on_pushButton_result_paraview_clicked(bool); private: @@ -47,9 +46,6 @@ private slots: QPushButton* pushButton_result_cgx; QHBoxLayout* HBoxLayout_pushButton_result_cgx; QSpacerItem* horizontal_spacer_pushButton_result_cgx; - QPushButton* pushButton_result_ccx2paraview; - QHBoxLayout* HBoxLayout_pushButton_result_ccx2paraview; - QSpacerItem* horizontal_spacer_pushButton_result_ccx2paraview; QPushButton* pushButton_result_paraview; QHBoxLayout* HBoxLayout_pushButton_result_paraview; QSpacerItem* horizontal_spacer_pushButton_result_paraview; diff --git a/src/GUI/JobsCreatePanel.cpp b/src/GUI/JobsCreatePanel.cpp index 808d2b12..8030a072 100644 --- a/src/GUI/JobsCreatePanel.cpp +++ b/src/GUI/JobsCreatePanel.cpp @@ -3,8 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" - JobsCreatePanel::JobsCreatePanel(QWidget *parent) : QWidget(parent), @@ -80,15 +78,8 @@ void JobsCreatePanel::on_pushButton_apply_clicked(bool) lineEdit_2->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/JobsDeletePanel.cpp b/src/GUI/JobsDeletePanel.cpp index 09d09ba1..3a1e2f92 100644 --- a/src/GUI/JobsDeletePanel.cpp +++ b/src/GUI/JobsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" JobsDeletePanel::JobsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void JobsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/JobsModifyPanel.cpp b/src/GUI/JobsModifyPanel.cpp index 716f48fb..b446af77 100644 --- a/src/GUI/JobsModifyPanel.cpp +++ b/src/GUI/JobsModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" JobsModifyPanel::JobsModifyPanel(QWidget *parent) : @@ -94,15 +93,8 @@ void JobsModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_2->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/JobsMonitor.cpp b/src/GUI/JobsMonitor.cpp index 3a1323ba..b36b187a 100644 --- a/src/GUI/JobsMonitor.cpp +++ b/src/GUI/JobsMonitor.cpp @@ -6,7 +6,6 @@ #include "CubitMessage.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" #include #include #include @@ -240,89 +239,32 @@ void JobsMonitor::setJob(int job_id) void JobsMonitor::on_pushButton_run_clicked(bool) { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx run job " + QString::number(current_job_id); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx run job " + std::to_string(current_job_id); + CubitInterface::cmd(command.c_str()); } void JobsMonitor::on_pushButton_kill_clicked(bool) { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx kill job " + QString::number(current_job_id); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx kill job " + std::to_string(current_job_id); + CubitInterface::cmd(command.c_str()); } void JobsMonitor::on_pushButton_result_cgx_clicked(bool) { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx result cgx job " + QString::number(current_job_id); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx result cgx job " + std::to_string(current_job_id); + CubitInterface::cmd(command.c_str()); } void JobsMonitor::on_pushButton_result_convert_clicked(bool) { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx result load job " + QString::number(current_job_id); - commands.push_back(command); - command = "ccx result convert job " + QString::number(current_job_id); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx result load job " + std::to_string(current_job_id); + CubitInterface::cmd(command.c_str()); } void JobsMonitor::on_pushButton_result_paraview_clicked(bool) { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx result paraview job " + QString::number(current_job_id); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx result paraview job " + std::to_string(current_job_id); + CubitInterface::cmd(command.c_str()); } void JobsMonitor::on_pushButton_close_clicked(bool) diff --git a/src/GUI/LoadsCentrifugalCreatePanel.cpp b/src/GUI/LoadsCentrifugalCreatePanel.cpp index cb953fa2..a903f79e 100644 --- a/src/GUI/LoadsCentrifugalCreatePanel.cpp +++ b/src/GUI/LoadsCentrifugalCreatePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsCentrifugalCreatePanel::LoadsCentrifugalCreatePanel(QWidget *parent) : @@ -139,15 +138,8 @@ void LoadsCentrifugalCreatePanel::on_pushButton_apply_clicked(bool) lineEdit_7->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/LoadsCentrifugalDeletePanel.cpp b/src/GUI/LoadsCentrifugalDeletePanel.cpp index ecc6b416..5a9dec40 100644 --- a/src/GUI/LoadsCentrifugalDeletePanel.cpp +++ b/src/GUI/LoadsCentrifugalDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsCentrifugalDeletePanel::LoadsCentrifugalDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void LoadsCentrifugalDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/LoadsCentrifugalModifyPanel.cpp b/src/GUI/LoadsCentrifugalModifyPanel.cpp index a1351e45..3d6d85df 100644 --- a/src/GUI/LoadsCentrifugalModifyPanel.cpp +++ b/src/GUI/LoadsCentrifugalModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsCentrifugalModifyPanel::LoadsCentrifugalModifyPanel(QWidget *parent) : @@ -170,15 +169,8 @@ void LoadsCentrifugalModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_7->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/LoadsForcesModifyPanel.cpp b/src/GUI/LoadsForcesModifyPanel.cpp index 4c4a039f..a10a0415 100644 --- a/src/GUI/LoadsForcesModifyPanel.cpp +++ b/src/GUI/LoadsForcesModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsForcesModifyPanel::LoadsForcesModifyPanel(QWidget *parent) : @@ -109,15 +108,8 @@ void LoadsForcesModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_3->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/LoadsGravityCreatePanel.cpp b/src/GUI/LoadsGravityCreatePanel.cpp index e0ba82bd..2c6c0c03 100644 --- a/src/GUI/LoadsGravityCreatePanel.cpp +++ b/src/GUI/LoadsGravityCreatePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsGravityCreatePanel::LoadsGravityCreatePanel(QWidget *parent) : @@ -129,15 +128,8 @@ void LoadsGravityCreatePanel::on_pushButton_apply_clicked(bool) lineEdit_6->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/LoadsGravityDeletePanel.cpp b/src/GUI/LoadsGravityDeletePanel.cpp index 5d1bb268..fda3457d 100644 --- a/src/GUI/LoadsGravityDeletePanel.cpp +++ b/src/GUI/LoadsGravityDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsGravityDeletePanel::LoadsGravityDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void LoadsGravityDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/LoadsGravityModifyPanel.cpp b/src/GUI/LoadsGravityModifyPanel.cpp index 442f899c..9fdeba3a 100644 --- a/src/GUI/LoadsGravityModifyPanel.cpp +++ b/src/GUI/LoadsGravityModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsGravityModifyPanel::LoadsGravityModifyPanel(QWidget *parent) : @@ -155,15 +154,8 @@ void LoadsGravityModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_6->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/LoadsHeatfluxesModifyPanel.cpp b/src/GUI/LoadsHeatfluxesModifyPanel.cpp index 4cc1e7f1..0118c562 100644 --- a/src/GUI/LoadsHeatfluxesModifyPanel.cpp +++ b/src/GUI/LoadsHeatfluxesModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsHeatfluxesModifyPanel::LoadsHeatfluxesModifyPanel(QWidget *parent) : @@ -109,15 +108,8 @@ void LoadsHeatfluxesModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_3->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/LoadsPressuresModifyPanel.cpp b/src/GUI/LoadsPressuresModifyPanel.cpp index f4a93a50..63d6e748 100644 --- a/src/GUI/LoadsPressuresModifyPanel.cpp +++ b/src/GUI/LoadsPressuresModifyPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" LoadsPressuresModifyPanel::LoadsPressuresModifyPanel(QWidget *parent) : @@ -109,15 +108,8 @@ void LoadsPressuresModifyPanel::on_pushButton_apply_clicked(bool) lineEdit_3->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/MaterialManagement.cpp b/src/GUI/MaterialManagement.cpp index 9b130548..da4397a6 100644 --- a/src/GUI/MaterialManagement.cpp +++ b/src/GUI/MaterialManagement.cpp @@ -12,7 +12,6 @@ #include "CubitMessage.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" MaterialManagement::MaterialManagement() { @@ -629,16 +628,9 @@ void MaterialManagement::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } @@ -654,23 +646,21 @@ void MaterialManagement::on_pushButton_new_clicked(bool) //log = " clicked new \n"; //PRINT_INFO("%s", log.c_str()); - QStringList commands; + //QStringList commands; + std::vector commands; bool ok; QString name = QInputDialog::getText(0, "Create Material", "Material Name:", QLineEdit::Normal, "", &ok); if (ok && !name.isEmpty()){ - commands.push_back("create material \"" + name + "\" property_group \"CalculiX-FEA\""); + //commands.push_back("create material \"" + name + "\" property_group \"CalculiX-FEA\""); + //commands.push_back(); + commands.push_back("create material \"" + name.toStdString() + "\" property_group \"CalculiX-FEA\""); } - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].c_str()); } } @@ -678,25 +668,23 @@ void MaterialManagement::on_pushButton_delete_clicked(bool) { //log = " clicked delete \n"; //PRINT_INFO("%s", log.c_str()); - QStringList commands; + //QStringList commands; + std::vector commands; QMessageBox::StandardButton msgbox; msgbox = QMessageBox::question(this,"Delete Material","Delete Material " + current_material_item->material_name_qstring + "?", QMessageBox::Yes | QMessageBox::No); if (msgbox == QMessageBox::Yes) { - commands.push_back("delete material " + current_material_item->material_id_qstring); + //commands.push_back("delete material " + current_material_item->material_id_qstring); + commands.push_back("delete material " + current_material_item->material_id_qstring.toStdString()); } - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].c_str()); } + this->removeListItems(); elastic_widget->hide(); diff --git a/src/GUI/ModelTree.cpp b/src/GUI/ModelTree.cpp index 85fb2305..d2628b18 100644 --- a/src/GUI/ModelTree.cpp +++ b/src/GUI/ModelTree.cpp @@ -43,11 +43,12 @@ #include "CustomLinesTree.hpp" #include "JobsMonitor.hpp" + +#include "CubitInterface.hpp" #include "CalculiXCoreInterface.hpp" #include "Claro.hpp" #include "Broker.hpp" -#include "ScriptTranslator.hpp" #include "NavigationModel.hpp" #include "NavigationNode.hpp" #include @@ -1245,12 +1246,9 @@ void ModelTree::showContextMenu(const QPoint &pos) QAction action5("Result CGX",this); connect(&action5, SIGNAL(triggered()),this,SLOT(ContextMenuAction5())); contextMenu.addAction(&action5); - QAction action6("ccx2paraview",this); + QAction action6("Result ParaView",this); connect(&action6, SIGNAL(triggered()),this,SLOT(ContextMenuAction6())); contextMenu.addAction(&action6); - QAction action7("Result ParaView",this); - connect(&action7, SIGNAL(triggered()),this,SLOT(ContextMenuAction7())); - contextMenu.addAction(&action7); contextMenu.exec(mapToGlobal(pos)); @@ -2248,49 +2246,13 @@ void ModelTree::execContextMenuAction(){ myJobsMonitor->update(); }else if (contextMenuAction[0][1]==4) //Action5 { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx result cgx job " + QString::number(contextMenuAction[0][2]); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx result cgx job " + std::to_string(contextMenuAction[0][2]); + CubitInterface::cmd(command.c_str()); + }else if (contextMenuAction[0][1]==5) //Action6 { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx result ccx2paraview job " + QString::number(contextMenuAction[0][2]); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } - }else if (contextMenuAction[0][1]==6) //Action7 - { - QStringList commands; - QString command = ""; - - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - command = "ccx result paraview job " + QString::number(contextMenuAction[0][2]); - commands.push_back(command); - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); - } + std::string command = "ccx result paraview job " + std::to_string(contextMenuAction[0][2]); + CubitInterface::cmd(command.c_str()); } } } diff --git a/src/GUI/SectionsCreateBeamPanel.cpp b/src/GUI/SectionsCreateBeamPanel.cpp index 5be88eba..0e135557 100644 --- a/src/GUI/SectionsCreateBeamPanel.cpp +++ b/src/GUI/SectionsCreateBeamPanel.cpp @@ -3,8 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" - SectionsCreateBeamPanel::SectionsCreateBeamPanel(QWidget *parent) : QWidget(parent), @@ -241,15 +239,8 @@ void SectionsCreateBeamPanel::on_pushButton_apply_clicked(bool) lineEdit_14->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsCreateMembranePanel.cpp b/src/GUI/SectionsCreateMembranePanel.cpp index cea25f61..1f4f568a 100644 --- a/src/GUI/SectionsCreateMembranePanel.cpp +++ b/src/GUI/SectionsCreateMembranePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsCreateMembranePanel::SectionsCreateMembranePanel(QWidget *parent) : @@ -116,15 +115,8 @@ void SectionsCreateMembranePanel::on_pushButton_apply_clicked(bool) lineEdit_5->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsCreateShellPanel.cpp b/src/GUI/SectionsCreateShellPanel.cpp index d4c74ab7..422f9f45 100644 --- a/src/GUI/SectionsCreateShellPanel.cpp +++ b/src/GUI/SectionsCreateShellPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsCreateShellPanel::SectionsCreateShellPanel(QWidget *parent) : @@ -115,16 +114,9 @@ void SectionsCreateShellPanel::on_pushButton_apply_clicked(bool) lineEdit_4->setText(""); lineEdit_5->setText(""); } - - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) - { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + for (size_t i = 0; i < commands.size(); i++) + { + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsCreateSolidPanel.cpp b/src/GUI/SectionsCreateSolidPanel.cpp index aff1ac6c..7faaffcb 100644 --- a/src/GUI/SectionsCreateSolidPanel.cpp +++ b/src/GUI/SectionsCreateSolidPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsCreateSolidPanel::SectionsCreateSolidPanel(QWidget *parent) : @@ -102,15 +101,8 @@ void SectionsCreateSolidPanel::on_pushButton_apply_clicked(bool) lineEdit_4->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsDeletePanel.cpp b/src/GUI/SectionsDeletePanel.cpp index b4b08c29..b89a3d80 100644 --- a/src/GUI/SectionsDeletePanel.cpp +++ b/src/GUI/SectionsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsDeletePanel::SectionsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void SectionsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsModifyBeamPanel.cpp b/src/GUI/SectionsModifyBeamPanel.cpp index 9c2d32cf..4f98355d 100644 --- a/src/GUI/SectionsModifyBeamPanel.cpp +++ b/src/GUI/SectionsModifyBeamPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsModifyBeamPanel::SectionsModifyBeamPanel(QWidget *parent) : @@ -289,15 +288,8 @@ void SectionsModifyBeamPanel::on_pushButton_apply_clicked(bool) lineEdit_14->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsModifyMembranePanel.cpp b/src/GUI/SectionsModifyMembranePanel.cpp index 64f0d136..7d2da127 100644 --- a/src/GUI/SectionsModifyMembranePanel.cpp +++ b/src/GUI/SectionsModifyMembranePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsModifyMembranePanel::SectionsModifyMembranePanel(QWidget *parent) : @@ -131,15 +130,8 @@ void SectionsModifyMembranePanel::on_pushButton_apply_clicked(bool) lineEdit_5->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsModifyShellPanel.cpp b/src/GUI/SectionsModifyShellPanel.cpp index b82205f4..80c97344 100644 --- a/src/GUI/SectionsModifyShellPanel.cpp +++ b/src/GUI/SectionsModifyShellPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsModifyShellPanel::SectionsModifyShellPanel(QWidget *parent) : @@ -131,15 +130,8 @@ void SectionsModifyShellPanel::on_pushButton_apply_clicked(bool) lineEdit_5->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SectionsModifySolidPanel.cpp b/src/GUI/SectionsModifySolidPanel.cpp index a1139d7b..7f7c1738 100644 --- a/src/GUI/SectionsModifySolidPanel.cpp +++ b/src/GUI/SectionsModifySolidPanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SectionsModifySolidPanel::SectionsModifySolidPanel(QWidget *parent) : @@ -121,15 +120,8 @@ void SectionsModifySolidPanel::on_pushButton_apply_clicked(bool) lineEdit_4->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsCreatePanel.cpp b/src/GUI/StepsCreatePanel.cpp index 3cfd58f5..7c620e41 100644 --- a/src/GUI/StepsCreatePanel.cpp +++ b/src/GUI/StepsCreatePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsCreatePanel::StepsCreatePanel(QWidget *parent) : @@ -104,15 +103,8 @@ void StepsCreatePanel::on_pushButton_apply_clicked(bool) comboBox_2->setCurrentIndex(0); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsDeletePanel.cpp b/src/GUI/StepsDeletePanel.cpp index 291b826b..0cae618a 100644 --- a/src/GUI/StepsDeletePanel.cpp +++ b/src/GUI/StepsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsDeletePanel::StepsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void StepsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/StepsManagement.cpp b/src/GUI/StepsManagement.cpp index f4a29363..0aad76cd 100644 --- a/src/GUI/StepsManagement.cpp +++ b/src/GUI/StepsManagement.cpp @@ -5,7 +5,6 @@ #include "CubitMessage.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsManagement::StepsManagement() { @@ -564,16 +563,9 @@ void StepsManagement::on_pushButton_apply_clicked(bool) } } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } this->update(); diff --git a/src/GUI/StepsModifyBucklePanel.cpp b/src/GUI/StepsModifyBucklePanel.cpp index ad603e8b..11740024 100644 --- a/src/GUI/StepsModifyBucklePanel.cpp +++ b/src/GUI/StepsModifyBucklePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyBucklePanel::StepsModifyBucklePanel(QWidget *parent) : @@ -158,15 +157,8 @@ void StepsModifyBucklePanel::on_pushButton_apply_clicked(bool) lineEdit_7->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsModifyCoupledTemperatureDisplacementPanel.cpp b/src/GUI/StepsModifyCoupledTemperatureDisplacementPanel.cpp index 711d0439..e8d5eedf 100644 --- a/src/GUI/StepsModifyCoupledTemperatureDisplacementPanel.cpp +++ b/src/GUI/StepsModifyCoupledTemperatureDisplacementPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyCoupledTemperatureDisplacementPanel::StepsModifyCoupledTemperatureDisplacementPanel(QWidget *parent) : @@ -292,15 +291,8 @@ void StepsModifyCoupledTemperatureDisplacementPanel::on_pushButton_apply_clicked lineEdit_15->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/StepsModifyFrequencyPanel.cpp b/src/GUI/StepsModifyFrequencyPanel.cpp index a26518a8..45da55c9 100644 --- a/src/GUI/StepsModifyFrequencyPanel.cpp +++ b/src/GUI/StepsModifyFrequencyPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyFrequencyPanel::StepsModifyFrequencyPanel(QWidget *parent) : @@ -201,15 +200,8 @@ void StepsModifyFrequencyPanel::on_pushButton_apply_clicked(bool) lineEdit_9->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsModifyHeatTransferPanel.cpp b/src/GUI/StepsModifyHeatTransferPanel.cpp index 95a09717..1842b08b 100644 --- a/src/GUI/StepsModifyHeatTransferPanel.cpp +++ b/src/GUI/StepsModifyHeatTransferPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyHeatTransferPanel::StepsModifyHeatTransferPanel(QWidget *parent) : @@ -345,15 +344,8 @@ void StepsModifyHeatTransferPanel::on_pushButton_apply_clicked(bool) lineEdit_18->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsModifyParameterPanel.cpp b/src/GUI/StepsModifyParameterPanel.cpp index 0d5f59cb..98204b27 100644 --- a/src/GUI/StepsModifyParameterPanel.cpp +++ b/src/GUI/StepsModifyParameterPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyParameterPanel::StepsModifyParameterPanel(QWidget *parent) : @@ -197,15 +196,8 @@ void StepsModifyParameterPanel::on_pushButton_apply_clicked(bool) lineEdit_9->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsModifyStaticPanel.cpp b/src/GUI/StepsModifyStaticPanel.cpp index 8acc2d19..e69c82c6 100644 --- a/src/GUI/StepsModifyStaticPanel.cpp +++ b/src/GUI/StepsModifyStaticPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyStaticPanel::StepsModifyStaticPanel(QWidget *parent) : @@ -243,15 +242,8 @@ void StepsModifyStaticPanel::on_pushButton_apply_clicked(bool) lineEdit_12->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/StepsModifyUncoupledTemperatureDisplacementPanel.cpp b/src/GUI/StepsModifyUncoupledTemperatureDisplacementPanel.cpp index 8f47c5e9..759f8b1f 100644 --- a/src/GUI/StepsModifyUncoupledTemperatureDisplacementPanel.cpp +++ b/src/GUI/StepsModifyUncoupledTemperatureDisplacementPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" StepsModifyUncoupledTemperatureDisplacementPanel::StepsModifyUncoupledTemperatureDisplacementPanel(QWidget *parent) : @@ -278,15 +277,8 @@ void StepsModifyUncoupledTemperatureDisplacementPanel::on_pushButton_apply_click lineEdit_14->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } \ No newline at end of file diff --git a/src/GUI/SurfaceInteractionsCreatePanel.cpp b/src/GUI/SurfaceInteractionsCreatePanel.cpp index dbcc2037..5191725c 100644 --- a/src/GUI/SurfaceInteractionsCreatePanel.cpp +++ b/src/GUI/SurfaceInteractionsCreatePanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SurfaceInteractionsCreatePanel::SurfaceInteractionsCreatePanel(QWidget *parent) : @@ -216,16 +215,9 @@ void SurfaceInteractionsCreatePanel::on_pushButton_apply_clicked(bool) } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SurfaceInteractionsDeletePanel.cpp b/src/GUI/SurfaceInteractionsDeletePanel.cpp index c9d4ebff..8fae6c71 100644 --- a/src/GUI/SurfaceInteractionsDeletePanel.cpp +++ b/src/GUI/SurfaceInteractionsDeletePanel.cpp @@ -3,7 +3,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SurfaceInteractionsDeletePanel::SurfaceInteractionsDeletePanel(QWidget *parent) : @@ -64,15 +63,8 @@ void SurfaceInteractionsDeletePanel::on_pushButton_apply_clicked(bool) lineEdit_1->setText(""); } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/GUI/SurfaceInteractionsModifyPanel.cpp b/src/GUI/SurfaceInteractionsModifyPanel.cpp index c1220b52..73e49663 100644 --- a/src/GUI/SurfaceInteractionsModifyPanel.cpp +++ b/src/GUI/SurfaceInteractionsModifyPanel.cpp @@ -4,7 +4,6 @@ #include "CubitInterface.hpp" #include "Broker.hpp" #include "Claro.hpp" -#include "ScriptTranslator.hpp" SurfaceInteractionsModifyPanel::SurfaceInteractionsModifyPanel(QWidget *parent) : @@ -347,16 +346,9 @@ void SurfaceInteractionsModifyPanel::on_pushButton_apply_clicked(bool) } - // We must send the Cubit commands through the Claro framework, so first we need to translate - // the commands into the python form that Claro will understand. - ScriptTranslator* cubit_translator = Broker::instance()->get_translator("Cubit"); - if(cubit_translator) + for (size_t i = 0; i < commands.size(); i++) { - for(int i = 0; i < commands.size(); i++) - cubit_translator->decode(commands[i]); - - // Send the translated commands - Claro::instance()->send_gui_commands(commands); + CubitInterface::cmd(commands[i].toStdString().c_str()); } } diff --git a/src/UserOptions/UserOptions.hpp b/src/UserOptions/UserOptions.hpp index a65473d9..8f3f722e 100644 --- a/src/UserOptions/UserOptions.hpp +++ b/src/UserOptions/UserOptions.hpp @@ -17,8 +17,6 @@ class UserOptions QString mPathCGXName; QString mPathParaView; QString mPathParaViewName; - QString mPathccx2paraview; - QString mPathccx2paraviewName; QString mPathIcons; QString mPathIconsName; }; diff --git a/src/UserOptions/UserOptionsPanel.cpp b/src/UserOptions/UserOptionsPanel.cpp index 461db082..b8e2a57d 100644 --- a/src/UserOptions/UserOptionsPanel.cpp +++ b/src/UserOptions/UserOptionsPanel.cpp @@ -20,25 +20,21 @@ UserOptionsPanel::UserOptionsPanel(QWidget *parent) : HBoxLayout_3 = new QHBoxLayout(); HBoxLayout_4 = new QHBoxLayout(); HBoxLayout_5 = new QHBoxLayout(); - HBoxLayout_6 = new QHBoxLayout(); label_1 = new QLabel(); label_2 = new QLabel(); label_3 = new QLabel(); label_4 = new QLabel(); label_5 = new QLabel(); - label_6 = new QLabel(); label_1->setFixedWidth(labelWidth); label_2->setFixedWidth(labelWidth); label_3->setFixedWidth(labelWidth); label_4->setFixedWidth(labelWidth); label_5->setFixedWidth(labelWidth); - label_6->setFixedWidth(labelWidth); lineEdit_1 = new QLineEdit(); lineEdit_2 = new QLineEdit(); lineEdit_3 = new QLineEdit(); lineEdit_4 = new QLineEdit(); lineEdit_5 = new QLineEdit(); - lineEdit_6 = new QLineEdit(); // Layout GridLayout->addLayout(VBoxLayout,0,0, Qt::AlignTop); @@ -47,7 +43,6 @@ UserOptionsPanel::UserOptionsPanel(QWidget *parent) : VBoxLayout->addLayout(HBoxLayout_3); VBoxLayout->addLayout(HBoxLayout_4); VBoxLayout->addLayout(HBoxLayout_5); - VBoxLayout->addLayout(HBoxLayout_6); VBoxLayout->addItem(vertical_spacer); HBoxLayout_1->addWidget(label_1); @@ -60,8 +55,6 @@ UserOptionsPanel::UserOptionsPanel(QWidget *parent) : HBoxLayout_4->addWidget(lineEdit_4); HBoxLayout_5->addWidget(label_5); HBoxLayout_5->addWidget(lineEdit_5); - HBoxLayout_6->addWidget(label_6); - HBoxLayout_6->addWidget(lineEdit_6); isInitialized = true; } @@ -75,15 +68,13 @@ void UserOptionsPanel::refresh_settings() label_2->setText(ccx_uo.mSolverThreadsName); label_3->setText(ccx_uo.mPathCGXName); label_4->setText(ccx_uo.mPathParaViewName); - label_5->setText(ccx_uo.mPathccx2paraviewName); - label_6->setText(ccx_uo.mPathIconsName); + label_5->setText(ccx_uo.mPathIconsName); lineEdit_1->setText(ccx_uo.mPathSolver); lineEdit_2->setText(QString::number(ccx_uo.mSolverThreads)); lineEdit_3->setText(ccx_uo.mPathCGX); lineEdit_4->setText(ccx_uo.mPathParaView); - lineEdit_5->setText(ccx_uo.mPathccx2paraview); - lineEdit_6->setText(ccx_uo.mPathIcons); + lineEdit_5->setText(ccx_uo.mPathIcons); } void UserOptionsPanel::save_settings() @@ -92,6 +83,5 @@ void UserOptionsPanel::save_settings() ccx_uo.mSolverThreads = lineEdit_2->text().toInt(); ccx_uo.mPathCGX = lineEdit_3->text(); ccx_uo.mPathParaView = lineEdit_4->text(); - ccx_uo.mPathccx2paraview = lineEdit_5->text(); - ccx_uo.mPathIcons = lineEdit_6->text(); + ccx_uo.mPathIcons = lineEdit_5->text(); } diff --git a/src/UserOptions/UserOptionsPanel.hpp b/src/UserOptions/UserOptionsPanel.hpp index b35b9613..f433b556 100644 --- a/src/UserOptions/UserOptionsPanel.hpp +++ b/src/UserOptions/UserOptionsPanel.hpp @@ -41,26 +41,22 @@ public slots: QVBoxLayout* VBoxLayout_3; QVBoxLayout* VBoxLayout_4; QVBoxLayout* VBoxLayout_5; - QVBoxLayout* VBoxLayout_6; QSpacerItem* vertical_spacer; QHBoxLayout* HBoxLayout_1; QHBoxLayout* HBoxLayout_2; QHBoxLayout* HBoxLayout_3; QHBoxLayout* HBoxLayout_4; QHBoxLayout* HBoxLayout_5; - QHBoxLayout* HBoxLayout_6; QLabel* label_1; QLabel* label_2; QLabel* label_3; QLabel* label_4; QLabel* label_5; - QLabel* label_6; QLineEdit* lineEdit_1; QLineEdit* lineEdit_2; QLineEdit* lineEdit_3; QLineEdit* lineEdit_4; QLineEdit* lineEdit_5; - QLineEdit* lineEdit_6; }; #endif // USEROPTIONSPANEL_HPP \ No newline at end of file