diff --git a/twin.py b/twin.py index fa3df08..d44f370 100644 --- a/twin.py +++ b/twin.py @@ -129,7 +129,7 @@ def keyboard(cont): def cmd_init(): - # Fichier de config (screen size : data/config/screen/width-> [0][0].text, height-> [0][1].text) + # Configuration de l'écran bge.render.setWindowSize(int(twin_config[0][0].text),int(twin_config[0][1].text)) quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA') scene.objects['About']['quality'] = int(twin_config[0][2].text) @@ -474,13 +474,14 @@ def file_open(): scene.objects['System']['file_proc'].terminate() # Démarrer le processus file - if sys.platform=="linux": # wxPython ne s'installe pas bien sur GNU/linux -> Qt6 + if sys.platform=="linux": # wxPython ne s'installe pas bien sur GNU/linux -> Qt5 scene.objects['System']['file_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_file_qt.py")], stdout=subprocess.PIPE, encoding = 'utf8') - else: # Qt6 ne s'installe pas bien sur Windows -> wxPython + else: # Qt5 ne s'installe pas bien sur Windows -> wxPython scene.objects['System']['file_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_file_wx.py")], stdout=subprocess.PIPE, encoding = 'utf8') + # Récupérer le nom du fchier stout = scene.objects['System']['file_proc'].communicate() - if stout[0][:-1] != 'None': + if stout[0][:-1] != 'None' and len(stout[0][:-1])>0 : scene.objects['System']['script'] = stout[0][:-1] scene.objects['Script-text']['Text']=scene.objects['System']['script'] @@ -544,6 +545,7 @@ def cycle_run (): scene.objects['System']['time']=0 scene.objects['System']['daq']=False scene.objects['System']['plot']=False + scene.objects['Twins-text']['Text'] = "Connection fermée." module_name=os.path.split((scene.objects['System']['script']))[1][:-3] if python_validation(scene.objects['System']['script']): runpy.run_path(scene.objects['System']['script'], run_name='start') # Execution du script utilisateur diff --git a/twin_config.xml b/twin_config.xml index 3ad3c82..a90fce4 100644 --- a/twin_config.xml +++ b/twin_config.xml @@ -1,7 +1,7 @@ - 1590 - 894 + 1609 + 905 1