Ignore:
Timestamp:
01/14/13 06:40:52 (12 years ago)
Author:
neise
Message:
changed OpenLid to wait instead of exit in case of too early
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/Main.js

    r14769 r14771  
    254254{
    255255    var horizon_parameter = "nautical"
    256     if (Sun.horizon( horizon_parameter ).isUp)
    257     {
    258         console.out(JSON.stringify(Sun.horizon( horizon_parameter )));
    259         throw new Error("Sun is above FACT-horizon, lid cannot be opened.");
     256    while (Sun.horizon( horizon_parameter ).isUp)
     257    {
     258       var minutes_until_sunset = (Sun.horizon( horizon_parameter ).set - new Date())/60000;
     259       console.out("Open Lid - Info: ");
     260       console.out("    Sun is above FACT-horizon, lid cannot be opened.");
     261       console.out("    sleeping " + minutes_until_sunset + "minutes ...");
     262       v8.sleep(60000);
    260263    }
    261264
Note: See TracChangeset for help on using the changeset viewer.