Skip to content
Snippets Groups Projects
Commit 2ee83b25 authored by Andi's avatar Andi
Browse files

Merge branch 'fix/copy_config_mode_libs' into 'main'

rce_workflow (schueltke):

See merge request !49
parents 6e53d4fd 5563bb7b
No related branches found
No related tags found
1 merge request!49rce_workflow (schueltke):
...@@ -130,7 +130,7 @@ def prepare_resume_of_parameter_study(paths_and_names, path_to_folder_old_refere ...@@ -130,7 +130,7 @@ def prepare_resume_of_parameter_study(paths_and_names, path_to_folder_old_refere
# create new aircraft project folder in temporary working directory # create new aircraft project folder in temporary working directory
if not os.path.isdir(temporary_working_directory + '/' + aircraft_project[:-4]): if not os.path.isdir(temporary_working_directory + '/' + aircraft_project[:-4]):
os.makedirs(temporary_working_directory + '/' + aircraft_project[:-4] + '/cleanSheetDesign') os.makedirs(temporary_working_directory + '/' + aircraft_project[:-4] + '/clean_sheet_design')
# create new temporary result folder in temporary working directory # create new temporary result folder in temporary working directory
if not os.path.isdir(temporary_working_directory + '/temporaryResults'): if not os.path.isdir(temporary_working_directory + '/temporaryResults'):
...@@ -197,11 +197,11 @@ def prepare_resume_of_parameter_study(paths_and_names, path_to_folder_old_refere ...@@ -197,11 +197,11 @@ def prepare_resume_of_parameter_study(paths_and_names, path_to_folder_old_refere
if os.path.isdir(path_to_folder_old_reference + element + '/' + result): if os.path.isdir(path_to_folder_old_reference + element + '/' + result):
shutil.copytree(path_to_folder_old_reference + element + '/' + result, shutil.copytree(path_to_folder_old_reference + element + '/' + result,
temporary_working_directory + '/' + aircraft_project[:-4] temporary_working_directory + '/' + aircraft_project[:-4]
+ '/cleanSheetDesign/' + result) + '/clean_sheet_design/' + result)
else: else:
shutil.copyfile(path_to_folder_old_reference + element + '/' + result, shutil.copyfile(path_to_folder_old_reference + element + '/' + result,
temporary_working_directory + '/' + aircraft_project[:-4] temporary_working_directory + '/' + aircraft_project[:-4]
+ '/cleanSheetDesign/' + result) + '/clean_sheet_design/' + result)
# else condition: current element is a file -> copy file to temporary working directory # else condition: current element is a file -> copy file to temporary working directory
else: else:
......
...@@ -434,7 +434,7 @@ def set_configuration_parameter(paths_and_names, global_loop_counter): ...@@ -434,7 +434,7 @@ def set_configuration_parameter(paths_and_names, global_loop_counter):
# delete current folder from project folder # delete current folder from project folder
while_count = 0 while_count = 0
while True: while True:
if os.path.isdir(path_to_project + element) and not element == 'cleanSheetDesign' \ if os.path.isdir(path_to_project + element) and not element == 'clean_sheet_design' \
and not element == 'retrofitDesign': and not element == 'retrofitDesign':
try: try:
shutil.rmtree(path_to_project + element) shutil.rmtree(path_to_project + element)
...@@ -717,7 +717,7 @@ def set_configuration_parameter(paths_and_names, global_loop_counter): ...@@ -717,7 +717,7 @@ def set_configuration_parameter(paths_and_names, global_loop_counter):
break break
# check if retrofit design is selected # check if retrofit design is selected
# -> if true: -> skipp set parameter to initial_sizing configuration file # -> if true: -> skip set parameter to initial_sizing configuration file
file_name_list = [] file_name_list = []
if not skip_initial_sizing_flag and not file_name == "cpacs_interface": if not skip_initial_sizing_flag and not file_name == "cpacs_interface":
file_name_list.append(file_name) file_name_list.append(file_name)
......
...@@ -63,9 +63,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj ...@@ -63,9 +63,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj
if not os.path.isfile(path_of_working_directory_rce + current_workflow_name if not os.path.isfile(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/' + file_name): + '/' + aircraft_project + '/' + file_name):
if os.path.isfile(path_of_working_directory_rce + current_workflow_name if os.path.isfile(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/' + file_name): + '/' + aircraft_project + '/clean_sheet_design/' + file_name):
shutil.copyfile(path_of_working_directory_rce + current_workflow_name shutil.copyfile(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/' + file_name, + '/' + aircraft_project + '/clean_sheet_design/' + file_name,
path_of_working_directory_rce + current_workflow_name path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/' + file_name) + '/' + aircraft_project + '/' + file_name)
...@@ -85,9 +85,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj ...@@ -85,9 +85,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj
if not os.path.isdir(path_of_working_directory_rce + current_workflow_name if not os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/geometry_data/'): + '/' + aircraft_project + '/geometry_data/'):
if os.path.isdir(path_of_working_directory_rce + current_workflow_name if os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/geometry_data/'): + '/' + aircraft_project + '/clean_sheet_design/geometry_data/'):
shutil.copytree(path_of_working_directory_rce + current_workflow_name shutil.copytree(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/geometry_data/', + '/' + aircraft_project + '/clean_sheet_design/geometry_data/',
path_of_working_directory_rce + current_workflow_name path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/geometry_data/') + '/' + aircraft_project + '/geometry_data/')
print('Warning: No geometry data in temporary working directory found! \n ' print('Warning: No geometry data in temporary working directory found! \n '
...@@ -104,9 +104,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj ...@@ -104,9 +104,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj
if not os.path.isdir(path_of_working_directory_rce + current_workflow_name if not os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/aero_data/'): + '/' + aircraft_project + '/aero_data/'):
if os.path.isdir(path_of_working_directory_rce + current_workflow_name if os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/aero_data/'): + '/' + aircraft_project + '/clean_sheet_design/aero_data/'):
shutil.copytree(path_of_working_directory_rce + current_workflow_name shutil.copytree(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/aero_data/', + '/' + aircraft_project + '/clean_sheet_design/aero_data/',
path_of_working_directory_rce + current_workflow_name path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/aero_data/') + '/' + aircraft_project + '/aero_data/')
print('Warning: No aero data in temporary working directory found! \n ' print('Warning: No aero data in temporary working directory found! \n '
...@@ -123,9 +123,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj ...@@ -123,9 +123,9 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj
if not os.path.isdir(path_of_working_directory_rce + current_workflow_name if not os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/engine_data/'): + '/' + aircraft_project + '/engine_data/'):
if os.path.isdir(path_of_working_directory_rce + current_workflow_name if os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/engine_data/'): + '/' + aircraft_project + '/clean_sheet_design/engine_data/'):
shutil.copytree(path_of_working_directory_rce + current_workflow_name shutil.copytree(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/cleanSheetDesign/engine_data/', + '/' + aircraft_project + '/clean_sheet_design/engine_data/',
path_of_working_directory_rce + current_workflow_name path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/engine_data/') + '/' + aircraft_project + '/engine_data/')
print('Warning: No engine data in temporary working directory found! \n ' print('Warning: No engine data in temporary working directory found! \n '
...@@ -156,7 +156,7 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj ...@@ -156,7 +156,7 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj
'/value').text '/value').text
# check if engine data exist -> if false: # check if engine data exist -> if false:
# -> try to copy engine data from cleanSheetDesign folder otherwise raise an error and abort program # -> try to copy engine data from clean_sheet_design folder otherwise raise an error and abort program
if not os.path.isdir(path_of_working_directory_rce + current_workflow_name if not os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/' + 'engine_data/' + engine_name): + '/' + aircraft_project + '/' + 'engine_data/' + engine_name):
try: try:
...@@ -165,12 +165,12 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj ...@@ -165,12 +165,12 @@ def prepare_single_mission_analysis(path_of_working_directory_rce, aircraft_proj
os.mkdir(path_of_working_directory_rce + current_workflow_name os.mkdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/' + 'engine_data') + '/' + aircraft_project + '/' + 'engine_data')
shutil.copytree(path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project + '/' shutil.copytree(path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project + '/'
+ 'cleanSheetDesign/engine_data/' + engine_name, + 'clean_sheet_design/engine_data/' + engine_name,
path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project + '/' path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project + '/'
+ 'engine_data/' + engine_name) + 'engine_data/' + engine_name)
print('Necessary engine data for ' + engine_name + ' successfully copied from "cleanSheetDesign" folder!') print('Necessary engine data for ' + engine_name + ' successfully copied from "clean_sheet_design" folder!')
log_file_list.append(str(datetime.now().strftime('%Y-%m-%d %H:%M:%S')) + 'Necessary engine data for ' log_file_list.append(str(datetime.now().strftime('%Y-%m-%d %H:%M:%S')) + 'Necessary engine data for '
+ engine_name + ' successfully copied from "cleanSheetDesign" folder!') + engine_name + ' successfully copied from "clean_sheet_design" folder!')
except OSError: except OSError:
print('Error: Necessary engine data for ' + engine_name + ' not available! ' print('Error: Necessary engine data for ' + engine_name + ' not available! '
......
...@@ -78,11 +78,11 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r ...@@ -78,11 +78,11 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r
# Use configuration file from clean sheet design folder # Use configuration file from clean sheet design folder
if use_configs_from_existing_project == 1: if use_configs_from_existing_project == 1:
path_to_config = path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project \ path_to_config = path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project \
+ '/cleanSheetDesign/config_files/' + '/clean_sheet_design/config_files/'
check_flag_xml_in_clean_sheet_folder =\ check_flag_xml_in_clean_sheet_folder =\
os.path.isdir(path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project os.path.isdir(path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project
+ '/cleanSheetDesign/config_files/') + '/clean_sheet_design/config_files/')
folder_name = 'cleanSheetDesign' folder_name = 'clean_sheet_design'
# Use configuration file from engine calibrated design folder # Use configuration file from engine calibrated design folder
if use_configs_from_existing_project == 2: if use_configs_from_existing_project == 2:
...@@ -113,7 +113,7 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r ...@@ -113,7 +113,7 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r
name_of_checkout_dir_from_repository = str(root_of_workflow_tree.find( name_of_checkout_dir_from_repository = str(root_of_workflow_tree.find(
'./control_settings/program_specific_settings/iteration_settings/use_configs_from_existing_project/' './control_settings/program_specific_settings/iteration_settings/use_configs_from_existing_project/'
'mode_specific_settings/mode_4/name_of_config_checkout_dir/value').text) 'mode_specific_settings/mode_4/name_of_config_checkout_dir/value').text)
# Check if the given input directory not equal to 'cleanSheetDesign' -> if true: -> retrofit design will be used # Check if the given input directory not equal to 'clean_sheet_design' -> if true: -> retrofit design will be used
if name_of_checkout_dir_from_repository == 'aerodynamicCalibration' \ if name_of_checkout_dir_from_repository == 'aerodynamicCalibration' \
or name_of_checkout_dir_from_repository == 'engineCalibration' \ or name_of_checkout_dir_from_repository == 'engineCalibration' \
or name_of_checkout_dir_from_repository == 'withoutCalibration': or name_of_checkout_dir_from_repository == 'withoutCalibration':
...@@ -151,8 +151,8 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r ...@@ -151,8 +151,8 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r
'mode_specific_settings/mode_4/name_of_config_checkout_dir/value').text) 'mode_specific_settings/mode_4/name_of_config_checkout_dir/value').text)
ssh_url = 'ssh://git@unicado.ilr.rwth-aachen.de:2222/source/' + repository_name + '.git' ssh_url = 'ssh://git@unicado.ilr.rwth-aachen.de:2222/source/' + repository_name + '.git'
if name_of_checkout_dir_from_server == 'cleanSheetDesign': if name_of_checkout_dir_from_server == 'clean_sheet_design':
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/cleanSheetDesign/config_files' name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/clean_sheet_design/config_files'
else: else:
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/retrofitDesign/' \ name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/retrofitDesign/' \
+ name_of_checkout_dir_from_server + '/config_files' + name_of_checkout_dir_from_server + '/config_files'
...@@ -193,7 +193,15 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r ...@@ -193,7 +193,15 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r
for content in list_of_working_directory_content: for content in list_of_working_directory_content:
if content == tool_name: if content == tool_name:
if os.path.isdir(path_of_working_directory + content): if os.path.isdir(path_of_working_directory + content):
if content == 'aerodynamic_assessment': if content == 'fuselage_design':
shutil.copytree(path_of_working_directory + '/' + content + '/fuselage_design_lib',
path_of_working_directory_rce + current_workflow_name
+ '/fuselage_design_lib')
if content == 'landing_gear_design':
shutil.copytree(path_of_working_directory + '/' + content + '/landing_gear_lib',
path_of_working_directory_rce + current_workflow_name
+ '/landing_gear_lib')
if content == 'aerodynamic_analysis':
print(path_to_config + element + '/liftingLine_conf.xml') print(path_to_config + element + '/liftingLine_conf.xml')
if os.path.isfile(path_to_config + element + '/liftingLine_conf.xml'): if os.path.isfile(path_to_config + element + '/liftingLine_conf.xml'):
shutil.copyfile(path_to_config + element + '/liftingLine_conf.xml', shutil.copyfile(path_to_config + element + '/liftingLine_conf.xml',
...@@ -205,7 +213,7 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r ...@@ -205,7 +213,7 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r
+ ': Replacement of liftingLine configuration file from ' + ': Replacement of liftingLine configuration file from '
+ folder_name + ' folder successfully done!') + folder_name + ' folder successfully done!')
if content == 'cpacsInterface': if content == 'cpacs_interface':
print(path_to_config + element + '/convertUNICADO2CPACS_conf.xml') print(path_to_config + element + '/convertUNICADO2CPACS_conf.xml')
if os.path.isfile(path_to_config + element + '/convertUNICADO2CPACS_conf.xml'): if os.path.isfile(path_to_config + element + '/convertUNICADO2CPACS_conf.xml'):
shutil.copyfile(path_to_config + element + '/convertUNICADO2CPACS_conf.xml', shutil.copyfile(path_to_config + element + '/convertUNICADO2CPACS_conf.xml',
......
...@@ -85,10 +85,10 @@ def select_engine_from_existing_project(path_of_working_directory_rce, path_to_a ...@@ -85,10 +85,10 @@ def select_engine_from_existing_project(path_of_working_directory_rce, path_to_a
# use engine from clean sheet design folder # use engine from clean sheet design folder
if use_engine_from_existing_project == 1: if use_engine_from_existing_project == 1:
check_flag_engine_in_folder = os.path.isdir(path_of_working_directory_rce + '/' + current_workflow_name + '/' check_flag_engine_in_folder = os.path.isdir(path_of_working_directory_rce + '/' + current_workflow_name + '/'
+ aircraft_project + '/cleanSheetDesign/engine_data/') + aircraft_project + '/clean_sheet_design/engine_data/')
source = path_of_working_directory_rce + '/' + current_workflow_name + '/' + aircraft_project \ source = path_of_working_directory_rce + '/' + current_workflow_name + '/' + aircraft_project \
+ '/cleanSheetDesign/engine_data/' + '/clean_sheet_design/engine_data/'
folder_name = 'cleanSheetDesign' folder_name = 'clean_sheet_design'
# use engine from engine calibrated design folder # use engine from engine calibrated design folder
if use_engine_from_existing_project == 2: if use_engine_from_existing_project == 2:
...@@ -120,7 +120,7 @@ def select_engine_from_existing_project(path_of_working_directory_rce, path_to_a ...@@ -120,7 +120,7 @@ def select_engine_from_existing_project(path_of_working_directory_rce, path_to_a
name_of_checkout_dir_from_repository = str(root_of_workflow_tree.find( name_of_checkout_dir_from_repository = str(root_of_workflow_tree.find(
'./control_settings/program_specific_settings/iteration_settings/use_engine_from_existing_project/' './control_settings/program_specific_settings/iteration_settings/use_engine_from_existing_project/'
'mode_specific_settings/mode_4/name_of_engine_checkout_dir/value').text) 'mode_specific_settings/mode_4/name_of_engine_checkout_dir/value').text)
# Check if the given input directory not equal to 'cleanSheetDesign' -> if true: -> retrofit design will be used # Check if the given input directory not equal to 'clean_sheet_design' -> if true: -> retrofit design will be used
if name_of_checkout_dir_from_repository == 'aerodynamicCalibration' \ if name_of_checkout_dir_from_repository == 'aerodynamicCalibration' \
or name_of_checkout_dir_from_repository == 'engineCalibration' \ or name_of_checkout_dir_from_repository == 'engineCalibration' \
or name_of_checkout_dir_from_repository == 'withoutCalibration': or name_of_checkout_dir_from_repository == 'withoutCalibration':
...@@ -164,8 +164,8 @@ def select_engine_from_existing_project(path_of_working_directory_rce, path_to_a ...@@ -164,8 +164,8 @@ def select_engine_from_existing_project(path_of_working_directory_rce, path_to_a
ssh_url = 'ssh://git@unicado.ilr.rwth-aachen.de:2222/source/' + repository_name + '.git' ssh_url = 'ssh://git@unicado.ilr.rwth-aachen.de:2222/source/' + repository_name + '.git'
if repository_name.lower() == 'raircraftreferences': if repository_name.lower() == 'raircraftreferences':
if name_of_checkout_dir_from_server == 'cleanSheetDesign': if name_of_checkout_dir_from_server == 'clean_sheet_design':
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/cleanSheetDesign/engine_data' name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/clean_sheet_design/engine_data'
elif name_of_checkout_dir_from_server == 'aerodynamicCalibration' \ elif name_of_checkout_dir_from_server == 'aerodynamicCalibration' \
or name_of_checkout_dir_from_server == 'engineCalibration' \ or name_of_checkout_dir_from_server == 'engineCalibration' \
or name_of_checkout_dir_from_server == 'withoutCalibration': or name_of_checkout_dir_from_server == 'withoutCalibration':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment