Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Im new to c# and im building a windows form for the Modified early warning scoring system (MEWS) which is used in hospitals to monitor a patients health. I have built a GUI for it, but im not sure what code to put in to get it to work. Im using timers to move coloured labels across the screen to represent a patient vital signs. So for example the Respiration rate ive put in is
MIDL
tmrResps.Enabled = true; tmrResps.Interval = 2000;


Ive but a button in which starts the timers and this works fine. But what I want to do next is show a score based on the output of that vital sign timer. I want to use buttons which when pressed will display the score in a text box. What I want to know is what code do i use to make this work?
Posted

1 solution

Hello Max,

Create a global field called - ArrayList alCountHeartRate = new ArrayList();

with each heart rate - you need to use Random() to break the constant 2 second intervals per heart beat - so that it deviates in routine.
Meaning select a random value between 1 - 2000 for the timer's milliseconds.

With each Tick() event of your timer - add 1 entry to the Arraylist with the actual value of the timer elapsed value. (0-2000)

when the user clicks the button to display results.
Do a Average with the ArrayList content of values for the result.

Regards,
X
 
Share this answer
 
Comments
fjdiewornncalwe 29-Nov-10 13:24pm    
Stop with the global fields already... They are bad for the health of your applications.
programmer1234 29-Nov-10 15:13pm    
Hi sorry to be a pain but I dont really know how to write out an arraylist or a global field, can you give me example code that shows how to do it?
Toli Cuturicu 29-Nov-10 16:06pm    
I deleted your comment. Please try to keep this forum friendly as it is now.
If you can't, may I suggest other forums...?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900