Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: VENPCCMX

VENPCCMX.m

Go to the documentation of this file.
  1. VENPCCMX ; IHS/OIT/GIS - PRINT DEAMON MONITOR 12 Feb 2004 10:12 AM ;
  1. ;;2.6;PCC+;**1,3**;APR 03, 2012;Build 24
  1. ;
  1. ;
  1. ;
  1. MON ; EP-MONITOR THE PRINT DEAMON
  1. N %,STOP,LAST,TOT
  1. S %=+$O(^TMP("VEN TASK",0)),LAST=$G(^TMP("VEN TASK",%))
  1. I '$D(^TMP("VEN TASK")) G:$$MSG(1) RPT Q
  1. W !,"The Print Deamon is being monitored"
  1. RPT W !!
  1. F TOT=1:1 Q:$G(STOP) D
  1. . S %=$O(^TMP("VEN TASK",0)) I '% D Q
  1. .. S STOP=1
  1. .. S %=$O(^VEN(7.7,999999999),-1) I '% Q
  1. .. I '$P($G(^VEN(7.7,%,0)),U,6) W !,"Print Deamon encountered an error: ",$G(^(1))
  1. .. Q
  1. . S %=^TMP("VEN TASK",%) I %="" S STOP=1 Q
  1. . I TOT=60,%=LAST W !,"The Print Deamon appears to be stuck!",!,"It will be shut down now..." D KILLTASK^VENPCCP S STOP=1 Q
  1. . I TOT=60 S TOT=1,LAST=%
  1. . W $C(13),?70,$C(13)
  1. . W %
  1. . R %:1 E Q
  1. . I %="^^" W !,"The Print Deamon has been stopped!" D KILLTASK^VENPCCP S STOP=1 Q
  1. . I %="" S STOP=1 Q
  1. . Q
  1. Q
  1. ;
  1. MSG(STATE) ; EP - START THE PRINT DEAMON MSG
  1. N %,%Y
  1. I $G(STATE) D
  1. . W !,"The Print Deamon does not appear to be running at this time!"
  1. . S %=$O(^VEN(7.7,999999999),-1) I '% Q
  1. . I '$P($G(^VEN(7.7,%,0)),U,6) W !,"It stopped with this error: ",$G(^(1))
  1. . Q
  1. W !,"Want to start the Print Deamon now"
  1. S %=1 D YN^DICN I %'=1 Q 0
  1. I $D(^TMP("VEN TASK")) W !,"Print Deamon has been started!" Q 1
  1. X ("J "_U_"VENPCCP")
  1. W !,"Attempting to start the Print Deamon... Please wait"
  1. H 3
  1. I $D(^TMP("VEN TASK")) W !,"Print Deamon has been started!" Q 1
  1. W !,"Unable to start the Print Deamon! Notify site manager..."
  1. Q 0
  1. ;
  1. STOP ; EP-STOP THE PRINT DEAMON
  1. I '$D(^TMP("VEN TASK")) W !,"The print deamon is not running at this time!" Q
  1. N %,%Y,CFIGIEN,PATH
  1. S CFIGIEN=$$CFG^VENPCCU
  1. S PATH=$G(^VEN(7.5,CFIGIEN,1))
  1. S %=$$COUNT^VENPCCP(PATH)
  1. I %=1 W !,"There is one file waiting to be processed by the Print Deamon" G SS
  1. I '% S %="no"
  1. W !,"There are ",%," files waiting to be processed by the Print Deamon"
  1. SS W !,"Want to stop the Print Deamon now"
  1. S %=1 D YN^DICN I %'=1 Q
  1. D KILLTASK^VENPCCP K ^TMP("VEN ERROR FLAG")
  1. S1 W !,"The Print Deamon has been stopped!"
  1. Q
  1. ;
  1. START ; EP-START THE PRINT DEAMON
  1. I $$MSG(0)
  1. Q
  1. ;
  1. RESTART ; EP-CLEAN OUT THE PRINT DIRECTORY AND RESTART THE PRINT DEAMON
  1. W !,"WARNING!!!",!,"This option will erase all files in the print queue and reset the system"
  1. W !,"Want to proceed" S %=2 D YN^DICN I %'=1 Q
  1. N PATH,F,CFIGIEN,%
  1. S PATH=$G(^VEN(7.5,+$$CFG^VENPCCU,1)) I '$L(PATH) W !,"Unable to find path in config file!. Request terminated.",!! Q
  1. S F="*.txt"
  1. D DEL^VENPCCP(PATH,F) W !,"The Print Directory has been cleaned out.",!!
  1. D KILLTASK^VENPCCP K ^TMP("VEN ERROR FLAG")
  1. I $$MSG(0)
  1. Q
  1. ;
  1. AUTO ; EP-AUTOMATICALLY START PCC PLUS PRINT DEAMON
  1. D KILLTASK^VENPCCP K ^TMP("VEN ERROR FLAG")
  1. X ("J "_U_"VENPCCP")
  1. Q
  1. ;