Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7048 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hello everybody !

I ran into problems with my solution again ;)

I have made a vehicle status system in which every unit has to report it's position by radio every 30 minutes. By clicking units symbol on screen a new timestamp and record is made to a log file. If the unit hasn't reported in 30 minutes the symbol turns red. There is about 20 units at the same time.

The different units status is shown in one file on portals. Now the problem is that how to refresh the screen every minute so the over dued timestamps turn to red ? I have tried to do it with an eternal loop -script, which refreshes the screen every minute, but it doesn't work, because then you cannot update the statuses.

Could you help me again ?

Arttu

Edited by Guest
Edit// Typos
Posted

I have no idea whether the following suggestion will work but it might be worth a try.

I am addressing the problem of running a loop and at the same time updating statuses, presumably by running other scripts. To make this time accurate you will need to work out how long it takes to update a status and how often this will happen in any period. How you make the unit symbols turn red is another matter which I assume you have sorted out already.

You will need a Counter field (global Number) and this is used to count to a minute. I have updated it every 2 seconds so it needs to count up to 30.

The CountUp script is:

Loop

Pause/Resume Script[Duration(seconds):2]

SetField[Counter;Counter+1]

Exit Loop If [Counter = 30]

End Loop

Set Field[Counter;0]

Refresh Window

Perform Script["Countup"]

OK this script is running continuously but most of the time it is in a paused state which does not prevent you running other scripts - pressing status buttons.

If you press a status button it seems to pause indefinitely so you have to give it a kick start. At the end of each script that you want to run you must add the line

Perform Script["Countup"]

This sets the count going again. Obviously the buttons being pressed slows down the count and that is why you need to work out how much time it takes to do the other scripts and adjust the count accordingly so that it runs for a minute between screen refreshes.

Posted

SlimJim,

Thanks a lot ! I will try this. At least in theory it might even work ! ;)

Arttu

This topic is 7048 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.