Example #1
0
        public CurveGroup AddNewGroup()
        {
            CurveGroup item = new CurveGroup(this);

            this.grpList.Add(item);
            return(item);
        }
Example #2
0
        public FormDayCurve()
        {
            InitializeComponent();


            this.dayCurveGroup = this.chart.AddNewGroup();
            this.dayCurveGroup.XAxes.MaxScale = 60000000 * 60L;
            this.dayCurveGroup.XAxes.MinScale = 250000;
            this.dayCurveGroup.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(DateTime.Now), 0);
            this.dayCurveGroup.CursorType = CurveCursorType.CURSOR_CROSSLINE;
            this.dayCurveGroup.DrawPointFlagXAxesScale = 5000000;


            IList <HHDeviceGrp> types = HHDeviceManager.GetInstance().DeviceGroupsUnsort;


            foreach (HHDeviceGrp type in types)
            {
                if (type.AnalogProperties.Count > 0)
                {
                    comboBoxEdit1.Properties.Items.Add(type);
                }
            }
            if (comboBoxEdit1.Properties.Items.Count > 0)
            {
                comboBoxEdit1.SelectedIndex = 0;
            }

            dateEdit1.DateTime = DateTime.Now.Date;
        }
Example #3
0
        public FormDayCurve()
        {
            InitializeComponent();

            this.dayCurveGroup = this.chart.AddNewGroup();
            this.dayCurveGroup.XAxes.MaxScale = 60000000*60L;
            this.dayCurveGroup.XAxes.MinScale = 250000;
            this.dayCurveGroup.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(DateTime.Now), 0);
            this.dayCurveGroup.CursorType = CurveCursorType.CURSOR_CROSSLINE;
            this.dayCurveGroup.DrawPointFlagXAxesScale = 5000000;

            IList<HHDeviceGrp> types = HHDeviceManager.GetInstance().DeviceGroupsUnsort;

            foreach (HHDeviceGrp type in types)
            {
                if (type.AnalogProperties.Count > 0)
                {
                   comboBoxEdit1.Properties.Items.Add(type);

                }
            }
            if (comboBoxEdit1.Properties.Items.Count > 0)
            {
                comboBoxEdit1.SelectedIndex = 0;
            }

            dateEdit1.DateTime = DateTime.Now.Date;
        }
Example #4
0
        public FormRawData()
        {
            InitializeComponent();

            this.rawCurveGroup = this.chart.AddNewGroup();
            this.rawCurveGroup.XAxes.MaxScale = 100000000L;
            this.rawCurveGroup.XAxes.MinScale = 400;
            this.rawCurveGroup.XAxes.SetScale(100000);
            this.rawCurveGroup.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(DateTime.Now), 0);
            this.rawCurveGroup.CursorType = CurveCursorType.CURSOR_CROSSLINE;
            rawCurveGroup.XAxes.XAxesMode = XAxesMode.Relative;

            this.rawCurveGroup.DrawPointFlagXAxesScale = 500;


            this.freqCurveGroup = this.chart1.AddNewGroup();
            this.freqCurveGroup.XAxes.MaxScale = 100000000L;
            this.freqCurveGroup.XAxes.MinScale = 100;
            this.freqCurveGroup.XAxes.SetScale(100000);
            this.freqCurveGroup.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(DateTime.Now), 0);
            this.freqCurveGroup.CursorType = CurveCursorType.CURSOR_CROSSLINE;
            freqCurveGroup.XAxes.XAxesMode = XAxesMode.Relative;

            this.freqCurveGroup.DrawPointFlagXAxesScale = 500;

            fftPlan = new FFTPlan(secNum * 8000);
            fftIn   = new float[secNum * 8000 * 2];
            fftOut  = new float[secNum * 8000 * 2];
        }
Example #5
0
        public FormSwitchCurve()
        {
            InitializeComponent();


            UltraChart.CurveGroup grp = chart.AddNewGroup();
            //chart.Attach(hWnd);
            grp.SetValueTipTimeFormat("", TipTimeType.MICROSECOND);
            grp.CursorType              = CurveCursorType.CURSOR_CROSSLINE;
            grp.XAxes.MaxScale          = 4000000;
            grp.XAxes.MinScale          = 20000;
            grp.XAxes.XAxesMode         = XAxesMode.Relative;
            grp.DrawPointFlagXAxesScale = 200000;


            IList <HHDeviceGrp> devGrps = HHDeviceManager.GetInstance().DeviceGroupsUnsort;

            foreach (HHDeviceGrp type in devGrps)
            {
                for (int i = 0; i < type.CurveProperties.Count; i++)
                {
                    comboBoxEdit1.Properties.Items.Add(type.CurveProperties[i]);
                }
            }
            if (comboBoxEdit1.Properties.Items.Count > 0)
            {
                comboBoxEdit1.SelectedIndex = 0;
            }
        }
Example #6
0
        public FormWav(Device dev)
            : this()
        {
            this.device = dev;


            for (int i = 0; i < listChart.Count; i++)
            {
                ChartGraph            chart = listChart[i];
                UltraChart.CurveGroup grp   = chart.AddNewGroup();
                grp.XAxes.MaxScale = 100000000L;
                grp.XAxes.MinScale = 100;
                grp.XAxes.SetScale(100000);
                grp.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(DateTime.Now), 0);
                grp.CursorType      = CurveCursorType.CURSOR_CROSSLINE;
                grp.XAxes.XAxesMode = XAxesMode.Relative;

                grp.DrawPointFlagXAxesScale = 500;
            }
        }
