public FocuserControlPanelForm() { InitializeComponent(); cbPort.SelectedIndex = 0; fFocuser = new TFFocuser(false, this); fFocuser.OnPingEvent += new EventHandler(fFocuser_OnPingEvent); fFocuser.OnHandshakeEvent += new EventHandler(fFocuser_OnHandshakeEvent); fFocuser.OnFirmwareEvent += new EventHandler(fFocuser_OnFirmwareEvent); fFocuser.OnRPCEvent += new EventHandler(fFocuser_OnRPCEvent); fFocuser.OnDebugEvent += new EventHandler(fFocuser_OnDebugEvent); fFocuser.OnDebugMsgEvent += new EventHandler(fFocuser_OnDebugMsgEvent); fFocuser.OnPositionChangedEvent += new EventHandler(fFocuser_OnChangePositionEvent); fFocuser.OnMinPositionChangedEvent += new EventHandler(fFocuser_OnMinPositionChangedEvent); fFocuser.OnMaxPositionChangedEvent += new EventHandler(fFocuser_OnMaxPositionChangedEvent); fFocuser.OnMotorStopEvent += new EventHandler(fFocuser_OnMotorStopEvent); fFocuser.OnMotorStepRightEvent += new EventHandler(fFocuser_OnMotorStepRightEvent); fFocuser.OnMotorStepLeftEvent += new EventHandler(fFocuser_OnMotorStepLeftEvent); fFocuser.OnPowerEvent += new EventHandler(fFocuser_OnPowerEvent); fFocuser.OnRollingEvent += new EventHandler(fFocuser_OnRollingEvent); fFocuser.OnRollingToNewPosEvent += new TFFocuser.OnRollingToNewPosHandler(fFocuser_OnRollingToNewPosEvent); fFocuser.OnSpeedChangedEvent += new EventHandler(fFocuser_OnSpeedChangedEvent); fFocuser.OnMaxSpeedChangedEvent += new EventHandler(fFocuser_OnMaxSpeedChangedEvent); fFocuser.OnMinSpeedChangedEvent += new EventHandler(fFocuser_OnMinSpeedChangedEvent); fFocuser.OnReleaseTimeChangeEvent += new EventHandler(fFocuser_OnReleaseTimeChange); fFocuser.OnRangeCheckEvent += new EventHandler(fFocuser_OnRangeCheckEvent); fFocuser.OnMicrostepEvent += new EventHandler(fFocuser_OnMicrostepEvent); }
/// <summary> /// Initializes a new instance of the <see cref="FlyeyeFocuserV1"/> class. /// Must be public for COM registration. /// </summary> public Focuser() { ReadProfile(); // Read device configuration from the ASCOM Profile store tl = new TraceLogger("", "FlyeyeFocuserV1"); tl.Enabled = traceState; tl.LogMessage("Focuser", "Starting initialisation"); //connectedState = false; // Initialise connected to false utilities = new Util(); //Initialise util object astroUtilities = new AstroUtils(); // Initialise astro utilities object //TODO: Implement your additional construction here tl.LogMessage("Focuser", "Completed initialisation"); fFocuser = new TFFocuser(true); isCreated = true; }