Hello,
I'm debugging a very simple SAD script and got some errors. Please help me to see
what's the matter. Thanks a lot.
Ge
----------------------------
*** Welcome to SAD1.0.8.14.8b 9/5/2002 18:30:00 ***
14:26:23 Tuesday 02/25/2003 ***
cpu time= 3.0000E-02(sec) dt= 30.000(msec) free area:: 16147
OFF CTIME LOG;READ 77; ; 25
*** SADScript Initialization: /home1/local/sad/Packages/init.n ***
*** SADScript Version 1.0.8.10.5b 9/29/2001 ***
RFSW RADCOD RAD FLUC INTRA POL COD DAPER EMIOU CMPLO FOURI SMEAR
F F F T F F T F F F F T
Design orbit length = 1.
w = BKMainFrame["BasicEPICSTest", f, Title->"Basic Test on SAD/CA for BEPCII"];
f1 = Frame[f, PadY->5, Fill->"x"];
v1 = ""; s1 = "normal";
ch1 = CaOpenMonitor["jane",
ValueCommand:>(
$FORM = "6.2";
v1=ToString[ch1[Value]];
$FORM = "";
! s1=Switch[ch1[Severity],0,"normal",1,"minor",2,"major"];
)];
font = Font->TextFont["times","bold",18];
side = Side->"left";
l1a = TextLabel[f1, Text->"EPICS Record jane is ", side, font];
*** SAD/Tkinter Version 1.0.8.14.4b 8/19/2002 ***
???General::wrongtype: Argument must be List, Rule, Symbol, String, Real in Ove
rride[Frame[f,(PadY->5),(Fill->"x")],
(Text->"EPICS Record jane is "),(Side->"left"),(Font->"*-*-times-bold-r-*-*-18-*
-*-*-*-*-*-*")]
l1b = TextLabel[f1, TextVariable:>v1, FG->"tomato", side, font];
???General::wrongtype: Argument must be List, Rule, Symbol, String, Real in Ove
rride[Frame[f,(PadY->5),(Fill->"x")],
(TextVariable:>v1),(FG->"tomato"),(Side->"left"),(Font->"*-*-times-bold-r-*-*-18
-*-*-*-*-*-*-*")]
!l1c = TextLabel[f1, Text->" unit. Alarm Severity is ", side, font];
!l1d = TextLabel[f1, TextVariable:>s1, FG->"tomato", side, font];
TkWait[];
Comment by A. Morita
( Date: Wednesday, February 26, 2003 15:06:23)
o coding miss
i. spelling
BKMainFrame -> KBMainFrame
CaOpenMonitor -> CaMonitor(CaMonitor class constructor)
ii. Value/Severity method for CaMonitor instance `ch1'
ch1[Value] -> ch1@Value[]
ch1[Severity] -> ch1@Severity[]
(@: member operator, Value[]/Severity[]: CaMonitor class member function)
o recommend
If you want to change $FORM in local scope, use StandardForm[] function
$FORM="foo"; bar; $FORM=""; -> StandardForm[$FORM="foo"; bar];
Try following code
FFS;
w = KBMainFrame["BasicEPICSTest", f, Title->"Basic Test on SAD/CA for BEPCII"];
f1 = Frame[f, PadY->5, Fill->"x"];
v1 = ""; s1 = "normal";
ch1 = CaMonitor["jane",
ValueCommand:>(
StandardForm[$FORM = "6.2";
v1=ToString[ch1@Value[]];
! s1=Switch[ch1@Severity[],0,"normal",1,"minor",2,"major"];
])];
font = Font->TextFont["times","bold",18];
side = Side->"left";
l1a = TextLabel[f1, Text->"EPICS Record jane is ", side, font];
l1b = TextLabel[f1, TextVariable:>v1, FG->"tomato", side, font];
!l1c = TextLabel[f1, Text->" unit. Alarm Severity is ", side, font];
!l1d = TextLabel[f1, TextVariable:>s1, FG->"tomato", side, font];
TkWait[];