1 registered members (Dico),
16,767
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
updating values on panel dynamically?
#147334
08/11/07 17:29
08/11/07 17:29
|
Joined: Jun 2007
Posts: 28
Doriel
OP
Newbie
|
OP
Newbie
Joined: Jun 2007
Posts: 28
|
Hello,
I am trying to display a variable value in a panel. I am using the digits() function and it works for the initial value of the variable. However, as the variable changes, it's not updating in the panel. What do I have to do to get it to update? Can I redraw the panel somehow? Also, when I use TEXT and define a string and display it on the panel, when I update the value, it's not always changing on the panel either (although it is changing sometimes). I have a feeling it has something to do with wait(1)?
As you can tell, this is all new to me. Please help!
Code:
Panel briefing_pan { bmap = "PatientBriefingPanel.bmp"; button(680, 600, "NextOn.bmp", "NextOff.bmp", "NextOn.bmp", next2, NULL, NULL); layer = 5; red = 0; green = 0; blue = 0; digits(433, 250, 6, arial_font, 1, age[currentPatient]); digits(108, 285, 6, arial_font, 1, height[currentPatient]); digits(450, 285, 6, arial_font, 1, weight[currentPatient]); digits(604, 250,"%0.f / ",arial_font, 1,sys_month); // Month in Date digits(632, 250,"%0.f / ",arial_font, 1,sys_day); // Day in Date digits(662, 250, 4, arial_font, 1,sys_year); // Year in Date digits(139, 565, 6, arial_font, 1, heart_rate[currentPatient]); digits(392, 565, 6, arial_font, 1, O2_sat[currentPatient]); digits(630, 565, 6, arial_font, 1, blood_pressure_top[currentPatient]); digits(171, 601, 6, arial_font, 1, resp_rate[currentPatient]); digits(399, 601, 6, arial_font, 1, blood_glucose[currentPatient]);
flags = overlay; }
|
|
|
Re: updating values on panel dynamically?
[Re: Doriel]
#147335
08/11/07 17:38
08/11/07 17:38
|
Joined: Sep 2002
Posts: 700 Orange County, CA
LogantheHogan
Developer
|
Developer
Joined: Sep 2002
Posts: 700
Orange County, CA
|
I think there have been some problems with using array indexes in digits definitions (correct me if I'm wrong) so it might be wiser to do the following: Code:
var digits_age; var digits_height; var digits_weight;
// etc.....
Panel briefing_pan { bmap = "PatientBriefingPanel.bmp";
button(680, 600, "NextOn.bmp", "NextOff.bmp", "NextOn.bmp", next2, NULL, NULL); layer = 5; red = 0; green = 0; blue = 0;
digits(433, 250, 6, arial_font, 1, digits_age); digits(108, 285, 6, arial_font, 1, digits_height); digits(450, 285, 6, arial_font, 1, digits_weight);
............... etc
And then have a starter function that constantly updates these values: Code:
starter update_digits() { while(1) { digits_age = age[currentPatient]; digits_height = height[currentPatient]; digits_weight = weight[currentPatient];
See if that works any better.
|
|
|
Re: updating values on panel dynamically?
[Re: LogantheHogan]
#147336
08/11/07 17:56
08/11/07 17:56
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
yah dont you have a function for it i dont work white starters
if u have please show
var digits_age; var digits_height; var digits_weight;
function move_digits { while(1) { digits_weight = digits_heigt / digits_weight; wait(1); } }
srry for re_var but i like to write everthing so i dont forget stuff
"empty"
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|