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
Branches
Tags
1 merge request!49rce_workflow (schueltke):
......@@ -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
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
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
if os.path.isdir(path_to_folder_old_reference + element + '/' + result):
shutil.copytree(path_to_folder_old_reference + element + '/' + result,
temporary_working_directory + '/' + aircraft_project[:-4]
+ '/cleanSheetDesign/' + result)
+ '/clean_sheet_design/' + result)
else:
shutil.copyfile(path_to_folder_old_reference + element + '/' + result,
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:
......
......@@ -434,7 +434,7 @@ def set_configuration_parameter(paths_and_names, global_loop_counter):
# delete current folder from project folder
while_count = 0
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':
try:
shutil.rmtree(path_to_project + element)
......@@ -717,7 +717,7 @@ def set_configuration_parameter(paths_and_names, global_loop_counter):
break
# 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 = []
if not skip_initial_sizing_flag and not file_name == "cpacs_interface":
file_name_list.append(file_name)
......
......@@ -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
+ '/' + aircraft_project + '/' + file_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
+ '/' + aircraft_project + '/cleanSheetDesign/' + file_name,
+ '/' + aircraft_project + '/clean_sheet_design/' + file_name,
path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/' + file_name)
......@@ -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
+ '/' + aircraft_project + '/geometry_data/'):
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
+ '/' + aircraft_project + '/cleanSheetDesign/geometry_data/',
+ '/' + aircraft_project + '/clean_sheet_design/geometry_data/',
path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/geometry_data/')
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
if not os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/aero_data/'):
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
+ '/' + aircraft_project + '/cleanSheetDesign/aero_data/',
+ '/' + aircraft_project + '/clean_sheet_design/aero_data/',
path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/aero_data/')
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
if not os.path.isdir(path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/engine_data/'):
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
+ '/' + aircraft_project + '/cleanSheetDesign/engine_data/',
+ '/' + aircraft_project + '/clean_sheet_design/engine_data/',
path_of_working_directory_rce + current_workflow_name
+ '/' + aircraft_project + '/engine_data/')
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
'/value').text
# 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
+ '/' + aircraft_project + '/' + 'engine_data/' + engine_name):
try:
......@@ -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
+ '/' + aircraft_project + '/' + 'engine_data')
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 + '/'
+ '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 '
+ engine_name + ' successfully copied from "cleanSheetDesign" folder!')
+ engine_name + ' successfully copied from "clean_sheet_design" folder!')
except OSError:
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
# Use configuration file from clean sheet design folder
if use_configs_from_existing_project == 1:
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 =\
os.path.isdir(path_of_working_directory_rce + current_workflow_name + '/' + aircraft_project
+ '/cleanSheetDesign/config_files/')
folder_name = 'cleanSheetDesign'
+ '/clean_sheet_design/config_files/')
folder_name = 'clean_sheet_design'
# Use configuration file from engine calibrated design folder
if use_configs_from_existing_project == 2:
......@@ -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(
'./control_settings/program_specific_settings/iteration_settings/use_configs_from_existing_project/'
'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' \
or name_of_checkout_dir_from_repository == 'engineCalibration' \
or name_of_checkout_dir_from_repository == 'withoutCalibration':
......@@ -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)
ssh_url = 'ssh://git@unicado.ilr.rwth-aachen.de:2222/source/' + repository_name + '.git'
if name_of_checkout_dir_from_server == 'cleanSheetDesign':
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/cleanSheetDesign/config_files'
if name_of_checkout_dir_from_server == 'clean_sheet_design':
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/clean_sheet_design/config_files'
else:
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/retrofitDesign/' \
+ name_of_checkout_dir_from_server + '/config_files'
......@@ -193,7 +193,15 @@ def select_configuration_files_from_existing_project(path_of_working_directory_r
for content in list_of_working_directory_content:
if content == tool_name:
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')
if os.path.isfile(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
+ ': Replacement of liftingLine configuration file from '
+ folder_name + ' folder successfully done!')
if content == 'cpacsInterface':
if content == 'cpacs_interface':
print(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',
......
......@@ -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
if use_engine_from_existing_project == 1:
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 \
+ '/cleanSheetDesign/engine_data/'
folder_name = 'cleanSheetDesign'
+ '/clean_sheet_design/engine_data/'
folder_name = 'clean_sheet_design'
# use engine from engine calibrated design folder
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
name_of_checkout_dir_from_repository = str(root_of_workflow_tree.find(
'./control_settings/program_specific_settings/iteration_settings/use_engine_from_existing_project/'
'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' \
or name_of_checkout_dir_from_repository == 'engineCalibration' \
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
ssh_url = 'ssh://git@unicado.ilr.rwth-aachen.de:2222/source/' + repository_name + '.git'
if repository_name.lower() == 'raircraftreferences':
if name_of_checkout_dir_from_server == 'cleanSheetDesign':
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/cleanSheetDesign/engine_data'
if name_of_checkout_dir_from_server == 'clean_sheet_design':
name_of_checkout_dir_from_server = aircraft_type + '/' + aircraft_project + '/clean_sheet_design/engine_data'
elif name_of_checkout_dir_from_server == 'aerodynamicCalibration' \
or name_of_checkout_dir_from_server == 'engineCalibration' \
or name_of_checkout_dir_from_server == 'withoutCalibration':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment