コード例 #1
0
        /// <summary>
        /// ON/OFF曲线
        /// </summary>
        private void refreshChart()
        {
            try
            {
                if (_udcChart == null)
                {
                    _udcChart = new udcChartOnOff();

                    _udcChart.Dock = DockStyle.Fill;

                    panel1.Controls.Add(_udcChart, 0, 2);
                }

                int maxAC = 0;

                for (int i = 0; i < ONOFF_MAX; i++)
                {
                    if (maxAC < _udcOnOff[i].acv)
                    {
                        maxAC = _udcOnOff[i].acv;
                    }
                }

                _udcChart.maxVolt = maxAC;

                _udcChart.biTime = System.Convert.ToDouble(txtTotalTime.Text) / 60;

                List <udcChartOnOff.COnOff> itemList = new List <udcChartOnOff.COnOff>();

                for (int i = 0; i < ONOFF_MAX; i++)
                {
                    udcChartOnOff.COnOff item = new udcChartOnOff.COnOff();

                    item.curVolt = _udcOnOff[i].acv;

                    item.onTimes = System.Convert.ToInt32(_udcOnOff[i].onTime);

                    item.offTimes = System.Convert.ToInt32(_udcOnOff[i].offTime);

                    item.onoffTimes = System.Convert.ToInt32(_udcOnOff[i].onoffTime) * (item.onTimes + item.offTimes);

                    item.outPutType = _udcOnOff[i].outPutType;

                    itemList.Add(item);
                }

                _udcChart.onoff = itemList;

                _udcChart.Refresh();
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
ファイル: FrmACVolt.cs プロジェクト: axinken/MyProject
        private void FrmACVolt_Load(object sender, EventArgs e)
        {
            labStartTime.Text = _CtrlAC.StartTime;

            TimeSpan ts = new TimeSpan(0, 0, _CtrlAC.RunTime);

            labRunTime.Text = ts.Days.ToString("D2") + ":" + ts.Hours.ToString("D2") + ":" + ts.Minutes.ToString("D2") + ":" + ts.Seconds.ToString("D2");

            labCurVolt.Text = _CtrlAC.CurVolt.ToString();

            labWaveVolt.Text = _CtrlAC.CurVolt.ToString();

            uiOnOff = new udcChartOnOff();

            uiOnOff.Dock = DockStyle.Fill;

            panel1.Controls.Add(uiOnOff, 0, 1);

            int maxAC = 0;

            uiOnOff.biTime = _CtrlAC.TotalTime;

            List <udcChartOnOff.COnOff> itemList = new List <udcChartOnOff.COnOff>();

            for (int i = 0; i < _CtrlAC.Time.OnOff.Count; i++)
            {
                udcChartOnOff.COnOff onoff = new udcChartOnOff.COnOff();

                onoff.curVolt = _CtrlAC.Time.OnOff[i].ACV;

                onoff.onoffTimes = _CtrlAC.Time.OnOff[i].OnOffTime;

                onoff.onTimes = _CtrlAC.Time.OnOff[i].OnTime;

                onoff.offTimes = _CtrlAC.Time.OnOff[i].OffTime;

                itemList.Add(onoff);

                if (_CtrlAC.Time.OnOff[i].ACV > maxAC)
                {
                    maxAC = _CtrlAC.Time.OnOff[i].ACV;
                }
            }

            uiOnOff.maxVolt = maxAC;

            uiOnOff.onoff = itemList;

            uiOnOff.Refresh();

            uiOnOff.startRun(_CtrlAC.RunTime);

            timer1.Enabled = true;
        }
コード例 #3
0
ファイル: FrmModel.cs プロジェクト: axinken/MyProject
        private void refreshChart()
        {
            try
            {
                if (_udcChart == null)
                {
                    _udcChart = new udcChartOnOff();

                    _udcChart.Dock = DockStyle.Fill;

                    panel3.Controls.Add(_udcChart, 0, 4);
                }

                int maxAC = 0;

                for (int i = 0; i < _onOffNum; i++)
                {
                    for (int j = 0; j < 4; j++)
                    {
                        if (maxAC < _onOff[i].Item[j].ACV)
                        {
                            maxAC = _onOff[i].Item[j].ACV;
                        }
                    }
                }

                _udcChart.maxVolt = maxAC;

                _udcChart.biTime = System.Convert.ToDouble(txtBITime.Text);

                List <udcChartOnOff.COnOff> itemList = calOnOffItem();

                _udcChart.onoff = itemList;

                _udcChart.Refresh();
            }
            catch (Exception)
            {
                throw;
            }
        }