Exemple #1
0
        private void ProcessLine(string key, string value, ConfigEntry entry)
        {
            int cp = value.IndexOf('#');

            if (cp > 0)
            {
                value = value.Substring(0, cp - 1);
            }
            string[] v = value.Split(';');
            int      c = v.Length;

            string columnName = v[0].Trim();

            bool   dynamicDataDisplay = false;
            double min    = 0.0;
            double max    = 100.0;
            double height = 100.0;

            if (v.Length > 1)
            {
                string dynDataDisplay = v[1].Trim();
                if (dynDataDisplay.StartsWith("("))
                {
                    dynamicDataDisplay = true;
                    this.ParseDisplayParams(dynDataDisplay, out min, out max, out height);
                }
            }

            var item = new ConfigItem(key);

            item.ColumnName = columnName;
            item.Unit       = this.GetUnit(columnName);
            item.Max        = max;
            item.Min        = min;
            item.Height     = height;

            item.DisplayInChart = dynamicDataDisplay;
            entry.Add(item);
        }
Exemple #2
0
        private void ProcessLine(string key, string value, ConfigEntry entry)
        {
            int cp = value.IndexOf('#');
            if (cp > 0)
            {
                value = value.Substring(0, cp - 1);
            }
            string[] v = value.Split(';');
            int c = v.Length;

            string columnName = v[0].Trim();

            bool dynamicDataDisplay = false;
            bool alarm = false;
            double min = 0.0;
            double max = 100.0;
            double height = 100.0;
            double yellow = double.MaxValue;
            double red = double.MaxValue;
            if (v.Length > 1)
            {
                string e2 = v[1].Trim();
                if (e2.StartsWith("("))
                {
                    dynamicDataDisplay = true;
                    this.ParseDisplayParams(e2, out min, out max, out height);
                }

                if (v.Length > 2)
                {
                    string e3 = v[2].Trim();
                    if (e3.StartsWith("alarm"))
                    {
                        alarm = true;
                        e3 = e3.Substring(5);
                        this.ParseAlarmParams(e3, out yellow, out red);
                    }
                }
                else
                {
                    if (e2.StartsWith("alarm"))
                    {
                        alarm = true;
                        e2 = e2.Substring(5);
                        this.ParseAlarmParams(e2, out yellow, out red);
                    }
                }

                string dynDataDisplay = v[1].Trim();
                if (dynDataDisplay.StartsWith("("))
                {
                    dynamicDataDisplay = true;
                    this.ParseDisplayParams(dynDataDisplay, out min, out max, out height);
                }
            }

            var item = new ConfigItem(key);
            item.ColumnName = columnName;
            item.Unit = this.GetUnit(columnName);
            item.Max = max;
            item.Min = min;
            item.Height = height;

            item.DisplayInChart = dynamicDataDisplay;

            item.Alarm = alarm;
            if (alarm)
            {
                item.Yellow = yellow;
                item.Red = red;
            }
            entry.Add(item);
        }
Exemple #3
0
        private void ProcessLine(string key, string value, ConfigEntry entry)
        {
            int cp = value.IndexOf('#');
            if (cp > 0)
            {
                value = value.Substring(0, cp - 1);
            }
            string[] v = value.Split(';');
            int c = v.Length;

            string columnName = v[0].Trim();

            bool dynamicDataDisplay = false;
            double min = 0.0;
            double max = 100.0;
            double height = 100.0;
            if (v.Length > 1)
            {
                string dynDataDisplay = v[1].Trim();
                if (dynDataDisplay.StartsWith("("))
                {
                    dynamicDataDisplay = true;
                    this.ParseDisplayParams(dynDataDisplay, out min, out max, out height);
                }
            }

            var item = new ConfigItem(key);
            item.ColumnName = columnName;
            item.Unit = this.GetUnit(columnName);
            item.Max = max;
            item.Min = min;
            item.Height = height;

            item.DisplayInChart = dynamicDataDisplay;
            entry.Add(item);
        }
Exemple #4
0
        private void ProcessLine(string key, string value, ConfigEntry entry)
        {
            int cp = value.IndexOf('#');

            if (cp > 0)
            {
                value = value.Substring(0, cp - 1);
            }
            string[] v = value.Split(';');
            int      c = v.Length;

            string columnName = v[0].Trim();

            bool   dynamicDataDisplay = false;
            bool   alarm  = false;
            double min    = 0.0;
            double max    = 100.0;
            double height = 100.0;
            double yellow = double.MaxValue;
            double red    = double.MaxValue;

            if (v.Length > 1)
            {
                string e2 = v[1].Trim();
                if (e2.StartsWith("("))
                {
                    dynamicDataDisplay = true;
                    this.ParseDisplayParams(e2, out min, out max, out height);
                }

                if (v.Length > 2)
                {
                    string e3 = v[2].Trim();
                    if (e3.StartsWith("alarm"))
                    {
                        alarm = true;
                        e3    = e3.Substring(5);
                        this.ParseAlarmParams(e3, out yellow, out red);
                    }
                }
                else
                {
                    if (e2.StartsWith("alarm"))
                    {
                        alarm = true;
                        e2    = e2.Substring(5);
                        this.ParseAlarmParams(e2, out yellow, out red);
                    }
                }

                string dynDataDisplay = v[1].Trim();
                if (dynDataDisplay.StartsWith("("))
                {
                    dynamicDataDisplay = true;
                    this.ParseDisplayParams(dynDataDisplay, out min, out max, out height);
                }
            }

            var item = new ConfigItem(key);

            item.ColumnName = columnName;
            item.Unit       = this.GetUnit(columnName);
            item.Max        = max;
            item.Min        = min;
            item.Height     = height;

            item.DisplayInChart = dynamicDataDisplay;

            item.Alarm = alarm;
            if (alarm)
            {
                item.Yellow = yellow;
                item.Red    = red;
            }
            entry.Add(item);
        }