topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 9:02 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Across-the-room Stability Monitor  (Read 22300 times)

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
DONE: Across-the-room Stability Monitor
« on: February 03, 2006, 02:05 AM »
this idea might be pretty easy to code hopefully.... let me explain:

I do a lot of CPU overclocking and stability testing, burn-in etc and am always building and testing new systems.  This often involves long time-consuming sessions of running various torture tests such as Prime95, SuperPI 32M, OCCT, Memtest etc.  It is boring to stare at the screen for 4 hours straight so often I will go to the next room and watch TV or listen to music etc.  I like to glance over my shoulder to make sure the system is still up & running and has not BSOD'd, rebooted, crashed or frozen.  Sometimes its hard to tell if the system has frozen from across the room.

So, I am looking for a program that does the following:

1) opens a window that shows a "heartbeat" which can be something like alternating flashing colors, changing patterns, some sort of color cycling animation, etc.

2) this window ideally should be resizable so that it can be made larger depending on the resolution of the monitor being used.

3) pattern or colors should shift once per second, or maybe once every 2-3 seconds.

4) cpu + ram usage of the program itself should be as minimal as possible so as not to interfere with or steal resources from the other stability testing programs.


This would make life a lot easier for testing these systems....  ;)
Any takers?
« Last Edit: February 18, 2006, 02:33 AM by brotherS »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #1 on: February 03, 2006, 03:59 AM »
I think a ahk script to do that wouldn't be too dificult.
The only think that worries me is the "low resurce" matter. Would 3mb of memory be too much?
I think that's the minimum a ahk script uses..

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #2 on: February 03, 2006, 04:56 AM »
Ok, just made a small ahk script.. I don't know if it fits your request, but here goes:
; Stability Monitor
Menu, tray, noicon
gosub ShowGui
return

ShowGui:
  Gui, Add, Button,gButtonSubmit vButtonSubmit x0 y0 w20 h20 +default,&X
  Gui,  +AlwaysOnTop +Resize
  ; -SysMenu  +ToolWindow -caption
  Gui, Color, Red
  ChangeColor = red
  SetTimer, Changer, 1000
  Gui, Show, x200 y200 w20 h100,Stability Monitor
return

Changer:
  GoSub %ChangeColor%
return

red:
  Gui, Color, Red
  ChangeColor = green
return

Green:
  Gui, Color, Green
  ChangeColor = Blue
return

Blue:
  Gui, Color, Blue
  ChangeColor = Yellow
return

Yellow:
  Gui, Color, yellow
  ChangeColor = black
return

Black:
  Gui, Color, Black
  changeColor = red
return

ButtonSubmit:
exitapp
return

GuiClose:
exitapp
return
« Last Edit: February 03, 2006, 05:08 AM by jgpaiva »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #3 on: February 03, 2006, 05:09 AM »
Here's the executable.

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #4 on: February 03, 2006, 10:33 AM »
thanks jgpaiva, this is cool and seems to work great!
3mb for this app is a little high but since you are using AHK there is not much you can do. 

One question, why did you put an additional "X" button in the top left?  something wrong with the normal close button in the title bar?

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #5 on: February 03, 2006, 11:06 AM »
1 more suggestion:  how about an .ini file that stores the last window size/position so it gets preserved between launches? that would be nice!

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #6 on: February 03, 2006, 11:09 AM »
3MB for this app is a little high but since you are using AHK there is not much you can do. 
Yep, i also figured you'd consider it a bit too much, but there really isn't any other option

One question, why did you put an additional "X" button in the top left?  something wrong with the normal close button in the title bar?
Ops... Put it there for testing and forgot to remove it. Code below is fixed, and i changed a performance setting to see if it consumes less memory. I don't think that ahk can do better than this :(

1 more suggestion:  how about an .ini file that stores the last window size/position so it gets preserved between launches? that would be nice!
Actually, i thought of this, but i still don't know how to do them, but I'm about to learn.
Tomorrow, if i don't forget, I'll post a version with an ini-file configuration ;)

; Stability Monitor
SetBatchLines, 100ms
Menu, tray, noicon
gosub ShowGui
return

