public INDIFocuser(string name, INDIClient host, bool client = true) : base(name, host, client) { if (!client) { AddNumberVector(new INumberVector(Name, "FOCUS_SPEED", "Select focus speed", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("FOCUS_SPEED_VALUE", "Set focuser speed", "%3.1f", 0, 1000.0, 0.1, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "FOCUS_MOTION", "Move focuser", "Motion Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("FOCUS_INWARD", "Focus inward", true), new INDISwitch("FOCUS_OUTWARD", "Focus outward", false) })); AddNumberVector(new INumberVector(Name, "FOCUS_TIMER", "Focuser speed", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("FOCUS_TIMER_VALUE", "Focus in the direction, speed and time selected", "%4.0f", 0.00, 1000.0, 1.0, 0.0) })); AddNumberVector(new INumberVector(Name, "REL_FOCUS_POSITION", "Focuser Relative position", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("FOCUS_RELATIVE_POSITION", "Focuser Relative position", "%5.0f", 0.00, 50000.0, 1, 0.0) })); AddNumberVector(new INumberVector(Name, "ABS_FOCUS_POSITION", "Focuser Absolute position", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("FOCUS_ABSOLUTE_POSITION", "Focuser Absolute position", "%5.0f", 0.00, 50000.0, 1, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "FOCUS_ABORT_MOTION", "Abort focuser motion", "Motion Control", "rw", "AtMostOne", new List <INDISwitch> { new INDISwitch("ABORT", "Abort focuser motion", false) })); DriverInterface |= DRIVER_INTERFACE.FOCUSER_INTERFACE; } }
public INDIDetector(string name, INDIClient host, bool client = true) : base(name, host, client) { EnableBLOB(true); if (!client) { AddNumberVector(new INumberVector(Name, "DETECTOR_CAPTURE", "Capture", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("DETECTOR_CAPTURE_VALUE", "Duration (s)", "%5.2f", 0.05, 10000.0, 0.05, 1.0) })); AddSwitchVector(new ISwitchVector(Name, "DETECTOR_ABORT_CAPTURE", "Expose Abort", "Main Control", "rw", "AtMostOne", new List <INDISwitch> { new INDISwitch("ABORT", "Abort", false) })); AddNumberVector(new INumberVector(Name, "DETECTOR_TEMPERATURE", "Temperature", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("DETECTOR_TEMPERATURE_VALUE", "Temperature (C)", "%5.2f", -50.0, 50.0, 0.0, 20.0) })); AddNumberVector(new INumberVector(Name, "DETECTOR_INFO", "Detector Information", "Image Info", "ro", "", new List <INDINumber> { new INDINumber("DETECTOR_SAMPLERATE", "Bandwidth (Hz)", "%18.2f", 0.01, 1.0e+15, 0.01, 1.0e+6), new INDINumber("DETECTOR_FREQUENCY", "Observed frequency (Hz)", "%18.2f", 0.01, 1.0e+15, 0.01, 1.42e+9), new INDINumber("DETECTOR_BITSPERSAMPLE", "Bits per sample", "%3.0f", 1, 64, 1, 8) })); AddBlobVector(new IBlobVector(Name, "DETECTOR", "Capture", "Data Streams", "ro", "", new List <INDIBlob> { new INDIBlob("CONTINUUM", Name + " continuum data", ".fits", new byte[1], 1), new INDIBlob("SPECTRUM", Name + " spectrum data", ".fits", new byte[1], 1), })); DriverInterface |= DRIVER_INTERFACE.DETECTOR_INTERFACE; } }
public INDIFilterWheel(string name, INDIClient host, bool client = true) : base(name, host, client) { if (!client) { AddNumberVector(new INumberVector(Name, "FILTER_SLOT", "The filter wheel's current slot number", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("FILTER_SLOT_VALUE", "Slot number", "%2.0f", 0.00, 99.0, 1.0, 0.0) })); AddTextVector(new ITextVector(Name, "FILTER_NAME_VALUE", "The filter wheel's current slot name", "Main Control", "ro", "", new List <INDIText> { new INDIText("FILTER_NAME", "Slot name", "LIGHT") })); DriverInterface |= DRIVER_INTERFACE.FILTER_INTERFACE; } }
public override void isNewBlob(Object sender, IsNewBlobEventArgs e) { base.isNewBlob(sender, e); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); try { if (e.Vector.Device == Name) { INDIClient caller = (INDIClient)sender; for (int i = 0; i < e.Vector.Values.Count; i++) { Console.WriteLine("Received BLOB " + e.Vector.Values[i].Name + " of size " + e.Vector.Values[i].size + " from device " + e.Device + "@" + caller.Address + ":" + caller.Port); IsNewBlob?.Invoke(this, new INDIDetectorBlobEventArgs(e.Vector.Values[i].value, e.Vector.Values[i].Name, e.Vector.Name, e.Vector.Values[0].format)); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public INDIBaseDevice(string n, INDIClient host, bool client = true) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); if (host == null) { throw new ArgumentException("host cannot be null"); } IsClient = client; Host = host; Name = n; Texts = new List <ITextVector>(); Numbers = new List <INumberVector>(); Switches = new List <ISwitchVector>(); Blobs = new List <IBlobVector>(); host.IsDelProperty += isDelProperty; host.IsNewText += isNewText; host.IsNewNumber += isNewNumber; host.IsNewSwitch += isNewSwitch; host.IsNewBlob += isNewBlob; host.IsNewMessage += isNewMessage; }
public INDIDevice(string name, INDIClient host, bool client = true) : base(name, host, client) { Host.AddDevice(this); if (!client) { AddSwitchVector(new ISwitchVector(Name, "CONNECTION", "Connection", "", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("CONNECT", "Connect", true), new INDISwitch("DISCONNECT", "Disconnect", false) })); AddTextVector(new ITextVector(Name, "DEVICE_PORT", "Connection port", "Connection", "ro", "", new List <INDIText> { new INDIText("PORT", "Connection port", "COM1") })); AddNumberVector(new INumberVector(Name, "TIME_LST", "Local sidereal time", "Device Properties", "ro", "", new List <INDINumber> { new INDINumber("LST", "Local sidereal time", "%16.0f", 0.0, 800000000.0, 0.0, 0.0) })); AddTextVector(new ITextVector(Name, "TIME_UTC", "UTC Time & Offset", "Device Properties", "ro", "", new List <INDIText> { new INDIText("UTC", "UTC time", "0"), new INDIText("OFFSET", "UTC offset", "0") })); AddNumberVector(new INumberVector(Name, "GEOGRAPHIC_COORD", "Earth geodetic coordinate", "Device Properties", "ro", "", new List <INDINumber> { new INDINumber("LAT", "Site latitude", "%2.3f", -90.0, 90.0, 0.0, 0.0), new INDINumber("LONG", "Site longitude", "%2.3f", 0.0, 360.0, 0.0, 0.0), new INDINumber("ELEV", "Site elevation", "%2.3f", 0.0, 360.0, 0.0, 0.0) })); AddNumberVector(new INumberVector(Name, "ATMOSPHERE", "Weather conditions", "Device Properties", "ro", "", new List <INDINumber> { new INDINumber("TEMPERATURE", "Temperature (K)", "%3.3f", -273.0, 180.0, 0.0, 0.0), new INDINumber("PRESSURE", "Pressure (hPa)", "%5.3f", 0.0, 400.0, 0.0, 0.0), new INDINumber("HUMIDITY", "Humidity (%)", "%3.3f", 0.0, 100.0, 0.0, 0.0) })); DriverInterface = DRIVER_INTERFACE.GENERAL_INTERFACE; DriverExec = Assembly.GetCallingAssembly().GetName().Name; DriverVersion = Assembly.GetCallingAssembly().GetName().Version.ToString(); DriverName = Name; } }
public INDITelescope(string name, INDIClient host, bool client = true) : base(name, host, client) { if (!client) { AddNumberVector(new INumberVector(Name, "EQUATORIAL_COORD", "Equatorial astrometric J2000 coordinate", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("RA", "J2000 RA", "%2.12f", 0.00, 24.0, 0.000000000001, 0.0), new INDINumber("DEC", "J2000 Dec", "%2.12f", -90.00, 90.0, 0.000000000001, 0.0) })); AddNumberVector(new INumberVector(Name, "EQUATORIAL_EOD_COORD", "Equatorial astrometric epoch of date coordinate", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("RA", "JNow RA", "%2.12f", 0.00, 24.0, 0.000000000001, 0.0), new INDINumber("DEC", "JNow Dec", "%2.12f", -90.00, 90.0, 0.000000000001, 0.0) })); AddNumberVector(new INumberVector(Name, "TARGET_EOD_COORD", "Slew Target", "Main Control", "ro", "Main Control", new List <INDINumber> { new INDINumber("RA", "JNow RA", "%2.12f", 0.00, 24.0, 0.000000000001, 0.0), new INDINumber("DEC", "JNow Dec", "%2.12f", -90.00, 90.0, 0.000000000001, 0.0) })); AddNumberVector(new INumberVector(Name, "HORIZONTAL_COORD", "topocentric coordinate", "Main Control", "ro", "Main Control", new List <INDINumber> { new INDINumber("ALT", "Altitude", "%2.12f", 0.00, 90.0, 0.000000000001, 0.0), new INDINumber("AZ", "Azimuth", "%3.12f", 0.00, 360.0, 0.000000000001, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "ON_COORD_SET", "Track mode", "Main Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("SLEW", "Slew", true), new INDISwitch("TRACK", "Track", false), new INDISwitch("SYNC", "Sync", false) })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_MOTION_NS", "Move telescope north or south", "Motion Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("MOTION_NORTH", "Move North", false), new INDISwitch("MOTION_SOUTH", "Move South", false) })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_MOTION_WE", "Move telescope west or east", "Motion Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("MOTION_WEST", "Move West", false), new INDISwitch("MOTION_EAST", "Move East", false) })); AddNumberVector(new INumberVector(Name, "TELESCOPE_TIMED_GUIDE_NS", "Timed guide telescope north or south", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("TIMED_GUIDE_N", "Guide North", "%5.2f", 0.00, 10000.0, 0.01, 0.0), new INDINumber("TIMED_GUIDE_S", "Guide South", "%2.2f", 0.00, 10000.0, 0.01, 0.0) })); AddNumberVector(new INumberVector(Name, "TELESCOPE_TIMED_GUIDE_WE", "Timed guide telescope west or east", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("TIMED_GUIDE_W", "Guide North", "%5.2f", 0.00, 10000.0, 0.01, 0.0), new INDINumber("TIMED_GUIDE_E", "Guide South", "%2.2f", 0.00, 10000.0, 0.01, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_SLEW_RATE", "Slew Rate", "Motion Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("SLEW_GUIDE", "Guiding Rate", false), new INDISwitch("SLEW_CENTERING", "Slow speed", false), new INDISwitch("SLEW_FIND", "Medium speed", true), new INDISwitch("SLEW_MAX", "Maximum speed", false), })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_PARK", "Park and unpark the telescope", "Main Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("PARK", "Park the telescope", false), new INDISwitch("UNPARK", "Unpark the telescope", false) })); AddNumberVector(new INumberVector(Name, "TELESCOPE_PARK_POSITION", "Home park position", "Main Control", "ro", "", new List <INDINumber> { new INDINumber("PARK_RA", "JNow RA", "%2.12f", 0.00, 24.0, 0.000000000001, 0.0), new INDINumber("PARK_DEC", "JNow Dec", "%2.12f", -90.00, 90.0, 0.000000000001, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_PARK_OPTION", "Park Option", "Main Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("PARK_CURRENT", "Use current park position", false), new INDISwitch("PARK_DEFAULT", "Use driver's default park position", true), new INDISwitch("PARK_WRITE_DATA", "Write park position", false) })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_ABORT_MOTION", "Abort", "Main Control", "rw", "AtMostOne", new List <INDISwitch> { new INDISwitch("ABORT_MOTION", "Stop telescope", false) })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_TRACK_RATE", "Track Rate", "Main Control", "rw", "AtMostOne", new List <INDISwitch> { new INDISwitch("TRACK_SIDEREAL", "Track at sidereal rate", true), new INDISwitch("TRACK_SOLAR", "Track at solar rate", false), new INDISwitch("TRACK_LUNAR", "Track at lunar rate", false), new INDISwitch("TRACK_CUSTOM", "Track at custom rate", false), })); AddNumberVector(new INumberVector(Name, "TELESCOPE_INFO", "Telescope informtations", "Telescope Info", "ro", "Informations", new List <INDINumber> { new INDINumber("TELESCOPE_APERTURE", "Telescope aperture", "%5.2f", 0.00, 10000.0, 0.01, 200.0), new INDINumber("TELESCOPE_FOCAL_LENGTH", "Telescope focal length", "%5.2f", 0.00, 10000.0, 0.01, 200.0), new INDINumber("GUIDER_APERTURE", "Guide telescope aperture", "%5.2f", 0.00, 10000.0, 0.01, 200.0), new INDINumber("GUIDER_FOCAL_LENGTH", "Guide telescope focal length", "%5.2f", 0.00, 10000.0, 0.01, 200.0), })); AddSwitchVector(new ISwitchVector(Name, "TELESCOPE_PIER_SIDE", "Pier Side", "Motion Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("PIER_EAST", "Pointing West", false), new INDISwitch("PIER_WEST", "Pointing East", false) })); DriverInterface |= DRIVER_INTERFACE.TELESCOPE_INTERFACE; } }
public INDIDome(string name, INDIClient host, bool client = true) : base(name, host, client) { if (!client) { AddNumberVector(new INumberVector(Name, "DOME_SPEED", "Dome speed", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("DOME_SPEED_VALUE", "Dome speed in RPM", "%3.1f", 0.00, 180.0, 0.1, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "DOME_MOTION", "Move dome", "Motion Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("DOME_CW", "Move dome Clockwise", true), new INDISwitch("DOME_CCW", "Move dome counter clockwise", false) })); AddNumberVector(new INumberVector(Name, "DOME_TIMER", "Dome speed", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("DOME_TIMER_VALUE", "Move the dome for n milliseconds", "%5.0f", 0.00, 60000.0, 1.0, 0.0) })); AddNumberVector(new INumberVector(Name, "REL_DOME_POSITION", "Dome Relative position", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("DOME_RELATIVE_POSITION", "Move n degrees azimuth in the direction selected", "%3.4f", 0.00, 180.0, 0.0001, 0.0) })); AddNumberVector(new INumberVector(Name, "ABS_DOME_POSITION", "Dome Absolute position", "Motion Control", "rw", "", new List <INDINumber> { new INDINumber("DOME_ABSOLUTE_POSITION", "Move dome to n absolute azimuth angle in degrees", "%3.4f", 0.00, 180.0, 0.0001, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "DOME_ABORT_MOTION", "Abort dome motion", "Motion Control", "rw", "AtMostOne", new List <INDISwitch> { new INDISwitch("ABORT", "Abort dome motion", false) })); AddSwitchVector(new ISwitchVector(Name, "DOME_SHUTTER", "Open/Close dome shutter", "Main Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("SHUTTER_OPEN", "Open dome shutter", false), new INDISwitch("SHUTTER_CLOSE", "Close dome shutter", true) })); AddSwitchVector(new ISwitchVector(Name, "DOME_GOTO", "", "Main Control", "rw", "AtMostOne", new List <INDISwitch> { new INDISwitch("DOME_HOME", "Go to home position", false), new INDISwitch("DOME_PARK", "Go to park position", true) })); AddNumberVector(new INumberVector(Name, "DOME_PARAMS", "Dome speed", "Main Control", "rw", "", new List <INDINumber> { new INDINumber("HOME_POSITION", "Dome home absolute position", "%3.1f", 0.00, 180.0, 0.1, 0.0), new INDINumber("PARK_POSITION", "Dome parking absolute position", "%3.1f", 0.00, 180.0, 0.1, 0.0), new INDINumber("AUTOSYNC_THRESHOLD", "Slaved dome autosync threshold", "%3.1f", 0.00, 180.0, 0.1, 0.0) })); AddSwitchVector(new ISwitchVector(Name, "DOME_AUTOSYNC", "Enable/Disable dome slaving", "Main Control", "rw", "OneOfMany", new List <INDISwitch> { new INDISwitch("DOME_AUTOSYNC_ENABLE", "Enable dome slaving", false), new INDISwitch("DOME_AUTOSYNC_DISABLE", "Disable dome slaving", true) })); AddNumberVector(new INumberVector(Name, "DOME_MEASUREMENTS", "Dome informtations", "Dome Info", "rw", "", new List <INDINumber> { new INDINumber("DM_DOME_RADIUS", "Dome radius (m)", "%3.3f", 0.00, 50.0, 0.001, 0.0), new INDINumber("DOME_SHUTTER_WIDTH", "Dome shutter width (m)", "%3.3f", 0.00, 50.0, 0.001, 0.0), new INDINumber("DM_NORTH_DISPLACEMENT", "Displacement to the north of the mount center (m)", "%3.3f", 0.00, 50.0, 0.001, 0.0), new INDINumber("DM_EAST_DISPLACEMENT", "Displacement to the east of the mount center (m)", "%3.3f", 0.00, 50.0, 0.001, 0.0), new INDINumber("DM_UP_DISPLACEMENT", "UP displacement of the mount center (m)", "%3.3f", 0.00, 50.0, 0.001, 0.0), new INDINumber("DM_OTA_OFFSET", "Distance from the optical axis to the mount center (m)", "%3.3f", 0.00, 50.0, 0.001, 0.0) })); DriverInterface |= DRIVER_INTERFACE.DOME_INTERFACE; } }