#include "pidf_local.h" SDDAS_INT SweepNUnits (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT *num_units) { SDDAS_INT error_code; SDDAS_INT scan_block; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, NOTUSED, NUNITS, (void *) num_units)) != ALL_OKAY) return (error_code); return (ALL_OKAY); } SDDAS_INT SweepSCFSensor (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT unit_num, SDDAS_INT *scf_sensor) { SDDAS_INT error_code; SDDAS_INT scan_block; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, unit_num, SCANSCFSEN, (void *) scf_sensor)) != ALL_OKAY) return (error_code); return (ALL_OKAY); } SDDAS_INT SweepVSCFSensor (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT unit_num, SDDAS_INT *v_scf_sensor) { SDDAS_INT error_code; SDDAS_INT scan_block; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, unit_num, VSCANSCFSEN, (void *) v_scf_sensor)) != ALL_OKAY) return (error_code); return (ALL_OKAY); } SDDAS_INT SweepVUBSCFSensor (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT unit_num, SDDAS_INT *v_ub_scf_sensor) { SDDAS_INT error_code; SDDAS_INT scan_block; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, unit_num, VSCANUBSCFSEN, (void *) v_ub_scf_sensor)) != ALL_OKAY) return (error_code); return (ALL_OKAY); } SDDAS_INT SweepUnitNums (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT *unit_nums) { SDDAS_INT number_tot_scans, scan_block; SDDAS_INT i; SDDAS_INT unit_idx = 0; SDDAS_INT error_code; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, NOTUSED, NUNITS, (void *) &number_tot_scans)) == ALL_OKAY) { for (i = 0; i < number_tot_scans; i++) { if ((error_code = ReadNewPidf(key, exten, SWEEP_STEP, scan_block, i, UNITNUM, (void *) &unit_nums [unit_idx])) == ALL_OKAY) { unit_idx++; } else return (error_code); } } else return (error_code); return (ALL_OKAY); } SDDAS_INT SweepVarUnitNums (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT *unit_nums) { SDDAS_INT number_tot_scans, scan_block; SDDAS_INT i; SDDAS_INT var_unit; SDDAS_INT unit_idx = 0; SDDAS_INT error_code; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, NOTUSED, NUNITS, (void *) &number_tot_scans)) == ALL_OKAY) { for (i = 0; i < number_tot_scans; i++) { if ((ReadNewPidf (key, exten, SWEEP_STEP, scan_block, i, VARUNITNUM, (void *) &var_unit)) != ALL_OKAY) { var_unit = 0; } unit_nums [unit_idx] = var_unit; unit_idx++; } } else return (error_code); return (ALL_OKAY); } SDDAS_INT SweepVarUnitUbNums (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, SDDAS_INT *unit_nums) { SDDAS_INT number_tot_scans, scan_block; SDDAS_INT i; SDDAS_INT var_unit; SDDAS_INT unit_idx = 0; SDDAS_INT error_code; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, NOTUSED, NUNITS, (void *) &number_tot_scans)) == ALL_OKAY) { for (i = 0; i < number_tot_scans; i++) { if ((ReadNewPidf (key, exten, SWEEP_STEP, scan_block, i, VARUNITUBNUM, (void *) &var_unit)) != ALL_OKAY) { var_unit = 0; } unit_nums [unit_idx] = var_unit; unit_idx++; } } else return (error_code); return (ALL_OKAY); } SDDAS_INT SweepUnitFmts (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, char *unit_fmts) { SDDAS_INT number_tot_scans, scan_block; SDDAS_INT i; SDDAS_INT unit_idx = 0; SDDAS_INT error_code; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, NOTUSED, NUNITS, (void *) &number_tot_scans)) == ALL_OKAY) { for (i = 0; i < number_tot_scans; i++) { if ((error_code = ReadNewPidf(key, exten, SWEEP_STEP, scan_block, i, UNITFMT, (void *) &unit_fmts [unit_idx])) == ALL_OKAY) { unit_idx++; } else return (error_code); } } else return (error_code); return (ALL_OKAY); } SDDAS_INT SweepVarUnitFmts (SDDAS_ULONG key, const SDDAS_CHAR *exten, SDDAS_INT scan_num, char *unit_fmts) { SDDAS_INT number_tot_scans, scan_block; SDDAS_INT i; char var_fmt; SDDAS_INT unit_idx = 0; SDDAS_INT error_code; if ((error_code = ReadNewPidf(key, exten, SENSOR, scan_num, NOTUSED, SWPNDX, (void *) &scan_block)) != ALL_OKAY) return (error_code); if ((error_code = ReadNewPidf (key, exten, SWEEP_STEP, scan_block, NOTUSED, NUNITS, (void *) &number_tot_scans)) == ALL_OKAY) { for (i = 0; i < number_tot_scans; i++) { if ((ReadNewPidf (key, exten, SWEEP_STEP, scan_block, i, VARUNITFMT, (void *) &var_fmt)) != ALL_OKAY) { var_fmt = '\0'; } unit_fmts [unit_idx] = var_fmt; unit_idx++; } } else return (error_code); return (ALL_OKAY); }