Skip to content

Simulator executes Alpaca operations when not connected #40

@Principia4834

Description

@Principia4834

Daniel

This ASCOM Developer thread provides background to the issue.

The attached files provide my implementation of a fix that always requires connected to be true before a device will execute an Alpaca request for an operation or a property. I have followed the BadRequestAlpacaProtocol approach and added the DeviceCannotAcceptOperation() function.

In BaseController.cs I have refactored the ActionResult<> calls to use a common calling thread to BadRequestAlpacaProtocol() and DeviceCannotAcceptOperation()

In DeviceManager.cs I have added an "all devices" dictionary keyed by DeviceType and DeviceID which holds a reference to the device instance as with base type of IAscomDeviceV2 - this enables access to the connected property for all driver types through inheritance.

I've attached my modified files. I've commented out a profile based if statement which could be used with the addition of the profile setting in the usual way.

I've built OmniSim on Windows with these changes and it passes ConformU tests.

Andy

Code.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions