コード例 #1
0
ファイル: frmMeasureStart.cs プロジェクト: kse-jp/RM-3000
        /// <summary>
        /// グラフ軸設定ボタンイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnGraphAxisSetting_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbColor.Visible)
                { cmbColor.Visible = false; }
                if (this.measSetting != null && this.measSetting.GraphSettingList != null)
                {
                    var graph = this.measSetting.GraphSettingList[this.dgvGraph.SelectedRows[0].Index];

                    using (var f = new RM_3000.Forms.Graph.frmGraphAxisSetting(this.log) { MeasSetting = this.measSetting, Graph = graph })
                    {
                        if (f.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            this.measSetting.IsUpdated = true;
                            this.measSetting.GraphSettingList[this.dgvGraph.SelectedRows[0].Index] = f.Graph;
                            if (f.IsModXAxis)
                            {
                                for (int i = 0; i < this.measSetting.GraphSettingList.Length; i++)
                                {
                                    if (this.measSetting.Mode == 1)
                                    {
                                        //if (f.Graph.MinimumX_Mode1 > this.measSetting.GraphSettingList[i].MaxX_Mode1)
                                        //{
                                        //    this.measSetting.GraphSettingList[i].MaxX_Mode1 = f.Graph.MaxX_Mode1;
                                        //    this.measSetting.GraphSettingList[i].MinimumX_Mode1 = f.Graph.MinimumX_Mode1;
                                        //}

                                        this.measSetting.GraphSettingList[i].MinimumX_Mode1 = f.Graph.MinimumX_Mode1;
                                        this.measSetting.GraphSettingList[i].MaxX_Mode1 = f.Graph.MaxX_Mode1;
                                        this.measSetting.GraphSettingList[i].DistanceX_Mode1 = f.Graph.DistanceX_Mode1;
                                    }
                                    else if (this.measSetting.Mode == 2)
                                    {
                                        //if (f.Graph.MinimumX_Mode2 > this.measSetting.GraphSettingList[i].MaxX_Mode2)
                                        //{
                                        //    this.measSetting.GraphSettingList[i].MaxX_Mode2 = f.Graph.MaxX_Mode2;
                                        //    this.measSetting.GraphSettingList[i].MinimumX_Mode2 = f.Graph.MinimumX_Mode2;
                                        //}
                                        this.measSetting.GraphSettingList[i].MinimumX_Mode2 = f.Graph.MinimumX_Mode2;
                                        this.measSetting.GraphSettingList[i].MaxX_Mode2 = f.Graph.MaxX_Mode2;
                                        this.measSetting.GraphSettingList[i].DistanceX_Mode2 = f.Graph.DistanceX_Mode2;
                                    }
                                    else
                                    {
                                        //if (f.Graph.MinimumX_Mode3 > this.measSetting.GraphSettingList[i].MaxX_Mode3)
                                        //{
                                        //    this.measSetting.GraphSettingList[i].MaxX_Mode3 = f.Graph.MaxX_Mode3;
                                        //    this.measSetting.GraphSettingList[i].MinimumX_Mode3 = f.Graph.MinimumX_Mode3;
                                        //}
                                        this.measSetting.GraphSettingList[i].MinimumX_Mode3 = f.Graph.MinimumX_Mode3;
                                        this.measSetting.GraphSettingList[i].MaxX_Mode3 = f.Graph.MaxX_Mode3;
                                        this.measSetting.GraphSettingList[i].DistanceX_Mode3 = f.Graph.DistanceX_Mode3;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }
            finally
            {

            }
        }
コード例 #2
0
ファイル: frmAnalyzeStart.cs プロジェクト: kse-jp/RM-3000
        /// <summary>
        /// グラフ軸設定ボタンイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnGraphAxisSetting_Click(object sender, EventArgs e)
        {
            try
            {
                //picGraphAxisSetting.Image = imageList1[(int)picGraphAxisSetting.Tag + 1];
                //Application.DoEvents();

                if (cmbColor.Visible)
                { cmbColor.Visible = false; }
                if (this.measSetting != null && this.measSetting.GraphSettingList != null)
                {
                    var graphIndex = this.dgvGraph.SelectedRows[0].Index;
                    var graph = this.analyzeData.MeasureSetting.GraphSettingList[graphIndex];

                    using (var f = new RM_3000.Forms.Graph.frmGraphAxisSetting(this.log) { MeasSetting = this.analyzeData.MeasureSetting, AnalyzeData = this.analyzeData, Graph = graph })
                    {
                        if (f.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            this.analyzeData.MeasureSetting.IsUpdated = true;
                            this.analyzeData.MeasureSetting.GraphSettingList[graphIndex] = f.Graph;
                            if (f.IsModXAxis)
                            {
                                for (int i = 0; i < this.analyzeData.MeasureSetting.GraphSettingList.Length; i++)
                                {
                                    if (i == graphIndex)
                                    {
                                        continue;
                                    }
                                    //this.analyzeData.MeasureSetting.GraphSettingList[i].MaxX = f.Graph.MaxX;
                                    // this.analyzeData.MeasureSetting.GraphSettingList[i].MinimumX = f.Graph.MinimumX;
                                    //this.analyzeData.MeasureSetting.GraphSettingList[i].DistanceX = f.Graph.DistanceX;
                                    if (this.analyzeData.MeasureSetting.Mode == 1)
                                    {
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].MaxX_Mode1 = f.Graph.MaxX_Mode1;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].MinimumX_Mode1 = f.Graph.MinimumX_Mode1;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].DistanceX_Mode1 = f.Graph.DistanceX_Mode1;
                                    }
                                    else if (this.analyzeData.MeasureSetting.Mode == 2)
                                    {
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].MaxX_Mode2 = f.Graph.MaxX_Mode2;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].MinimumX_Mode2 = f.Graph.MinimumX_Mode2;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].DistanceX_Mode2 = f.Graph.DistanceX_Mode2;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].NumbeOfShotMode2 = f.Graph.NumbeOfShotMode2;
                                    }
                                    else
                                    {
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].MaxX_Mode3 = f.Graph.MaxX_Mode3;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].MinimumX_Mode3 = f.Graph.MinimumX_Mode3;
                                        this.analyzeData.MeasureSetting.GraphSettingList[i].DistanceX_Mode3 = f.Graph.DistanceX_Mode3;
                                    }
                                }
                            }

                            this.dirty = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }
            finally
            {
                //picGraphAxisSetting.Image = imageList1[(int)picGraphAxisSetting.Tag];
                //Application.DoEvents();
            }
        }