Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Location
    Canterbury, Kent
    Posts
    246

    Cool Creating ACP Scheduler Projects using Visual Studio and ReSharper Live Templates

    I thought I would share this technique I've developed for creating ACP Scheduler projects. I am assuming that you have Visual Studio and ReSharper. If you don't have ReSharper, you can get a 30 day trial, otherwise this post is not for you.

    Disclaimer: There is a comment in the exported XML file that says "do not create or edit this file by hand". Arguably, I'm not hand editing but my technique is probably not supported. It works for me but your mileage may vary, and Bob might not approve ;-)

    The problem I'm addressing here is where I want to create a large project with many plans and observations, such as asteroid follow-up observations for many asteroids. Today I'm creating a plan to observe the top 20 bright minor planets at opposition. So the technique is as follows:


    1. Create the project and its first plan, with all constraints and target details set correctly. Do this in the Schedule Browser utility or using the web interface.
    2. Right click on the project and select "Export Project". This gives you an XML file.
    3. Create a blank Visual Studio solution (File -> New Project -> Other project types -> Blank Solution)
    4. Add the exported XML file to your solution (Right-click the solution, Add -> Existing Item, brows for the XML file and add it)
    5. Select the entire <Plan> element including opening and closing tags, and cut it (Ctrl-X)
    6. Create a ReSharper Live Template and paste in the <Plan> element.
    7. Work through the plan and replace the items you want to change with substitution tokens. For my use, I created tokens for the target name, time from previous observation and timing tolerance. I used the "constant value" macro to add defaults for the timing tokens.
    8. Name the live template (I used "plan-asteroid") and save it.


    The above takes a little bit of time and you have to be careful to get all the occurrences of the substitution tokens added correctly, but once you;ve done that it becomes extremely quick and easy to add a new plan. Here's a video showing it in action.


    Finally, you can import your project back into the Schedule Browser, by right-clicking your user name, and selecting Import Project. Here's another video showing that:

    Tim Long
    Tigra Astronomy - http://tigra-astronomy.com

  2. #2
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    28,202

    Default

    This is pretty cool Tim!! A novel use of ReSharper :-)

    I need to add a caveat though. The internal structure of the database, and thus of the exported/imported XML, are both "private" and subject to my whims. There is a COM-callable API for the Scheduler Database that provides all sorts of high level access and manipulations. I have not published it but I am OK with people using it for special purposes or tools. That interfaces are not going to change (but I may add additional members).

    Meanwhile I don't envision any breaking changes in the near future so press on with this project!! Thanks again!!
    -- Bob

  3. #3
    Join Date
    Oct 2005
    Location
    Canterbury, Kent
    Posts
    246

    Default

    In that case, I have a mosaic generator application under construction that might benefit from using your database API if you are willing to share it. Currently I have it generating RTML files, but they are a bit "icky" to work with, even if using the RTML SDK. It would be even better if you had a REST API for the scheduler database so that one is not tied to being at the observatory.

    Tim Long
    Tigra Astronomy - http://tigra-astronomy.com

  4. #4
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    28,202

    Default

    It would be even better if you had a REST API for the scheduler database so that one is not tied to being at the observatory.
    Oh yes! I would need to really study this problem. And making it all public is an open invitation to seriously inscrutable problems for a relatively small population of users. I know RTML is icky, but if you use it you are safe from internal changes. I didn't design it, and you would chuckle if you knew the environment and players at that time. I did add a bit to V2 for my own uses.
    -- Bob

  5. #5
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    28,202

    Default

    -- Bob

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. COM object error when building Visual Studio app in x64 mode only
    By Sam Anahory in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 3
    Last Post: Feb 15, 2016, 17:20

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •