source: WorldVistAEHR/trunk/r/CAPACITY_MANAGEMENT_TOOLS-KMPD-KMPL/KMPDUG2.m@ 619

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

initial load of WorldVistAEHR

File size: 4.6 KB
Line 
1KMPDUG2 ;OAK/RAK - CM Tools Graph Utility ;2/17/04 09:59
2 ;;2.0;CAPACITY MANAGEMENT TOOLS;;Mar 22, 2002
3 ;
4OPTIONS(KMPUOPTS) ;-- select options.
5 ;-----------------------------------------------------------------------
6 ; KMPUOPTS.. Result of selection.
7 ; Exceptions: "" - No options selected.
8 ; ^ - User up-arrowed out.
9 ;-----------------------------------------------------------------------
10 N I,X,OUT
11 S KMPUOPTS="",OUT=0
12 S DTIME=$S($G(DTIME):DTIME,1:300)
13 F D Q:OUT
14 .W !?5,"The following graph selections are 'optional':"
15 .D DISPLAY(.KMPUOPTS) I KMPUOPTS="" S OUT=1 Q
16 .R !!,"Enter one or more option letter(s): ",X:DTIME
17 .I X="" S OUT=1,KMPUOPTS="" Q
18 .I X="^" S OUT=1,KMPUOPTS="^" Q
19 .I X["?" D HELP W @IOF Q
20 .;
21 .; remove any commas, dashes or spaces.
22 .S X=$TR(X,",- ",""),X=$$UP^XLFSTR(X)
23 .;
24 .; check for invalid answer.
25 .D CHECK Q:KMPUOPTS=""
26 .;
27 .I X["A",(X'["V") D Q
28 ..W *7,!!?10,"Angle Data Titles only available with a Vertical Graph..."
29 .;
30 .; if vertical display warning message.
31 .I X["V" D
32 ..W !!?7,"...please be aware that because of screen limitations Vertical"
33 ..W !?7," Graphs are not as accurate as Horizontal Graphs and should be"
34 ..W !?7," used for visual comparison rather than detailed analysis..."
35 .;
36 .S KMPUOPTS=X,OUT=1
37 ;
38 Q
39 ;
40CHECK ;-- check for valid answer.
41 N I
42 F I=1:1:$L(X) I KMPUOPTS'[$E(X,I) D Q
43 .W *7,!!?10,"'",$E(X,I),"' is not an available option."
44 .S KMPUOPTS=""
45 Q
46 ;
47DISPLAY(KMPUOPT) ;-- display available options.
48 ;-----------------------------------------------------------------------
49 ; KMPUOPT... Will be set to available options.
50 ;-----------------------------------------------------------------------
51 N I S KMPUOPT="" W !
52 F I=1:1 Q:$T(OPT+I)']"" D
53 .W !?7,$P($T(OPT+I),";",3)," - ",$P($T(OPT+I),";",4)
54 .S KMPUOPT=KMPUOPT_$P($T(OPT+I),";",3)
55 Q
56 ;
57FTR(FOOTER,VALUE) ;print footer
58 ;--------------------------------------------------------------------
59 ; line feed to IOSL-3 and place message on screen
60 ; if IOSL or IOM are not defined routine will quit
61 ;
62 ; FOOTER - text to appear at the bottom of the screen
63 ; if footer is not defined then the message
64 ; 'Press RETURN to continue, '^' to exit' will appear
65 ;
66 ; footer appears in the middle of the screen
67 ;
68 ; VALUE - value returned:
69 ; "" - if IOSL or IOM are not defined
70 ; 0 - if an uparrow '^' is entered
71 ; 1 - if return is entered
72 ;
73 S VALUE=""
74 I '$G(IOSL)!('$G(IOM)) Q
75 N DIR,I,X,Y
76 I $G(FOOTER)']"" S FOOTER="Press RETURN to continue, '^' to exit"
77 I $G(IORVON)']""!($G(IORVOFF)']"") N IORVON,IORVOFF,X D
78 .S X="IORVON;IORVOFF" D ENDR^%ZISS
79 S FOOTER=IORVON_" "_FOOTER_" "_IORVOFF
80 S DIR(0)="EA",DIR("A")=$J(" ",(IOM-$L(FOOTER)/2))_FOOTER
81 F I=$Y:1:(IOSL-3) W !
82 D ^DIR S VALUE=Y
83 Q
84 ;
85HELP ;--help display for options.
86 N KMPUOUT
87 W @IOF
88 W !,"A: Angle data titles..: Angle the titles (for Vertical Graphs only)."
89 W !," Example: __________"
90 W !," | |"
91 W !," | |"
92 W !," | |"
93 W !," __________"
94 W !," J F M A"
95 W !," a e a p"
96 W !," n b r r"
97 W !
98 W !,"D: Double space data..: Will place an empty column/row between graph bars"
99 W !," (it is highly recommended that double spacing be used"
100 W !," with Vertical graphs)."
101 W !
102 W !,"G: Grid...............: Print grid lines on graph."
103 W !," example: ______________________________"
104 W !," Jan | | | | | | |"
105 W !," Feb | | | | | | |"
106 W !," Mar | | | | | | |"
107 W !," Apr | | | | | | |"
108 W !," ______________________________"
109 D FTR("",.KMPUOUT) Q:'KMPUOUT W @IOF
110 W !,"S: Scientific Notation: If values are 1000 or greater the graph will normally"
111 W !," display a description as...: (x10k), (x100k), etc."
112 W !," - Scientific notation will be: (x10^2), (x10^3), etc."
113 W !
114 W !,"V: Vertical graph.....: The default is horizontal display."
115 W !," - Selecting this option will display data vertically"
116 W !," (graph bars running top to bottom)."
117 D FTR("Press <RET> to continue: ") W @IOF,!!!
118 Q
119 ;
120OPT ;list of options
121 ;;A;Angle data titles (vertical graph only).
122 ;;D;Double space data.
123 ;;G;Grid.
124 ;;S;Scientific Notation.
125 ;;V;Vertical graph.
Note: See TracBrowser for help on using the repository browser.