Exemple #1
0
        public int aqVals2Coll(List <double> aqVals, int updateHour, string updateDate)
        {
            for (var h = 0; h < 24; h++)
            {
                var rotHour = (24 + updateHour - h) % 24;
                var aqVal   = aqVals[rotHour];
                // This ugly coding style comes from a problem that the chart doesn't update its Hour axis anymore after the first assignment to Hour.
                if (rotHour == 0)
                {
                    aq24HrValColl.Add(new Aq24HrVal
                    {
                        // Replace Hour 0 with date.
                        Hour = updateDate.Replace("-", "/"),
                        Val  = aqVal
                    });
                }
                else
                {
                    aq24HrValColl.Add(new Aq24HrVal
                    {
                        Hour = rotHour + "",
                        Val  = aqVal
                    });
                }
                var aqLevel = StaticTaqModel.getAqLevel(AqHistShared.aqName, aqVal);
                //aq24HrValColl.Where(hv => hv.Hour == "0").First().Hour = updateDate.Replace("-", "/");
                aqColors.Add(new SolidColorBrush(StaticTaqModelView.html2RgbColor(StaticTaqModel.aqColors[AqHistShared.aqName][aqLevel])));
            }
            ccm.CustomBrushes = aqColors;

            return(0);
        }
Exemple #2
0
        public object Convert(object value, Type targetType, object parameter, string culture)
        {
            var aqLevel = StaticTaqModel.getAqLevel(AqHistShared.aqName, double.Parse((string)value));

            return(StaticTaqModelView.getTextColor(aqLevel));
        }