ShowGui:
  Gui, Add, Button,gButtonSubmit vButtonSubmit x0 y0 w0 h0 +default,&X
  Gui,  +AlwaysOnTop +Resize
  Gui, Color, Red
  ChangeColor = red
  SetTimer, Changer, 1000
  Gui, Show, x200 y200 w20 h100,Stability Monitor
return

Changer:
  GoSub %ChangeColor%
return

red:
  Gui, Color, Red
  ChangeColor = green
return

Green:
  Gui, Color, Green
  ChangeColor = Blue
return

Blue:
  Gui, Color, Blue
  ChangeColor = Yellow
return

Yellow:
  Gui, Color, yellow
  ChangeColor = black
return

Black:
  Gui, Color, Black
  changeColor = red
return

ButtonSubmit:
exitapp
return

GuiClose:
exitapp
return

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #7 on: February 03, 2006, 11:31 AM »
Tomorrow, if i don't forget, I'll post a version with an ini-file configuration ;)
wow great stuff!! thanks a lot jgpaiva!
 :D

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #8 on: February 05, 2006, 07:13 PM »
 :) Did you get that ini version, LuckMan212?

If not, here's one.

Skrommel


;Alive - Show a flashing window to indicate a living system
;To use, save as Alive.ahk, download and install AutoHotkey from www.autohotkey.com
;Skrommel @2006

#SingleInstance,Force
OnExit,EXIT

x=
y=
w=100
h=100
pause=1000
color=FF0000

IfExist,Alive.ini
{
  IniRead,x,Alive.ini,Settings,x
  IniRead,y,Alive.ini,Settings,y
  IniRead,w,Alive.ini,Settings,w
  IniRead,h,Alive.ini,Settings,h
  IniRead,pause,Alive.ini,Settings,pause
}

Gui,+AlwaysOnTop +Resize
Gui,Color,%color%
Gui,Show,x%x% y%y% w%w% h%h%,Alive!
WinMove,Alive!,,%x%,%y%,%w%,%h%
SetTimer,CHANGE,%pause%
Return

CHANGE:
Gui,Color,%color%
StringLeft,first,color,2
StringTrimLeft,last,color,2
color=%last%%first%
Return

GuiClose:
EXIT:
WinGetPos,x,y,w,h,Alive!
IniWrite,%x%,Alive.ini,Settings,x
IniWrite,%y%,Alive.ini,Settings,y
IniWrite,%w%,Alive.ini,Settings,w
IniWrite,%h%,Alive.ini,Settings,h
IniWrite,%pause%,Alive.ini,Settings,pause
ExitApp
« Last Edit: February 05, 2006, 08:21 PM by skrommel »

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #9 on: February 06, 2006, 02:25 AM »
hey skrommel!  thanks-- works a treat

I need to learn AHK one of these days!  ;D

Can you tell me how to modify this app so it just alternates 0000FF and 000000 colors? (black/green).  I assume you can set a variable, something like....

if var=000000 then set var=0000FF else set var=000000
change color to var
..

but I dont know how to do this in AHK  :'(

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #10 on: February 06, 2006, 03:49 PM »
Replacing the CHANGE part should do the trick:

CHANGE:
If color=000000
  color=0000FF
Else
  color=000000
Return

Skrommel

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #11 on: February 06, 2006, 04:55 PM »
hey thanks skrommel!
actually it needs one more line:

CHANGE:
If color=000000
  color=00FF00
Else
  color=000000
Gui,Color,%color%
Return

