SharpCap 4.1 - Documentation Update in progress

Official SharpCap and Forum announcements
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

SharpCap 4.1 - Documentation Update in progress

#1

Post by admin »

Hi folks,

maybe you've noticed that a lot less is being changed in each weekly SharpCap 4.1 update recently. Really I am only making obvious bug fixes and adding small tweaks to new 4.1 stuff based on user feedback. We might get some SDK updates from camera manufacturers every now and then, but that's about it.

However, here at SharpCap Towers, there's still a lot of hard work going on... I'm updating the user manual from the 4.0 version (which was a bit out-of-date relative to changes in 4.0 anyway) to cover all the changes in SharpCap 4.1... This will take a while! As well as documenting all the new stuff, there are hundreds of screen shots of parts of the program to update, and I'm trying to improve the readability and usefulness of some sections of the manual too.

Current progress is that I have reached page 82 out of 316 in the 'main rewrite'. I'll post updated figures every now and then so you can see how things are going and how much has been added. I should warn that almost all of the 'new stuff' is still ahead of me...

cheers,

Robin
Candieman
Posts: 37
Joined: Thu Nov 29, 2018 6:29 pm

Re: SharpCap 4.1 - Documentation Update in progress

#2

Post by Candieman »

Robin,

Thanks for doing this. I have found that "Good Code" is great, but "Good Code + Good Documentation" is MUCH better.

Rich
Altocumulus
Posts: 85
Joined: Sun Jan 27, 2019 9:48 am

Re: SharpCap 4.1 - Documentation Update in progress

#3

Post by Altocumulus »

Thanks for all the hard work for all at the Towers.
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1 - Documentation Update in progress

#4

Post by admin »

I'm now at page 189 (of 330) and the documentation currently runs to about 94000 words.

I have re-written large sections including how camera controls are described and their effects explained and significant changes to the documentation on focusing to cover autofocus. I have also re-arranged the documentation considerably to give section headings that align more with what end-users want to do (Getting Good Images, Controlling Cameras, Finding Targets, etc) rather than aligning with the features of the application.

Although 189 of 330 seems more than half-way, I have a big section to come on 'Finding, Indentifying and Framing Targets' which is currently just sub-headings. Also nothing written yet for the mosaic tools!

cheers,

Robin
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: SharpCap 4.1 - Documentation Update in progress

#5

Post by Jean-Francois »

Hello Robin,

... and the section of the scripting language with the explication of all the functions (you need maybe 1000 additional pages :-) )

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1 - Documentation Update in progress

#6

Post by admin »

Hi Jean-Francois,

I could auto-generate that based on the python 'help()' command :)

To be honest, help(SharpCap) or whatever is actually pretty good, although no way to find out the right namespace for types, so I should try to work that out.

cheers,

Robin
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: SharpCap 4.1 - Documentation Update in progress

#7

Post by Jean-Francois »

Hello Robin,

I know the "." list ... "SharpCap." will show the same as help(SharpCap).
But it is a quick list without any explication what they do and how to use it (maybe in combination with other command).

For example: help(SharpCap.Reticules.SelectedReticule) gives a lot information ... but I need a lot of tries (and with more errors) until I understand only a very few of the possibilities.
=> SharpCap.Reticules.SelectedReticule.FractionalPosition.X gives the relative position of the reticule.
But it seems that it is not possible to do the following: SharpCap.Reticules.SelectedReticule.FractionalPosition.X = 0.2 for moving the reticule.

But ... at the end ... you know everything ... So I can ask you directly.
And sometimes you add a new script function for me ... thanks :-)


Nice weekend,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1 - Documentation Update in progress

#8

Post by admin »

Hi Jean-Francois,

the trick with changing things like FractionalPosition is that you have to replace the whole Position rather than setting X and Y. It's an odd quirk of the C# language - the Point, Size, PointF, SizeF types are classified as 'structs' not 'classes', so you get a copy of the data, not a reference to the same object. When you fetch a property (like FractionalPosition) you get back a copy of the position, so any changes you make by setting .X and .Y are changes on the copy, so it doesn't do anything.

Instead...

Code: Select all

blah.blah.FractionalPosition = PointF(0.123, 0.345)
Here's some code that imports the additional types that you might need to use in calling the API

Code: Select all

clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
from System.Drawing import Bitmap, PointF, Size, RectangleF, Rectangle, SizeF
from System import DateTime, TimeSpan
from SharpCap.Base import RADecPosition, AltAzPosition, CameraFlags, NotificationMessage, NotificationButton, NotificationStatus
from SharpCap.Base.Interfaces import Axis, AxisRate, TrackingRate, SideOfPier
from System.Threading import CancellationToken
from SharpCap.Base.PropertyControls import CommonPropertyIDs
from SharpCap.UI import CaptureLimitConfiguration, CaptureLimitType
from System.Windows.Forms import MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton
from System.Drawing.Imaging import PixelFormat
from SharpCap.Interfaces import ExceptionReportStrategy, PlateSolvePurpose
I wrote a bit of code that walked the API and found the types that might be needed to make calls (other than simple stuff like integers, strings, etc). The above list (with minor manual tinkering) was the result.

cheers,

Robin
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: SharpCap 4.1 - Documentation Update in progress

#9

Post by Jean-Francois »

Hello Robin,

Thanks ... but ...
Note that it works, the reticule can be moved, but with the following error.

Code: Select all

>>> SharpCap.Reticules.SelectedReticule.FractionalPosition = PointF(0.4, 0.8)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: Der aufrufende Thread kann nicht auf dieses Objekt zugreifen, da sich das Objekt im Besitz eines anderen Threads befindet.
>>> 
... and, how to change the rotation angle of the reticule ?


Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SharpCap 4.1 - Documentation Update in progress

#10

Post by admin »

Hi Jean-Francois,

I can fix the error with setting the position in today's update - I just need to make sure that the actual drawing code runs in the UI thread not the scripting thread.

The angle is trickier as it will require deeper changes to make it work. You can reset it to 45 degrees using 'Reset', but that's all I'm afraid.

cheers,

Robin
Post Reply