public void LogState(EngineRoomServiceDB erdb)
        {
            if (Tanks.Count == 0 || !Enabled || DateTime.Now.Subtract(_initialisedAt).TotalSeconds < 45)
            {
                return;
            }

            String desc;

            foreach (FluidTank ft in Tanks)
            {
                desc = String.Format("Water tank {0} is {1}% full (distance = {2}) and has {3}L remaining ... level is {4}", ft.ID, ft.PercentFull, ft.AverageDistance, ft.Remaining, ft.Level);
                erdb.LogState(ft.ID, "Percent Full", ft.PercentFull, desc);
            }

            desc = String.Format("Remaining water @ {0}%, {1}L ... level is {2}", PercentFull, Remaining, Level);
            erdb.LogState(ID, "Percent Full", PercentFull, desc);
        }
示例#2
0
        public void LogState(EngineRoomServiceDB erdb)
        {
            if (!Enabled)
            {
                return;
            }

            String desc = IsOn ? String.Format("On @ {0} for {1} secs", LastOn, DateTime.Now.Subtract(LastOn).TotalSeconds) : String.Empty;

            erdb.LogState(ID, "Pumping", State, desc);
        }
        public void LogState(EngineRoomServiceDB erdb)
        {
            if (!Enabled)
            {
                return;
            }

            erdb.LogState(ID, "Running", Running);
            if (RPM != null)
            {
                erdb.LogState(ID, "RPM", RPM.RPM);
                erdb.LogState(ID, "RPM Average", RPM.AverageRPM);
            }
            if (OilSensor != null)
            {
                erdb.LogState(ID, "OilSensor", OilSensor.State);
            }
            if (TempSensor != null)
            {
                erdb.LogState(ID, "Temperature", TempSensor.Temperature);
                erdb.LogState(ID, "Temperature Average", TempSensor.AverageTemperature);
            }
        }