Example #7
0
 public CurveGroup AddNewGroup()
 {
     CurveGroup item = new CurveGroup(this);
     this.grpList.Add(item);
     return item;
 }
Example #8
0
        private void ProcADSample(object obj)
        {
            int channel = (int)obj;

            ADBlock block = new ADBlock(8000, 4000);

            this.device.AddADBlock(channel, block);

            try
            {
                while (true)
                {
                    short[] adData = block.GetAdData(-1);

                    if (adData == null)
                    {
                        continue;
                    }

                    if (listEnable[channel] == false)
                    {
                        continue;
                    }

                    int adMin = int.MaxValue;
                    int adMax = int.MinValue;


                    for (int i = 0; i < adData.Length; i++)
                    {
                        if (adData[i] > adMax)
                        {
                            adMax = adData[i];
                        }
                        if (adData[i] < adMin)
                        {
                            adMin = adData[i];
                        }
                    }

                    float adMaxf = adMax + (adMax - adMin) * 0.2f;

                    float adMinf = adMin - (adMax - adMin) * 0.2f;

                    this.Invoke((EventHandler) delegate
                    {
                        ChartGraph chart          = listChart[channel];
                        UltraChart.CurveGroup grp = chart.GroupList[0];
                        grp.ClearChartObject();

                        LineArea area         = new LineArea(chart, "AD曲线", true);
                        area.IsShowFoldFlag   = false;
                        area.IsFold           = false;
                        area.YAxes.Mode       = YAxesMode.Manual;
                        area.YAxes.YAxesMin   = adMinf;
                        area.YAxes.YAxesMax   = adMaxf;
                        area.YAxes.Precision  = 3;
                        area.YAxes.UnitString = "";


                        LineCurve lcAmpl = new LineCurve(chart, "原始波形", 0);

                        lcAmpl.LineColor = Color.Lime;
                        area.AddLine(lcAmpl);

                        DateTime timeNow = DateTime.Now;
                        long startTm     = ChartGraph.DateTime2ChartTime(timeNow);
                        for (int j = 0; j < adData.Length; j++)
                        {
                            long tm = startTm + j * 1000000L / 8000;
                            // var tm = timeQuery.AddMilliseconds(j / 8.0);
                            lcAmpl.AddPoint(new LinePoint(tm, adData[j]));
                        }


                        grp.AddChartObject(area);
                        grp.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(timeNow), 0);
                        chart.AutoSetXScale();


                        chart.Draw();
                    });
                }
            }
            catch (Exception ex)
            {
            }
            finally {
                this.device.RemoveADBlock(channel, block);
            }
        }
Example #9
0
        private void DrawCurve()
        {
            HHDevice device = comboBoxEdit2.SelectedItem as HHDevice;

            HHDeviceProperty devProp = comboBoxEdit1.SelectedItem as HHDeviceProperty;
            DateTime         timeSel = DateTime.Now;

            if (comboBoxEdit3.SelectedIndex >= 0)
            {
                timeSel = (DateTime)comboBoxEdit3.SelectedItem;
            }



            HHDeviceProperty devBindProp = device.GetProperty(devProp);


            List <DevCurve> curves = devBindProp.Curves;

            UltraChart.CurveGroup grp = chart.GroupList[0];
            grp.ClearChartObject();

            LineArea area = new LineArea(chart, "道岔曲线", true);

            area.IsShowFoldFlag   = false;
            area.IsFold           = false;
            area.YAxes.Mode       = YAxesMode.Manual;
            area.YAxes.YAxesMin   = curves[0].ADMin;
            area.YAxes.YAxesMax   = curves[0].ADMax;
            area.YAxes.Precision  = 3;
            area.YAxes.UnitString = "";
            grp.AddChartObject(area);
            grp.XAxes.SetOrgTime(ChartGraph.DateTime2ChartTime(timeSel), 0);
            chart.AutoSetXScale();


            List <StationCurve> listCurve = DataStorage.DatabaseModule.GetInstance().QueryCurveHistory(curves[0].Group.Type, curves[0].Index, timeSel);


            string[][] curveNames = new string[][] {
                new string[] { "曲线" },
                new string[] { "曲线1", "曲线2" },
                new string[] { "A相", "B相", "C相" },
            };

            for (int i = 0; i < curves.Count; i++)
            {
                LineCurve line = new LineCurve(chart, curveNames[curves.Count - 1][i], 0);
                line.LineColor = ColorList[i % ColorList.Length];
                area.AddLine(line);
                if (listCurve != null && listCurve.Count > 0 && listCurve[i] != null)
                {
                    for (int j = 0; j < listCurve[i].Points.Length; j++)
                    {
                        DateTime  time  = timeSel.AddMilliseconds(curves[i].TimeInterval * j); //40毫秒
                        LinePoint point = new LinePoint();
                        point.Value = listCurve[i].Points[j];
                        point.Time  = ChartGraph.DateTime2ChartTime(time);
                        line.AddPoint(point);
                    }
                }
            }
            chart.AutoSetXScale();
            chart.Draw();
        }