示例#1
0
        private LabelListSetting GenerateDefaultLabelSetting(string settingKey = null)
        {
            var          settings = new LabelListSetting();
            LabelSetting setting  = null;

            if (settingKey != null && LevelValueManager.Settings.Keys.Contains(settingKey))
            {
                var levelSetting = LevelValueManager.Settings[settingKey];
                foreach (var item in levelSetting.LevelSettingVmList)
                {
                    string startValue = item.StartValue.ToString();
                    string endValue   = item.EndValue.ToString();
                    if (item.StartValue == int.MinValue)
                    {
                        startValue = "Min";
                    }
                    if (item.EndValue == int.MaxValue)
                    {
                        endValue = "Max";
                    }
                    //GridValue
                    setting = new LabelSetting
                    {
                        TextExpression = $"[{Diamond4Attributes.GridValue}]",
                        Name           = $"{Diamond4Attributes.GridValueCn} {startValue}~{endValue}",
                        IsVisible      = true,
                        Placement      = LabelPlacement.PointAboveLeft,
                        WhereClause    = $"{Diamond4Attributes.GridValueFloat}>={item.StartValue} and {Diamond4Attributes.GridValueFloat}<{item.EndValue}",
                        LabelColor     = item.LevelColor,
                        Position       = LabelPosition.FixedPositionOrRemove
                    };
                    settings.LabelSettings.Add(setting);
                }
            }
            else
            {
                //GridValue
                setting = new LabelSetting
                {
                    TextExpression = $"[{Diamond4Attributes.GridValue}]",
                    Name           = Diamond4Attributes.GridValueCn,
                    IsVisible      = true,
                    Placement      = LabelPlacement.PointAboveLeft,
                    Position       = LabelPosition.FixedPositionOrRemove
                };
                settings.LabelSettings.Add(setting);
            }

            return(settings);
        }
示例#2
0
        public LabelListSetting GenerateDefaultLabelSettings()
        {
            var settings = new LabelListSetting();
            //Temperature
            LabelSetting setting = new LabelSetting
            {
                TextExpression = $"[{Diamond2Attributes.Temperature}]",
                Name           = Diamond2Attributes.TemperatureCn,
                LabelColor     = Colors.Red,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveLeft
            };

            settings.LabelSettings.Add(setting);

            //TemperatureDiff
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond2Attributes.TemperatureDiff}]",
                Name           = Diamond2Attributes.TemperatureDiffCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointCenterLeft
            };
            settings.LabelSettings.Add(setting);

            //DewPoint
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond2Attributes.DewPoint}]",
                Name           = Diamond2Attributes.DewPointCn,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointBelowLeft
            };
            settings.LabelSettings.Add(setting);

            //WindSpeed
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond2Attributes.WindSpeed}]",
                Name           = Diamond2Attributes.WindSpeedCn,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveRight
            };
            settings.LabelSettings.Add(setting);

            //Height
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond2Attributes.Height}]",
                Name           = Diamond2Attributes.HeightCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointCenterRight
            };
            settings.LabelSettings.Add(setting);

            //StationNumber
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond2Attributes.StationNumber}]",
                Name           = Diamond2Attributes.StationNumberCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointBelowRight
            };
            settings.LabelSettings.Add(setting);

            return(settings);
        }
示例#3
0
        private LabelListSetting GenerateDefaultLabelSetting()
        {
            var settings = new LabelListSetting();
            //Temperature
            LabelSetting setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.Temperature}]",
                Name           = Diamond1Attributes.TemperatureCn,
                LabelColor     = Colors.Red,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveLeft
            };

            settings.LabelSettings.Add(setting);

            //CloudAmount
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.CloudAmount}]",
                Name           = Diamond1Attributes.CloudAmountCn,
                Position       = LabelPosition.FixedPositionOrRemove,
                IsVisible      = false,
                Placement      = LabelPlacement.PointCenterLeft
            };
            settings.LabelSettings.Add(setting);

            //WindSpeed
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.WindSpeed}]",
                Name           = Diamond1Attributes.WindSpeedCn,
                Placement      = LabelPlacement.PointBelowLeft,
                Position       = LabelPosition.FixedPositionOrRemove,
                IsVisible      = false
            };
            settings.LabelSettings.Add(setting);

            //SixhoursRain
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.SixhoursRain}]",
                Name           = Diamond1Attributes.SixhoursRainCn,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveRight
            };
            settings.LabelSettings.Add(setting);

            //AirPressure
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.AirPressure}]",
                Name           = Diamond1Attributes.AirPressureCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointCenterRight
            };
            settings.LabelSettings.Add(setting);

            //StationNumber
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.StationNumber}]",
                Name           = Diamond1Attributes.StationNumberCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointBelowRight
            };
            settings.LabelSettings.Add(setting);

            //ThreehoursAP
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.ThreehoursAP}]",
                Name           = Diamond1Attributes.ThreehoursAPCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveCenter
            };
            settings.LabelSettings.Add(setting);

            //DiYunLiang
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.DiYunLiang}]",
                Name           = Diamond1Attributes.DiYunLiangCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointBelowCenter
            };
            settings.LabelSettings.Add(setting);

            //DiYunGao
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.DiYunGao}]",
                Name           = Diamond1Attributes.DiYunGaoCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveCenter
            };
            settings.LabelSettings.Add(setting);

            //DewPoint
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.DewPoint}]",
                Name           = Diamond1Attributes.DewPointCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointBelowCenter
            };
            settings.LabelSettings.Add(setting);

            //Visibility
            setting = new LabelSetting
            {
                TextExpression = $"[{Diamond1Attributes.Visibility}]",
                Name           = Diamond1Attributes.VisibilityCn,
                IsVisible      = false,
                Position       = LabelPosition.FixedPositionOrRemove,
                Placement      = LabelPlacement.PointAboveCenter
            };
            settings.LabelSettings.Add(setting);

            return(settings);
        }