Example #1
0
 public GraphLineCollectionPropertyDescriptor(GraphLineCollection coll, int idx)
     :
     base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index      = idx;
 }
 public void SetDataSource(GraphLineCollection lines)
 {
     //checkedListBoxControl1.DataSource = lines;
     foreach (GraphLine line in lines)
     {
         if (line.LineVisible)
         {
             checkedListBoxControl1.Items.Add(line.Symbol, line.ChannelName, CheckState.Checked, true);
         }
         else
         {
             checkedListBoxControl1.Items.Add(line.Symbol, line.ChannelName, CheckState.Unchecked, true);
         }
     }
 }
Example #3
0
 public GraphLineCollectionPropertyDescriptor(GraphLineCollection coll, int idx)
     : base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index = idx;
 }
        public void AddMeasurementToCollection(GraphLineCollection coll, string Graphname, string SymbolName, DateTime Timestamp, float value, float minrange, float maxrange, Color linecolor)
        {
            bool _linefound = false;
            foreach (GraphLine line in coll)
            {
                if (line.Symbol == SymbolName)
                {
                    _linefound = true;
                    //                    if (value < minrange) minrange = value - 5;
                    //                    if (value > maxrange) maxrange = value + 5;

                    line.AddPoint(value, Timestamp, minrange, maxrange, linecolor);
                    break;
                }
            }
            if (!_linefound)
            {
                GraphLine _newline = new GraphLine();
                _newline.Symbol = SymbolName;
                _newline.NumberOfDecimals = GetChannelResolution(SymbolName);
                _newline.ChannelName = Graphname;
                _newline.Clear();
                coll.Add(_newline);
                _newline.AddPoint(value, Timestamp, minrange, maxrange, linecolor);
                _newline.LineVisible = GetRegistryValue(Graphname);
            }
        }
 private GraphLineCollection GetLinesInSelection()
 {
     //Console.WriteLine("date selection: " + _mindt.ToString("dd/MM HH:mm:ss") + " - " + _maxdt.ToString("dd/MM HH:mm:ss"));
     if (_selectionDetermined) return selcoll;
     selcoll = new GraphLineCollection();
     bool _measurementfound = false;
     while (!_measurementfound)
     {
         foreach (GraphLine _line in _lines)
         {
             foreach (GraphMeasurement gm in _line.Measurements)
             {
                 if (gm.Timestamp >= _mindt && gm.Timestamp <= _maxdt)
                 {
                     _measurementfound = true;
                     AddMeasurementToCollection(selcoll, _line.ChannelName, _line.Symbol, gm.Timestamp, gm.Value, _line.Minrange, _line.Maxrange, _line.LineColor);
                 }
             }
         }
         if (!_measurementfound)
         {
             if(!(PanToLeft())) _measurementfound = true;
         }
     }
     _selectionDetermined = true;
     return selcoll;
 }