This is going to be a question for the SharpCap author mainly. Robin, hopefully you'll find time to read and answer it as the text below is somewhat long
First let me describe how I ended up with the issue I'm having now...
Its known that Sony do not have public API to control their cameras remotely, so that makes usage of Sony cameras for more or less automated astrophotograpy quite problematic. The good news is that the guy from CN forum came up with solution, few years ago he wrote small app called MarksAcquisition. The app is "emulating mouse clicks" in the proprietary Sony app called "Imaging Edge", which allows you to control your camera from PC. With the help of this app it is possible to automate taking exposures, and it even can integrate with PHD2 to send dithering commans. The problem is of course that you still cannot use Sony cameras with all of the astrophotography software such as SharpCap (okay, its not entirely true with the Folder monitor camera added, but that requires some additional app which will be taking photos, so its not ideal solution)
So being inspired by MarksAcquisition app and by ASCOM.DSLR driver for Canon and Nikon I decided to write ASCOM camera driver for Sony.
That driver requires you to connect your Sony camera with USB cable and then run Imaging Edge Remote app from sony. The the driver will be "emulating mouse clicks" in Imaging Edge Remote app to take exposures, Imaging Edge Remote app will save those exposures in specified folder, driver will watch that folder, read the files and return back to ASCOM compatible app. So thats the idea. Very close to what you implemented in ASCOM.DSLR driver, but using user32.dll interactions with Sony Imaging Edge app to "talk" to camera instead of public API (which not exists).
Now let me describe the issue itself...
I got this driver working in several ASCOM compatible apps (SGP, PHD2, MaximDL) - they successfully receive image data from my driver. But I'm spending last few days trying to make it working with SharpCap with no luck.
I think I did it all correctly, I tried to return both RGGB data and Color data, but it still not working.
SharpCap giving me error "Cannot convert type 'string' to 'float'" when it tries to process image array returned by my driver.
I'm not sure what the problem is and I cant see anything useful or related to this error in SharpCap logs as well (even with additional logging enabled). I clicked several times that "send and quit" button - https://prnt.sc/pd1nls, so perhaps you already have my logs or at least exception details, but I'll post full stack trace of the error below for your reference.
Can you please help me understand this issue? I have no idea what it tries to convert here. Perhaps you can check your source codes and see what it do not like in the data returned by my driver?
I appreciate your help.
Btw, I'm happy user of SharpCap PRO. I really like the app and the fact that I cant make my driver working with it drives me crazy...
Code: Select all
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
Cannot convert type 'string' to 'float'
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at SharpCap.Models.Controls.<>c__DisplayClass4_0.<GetValueCached>b__0() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap\Models\Controls.cs:line 41
at SharpCap.Base.CachedItem`1.GetValue() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Base\CachedItem.cs:line 23
at SharpCap.Models.Controls.GetValueCached(CommonPropertyIDs control) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap\Models\Controls.cs:line 44
at SharpCap.Models.Camera.OnFrameCaptured(Object sender, FrameCapturedEventArgs e) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap\Models\Camera.cs:line 1263
at SharpCap.MultiCaptureProvider.Scp_FrameCaptured(Object sender, FrameCapturedEventArgs e) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap\Models\MultiCaptureProvider.cs:line 552
at SharpCap.Base.CaptureProviderBase`1.OnImageProviderOnFrameCaptured(Object src, FrameCapturedEventArgs args) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Base\CaptureProviderBase.cs:line 559
at SharpCap.Base.BaseImageProvider.OnFrameCaptured(FrameCapturedEventArgs e) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Base\BaseImageProvider.cs:line 729
at SharpCap.Base.BaseImageProvider.ProcessFrame(BufferFrame frame) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Base\BaseImageProvider.cs:line 528
at SharpCap.Base.BaseImageProvider.ProcessThreadProc() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Base\BaseImageProvider.cs:line 433
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()