Ejemplo n.º 1
0
        private void UpdateStatusProperties()
        {
            if (AtmosphericAverage.SampleSize < 1)
            {
                OverallStatus = PressureStatus = TemperatureStatus = CompositionStatus = AcuStatus.Caution;
                return;
            }

            PressureStatus    = GetMetricStatus(Thresholds.Pressure, AtmosphericAverage.Pressure);
            TemperatureStatus = GetMetricStatus(Thresholds.Temperature, AtmosphericAverage.Temperature);
            CompositionStatus = AcuStatus.Nominal;

            // We need to loop over all possible gases (or more specifically, a union of detected gases and recognized gases).
            foreach (GasSO gas in Gas.Gases.Values)
            {
                bool gasDetected = AtmosphericAverage.HasGas(gas);
                if (gasDetected && Thresholds.GasMoles.ContainsKey(gas) == false)
                {
                    // Let thresholds know about this unrecognized gas, but values are undetermined (let a technician set them).
                    Thresholds.GasMoles.Add(gas, AcuThresholds.UnknownValues);
                }

                GasLevelStatus[gas] = gasDetected
                                                ? GetMetricStatus(Thresholds.GasMoles[gas], AtmosphericAverage.GetGasMoles(gas))
                                                : AcuStatus.Nominal;
                CompositionStatus = GasLevelStatus[gas] > CompositionStatus? GasLevelStatus[gas] : CompositionStatus;
            }

            OverallStatus = PressureStatus;
            OverallStatus = TemperatureStatus > OverallStatus ? TemperatureStatus : OverallStatus;
            OverallStatus = CompositionStatus > OverallStatus ? CompositionStatus : OverallStatus;
        }
Ejemplo n.º 2
0
        private void UpdateAtmosphericAverage()
        {
            AtmosphericAverage.Clear();
            foreach (IAcuControllable device in ConnectedDevices)
            {
                AtmosphericAverage.AddSample(device.AtmosphericSample);
            }

            if (acuSamplesAir)
            {
                acuSample.FromGasMix(facingMetaNode.GasMix);
                AtmosphericAverage.AddSample(acuSample);
            }
        }