and also, initial color must be set to black instead of red (line 13), otherwise color never changes:
color=000000
:Thmbsup:

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #12 on: February 06, 2006, 05:15 PM »
 :-[ Just to help you learn AHK...

Skrommel

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #13 on: February 06, 2006, 05:19 PM »
I made one more tweak, inifile and window name are now variables

#SingleInstance,Force
OnExit,EXIT

x=
y=
w=100
h=100
pause=1000
color=000000
inifile=Alive.ini
wintitle=Alive

IfExist,%inifile%
{
  IniRead,x,%inifile%,Settings,x
  IniRead,y,%inifile%,Settings,y
  IniRead,w,%inifile%,Settings,w
  IniRead,h,%inifile%,Settings,h
  IniRead,pause,%inifile%,Settings,pause
}

Gui,+AlwaysOnTop +Resize
Gui,Color,%color%
Gui,Show,x%x% y%y% w%w% h%h%,%wintitle%
WinMove,%wintitle%,,%x%,%y%,%w%,%h%
SetTimer,CHANGE,%pause%
Return

CHANGE:
If color=000000
  color=00FF00
Else
  color=000000
Gui,Color,%color%
Return

GuiClose:
EXIT:
WinGetPos,x,y,w,h,%wintitle%
IniWrite,%x%,%inifile%,Settings,x
IniWrite,%y%,%inifile%,Settings,y
IniWrite,%w%,%inifile%,Settings,w
IniWrite,%h%,%inifile%,Settings,h
IniWrite,%pause%,%inifile%,Settings,pause
ExitApp

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #14 on: February 13, 2006, 04:18 AM »
well i've been hacking away at AutoHotKey for a few hours, and have come up with a nice version (almost complete rewrite) of this little app!  ;D Its called SysBeacon now, and I've added a number of things (all described in the included README).  I credited jgpaiva and skrommel in the About Box for their help in getting me started.  Its been a great learning experience and even though this is a simple app I have learned a lot and plan to release some more apps in the coming weeks.
;)

screenshot:


Why not download it and let me know what you think!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #15 on: February 13, 2006, 04:24 AM »
looks cool!

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #16 on: February 13, 2006, 04:29 AM »
Welcome LuckMan to the coding snacks coder's group  :tellme:
SysBeacon looks good!
Congratulations on your first ahk script :D
Hope to see more of those soon  :Thmbsup:
Just one proposition: why don't you post the source?

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #17 on: February 13, 2006, 04:33 AM »
ok yes, here is the source as you requested:
keep in mind this will not really run correctly as an .ahk script without some modification, due to some custom things I am doing with PIDs and icons... but it could be easily tweaked to work again as a raw ahk script...
 ;)
;SysBeacon
; blinks at intervals to inform user that system is alive!
; v1.01 ©2006 LuckMan212, portions inspired by jgpaiva and skrommel of DonationCoder.com

#SingleInstance,Force
#NoTrayIcon
AutoTrim,Off
OnExit,SaveAndQuit

hdc:=DllCall("GetDC")
bpp:=DllCall("GetDeviceCaps", "Int", hdc, "Int", 12)
if bpp<32
{
  t_icon=7
  m_icon=Icon3
}
else
{
  t_icon=6
  m_icon=Icon1
}
appname=SysBeacon
inifile=%appname%.ini
myname=%A_ScriptName%
Process,Exist
mypid=%ErrorLevel%
if mypid=
  MsgBox,Error getting PID!

IfNotExist,%inifile%
{
  firstrun=true
  FileAppend,,%inifile%
  If ErrorLevel
    MsgBox, Error creating ini file!
}
IniRead,x,%inifile%,Settings,x,0
IniRead,y,%inifile%,Settings,y,0
IniRead,w,%inifile%,Settings,w,127
IniRead,h,%inifile%,Settings,h,127
IniRead,blinkinterval,%inifile%,Settings,blinkinterval,500
IniRead,color1,%inifile%,Settings,color1,000000
IniRead,color2,%inifile%,Settings,color2,00FF00
IniRead,aot,%inifile%,Settings,alwaysontop,1
;sanity checks
if x=
  x=0
if y=
  y=0
if w=
  w=127
if h=
  h=127
if blinkinterval=
  blinkinterval=500
if color1=
  color1=000000
if color2=
  color2=00FF00
if aot=
  aot=1

Gosub,TRAYMENU
Gosub,UPDATE_AOT
EnvSub,w,8
EnvSub,h,26
Gui,+Resize +ToolWindow
Gui,Color,%color1%
Gui,Show,x%x% y%y% w%w% h%h%,%appname%
Gosub SAVE_INI
SetTimer,CHANGE,%blinkinterval%
Return

CHANGE:
If color=%color2%
  color=%color1%
Else
  color=%color2%
Gui,Color,%color%
Return

