Ejemplo n.º 1
0
        private void AirConfigRdy(SerialComm sender)
        {
            AirCondConfig config = sender as AirCondConfig;

            minTT.Text  = string.Format(CultureInfo.InvariantCulture, "{0:F1}°C", config.MinT);
            maxTT.Text  = string.Format(CultureInfo.InvariantCulture, "{0:F1}°C", config.MaxT);
            minTrh.Text = string.Format(CultureInfo.InvariantCulture, "{0:F0}%", config.MinRH);
            maxTrh.Text = string.Format(CultureInfo.InvariantCulture, "{0:F0}%", config.MaxRH);
            if (!refreshReq)
            {
                config.MinT     = (float)minT.Value;
                config.MaxT     = (float)maxT.Value;
                config.MinRH    = (float)minRH.Value;
                config.MaxRH    = (float)maxRH.Value;
                config.FanLevel = (float)fanLvl.Value / 100;
            }
        }
Ejemplo n.º 2
0
        private void AirStateRdy(SerialComm sender)
        {
            AirCondConfig config = App.SerialDevs[0] as AirCondConfig;
            AirCondState  state  = sender as AirCondState;

            if (config.IsBufferValid)
            {
                fanTlvl.Text = config.FanLevel >= .99f ?
                               "Auto" : state.FanLevel.ToString("P0", CultureInfo.InvariantCulture);
                if (refreshReq)
                {
                    minT.Value   = config.MinT;
                    maxT.Value   = config.MaxT;
                    minRH.Value  = config.MinRH;
                    maxRH.Value  = config.MaxRH;
                    fanLvl.Value = config.FanLevel >= .99f ? 100 : state.FanLevel * 100;
                    refreshReq   = false;
                }
            }
        }