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/ZISETONT.m@ 703

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1ZISETONT ;SF/AC - INITIALIZES DEVICE AND TERMINAL TYPES FOR INTERSYSTEMS ;03/05/97 16:51
2 ;;8.0;KERNEL;;Jun 10, 1995
3 W !,"This routine will setup some defaults for intersystems OpenM for NT.",!,"in the ^%ZIS files.",!!
4 S X=0 I '$D(^%ZIS(1,0)) S X=1 W !!,"The device file is missing, Please install Kernel frist"
5 I '$D(^%ZIS(2,0)) S X=1 W !!,"The Subtype file is missing, Please install Kernel frist"
6 I X W !,"Then run this routine again." Q
7 R "OK? ",X:$S($D(DTIME):DTIME,1:60),!! G EXIT:X'?1"Y".E
8 L +^%ZIS:2 W:'$T !,"FILE IS IN USE. TRY AGAIN LATER!!!",*7 Q:'$T
9 S $P(^%ZIS(1,0),U,3)=0,$P(^%ZIS(2,0),U,3)=0 ;Cause it to fillin.
10 S U="^",%ZISV=$S($D(^%ZOSF("VOL")):^("VOL"),1:"")
11QUES ;I %ZISV]"" W !,"Please Enter a Prefix for New Devices: "_%ZISV_"//" R %ZISV1:$S($D(DTIME):DTIME,1:300) G EXIT:%ZISV1="^"!'$T S:%ZISV1="" %ZISV1=%ZISV I %ZISV1?1"?"."?" D HLP G QUES
12 F L=0:0 S L=$O(^DISV(L)) Q:L'>0 K ^DISV(L,"^%ZIS(1,")
13BASIC ;Load some basic devices
14 F IX=0:1 S X=$T(BX+IX) Q:$P(X,";",3)="" D
15 . F J=3:1:7 S:$P(X,";",J)]"" DEV($P(";;NAME;$I;ASKD;TYPE;SUB;",";",J))=$P(X,";",J)
16 . D ADDDEV(.DEV) Q ;FINISH
17 Q
18BX ;;Principal device;|TNT|;1;TRM;C-VT102
19 ;;Windows NT Console;|TRM|;1;VTRM;C-VT320
20 ;;Principal device;|LAT|;1;VTRM;C-VT320
21 ;
22SUB S (C,L,N)=0 I $D(^%ZIS(2,0)) S N=$P(^(0),U,4),L=$P(^(0),U,3)
23 W "TERMINAL TYPES:",!
24A S C=$O(^%IS(0,"SUB",C))
25 I C="" S R=$S($D(^%ZIS(2,0)):^(0),1:"TERMINAL TYPE^3.2"),^(0)=$P(R,U,1,2)_U_L_U_N G DEVICE
26 S R=^(C),Z=$S($D(^(C,1)):^(1),1:"") G A:$D(^%ZIS(2,"B",C)) I Z?."^" S Z=""
27 F L=L+1:1 I '$D(^%ZIS(2,L,0)) S ^(0)=C,^(1)=R,^%ZIS(2,"B",C,L)="",N=N+1 W C,! Q
28 I Z]"" S X=$P(Z,U,1,5)_U_$P(Z,U,11),^%ZIS(2,L,6)=X,X=$P(Z,U,10,12) D X
29 W !,C G A
30 ;
31X I X?."^" Q
32 S X=$P(X,U,1)_U_$P(X,U,3) I '$D(^%ZIS(2,N,5)) S ^(5)=X
33 Q
34 ;
35DEVICE S U="^",(L,N)=0 I $D(^%ZIS(1,0)) S N=$P(^(0),U,4),L=$P(^(0),U,3)
36 W !!,"DEVICES:",!
37 S I=0 F Y=0:0 S I=$O(^%IS(I)) Q:I'>0 I $D(^(I,0)),$D(^(1)),^(1)]"" S C=^(1),X=^(0) D CHK
38 F I=0:0 S I=$O(^%ZIS(1,I)) Q:I'>0 I '$D(^(I,99)) S C=$P(^(0),U,1) I $D(^%IS(C,99)),^(99)]"" S C=$O(^%ZIS(1,"B",^(99),0)) I C>0 S ^%ZIS(1,I,99)=C
39 S C=$S($D(^%ZIS(1,0)):^(0),1:"DEVICE^3.5"),^(0)=$P(C,U,1,2)_U_L_U_N
40C K ^%ZIS("C") S ^%ZIS("C")="G ^%ZISC"
41 W !!,"ALL SETUP"
42EXIT L -^%ZIS K %ZISV,%ZISV1,C,I,I1,L,N,R,X,Y Q
43 ;
44CHK I $P(C,U,1)'=I,'$D(^%ZIS(1,"B",I)) S I1=I D ADD Q
45 I $P(C,U,1)=I,'$S(%ZISV]"":$S($O(^%ZIS(1,"G","SYS."_%ZISV_"."_$P(C,U,1),0))>0:1,$O(^%ZIS(1,"CPU",%ZISV_"."_$P(C,U,1),0))>0:1,1:0),$O(^%ZIS(1,"C",$P(C,U,1),0))>0:1,1:0) S I1=%ZISV1_I D ADD Q
46 Q
47ADDDEV(IS) ;Add an entry to the device file
48 W I1,! S L=$P(^%ZIS(1,0),U,3) F L=L+1:1 I '$D(^%ZIS(1,L,0)) Q
49 ;S ^%ZIS(1,"B",NAM,L)="",^%ZIS(1,"C",DI,L)="",^%ZIS(1,L,0)=NAM_U_DI_U_($P(C,U,4)'=1)_U_'$P(C,U,4),^("TYPE")=$P(C,U,2),^("IOPAR")=$P(C,U,6),N=N+1 I X'?." " S ^(1)=X
50 S ^%ZIS(1,"B",IS("NAME"),L)="",^%ZIS(1,"C",IS("$I"),L)="",^%ZIS(1,L,0)=IS("NAME")_U_IS("$I")_U_$G(IS("ASKD")),^("TYPE")=IS("TYPE") ;,^("IOPAR")=$P(C,U,6),N=N+1 I X'?." " S ^(1)=X
51 I '$D(^%ZIS(1,"G","SYS."_%ZISV_"."_IS("$I"))) S ^("SYS."_%ZISV_"."_IS("$I"),L)="",$P(^%ZIS(1,L,0),U,11)=1
52 I '$D(^%ZIS(1,"CPU",%ZISV_"."_IS("$I"),L)) S ^(L)=""
53 I IO("SUB")]"" S C=$O(^%ZIS(2,"B",IO("SUB"),0)) I $D(^%ZIS(2,+C,0)) S ^%ZIS(1,L,"SUBTYPE")=C
54 Q
55HLP ;HELP FOR PREFIX QUESTION
56 W !,"There must be a prefix for a new device"
57 W !,"becuase the Device Name and the $I cannot"
58 W !,"be the same." Q
Note: See TracBrowser for help on using the repository browser.