mirror of
https://forge.apps.education.fr/blender-edutech/jumeaux-numeriques.git
synced 2024-01-27 06:56:18 +01:00
Génération du CSV dans le répertoire du script de commande
This commit is contained in:
parent
b2fd1753aa
commit
a5d7bf89e0
@ -107,7 +107,6 @@ def init(cont):
|
||||
scene.objects['Recepteur IR']['description']="Capteur barrage IR (absence d\"obstacle) : ir_recep()"
|
||||
|
||||
system_init() # Initialisation du système
|
||||
scene.objects['System']['plot_proc'] = None # Initialisation du processus plot
|
||||
|
||||
def get_public_vars():
|
||||
return public_vars
|
||||
|
Binary file not shown.
21
twin_daq.py
21
twin_daq.py
@ -87,7 +87,7 @@ def localize_floats(row):
|
||||
|
||||
def csv_generate():
|
||||
scene.objects['System']['daq']=False
|
||||
fichier_csv=scene.objects['System']['system']+'.csv'
|
||||
fichier_csv=os.path.join(os.path.split((scene.objects['System']['script']))[0], scene.objects['System']['system']+'.csv')
|
||||
scene.objects['Cmd-text']['modal']= True
|
||||
scene.objects['Cmd-text']['Text']= "Génération du fichier : "+fichier_csv
|
||||
scene.objects['Cmd-text'].setVisible(True,False)
|
||||
@ -151,22 +151,19 @@ def plot(data_groups):
|
||||
plot_config_generate(data_groups)
|
||||
scene.objects['System']['plot']=True
|
||||
|
||||
##
|
||||
# Fermer le processus du graphique
|
||||
##
|
||||
|
||||
def plot_close():
|
||||
if scene.objects['System']['plot_proc'] is not None:
|
||||
if scene.objects['System']['plot_proc'].poll()==None:
|
||||
scene.objects['System']['plot_proc'].terminate()
|
||||
|
||||
##
|
||||
# Génération du graphique
|
||||
##
|
||||
|
||||
def plot_generate():
|
||||
plot_close()
|
||||
fichier_csv=scene.objects['System']['system']+'.csv'
|
||||
|
||||
# Terminer le processus plot précédent
|
||||
if ('plot_proc' in scene.objects['System']):
|
||||
if scene.objects['System']['plot_proc'].poll()==None:
|
||||
scene.objects['System']['plot_proc'].terminate()
|
||||
|
||||
# Démarrer le processus plot
|
||||
fichier_csv=os.path.join(os.path.split((scene.objects['System']['script']))[0], scene.objects['System']['system']+'.csv')
|
||||
scene.objects['System']['plot_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_plot_qt.py"), fichier_csv])
|
||||
scene.objects['System']['plot']=False
|
||||
|
||||
|
@ -306,3 +306,4 @@ app = QtWidgets.QApplication(sys.argv)
|
||||
# w = DynamicPlot()
|
||||
w = MainWindow() # StaticPlot()
|
||||
app.exec_()
|
||||
sys.exit(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user