/* * MitigationConstants.h * MPSLinkProcessor * * Created by Stephen Norum. * Copyright 2009 Stanford Linear Accelerator Center. All rights reserved. * */ #ifndef MITIGATIONCONSTANTS_H #define MITIGATIONCONSTANTS_H #ifdef __cplusplus extern "C" { #endif enum MPSMitigationSpecialValues { #warning snorum: reconsider this value... MPSMitigationTimeslotsRelevantToPermitMessage = 1800 + 180, /* (11 * MPSMitigationMinCloseTimeMechanicalShutter) */ MPSMitigationNumberOfTimeslotsPerSecond = 360, }; /* Minimum Timeslot Downtimes * -------------------------- * Minimum downtimes are calculated as: * * Min Downtime = Ceiling(N / R) - A * * where * N = Number of Timeslots Per Second * R = Requested Beam Rate * A = Number of Timeslots Permit Message Can Be Sent In Advance * * For the Pockels Cell and BYKIK at all rates, N = 360, A = 2, and R is the beam rate. * For the shutters device is always open at rates greater than 0 Hz and always closed for 0 Hz. * * Note: MPSMitigationMinDowntime0Hz _must_ be larger than MPSMitigationMaxTimeslotsSinceLastBeam */ enum MPSMitigationMinDowntimes { MPSMitigationMinDowntime120Hz = (MPSMitigationNumberOfTimeslotsPerSecond / 120) - 2, /* 1 */ MPSMitigationMinDowntime60Hz = (MPSMitigationNumberOfTimeslotsPerSecond / 60) - 2, /* 4 */ MPSMitigationMinDowntime30Hz = (MPSMitigationNumberOfTimeslotsPerSecond / 30) - 2, /* 10 */ MPSMitigationMinDowntime10Hz = (MPSMitigationNumberOfTimeslotsPerSecond / 10) - 2, /* 34 */ MPSMitigationMinDowntime1Hz = (MPSMitigationNumberOfTimeslotsPerSecond / 1) - 2, /* 358 */ MPSMitigationMaxTimeslotsSinceLastBeam, MPSMitigationMinDowntime0Hz }; /* All times in units of number of timeslots passed (timeslots update at 360 Hz) */ enum MPSMitigationOpenCloseTimes { MPSMitigationMinCloseTimePockelsCell = 0, /* ( 0 ms * 360 Hz) */ MPSMitigationMinStableCloseTimePockelsCell = 1, /* ( 2.8 ms * 360 Hz) */ MPSMitigationMinStableOpenTimePockelsCell = 1, /* ( 2.8 ms * 360 Hz) */ MPSMitigationMinCloseTimeMechanicalShutter = 180, /* ( 500 ms * 360 Hz) */ MPSMitigationMinStableCloseTimeMechanicalShutter = 180, /* ( 500 ms * 360 Hz) */ MPSMitigationMinStableOpenTimeMechanicalShutter = 180, /* ( 500 ms * 360 Hz) */ MPSMitigationMinCloseTimeBykik = 0, /* ( 0 ms * 360 Hz) */ MPSMitigationMinStableCloseTimeBykik = 1, /* ( 2.8 ms * 360 Hz) */ MPSMitigationMinStableOpenTimeBykik = 1, /* ( 2.8 ms * 360 Hz) */ MPSMitigationMinCloseTimeLaserHeaterShutter = 1080, /* (3000 ms * 360 Hz) */ MPSMitigationMinStableCloseTimeLaserHeaterShutter = 180, /* ( 500 ms * 360 Hz) */ MPSMitigationMinStableOpenTimeLaserHeaterShutter = 180 /* ( 500 ms * 360 Hz) */ }; #ifdef __cplusplus } #endif #endif