Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,631 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
updating values on panel dynamically? #147334
08/11/07 17:29
08/11/07 17:29
Joined: Jun 2007
Posts: 28
D
Doriel Offline OP
Newbie
Doriel  Offline OP
Newbie
D

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
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

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
F
flits Offline
User
flits  Offline
User
F

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"
Re: updating values on panel dynamically? [Re: flits] #147337
08/11/07 18:33
08/11/07 18:33
Joined: Jun 2007
Posts: 28
D
Doriel Offline OP
Newbie
Doriel  Offline OP
Newbie
D

Joined: Jun 2007
Posts: 28
yep. that was it. something to do with the arrays. i changed it up and it's working now. thanks!


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1