1,4 → 1,5 |
#include "MPOD.h" |
#include <utility.h> |
#include "HVtest_ui.h" |
|
#define HVSLOT 3 |
14,7 → 15,7 |
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, |
LPSTR lpszCmdLine, int nCmdShow) { |
|
const int mo=3; |
const int mo=HVSLOT; |
const int ch0=100*mo; |
|
int mainonoff,HVonoffall; |
65,12 → 66,13 |
} |
for (i=0;i<4;i++) { |
if (!HVonoffall) HVonoff[i]=1; |
SetCtrlVal (p1h, HVonoff_rID[i], HVonoff[i]); |
SetCtrlVal (p1h, HVonoff_rID[i], HVonoff[i]); |
} |
HVvset[0]=getOutputVoltage(crate1,ch0); |
SetCtrlVal (p1h, P1_HVvset, HVvset[0]); |
HVcset[0]=1e+6*getOutputCurrent(crate1,ch0); |
SetCtrlVal (p1h, P1_HVcset, HVcset[0]); |
SetAxisScalingMode (p1h, P1_G1, VAL_LEFT_YAXIS, VAL_MANUAL, -(HVcset[0]+1), 1.); |
HVvrise=getModuleRampSpeedVoltage(crate1,mo); |
SetCtrlVal (p1h, P1_HVvrise, HVvrise); |
// vfall[0]=abs(getOutputFallRate(crate1,ch)); |
94,7 → 96,8 |
SetCtrlVal (p1h, HVvdis_rID[i], HVvdis[i]); |
HVcdis[i]=1e+6*getCurrentMeasurement(crate1, ch0+i); |
SetCtrlVal (p1h, HVcdis_rID[i], HVcdis[i]); |
PlotStripChart (p1h, P1_G1, HVcdis, 4, 0, 0, VAL_DOUBLE); |
} |
PlotStripChart (p1h, P1_G1, HVcdis, 4, 0, 0, VAL_DOUBLE); |
break; |
case P1_MSW: |
GetCtrlVal (p1h, P1_MSW, &mainonoff); |
115,31 → 118,39 |
SetCtrlVal (p1h, P1_HVvset, HVvset[0]); |
HVcset[0]=1e+6*getOutputCurrent(crate1,ch0); |
SetCtrlVal (p1h, P1_HVcset, HVcset[0]); |
SetAxisScalingMode (p1h, P1_G1, VAL_LEFT_YAXIS, VAL_MANUAL, -(HVcset[0]+1), 1.); |
HVvrise=getModuleRampSpeedVoltage(crate1,mo); |
SetCtrlVal (p1h, P1_HVvrise, HVvrise); |
} |
break; |
} |
} |
if (!mainonoff) continue; |
switch (rID) { |
case P1_HVonoff: |
GetCtrlVal (p1h, P1_HVonoff, &HVonoffall); |
for (i=0;i<4;isetChannelSwitch(crate1, ch, onoff[0]); |
case P1_HVonoffall: |
GetCtrlVal (p1h, P1_HVonoffall, &HVonoffall); |
for (i=0;i<4;i++) { |
GetCtrlVal (p1h, HVonoff_rID[i], &HVonoff[i]); |
if (HVonoff[i]) |
setChannelSwitch(crate1, ch0+i, HVonoffall); |
} |
break; |
case P1_V0: |
GetCtrlVal (p1h, P1_V0, &vset[0]); |
setOutputVoltage(crate1, ch, vset[0]); |
case P1_HVvset: |
GetCtrlVal (p1h, P1_HVvset, &HVvset[0]); |
for (i=0;i<4;i++) |
setOutputVoltage(crate1, ch0+i, HVvset[0]); |
break; |
case P1_C0: |
GetCtrlVal (p1h, P1_C0, &cset[0]); |
cset[0]/=1e+6; //[uA] |
setOutputCurrent(crate1, ch, cset[0]); |
case P1_HVcset: |
GetCtrlVal (p1h, P1_HVcset, &HVcset[0]); |
SetAxisScalingMode (p1h, P1_G1, VAL_LEFT_YAXIS, VAL_MANUAL, -(HVcset[0]+1), 1.); |
HVcset[0]/=1e+6; //[uA] |
for (i=0;i<4;i++) |
setOutputCurrent(crate1, ch0+i, HVcset[0]); |
break; |
case P1_VRI0: |
GetCtrlVal (p1h, P1_VRI0, &ret); |
setModuleRampSpeedVoltage(crate1, mo, ret); |
vrise[0]=getModuleRampSpeedVoltage(crate1,mo); |
SetCtrlVal (p1h, P1_VRI0, vrise[0]); |
case P1_HVvrise: |
GetCtrlVal (p1h, P1_HVvrise, &HVvrise); |
setModuleRampSpeedVoltage(crate1, mo, HVvrise); |
HVvrise=getModuleRampSpeedVoltage(crate1,mo); |
SetCtrlVal (p1h, P1_HVvrise, HVvrise); |
break; |
// case P1_VFA0: |
// GetCtrlVal (p1h, P1_VFA0, &ret); |