How to create a continuously updating Log file?

Scripts and programs to automate Astroart
Post Reply
Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

How to create a continuously updating Log file?

Post by Forum_2014 »

Hi All,

I'd like to create a Log file for my script, to which output is added throughout the execution of the script,
e.g. something like :-

run script
logfile="C:\mystuff\logs\20140425\log.txt"

OPEN lun, logfile

do stuff..
print logfile "imaging with filter x", at date$
do more stuff..
print logfile "imaging with filter x at ", date$
do more stuff..
reached end of script
print logfile "end of script at ", date$
CLOSE lun
End

Is this possible? None of the text routines seem friendly to this concept...


Regards,

Andrew
www.skippysky.com.au

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: How to create a continuously updating Log file?

Post by Forum_2014 »

Hi,
here is a working example:

Code: Select all

logFile="C:\temp\mylog.txt"

sub AddLog(line)
  AppendText(line + " - " + time() + crlf(), logFile)
end sub

AddLog("imaging with filter x")
AddLog("imaging with filter y")
AddLog("end of script")

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: How to create a continuously updating Log file?

Post by Forum_2014 »

Fabio,

Was that a script command I missed?
What version of the DLL did that go into?
On the next version of ObservationManager I will switch to using this script command instead of the existing log generation.
The next version will be Version9.06 and the auto script generator will include Dome and roof control in the automation.

I understand you may be thinking about new guiding features to take account of slit spectroscopy. Will this be some new settings in the main program or script commands.
If they are settings it would be nice to have Astroart remember them for startup.
The guiding automation features you added to the script commands are working fine and have solved the reverse polarity switching issue for various az positions > 180.

I only have one minor automation problem now, but have written a good simulator to check the nights observing run, that is Mount flip mid long exposures.
At the moment the long exposure users run the simulator first and check for possible mount flips. Not sure there is any other solution to this. I might do some calculations using exposure time, target alt, az and then calculate time to flip and see if it is shorter than exposure time.

All the best

John
http:\\www.astro.me.uk
AA5ObsMgr yahoo group.
FRAS

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: How to create a continuously updating Log file?

Post by Forum_2014 »

Hi John,
that command was added in the interface 5.30.
Internally it works this way: It opens the text file for read/write, appends data to it, then closes the file. Doing so the log file is always in a consistent state and can be accessed by other software.
Clear skies,
Fabio.

Post Reply