Génération du CSV dans le répertoire du script de commande

This commit is contained in:
Philippe Roy 2023-01-28 01:37:28 +01:00
parent b2fd1753aa
commit a5d7bf89e0
4 changed files with 10 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -306,3 +306,4 @@ app = QtWidgets.QApplication(sys.argv)
# w = DynamicPlot()
w = MainWindow() # StaticPlot()
app.exec_()
sys.exit(0)