#include "fivewin.ch"
STATIC oDlg1, oDlg2
STATIC oWndMain, oFontBig
STATIC oDlg3, oDlg4, oDlg5, oDlg6, oDlg7, oDlg8
STATIC lACTIVATED
Function Main()
Local oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6, oBtn7, oBtn8
PUBLIC cSat[8] // cSat1, cSat2, cSat3, cSat4, cSat5, cSat6, cSat7, cSat8
PUBLIC cHR[8] // cHR1, cHR2, cHR3, cHR4, cHR5, cHR6, cHR7, cHR8
DEFINE FONT oFontBig NAME "ARIAL" SIZE 50, 75 BOLD
ACTIVATE FONT oFontBig
lACTIVATED := .F.
For i = 1 to 8
c:= alltrim(str(i))
cSat[i] := "---"
cHR[i] := "---"
Next
DEFINE WINDOW oWndMain FROM 0,0 TO MaxRow(), MaxCol() TITLE "EzMon" COLOR RGB(0,0,0),RGB(255,255,255) MENU BuildMenu() //MDI //ICON "\EzSat\DLL\EzIcon2.ico"
MakeMainBar()
@ 6, 30 BUTTON oBtn1 PROMPT "Activate Monitor 1" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(1) )
@ 6, 100 BUTTON oBtn2 PROMPT "Activate Monitor 2" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(2) )
@ 14, 30 BUTTON oBtn3 PROMPT "Activate Monitor 3" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(3) )
@ 14,100 BUTTON oBtn4 PROMPT "Activate Monitor 4" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(4) )
@ 22, 30 BUTTON oBtn5 PROMPT "Activate Monitor 5" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(5) )
@ 22,100 BUTTON oBtn6 PROMPT "Activate Monitor 6" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(6) )
@ 30, 30 BUTTON oBtn7 PROMPT "Activate Monitor 7" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(7) )
@ 30,100 BUTTON oBtn8 PROMPT "Activate Monitor 8" of oWndMain SIZE 200,75 ;
ACTION ( IIF( lACTIVATED = .T., ( oDlg1:End(), lACTIVATED := .F. ), NIL ), MakeDialog(8) )
ACTIVATE WINDOW oWndMain MAXIMIZED VALID QuitApp()
Return Nil
// -----------------
function BuildMenu()
MENU oMenu 2007
MENUITEM "Exit"
MENU
MENUITEM "Exit Program" ACTION QuitApp()
ENDMENU
ENDMENU
return oMenu
// --------------
function quitapp()
dbcloseall()
set resources to
clear memory
ResAllFree()
Syswait(.5)
quit
return nil
Function MakeMainBar()
DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWndMain 2007 //36, 40
DEFINE BUTTON OF oBar FILE "\EzSat\Dll\Fix.bmp" ;
MESSAGE "Message";
TOOLTIP "Tooltip";
ACTION MsgInfo()
Return Nil
// --------------
Function MakeDialog( nDialog )
LOCAL oSaySat, oSayHR, oBtnInfo, oBtnQuit
Local nTop, nBottom, nLeft, nRight, cTitle:="Monitor # "+ALLTRIM(str(nDialog))
Local nWide:= 506, nHigh:=127
Local n
lACTIVATED := .T.
If nDialog = 1
nTop := 93
nLeft := 0
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 2
nTop := 93
nLeft := 512
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 3
nTop := 253
nLeft := 0
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 4
nTop := 253
nLeft := 512
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 5
nTop := 411
nLeft := 0
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 6
nTop := 411
nLeft := 512
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 7
nTop := 571
nLeft := 0
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
If nDialog = 8
nTop := 571
nLeft := 512
nBottom := nTop+nHigh
nRight := nLeft+nWide
Endif
// n := ALLTRIM(STR( nDialog ))
DEFINE DIALOG oDlg1 FROM nTop,nLeft to nBottom,nRight TITLE cTitle of oWndMain PIXEL ;
COLOR RGB(0,0,0),RGB(208,221,230) ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION) ;
TRANSPARENT
@ 2,40 SAY "SPO2" of oDlg1 PIXEL SIZE 25,10
@ 2,150 SAY "HR" of oDlg1 PIXEL SIZE 25,10
@ 10,5 SAY oSaySat VAR cSat[nDialog] FONT oFontBig PIXEL SIZE 82,37 UPDATE of oDlg1
@ 10,110 SAY oSayHR VAR cHR[nDialog] FONT oFontBig PIXEL SIZE 82,37 UPDATE of oDlg1
@ 1.5,34 BUTTON oBtnInfo PROMPT "Pt. Info" of oDlg1 ACTION PatientInfo()
// @ 2.5,34 BUTTON oBtnQuit PROMPT "Close " of oDlg1 ACTION oDlg1:End()
ACTIVATE DIALOG oDlg1 NOWAIT ;
ON PAINT GetData(oDlg1,n, oSaySat, oSayHR)
Return Nil
// ---------------
Function GetData(oDlg,n, oSaySat, oSayHR)
Local lTest:=.t.
Do while lTest := .t.
FOR I = 1 TO 8
// C=aLLTRIM(STR(I) )
cSat[i] := ALLTRIM(STR( ABS(HB_RandomInt( 85, 100 ) ) ) )
cHR[i] := ALLTRIM(STR( ABS(HB_RandomInt( 75, 150 ) ) ) )
TRY
IF VAL(cSat[i]) <= 88
oSaySat:SetColor( RGB(255,0,0),RGB(208,221,230))
ELSE
oSaySat:SetColor( RGB(0,0,0),RGB(208,221,230))
ENDIF
CATCH
END
NEXT
SysWait(1)
// For i = 1 to 8
// c:=alltrim( str( i ) )
TRY
oDlg:Update()
CATCH
END
// Next
ENDDO
Return Nil
Function PatientInfo()
Return Nil