From 6286e6c557c8e79061d49e1caa6a2f3299f6daad Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Wed, 18 Jun 2025 10:20:25 +0200 Subject: [PATCH] JOE FIGHT! --- Fotovoltaico.py | 18 ++++++++++++------ Program1.py | 10 ++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Fotovoltaico.py b/Fotovoltaico.py index 1f3f312..f95a750 100644 --- a/Fotovoltaico.py +++ b/Fotovoltaico.py @@ -1,6 +1,8 @@ from src.Functions_Energy_Model import * from src.Functions_General import * import subprocess +import signal +import time location_ita = 'Biella' # location in Italian capacity = 100 # kWp @@ -9,13 +11,14 @@ azimuth = 0 # degrees num_years = 1 # number of years to simulate derating_factor_percent = 1 # derating factor that reduce the efficiency of the modules in percentage [%] +# IGNORE THIS config = yaml.safe_load(open("config.yml", 'r')) path_export = str(config['filename_output_csv_gen_pv']) # path to save the results -joe = config['joe_fight'] - -if(joe == True): - if shutil.which('wmplayer') is not None: - proc = subprocess.Popen(['ffplay', 'assets/joefight.mp4']) +isJoe = config['joe_fight'] +if(isJoe == True): + if shutil.which('ffplay') is not None: + joe = subprocess.Popen(['ffplay', 'assets/joefight.mp4']) + time.sleep(25) # deve arrivare il drop else: print("ffplay non installato, no joe fight.") @@ -45,4 +48,7 @@ result_ac_energies_to_csv_df = suppress_printing(simulate_unstacked_productivity # ESPORTAZIONE RISULTATI IN CSV result_ac_energies_to_csv_df.to_csv(path_export, encoding='utf-8') -os.startfile(path_export) \ No newline at end of file +os.startfile(path_export) + +joe.terminate() +joe.kill() \ No newline at end of file diff --git a/Program1.py b/Program1.py index 383e5f0..fc862d6 100644 --- a/Program1.py +++ b/Program1.py @@ -2,6 +2,16 @@ from src.Functions_General import * from src.Functions_Energy_Model import * from src.Functions_Financial_Model import * from src.Functions_Load_Emulator_and_DSM import * +import subprocess + +config = yaml.safe_load(open("config.yml", 'r')) +joe = config['joe_fight'] +if(joe == True): + if shutil.which('ffplay') is not None: + proc = subprocess.Popen(['ffplay', 'assets/joefight.mp4']) + else: + print("ffplay non installato, no joe fight.") + generate_calendar() kill_excel_processes()