TRAYMENU:
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,&About...,ABOUT
Menu,Tray,Add,Always On Top,TOGGLE_ONTOP
Menu,Tray,Add,
Menu,Tray,Add,&Quit,SaveAndQuit
Menu,Tray,Tip,%appname%
Menu,Tray,Icon,%A_ScriptFullPath%,%t_icon%
Menu,Tray,Icon
if firstrun=true
{
  TrayTip,Welcome to %appname%!,Right click on this menu for basic options.`nAdvanced users can access more settings by`ndirectly editing the .ini file.  Good luck testing!,5,1
}
Return

ABOUT:
Gui,2:Destroy
Gui,2:-SysMenu
Gui,2:Add,Picture,x+295 ym+3 GSND_WIDGET %m_icon%,%myname%
Gui,2:Font,s10 Bold,Tahoma
Gui,2:Add,Text,xm ym+3,%appname% v1.01
Gui,2:Font,s8 Norm,Tahoma
Gui,2:Add,Text,xm y+1,Blinks to let you know your machine hasn't frozen!
Gui,2:Add,Text,xm y+1,Some settings can be adjusted by editing the .ini file.
Gui,2:Add,Text,xm y+15,Thanks to jgpaiva and skrommel for their code samples.
Gui,2:Add,Text,xm y+1,Visit
Gui,2:Font,s8 CBlue Norm,Tahoma
Gui,2:Add,Text,x+3 GWWW1,donationcoder.com
Gui,2:Font,s8 CBlack Norm,Tahoma
Gui,2:Add,Text,x+3,- the best software community on the web!
Gui,2:Add,Text,xm y+15,coded by
Gui,2:Font,Bold,Tahoma
Gui,2:Add,Text,x+3,LuckMan212
Gui,2:Font,s8 CBlue Norm,Tahoma
Gui,2:Add,Text,xm y+1 GWWW2,xtremesystems.org
Gui,2:Font,s8 Norm,Tahoma
Gui,2:Add,Button,GABOUTOK Default xm+125 yp+17 w75,&OK
Gui,2:Show,,About
Return

WWW1:
Run,https://www.donationcoder.com,,UseErrorLevel
Return

WWW2:
Run,http://www.xtremesystems.org/forums/member.php?u=6536,,UseErrorLevel
Return

SND_WIDGET:
SoundPlay,%SystemRoot%\Media\Windows XP Pop-up Blocked.wav
Return

ABOUTOK:
Gui,2:Destroy
Return

TOGGLE_ONTOP:
aot := !aot
Gosub UPDATE_AOT
Return

UPDATE_AOT:
If aot=1
{
  Menu,Tray,Check,Always On Top
  Gui,+AlwaysOnTop
}
Else
{
  Menu,Tray,UnCheck,Always On Top
  Gui,-AlwaysOnTop
}
Return

SAVE_INI:
WinGetPos,x,y,w,h,%appname% ahk_pid %mypid%
IfNotExist,%inifile%
{
  FileAppend,,%inifile%
  If ErrorLevel
    MsgBox, Error creating ini file!
}
IniWrite,%x%,%inifile%,Settings,x
IniWrite,%y%,%inifile%,Settings,y
IniWrite,%w%,%inifile%,Settings,w
IniWrite,%h%,%inifile%,Settings,h
IniWrite,%blinkinterval%,%inifile%,Settings,blinkinterval
IniWrite,%color1%,%inifile%,Settings,color1
IniWrite,%color2%,%inifile%,Settings,color2
IniWrite,%aot%,%inifile%,Settings,alwaysontop
If ErrorLevel
    MsgBox, Error saving settings to ini file!
Return

GuiClose:
ExitApp

SaveAndQuit:
Gosub SAVE_INI
ExitApp

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #18 on: February 13, 2006, 04:41 AM »
Well.. I'll just try to learn something from your code.
Tell me, why do you do those dll calls?

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #19 on: February 13, 2006, 04:44 AM »
this external DLL call is to determine the monitor depth (32 bit, 8 bit etc).  If the system cannot display the 32bit icons embedded in the .exe, then it falls back on some 8bit ones.  I was just experimenting with this type of thing, and got that tip from the AHK forums.  There doesn't seem to be a way to determine monitor depth directly using AHK.

you can test this by setting your monitor to 8 bit and re-launching the app... you will see a different tray icon (at least you should!)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Across-the-room Stability Monitor
« Reply #20 on: February 13, 2006, 04:47 AM »
Sweet! I'm always learning something new about ahk ;)
Thanks!