public void init() { if (initialized) { return; } name = "Wise40 SafeToOperate"; driverDescription = string.Format("{0} v{1}", driverID, version.ToString()); if (_profile == null) { _profile = new Profile() { DeviceType = "SafetyMonitor" }; } WiseSite.initOCH(); WiseSite.och.Connected = true; humiditySensor = new HumiditySensor(this); windSensor = new WindSensor(this); sunSensor = new SunSensor(this); cloudsSensor = new CloudsSensor(this); rainSensor = new RainSensor(this); humanInterventionSensor = new HumanInterventionSensor(this); computerControlSensor = new ComputerControlSensor(this); platformSensor = new PlatformSensor(this); doorLockSensor = new DoorLockSensor(this); pressureSensor = new PressureSensor(this); temperatureSensor = new TemperatureSensor(this); // // The sensors in priotity order. The first one that: // - is enabled // - not bypassed // - forces decision // - is not safe // causes SafeToOperate to be NOT SAFE // _prioritizedSensors = new List <Sensor>() { humanInterventionSensor, // Immediate sensors computerControlSensor, platformSensor, doorLockSensor, sunSensor, // Weather sensors - affecting isSafe windSensor, cloudsSensor, rainSensor, humiditySensor, pressureSensor, // Weather sensors - NOT affecting isSafe temperatureSensor, }; _cumulativeSensors = new List <Sensor>(); foreach (Sensor s in _prioritizedSensors) { if (!s.HasAttribute(Sensor.SensorAttribute.Immediate)) { _cumulativeSensors.Add(s); } } _connected = false; novas31 = new NOVAS31(); astroutils = new AstroUtils(); ascomutils = new Util(); novas31.MakeObject(0, Convert.ToInt16(Body.Sun), "Sun", new CatEntry3(), ref Sun); ReadProfile(); // Read device configuration from the ASCOM Profile store _safetyState = Event.SafetyEvent.SafetyState.Unknown; activityMonitor.Event(new Event.SafetyEvent() { _safetyState = _safetyState, _details = "WiseSafeToOperate.init()", }); initialized = true; }