Esempio n. 1
0
def mcs_data_grab(master_path):
    data_structure = data_format.epics_record_structure
    xmodel_fil_vars = list()
    for i, k in enumerate(data_structure):
        if data_structure[k]['scope'] == 'GBLV':
            xmodel_fil_vars.append(data_structure[k]['variable'])
    mcs_data = extract_data.main(master_path, xmodel_fil_vars)
    return mcs_data
Esempio n. 2
0
def import_label_data(master_path):
    # Imports the raw data required for the labels from a '.e.pmc' file.
    data_filter = ['e_BrickN_P',
                   'e_DevName_P',
                   'e_AxisID_P',
                   'b_AxisN_P',
                   'e_BrickIP_P',
                   'e_MotionRackIP_P',
                   ]
    controller_frame = extract_data.main(master_path, data_filter)
    return controller_frame
Esempio n. 3
0
def import_label_data(master_path):
    # Imports the raw data required for the labels from a '.e.pmc' file.
    data_fields = ['e_BrickN_P',
                   'e_DevName_P',
                   'e_AxisID_P',
                   'b_AxisN_P',
                   'a_Commutation_D',
                   'a_IsBrakeUsed_X',
                   'e_StageEncPortN_X',
                   'b_StageEncPortN_P',
                   'e_MotEncPortN_X',
                   'b_MotEncPortN_P',
                   'a_IsEncoderUsed_X',
                   'e_BrickIP_P',
                   ]
    controller_frame = extract_data.main(master_path, data_fields)
    return controller_frame
def main():
    filter_variables = list()
    values = iter_dict(data_format.levels)
    for value in values:
        filter_variables.append(expand_variables(value))
    master_paths = configuration_validation_tool.find_all_master()
    filename = export_config_validation()
    with open(filename, 'w') as f:
        f.write('\n')
        for gblv_path in master_paths:
            f.write(gblv_path + '\n')
            gblv_data = extract_data.main(gblv_path, filter_variables)
            for check in run_checks(gblv_data):
                for line in check:
                    f.write(line)
            f.write('\n\n')
    print('\nYour file has been created.')
    configuration_validation_tool.retry()
Esempio n. 5
0
def main():
    user_response = input('Do you want to search for all master.pmc files? [Y/N]\n')
    master_file_list = list()
    if user_response.lower() == 'y':
        master_file_list = configuration_validation_tool.find_all_master()
    elif user_response.lower() == 'n':
        master_file_list.append(configuration_validation_tool.find_one_master())
    else:
        print('That is not a valid answer, please try again.')
        main()
    file_data = list()
    for file in master_file_list:
        controller_data = import_label_data(file)
        gblv_label = raw_gblv_label(controller_data)
        file_data.append(gblv_label)
    mcs = extract_data.main(master_file_list[0], 'e_BrickN_P').irow(0)['e_BrickN_P'].strip("'")
    export_gblv_label(file_data, mcs)
    answer = input('Would you like to produce more GBLV labels? [Y/N]\n or type "Other" to select a different tool.\n')
    configuration_validation_tool.retry(answer, '4')
def st_match(st_path, master_path):
    # This checks that the data in the st.cmd file is consistent within the st.cmd file and also checks that the file
    # against the master.pmc.
    st_data = {'SPORT': 'No SPORT found', 'PORT': 'No PORT found'}
    ioc_path = check_st_cmd(st_path)
    master_ip_addr = extract_data.main(master_path, ['e_BrickIP_P'])['e_BrickIP_P']
    # Check if all IP's are the same. (They should be, this verification should be done before this stage.
    # In the asbuilt tool.)
    if all(x == master_ip_addr[0] for x in master_ip_addr):
        st_controller = st_master_compare(ioc_path, str(master_ip_addr[0]))
        st_data['SPORT'] = st_controller['IPPort']
        st_data['PORT'] = st_controller['PortName']
        print('ST values found.')
        return st_data
    elif not all(x == master_ip_addr[0] for x in master_ip_addr):
        print('IP addresses do not match for all the axis on this controller.\n')
        return st_data
    else:
        st_data = st_ask_input()
        return st_data
Esempio n. 7
0
def import_data(master_file):
    # Imports filtered data from master.pmc.
    filter_variables = data_format.motor_list_filter_variables
    data = extract_data.main(master_file, filter_variables)
    return data