Refresh screens on other PC's

Refresh screens on other PC's

Postby Marc Vanzegbroeck » Tue Oct 28, 2008 7:18 am

Hi,

I have an application running in a truck-transport company.
They handle the planning with my program. They working with 10 people together. With a browse they can see what truck have to go to what place.
If anyone change, or add a route they want automaticly refresh the screens of the other users, so they see direcly the latest status.
What I did now is, when a user start the program, the serienumber of his PC is added to a database. So if 7 users are working in the program, 7 records
of serienumbers are in the database.
When someone update or change anything, the program set a logic field of that database to ON of all users.
In the program I have defined a timer that do a search in the database of it's serienumber, and if the field is ON, the screen will refresh, and put the
logic field of his serienr back OFF.
That is working very nice.

Now they want me to write another program to do some planning for truck-maintenance and I was wondering if there was an other (easyer) method to do
a refresh of the screens on the other PC?

Thanks
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby anserkk » Tue Oct 28, 2008 7:35 am

Why don't you access a common dbf from both different module to check whether screen refresh is required or not

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby Marc Vanzegbroeck » Tue Oct 28, 2008 8:43 am

Anser,

That's how it did is now with the database including de serialnumbers of the PC that opened the program. Than setting a logic field when refresh have to be done.
I was wondering that there was another way to do the update like sockets or something like that.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby James Bott » Tue Oct 28, 2008 6:34 pm

Marc,

>I was wondering that there was another way to do the update like sockets or something like that.

Not to my knowledge. I think the solution that you came up with is a good one.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Refresh screens on other PC's

Postby Carlos Mora » Wed Oct 29, 2008 5:42 pm

Hi Marc,

Marc Vanzegbroeck wrote:Hi,

So if 7 users are working in the program, 7 records
of serienumbers are in the database.
When someone update or change anything, the program set a logic field of that database to ON of all users.


To make this a little bit simpler, in place of use a logical ON/OFF you can use a numeric field with RELEASE info, so when someone updates increments that value.
Everyone has the release number being shown on browse, an if is different, has to make an update. In this way you don´t need a record for each user, just one for table.

Regards,

Carlos.
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Postby Marc Vanzegbroeck » Wed Oct 29, 2008 7:26 pm

Thanks Carlos,

That's a good idea. The only problem is when do I have to reset the counter, because after a while, there can be an overflow.
I could also combine date() and time(). But then all clocks of all PC's should be exact the same. Maybe I can combine date() + counter.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby James Bott » Wed Oct 29, 2008 8:05 pm

Marc,

I wonder if you can just automatically reset the counter when it reaches a certain number, and just check if the users counter is not equal to the current table counter (instead of less than). Then it doesn't matter what value the counter is, as long as it is different.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Carlos Mora » Wed Oct 29, 2008 9:22 pm

Mark,

Marc Vanzegbroeck wrote:That's a good idea. The only problem is when do I have to reset the counter, because after a while, there can be an overflow.


As James said, you just have to check for changes. Is current value is different from the last registered an update should be done.
And... how many updates can be made in a single day? thinking in 3 per minute (1 every 20 seconds) that will be 4320 in the whole 24 hs of one day. Using a field numeric with 10 digits, gives you a frame of 2314814,8 days to overflow, that is 6337 years, so you can write a manual just in case you are not there to restart the counter ;)

Regards,

Carlos.
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Postby Marc Vanzegbroeck » Thu Oct 30, 2008 9:43 am

Carlos,

You are right. I beleave there will be an update of the program before running the program 6337years :lol: . I can automaticly reset the counter every update.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests