From 5e244d168aaeea24a1e9f9316e63e183feaad850 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 00:07:39 +0900 Subject: better abstraction of method of switching voltage-controlled PW range, for clarity --- device-functions.c | 19 +++++++++++++++---- device-functions.h | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/device-functions.c b/device-functions.c index 6630c19..243edee 100644 --- a/device-functions.c +++ b/device-functions.c @@ -578,12 +578,10 @@ int Set_Pw(int check_possible_only,int word_override,int range_override,int chan } } - /* Zout hardware/software is used in AVPP to control PW ranges in the - * external circuitry, not Zout */ - Set_zout(channel,globals.Flash.zout_min[channel],0); + Set_Use_Vctrl_PW_Range(channel,TRUE); } else { - Set_zout(channel,globals.Flash.zout_max[channel],0); + Set_Use_Vctrl_PW_Range(channel,FALSE); /* In AVPP units, the bottom range is voltage-controlled, and the upper range(s) are PWin=PWout. Therefore, shift the relay used by the upper ranges by one, to avoid @@ -1405,6 +1403,19 @@ int Set_zout(int channel,int setting,int really_for_zout) } +int Set_Use_Vctrl_PW_Range(int channel, gboolean mode) +{ + // This is a bit hackish. + // The Zout hardware/software is used in AVPP and similar units + // to control PW ranges in the external circuitry, not Zout. + if (mode == TRUE) { + Set_zout(channel,globals.Flash.zout_min[channel],0); + } else { + Set_zout(channel,globals.Flash.zout_max[channel],0); + } +} + + int Set_Load(int channel, float value) { int error_num; diff --git a/device-functions.h b/device-functions.h index c60bacb..532026b 100644 --- a/device-functions.h +++ b/device-functions.h @@ -27,6 +27,7 @@ int Set_Trig_Source(int channel,int mode); int Set_Gate_Sync(int channel,int mode); int Set_Gate_Level(int channel,int mode); int Set_zout(int channel,int setting,int really_for_zout); +int Set_Use_Vctrl_PW_Range(int channel, gboolean mode); int Set_Load(int channel, float value); int Set_EA(int channel,int mode); int Set_AdvDel(int channel,int setting); -- cgit