APSF //################################################################################################################################## // Name : AP2POTH (AstroPlanner To ASCOM POTH) // Purpose : Pass currently selected object RA/Dec values to ASCOM via POTH.Telescope // Requires: AP 1.5.5 // Author : Robin Lauryssen-Mitchell // Date : 19Mar2007 // Version : 1.0 // Status : Beta // History : 0.1 - Initial beta release // 1.0 - Initial production release // 1.1 - Added check for object visibility // Notes : - Small, but to me annoying, delay before POTH.Telescope starts responding. // Possibly due to internal ASCOM stuff and therefore outside my control! // OTOH it does give user time to switch apps without scripting a call to minimize AP :) // - Not using my usual copious quantities of constant and variable declarations. Trying for speed optimisation. // - Might want to put in a call to minimize AP before the Shell call. If done the Bleep call would be less useful. // - Timeout value of 10000 works well for me. Have NOT played to find optimal value. May be local system dependent. //################################################################################################################################## //================================================================================================================================== // Main Code //================================================================================================================================== //Declarations dim DoIt as boolean //Setup initial conditions DoIt = false if SelectedObject = -1 then print "Error: No object selected" DoIt = false else DoIt = true if Obj(SelectedObject).Visible <> "Yes" then DoIt = YesNo("WARNING:"+EndOfLine+"Object is not visible."+EndOfLine+"Attempt to slew telescope anyway?", false) end if end if if DoIt then Call Shell(""""+left(ScriptFilePath, instr(ScriptFilePath, ScriptName)-1)+"AP2POTH.exe"+"""", _ FormatRA(Obj(SelectedObject).RA, True, "h") _ + " " +_ FormatDec(Obj(SelectedObject).Dec, True, "d"), _ 10000) end if