source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZISETDTM.m@ 738

Last change on this file since 738 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1ZISETDTM ;HGL::B-FmSys.Rsave;10:46 AM 21 Mar 1990;INITIALIZE DEVICE FILE FOR DATATREE ;4/9/92 14:17
2 ;;7.1;KERNEL;;Jun 08, 1993
3 ; ** For DataTree **
4 W !,"THIS ROUTINE INITIALIZES THE DEVICE FILE WITH CURRENT PORT NUMBERS"
5 W !,"OR UPDATES THE DEVICE FILE IF NEW HARDWARE HAS BEEN ADDED TO THE SYSTEM",!
6 R "OK? ",X:$S($D(DTIME):DTIME,1:9999),!! I X'?1"Y".E G EXIT
7 L +^%ZIS:2 W:'$T !,"FILE IS IN USE. TRY AGAIN LATER!!!",*7 Q:'$T
8 I '$D(^%ZIS(1,0)) S ^%ZIS(1,0)="DEVICE^3.5"
9 I $D(^%ZIS(2,0))[0 S ^%ZIS(2,0)="TERMINAL TYPE^3.2I^2^2" D TT
10 S %ZISV=$S($D(^%ZOSF("VOL")):^("VOL"),1:"")
11 D FLST
12QUES W !,"Please Enter a Prefix for New Devices: " W:%ZISV]"" %ZISV_"// "
13 R %ZISV1:300 Q:%ZISV1="^"!'$T S:%ZISV1="" %ZISV1=%ZISV
14 I %ZISV1?1"?"."?"!(%ZISV1="") D HLP G QUES
15 ;
16 S TYPE="TRM",DEV=1,ZISADD=0 D CHK,ADD:ZISADD
17 S TYPE="HFS" F DEV=10:1:17 S ZISADD=0 D CHK,ADD:ZISADD
18 S TYPE="SPL",DEV=18,ZISADD=0 D CHK,ADD:ZISADD
19 S TYPE="SDP",DEV=19,ZISADD=0 D CHK,ADD:ZISADD
20 S TYPE="TRM" F DEV=30:1:200 D CHKDEV I '$D(ERR) S ZISADD=0 D CHK,ADD:ZISADD
21 D C,SETCNTR
22 W !!,"Device File setup completed"
23EXIT ;
24 L -^%ZIS K %ZISV,%ZISV1,A,I,T,X,DEV,ERR,LST,NM,TYPE,ZISADD
25 Q
26 ;
27CHKDEV K ERR ZETRAP NODEV O DEV::0 C DEV Q
28NODEV S ERR="NO SUCH DEVICE" Q
29 ;
30C ; Close Logic
31 K ^%ZIS("C") S ^%ZIS("C")="G ^%ZISC"
32 Q
33SETCNTR S $P(^%ZIS(1,0),"^",3)=+LST,$P(^(0),"^",4)=T
34 Q
35 ;
36CHK I $O(^%ZIS(1,"G","SYS."_%ZISV_"."_DEV,0))>0 Q
37 I $O(^%ZIS(1,"CPU",%ZISV_"."_DEV,0))>0 Q
38 I $O(^%ZIS(1,"C",DEV,0))>0 Q
39 S NM=%ZISV1_DEV,ZISADD=1
40 Q
41ADD S LST=LST+1 G:$D(^%ZIS(1,+LST,0))#2 ADD S T=T+1
42 S ^%ZIS(1,+LST,0)=NM_"^"_DEV_"^^^^^^^"_%ZISV_"^^1"
43 I TYPE="TRM" S ^%ZIS(1,+LST,0)=$P(^%ZIS(1,+LST,0),"^",1,2)_"^1^1^"_$P(^(0),"^",5,99)
44 I TYPE="SDP" S $P(^%ZIS(1,+LST,0),"^",4)=1
45 S ^%ZIS(1,+LST,"TYPE")=TYPE
46 S ^%ZIS(1,"B",NM,+LST)="",^%ZIS(1,"C",DEV,+LST)=""
47 S ^%ZIS(1,"CPU",%ZISV_"."_DEV,+LST)="",^%ZIS(1,"G","SYS."_%ZISV_"."_DEV,+LST)=""
48 W !,"Device ",NM," added. TYPE=",^%ZIS(1,+LST,"TYPE")
49 Q
50FLST S (A,T)=0
51 F I=0:0 S I=+$O(^%ZIS(1,I)) Q:I'>0 S A=I,T=T+1
52 S LST=A
53 Q
54TT ; Define general terminal types
55 S ^%ZIS(2,1,0)="C-OTHER",^(1)="80^#^24^$C(8)",^(9)="general 'dumb' video terminal"
56 S ^%ZIS(2,2,0)="P-OTHER",^(1)="132^#^64^$C(8)",^(9)="General printer (132)"
57 S ^%ZIS(2,"B","C-OTHER",1)="",^%ZIS(2,"B","P-OTHER",2)=""
58 Q
59HLP ;HELP FOR PREFIX QUESTION
60 W !,"There must be a prefix for a new devices"
61 W !,"because the Device Name and the $I cannot"
62 W !,"be the same."
63 Q
Note: See TracBrowser for help on using the repository browser.