Example #1
0
def generate_cds_utils_header(tgtApp):
    global g_OutDir, g_Tbls

    # Construct file path
    name = tgtApp.lower() + "_cds_utils.h"
    filePath = os.path.join(g_OutDir, tgtApp.lower(), "fsw", "tables", name)
    fileExist_p = os.path.exists(filePath)

    if "none" in g_Tbls or "cds" not in g_Tbls:
        # Remove file
        app_utils.remove_file(filePath)
    elif "cds" in g_Tbls:
        # Open file
        fileHdl = app_utils.open_file_for_writing(filePath, False)
        # Write to file
        fileHdl.write(construct_cds_util_header_content(tgtApp))
        # Close file
        app_utils.close_file_from_writing(fileHdl, filePath, fileExist_p)
    else:
        pass
Example #2
0
def generate_cds_utils_header(tgtApp):
    global g_OutDir, g_Tbls

    # Construct file path
    name = tgtApp.lower() + "_cds_utils.h"
    filePath = os.path.join(g_OutDir, tgtApp.lower(), "fsw", "tables", name)
    fileExist_p = os.path.exists(filePath)

    if "none" in g_Tbls or "cds" not in g_Tbls:
        # Remove file
        app_utils.remove_file(filePath)
    elif "cds" in g_Tbls:
        # Open file
        fileHdl = app_utils.open_file_for_writing(filePath, False)
        # Write to file
        fileHdl.write(construct_cds_util_header_content(tgtApp))
        # Close file
        app_utils.close_file_from_writing(fileHdl, filePath, fileExist_p)
    else:
        pass
Example #3
0
def generate_table_makefile(tgtApp):
    global g_OutDir, g_Tbls

    # Construct file path
    name = tgtApp.lower() + "_tables.mak"
    filePath = os.path.join(g_OutDir, tgtApp.lower(), "fsw", "for_build", name)

    if not g_Tbls:
        # Remove existing file, if exists
        app_utils.remove_file(filePath)
    elif "iload" in g_Tbls or "cds" in g_Tbls:
        fileExist_p = os.path.exists(filePath)
        # Open file
        fileHdl = app_utils.open_file_for_writing(filePath, False)

        # Write to file
        fileHdl.write(construct_table_makefile_content(tgtApp))

        # Close file
        app_utils.close_file_from_writing(fileHdl, filePath, fileExist_p)
    else:
        pass
Example #4
0
def generate_table_makefile(tgtApp):
    global g_OutDir, g_Tbls

    # Construct file path
    name = tgtApp.lower() + "_tables.mak"
    filePath = os.path.join(g_OutDir, tgtApp.lower(), "fsw", "for_build", name)

    if not g_Tbls:
        # Remove existing file, if exists
        app_utils.remove_file(filePath)
    elif "iload" in g_Tbls or "cds" in g_Tbls:
        fileExist_p = os.path.exists(filePath)
        # Open file
        fileHdl = app_utils.open_file_for_writing(filePath, False)

        # Write to file
        fileHdl.write(construct_table_makefile_content(tgtApp))

        # Close file
        app_utils.close_file_from_writing(fileHdl, filePath, fileExist_p)
    else:
        pass
Example #5
0
def generate_iload_utils_source(tgtApp):
    global g_OutDir, g_Tbls

    # Construct file path
    name = tgtApp.lower() + "_iload_utils.c"
    filePath = os.path.join(g_OutDir, tgtApp.lower(), "fsw", "tables", name)
    fileExist_p = os.path.exists(filePath)

    if "none" in g_Tbls or "iload" not in g_Tbls:
        # Remove file
        app_utils.remove_file(filePath)
    elif "iload" in g_Tbls:
        # Open file
        fileHdl = app_utils.open_file_for_writing(filePath, False)
        # Write to file
        fileHdl.write(construct_source_iload_util_head_content(tgtApp))
        fileHdl.write(construct_source_iload_util_init_content(tgtApp))
        fileHdl.write(construct_source_iload_util_validate_content(tgtApp))
        fileHdl.write(construct_source_iload_util_process_content(tgtApp))
        fileHdl.write(construct_source_iload_util_tail_content(tgtApp))
        # Close file
        app_utils.close_file_from_writing(fileHdl, filePath, fileExist_p)
    else:
        pass
Example #6
0
def generate_iload_utils_source(tgtApp):
    global g_OutDir, g_Tbls

    # Construct file path
    name = tgtApp.lower() + "_iload_utils.c"
    filePath = os.path.join(g_OutDir, tgtApp.lower(), "fsw", "tables", name)
    fileExist_p = os.path.exists(filePath)

    if "none" in g_Tbls or "iload" not in g_Tbls:
        # Remove file
        app_utils.remove_file(filePath)
    elif "iload" in g_Tbls:
        # Open file
        fileHdl = app_utils.open_file_for_writing(filePath, False)
        # Write to file
        fileHdl.write(construct_source_iload_util_head_content(tgtApp))
        fileHdl.write(construct_source_iload_util_init_content(tgtApp))
        fileHdl.write(construct_source_iload_util_validate_content(tgtApp))
        fileHdl.write(construct_source_iload_util_process_content(tgtApp))
        fileHdl.write(construct_source_iload_util_tail_content(tgtApp))
        # Close file
        app_utils.close_file_from_writing(fileHdl, filePath, fileExist_p)
    else:
        pass