public object Clone()
        {
            TagChannelRelationSetting ret = new TagChannelRelationSetting();

            if(this.relationList != null)
                ret.relationList = new List<RelationSetting>(this.relationList).ToArray();

            ret.IsUpdated = this.IsUpdated;

            return ret;
        }
Esempio n. 2
0
        /// <summary>
        /// フォームロードイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMeasureStart_Load(object sender, EventArgs e)
        {
            if (this.log != null) this.log.PutLog("frmMeasureStart.frmMeasureStart_Load() - 測定開始画面のロードを開始しました。");
            try
            {
                // 言語切替
                AppResource.SetControlsText(this);
                cmbMeasMode.Items.Clear();
                cmbMeasMode.Items.Add(AppResource.GetString("TXT_MODE1"));
                cmbMeasMode.Items.Add(AppResource.GetString("TXT_MODE2"));
                cmbMeasMode.Items.Add(AppResource.GetString("TXT_MODE3"));
                // タグ一覧表示
                this.tagSetting = SystemSetting.DataTagSetting;

                // 測定設定ファイル読み込み
                this.measSetting = SystemSetting.MeasureSetting;
                this.relationSetting = SystemSetting.RelationSetting;
                this.chSetting = SystemSetting.ChannelsSetting;

                //選択色をセットする。
                cmbColor.ListColors = new List<Color>(Constants.GraphLineColors);
                cmbColor.InitColors();

                // ch-tag relation can be changed in other setting form.
                if (this.measSetting != null && this.measSetting.MeasTagList != null)
                {
                    for (int i = 1; i < this.relationSetting.RelationList.Length; i++)
                    {
                        this.measSetting.MeasTagList[i - 1] = this.relationSetting.RelationList[i].TagNo_1;
                    }
                    this.revolutionTag = this.relationSetting.RelationList[0].TagNo_1;
                }

                // 測定設定を表示
                ShowMeasSetting();
                this.measSetting.IsUpdated = false;
                if (cmbColor.Visible)
                { cmbColor.Visible = false; }

                //コンテンツのロード
                ContentsLoad();

                //ボタンイメージの設定
                InitButtonImage();

            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }

            if (this.log != null) this.log.PutLog("frmMeasureStart.frmMeasureStart_Load() - 測定開始画面のロードを終了しました。");
        }
Esempio n. 3
0
        /// <summary>
        /// 各種設定取得
        /// </summary>
        private void LoadSettings()
        {
            // タグ一覧取得
            this.tagSetting = (this.IsMeasure) ? SystemSetting.DataTagSetting : this.AnalyzeData.DataTagSetting;

            // 測定設定取得
            this.measSetting = (this.IsMeasure) ? SystemSetting.MeasureSetting : this.AnalyzeData.MeasureSetting;

            // 測定項目-チャンネル結び付け設定取得
            this.relationSetting = (this.IsMeasure) ? SystemSetting.RelationSetting : this.AnalyzeData.TagChannelRelationSetting;

            // 回転数タグ
            this.revolutionTag = this.relationSetting.RelationList[0].TagNo_1;

            // チャンネル設定取得
            this.chSetting = (this.IsMeasure) ? SystemSetting.ChannelsSetting : this.AnalyzeData.ChannelsSetting;
        }
Esempio n. 4
0
 public CalcDataManager(DataTagSetting src_DataTagSetting, ConstantSetting src_ConstantSetting, TagChannelRelationSetting src_TagChannelRelationSetting, MeasureSetting src_MeasureSetting)
 {
     dataTagSetting = src_DataTagSetting;
     constantSetting = src_ConstantSetting;
     tagChannelRelationSetting = src_TagChannelRelationSetting;
     measureSetting = src_MeasureSetting;
 }
Esempio n. 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="log">ログ</param>
        public frmTagChannelRelation(LogManager log)
        {
            InitializeComponent();

            int index = 0;
            this.log = log;

            try
            {
                //タグリスト
                this.setting = SystemSetting.DataTagSetting;
                dgvDataTag.Rows.Clear();
                if (this.setting != null && this.setting.DataTagList != null)
                {
                    this.list.AddRange(this.setting.DataTagList);
                    int count = this.setting.DataTagList.Length;
                    for (int i = 0; i < count; i++)
                    {

                        if (this.setting.DataTagList[i] != null)
                        {
                            dgvDataTag.Rows.Add(new object[] { this.setting.DataTagList[i].TagNo, this.setting.DataTagList[i].GetSystemTagName(), this.setting.DataTagList[i].GetSystemUnit() });
                        }
                        else
                        {
                            dgvDataTag.Rows.Add(new object[] { "---", "---", "---" });
                        }
                    }
                }

                this.chSetting = SystemSetting.ChannelsSetting;
                if (this.chSetting.ChannelSettingList == null)
                {
                    this.chSetting.ChannelSettingList = new ChannelSetting[10];
                    for (int i = 0; i < this.chSetting.ChannelSettingList.Length; i++)
                    {
                        this.chSetting.ChannelSettingList[i] = new ChannelSetting();
                        this.chSetting.ChannelSettingList[i].ChKind = 0;
                        this.chSetting.ChannelSettingList[i].ChNo = i + 1;
                    }
                }
                //回転数結び付け設定
                dgvRotation.Rows.Add(new string[] { "---", "---", "-1" });

                this.relationSetting = SystemSetting.RelationSetting;
                if (this.relationSetting != null && this.relationSetting.RelationList != null)
                {
                    if (this.relationSetting.RelationList.Length <= 11)
                    {
                        DataTag tag = null;
                        if (this.relationSetting.RelationList[0] != null)
                        {
                            tag = FindDataTag(this.relationSetting.RelationList[0].TagNo_1);
                            if (tag != null)
                            {
                                dgvRotation.Rows[0].Cells[0].Value = tag.GetSystemTagName();
                                dgvRotation.Rows[0].Cells[1].Value = tag.GetSystemUnit();
                                dgvRotation.Rows[0].Cells[2].Value = tag.TagNo.ToString();
                                selectedRotation = tag;
                            }
                        }

                        for (index = 1; index < 11; index++)
                        {
                            if (this.relationSetting.RelationList[index] != null)
                            {
                                tag = FindDataTag(this.relationSetting.RelationList[index].TagNo_1);
                                if (tag != null)
                                {
                                    this.selectedTagArray[index - 1] = tag;
                                }
                                if (this.relationSetting.RelationList[index].TagNo_2 > 0)
                                {
                                    tag = FindDataTag(this.relationSetting.RelationList[index].TagNo_2);
                                    this.selectedTagSecond[index - 1] = tag;
                                }
                            }

                        }

                        LoadBoardDataByChannelType();
                    }
                }
                else
                {
                    this.relationSetting.RelationList = new RelationSetting[11];
                    for (int i = 0; i < 11; i++)
                    {
                        dgvBoardChannel.Rows.Add(new string[] { i.ToString(), "---", "---", "---", "-1" });
                    }
                }

                AppResource.SetControlsText(this);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// load content analyze data
        /// </summary>
        private void LoadContent()
        {
            bool selectAll = false;
            try
            {
                this.analyzeData.Desirialize_WithOut_Data();
            }
            catch
            {

            }

            if (this.analyzeData.DataTagSetting != null)
            {
                this.tagSetting = this.analyzeData.DataTagSetting;
            }
            else
            { this.tagSetting = new DataTagSetting(); }
            if (this.analyzeData.MeasureSetting != null)
            {
                this.measSetting = this.analyzeData.MeasureSetting;
            }
            else
            {
                selectAll = true;
                this.measSetting = new MeasureSetting();
            }
            if (this.analyzeData.TagChannelRelationSetting != null)
            {
                this.relationSetting = this.analyzeData.TagChannelRelationSetting;
            }
            else
            { this.relationSetting = new TagChannelRelationSetting(); }
            if (this.analyzeData.ChannelsSetting != null)
            {
                this.chSetting = this.analyzeData.ChannelsSetting;
            }
            else
            { this.chSetting = new ChannelsSetting(); }
            if (this.analyzeData.PositionSetting != null)
            {
                this.positionSetting = this.analyzeData.PositionSetting;
            }
            else
            { this.positionSetting = new SensorPositionSetting(); }
            if (selectAll)
            {
                for (int i = 1; i < this.relationSetting.RelationList.Length; i++)
                {
                    this.measSetting.MeasTagList[i - 1] = this.relationSetting.RelationList[i].TagNo_1;
                }
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Set graph setting to graph control
        /// </summary>
        public void SetGraphSetting()
        {
            // 測定設定ファイル読み込み
            if (this.IsMeasure)
            {
                // 測定中
                this.measSetting = SystemSetting.MeasureSetting;
                this.relationSetting = SystemSetting.RelationSetting;
                this.chSetting = SystemSetting.ChannelsSetting;
                this.graphViewer.EnableCurrentLine = false;
                this.IsMouseZoomEnabled = false;
            }
            else
            {
                // 解析中
                this.measSetting = this.AnalyzeData.MeasureSetting;
                this.relationSetting = this.AnalyzeData.TagChannelRelationSetting;
                this.chSetting = this.AnalyzeData.ChannelsSetting;
                this.graphViewer.EnableCurrentLine = true;
                this.IsMouseZoomEnabled = true;
            }
            // 測定項目設定ファイル読み込み
            if (this.tagSetting == null)
            {
                if (this.IsMeasure)
                {
                    // 測定中
                    this.tagSetting = SystemSetting.DataTagSetting;
                }
                else
                {
                    // 解析中
                    this.tagSetting = this.AnalyzeData.DataTagSetting;
                }
            }

            if (this.measSetting != null && this.measSetting.GraphSettingList != null && this.graphIndex >= 0)
            {
                var graph = this.measSetting.GraphSettingList[this.graphIndex];

                // グラフタイトル
                this.Text = graph.Title;

                // グラフに割り当てられているCH番号を取得する
                {
                    // CH番号リストクリア
                    this.chIndexList = new ChannelIndex[10];
                    for (int i = 0; i < this.chIndexList.Length; i++)
                    {
                        this.chIndexList[i] = new ChannelIndex();
                    }
                    this.calcTagList = new ChannelIndex[10];
                    for (int i = 0; i < this.calcTagList.Length; i++)
                    {
                        this.calcTagList[i] = new ChannelIndex();
                    }

                    // 測定項目-チャンネル結び付け設定ファイル読み込み
                    var relation = (this.IsMeasure) ? SystemSetting.RelationSetting : this.AnalyzeData.TagChannelRelationSetting;
                    if (relation == null || relation.RelationList == null || relation.RelationList.Length == 0)
                    {
                        MessageBox.Show(AppResource.GetString("MSG_RELATION_INVALID_SETTING"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    // CH番号リスト探索
                    for (int i = 0; i < graph.GraphTagList.Length; i++)
                    {
                        if (graph.GraphTagList[i].GraphTagNo != -1)
                        {
                            if (this.tagSetting.GetTagKind(graph.GraphTagList[i].GraphTagNo) == 2)
                            {
                                // 2:演算(解析)
                                this.calcTagList[i].Index = graph.GraphTagList[i].GraphTagNo;
                                continue;
                            }
                            else
                            {
                                for (int j = 0; j < relation.RelationList.Length; j++)
                                {
                                    if (graph.GraphTagList[i].GraphTagNo == relation.RelationList[j].TagNo_1
                                        || (this.measSetting.Mode == 1 && graph.GraphTagList[i].GraphTagNo == relation.RelationList[j].TagNo_2))
                                    {
                                        this.chIndexList[i].Index = j;
                                        this.chIndexList[i].IsMaxCh = (graph.GraphTagList[i].GraphTagNo == relation.RelationList[j].TagNo_1);
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }

                // グラフ軸設定
                if (this.measSetting.Mode == 1)
                {
                    CreateGraphInfo1(graph);
                }
                else if (this.measSetting.Mode == 2)
                {
                    CreateGraphInfo2(graph);
                }
                else if (this.measSetting.Mode == 3)
                {
                    CreateGraphInfo3(graph);
                }

            }
        }
Esempio n. 8
0
        /// <summary>
        /// フォームロードイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmGraphAxisSetting_Load(object sender, EventArgs e)
        {
            if (this.log != null) this.log.PutLog("frmGraphAxisSetting.frmGraphAxisSetting_Load() - グラフ軸設定画面のロードを開始しました。");

            try
            {
                AppResource.SetControlsText(this);
                config.LoadXmlFile();
                IsModXAxis = false;
                if (this.MeasSetting == null)
                {
                    ShowErrorMessage(AppResource.GetString("ERROR_MEASURE_SETTING_FILE_NOT_FOUND"));
                    this.Close();
                }

                if (this.IsMeasure)
                {
                    // 測定中
                    this.relationSetting = SystemSetting.RelationSetting;
                    this.chSetting = SystemSetting.ChannelsSetting;
                }
                else
                {
                    // 解析中
                    this.relationSetting = this.AnalyzeData.TagChannelRelationSetting;
                    this.chSetting = this.AnalyzeData.ChannelsSetting;
                }

                // Check this graph includes B and R type board only. (Mode1)
                this.boardBR = (this.MeasSetting.Mode == 1) ? CheckBoardBR(this.Graph) : false;

                this.binding = true;
                if (Graph != null)
                {
                    this.currentGraphSetting = (GraphSetting)Graph.Clone();

                    if (this.MeasSetting.Mode == 1)
                    {
                        this.ntbMinX.Text = Graph.MinimumX_Mode1.ToString();
                        this.ntbMaxX.Text = Graph.MaxX_Mode1.ToString();
                        this.ntbDistanceX.Text = Graph.DistanceX_Mode1.ToString();

                        if (this.boardBR)
                        {
                            this.lblSign.Visible = true;
                            this.ntbMinY.Text = Graph.CenterScale.ToString();
                            this.ntbMaxY.Text = Graph.Scale.ToString();
                            this.ntbMinY.MaxLength = 9;
                            this.ntbMaxY.AllowMinus = false;
                            this.ntbDistanceY.Text = Graph.DistanceY_CenterScale_Mode1.ToString();
                        }
                        else
                        {
                            this.ntbMinY.Text = Graph.MinimumY_Mode1.ToString();
                            this.ntbMaxY.Text = Graph.MaxY_Mode1.ToString();
                            this.ntbMaxY.AllowMinus = true;
                            this.ntbDistanceY.Text = Graph.DistanceY_Mode1.ToString();
                        }

                        this.ntbMinY.AllowMinus = true;
                    }
                    else if (this.MeasSetting.Mode == 2)
                    {
                        this.ntbMinX.Text = SystemSetting.ChannelsSetting.ChannelMeasSetting.Degree1.ToString();
                        this.ntbMaxX.Text = SystemSetting.ChannelsSetting.ChannelMeasSetting.Degree2.ToString();
                        this.ntbDistanceX.Text = Graph.DistanceX_Mode2.ToString();

                        this.ntbMinY.Text = Graph.MinimumY_Mode2.ToString();
                        this.ntbMaxY.Text = Graph.MaxY_Mode2.ToString();
                        this.ntbDistanceY.Text = Graph.DistanceY_Mode2.ToString();
                    }
                    else if (this.MeasSetting.Mode == 3)
                    {
                        this.ntbMinX.Text = Graph.MinimumX_Mode3.ToString();
                        this.ntbMaxX.Text = Graph.MaxX_Mode3.ToString();
                        this.ntbDistanceX.Text = Graph.DistanceX_Mode3.ToString();

                        this.ntbMinY.Text = Graph.MinimumY_Mode3.ToString();
                        this.ntbMaxY.Text = Graph.MaxY_Mode3.ToString();
                        this.ntbDistanceY.Text = Graph.DistanceY_Mode3.ToString();
                    }

                    //if (this.MeasSetting.Mode == 1)
                    //{
                    //    this.ntbMinY.Text = Graph.CenterScale.ToString();
                    //    this.ntbMaxY.Text = Graph.Scale.ToString();
                    //    this.ntbMinY.AllowMinus = true;
                    //    this.ntbMaxY.AllowMinus = true;
                    //    this.ntbMinY.MaxLength = 9;
                    //    this.ntbDistanceY.Text = Graph.DistanceY_Mode1.ToString();
                    //}
                    //else
                    //{
                    //    if (this.MeasSetting.Mode == 2)
                    //    {
                    //        this.ntbMinY.Text = Graph.MinimumY_Mode2.ToString();
                    //        this.ntbMaxY.Text = Graph.MaxY_Mode2.ToString();
                    //        this.ntbDistanceY.Text = Graph.DistanceY_Mode2.ToString();
                    //    }
                    //    else
                    //    {
                    //        this.ntbMinY.Text = Graph.MinimumY_Mode3.ToString();
                    //        this.ntbMaxY.Text = Graph.MaxY_Mode3.ToString();
                    //        this.ntbDistanceY.Text = Graph.DistanceY_Mode3.ToString();
                    //    }
                    //}

                    if (this.MeasSetting.Mode != 2)
                    {
                        ntbMinX.Enabled = false;
                        ntbMinX.Text = "0";
                    }
                    // this.ntbDistanceY.Text = Graph.DistanceY.ToString();
                    this.ntbShotNumber.Text = Graph.NumbeOfShotMode2.ToString();
                }

                this.binding = false;
                string unit = string.Empty;

                if (this.MeasSetting.Mode == 3)
                {
                    // To Net
                    // Enable below after you fix #....
            #if false
                    if (this.MeasSetting.SamplingTiming_Mode3 > 999999)
                    { unit = AppResource.GetString("TXT_UNIT_SECOND"); }
                    else if (this.MeasSetting.SamplingTiming_Mode3 > 999)
                    { unit = AppResource.GetString("TXT_UNIT_MILLISECOND"); }
                    else if (this.MeasSetting.SamplingTiming_Mode3 <= 999)
                    { unit = AppResource.GetString("TXT_UNIT_MICROSECOND"); ; }
            #else
                    unit = AppResource.GetString("TXT_UNIT_MILLISECOND");
            #endif
                }

                if (this.MeasSetting.Mode == 1)
                {
                    this.lblUnit1.Text = "TXT_SHOT_NUMBER";
                    this.lblUnit2.Text = string.Empty;

                }
                else if (this.MeasSetting.Mode == 2)
                {
                    if (!IsMeasure)
                    {
                        this.lblShotNumber.Visible = true;
                        this.ntbShotNumber.Visible = true;
                        this.lblShot.Visible = true;
                    }
                    this.lblUnit1.Text = "TXT_DEGREE_UNIT";
                    this.lblUnit2.Text = string.Empty;
                    ntbMinX.Enabled = false;
                    ntbMaxX.Enabled = false;

                }
                else if (this.MeasSetting.Mode == 3)
                {
                    this.lblUnit1.Text = unit;
                    this.lblUnit2.Text = string.Empty;
                }

                if (this.currentGraphSetting != null && this.currentGraphSetting.GraphTagList != null)
                {
                    for (int i = 0; i < this.currentGraphSetting.GraphTagList.Length; i++)
                    {
                        if (this.currentGraphSetting.GraphTagList[i].GraphTagNo > 0)
                        {
                            if (!IsMeasure && this.MeasSetting.Mode == 2)
                            {
                                this.lblShotNumber.Visible = true;
                                this.ntbShotNumber.Visible = true;
                                this.lblShot.Visible = true;
                            }
                            DataTagSetting tagSetting = (IsMeasure) ? SystemSetting.DataTagSetting : this.AnalyzeData.DataTagSetting;
                            this.lblUnit2.Text = tagSetting.GetUnitFromTagNo(this.currentGraphSetting.GraphTagList[i].GraphTagNo);
                            break;
                        }

                    }
                }
                // 言語切替
                AppResource.SetControlsText(this);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }

            if (this.log != null) this.log.PutLog("frmGraphAxisSetting.frmGraphAxisSetting_Load() - グラフ軸設定画面のロードを終了しました。");
        }
 public override void Revert()
 {
     TagChannelRelationSetting data = new TagChannelRelationSetting();
     //if (this.oldValue == null)
     //{
     //    if (System.IO.File.Exists(this.FilePath))
     //    {
     //        this.oldValue = (TagChannelRelationSetting)TagChannelRelationSetting.Deserialize(this.FilePath);
     //    }
     //    else
     //    {
     //        this.oldValue = new TagChannelRelationSetting();
     //    }
     //}
     if (System.IO.File.Exists(this.FilePath))
     {
         this.oldValue = (TagChannelRelationSetting)TagChannelRelationSetting.Deserialize(this.FilePath);
     }
     data = (TagChannelRelationSetting)this.oldValue;
     this.relationList = data.relationList;
     this.IsUpdated = false;
 }
Esempio n. 10
0
        /// <summary>
        /// load settings from xml files
        /// </summary>
        public static void LoadInstance()
        {
            MeasureSetting = new MeasureSetting();
            string xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + MeasureSetting.FileName;
            if (System.IO.File.Exists(xmlFilePath))
            {
                MeasureSetting = (MeasureSetting)MeasureSetting.Deserialize(xmlFilePath);
                if (MeasureSetting.Mode1_MeasCondition != null)
                {
                    MeasureSetting.Mode1_MeasCondition.IsUpdated = false;
                }
            }
            else
            {
                MeasureSetting = new MeasureSetting() { FilePath = xmlFilePath };
            }

            ChannelsSetting = new ChannelsSetting();
            xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + ChannelsSetting.FileName;
            if (System.IO.File.Exists(xmlFilePath))
            {
                ChannelsSetting = (ChannelsSetting)ChannelsSetting.Deserialize(xmlFilePath);
            }
            else
            {
                ChannelsSetting = new ChannelsSetting() { FilePath = xmlFilePath };
            }

            ConstantSetting = new ConstantSetting();
            xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + ConstantSetting.FileName;
            if (System.IO.File.Exists(xmlFilePath))
            {
                ConstantSetting = (ConstantSetting)ConstantSetting.Deserialize(xmlFilePath);
            }
            else
            {
                ConstantSetting = new ConstantSetting() { FilePath = xmlFilePath };
            }

            DataTagSetting = new DataTagSetting();
            xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + DataTagSetting.FileName;
            if (System.IO.File.Exists(xmlFilePath))
            {
                DataTagSetting = (DataTagSetting)DataTagSetting.Deserialize(xmlFilePath);
            }
            else
            {
                DataTagSetting = new DataTagSetting() { FilePath = xmlFilePath };
            }

            RelationSetting = new TagChannelRelationSetting();
            xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + TagChannelRelationSetting.FileName;
            if (System.IO.File.Exists(xmlFilePath))
            {
                RelationSetting = (TagChannelRelationSetting)TagChannelRelationSetting.Deserialize(xmlFilePath);
            }
            else
            {
                RelationSetting = new TagChannelRelationSetting() { FilePath = xmlFilePath };
            }

            PositionSetting = new SensorPositionSetting();
            xmlFilePath = CommonLib.SystemDirectoryPath.SystemPath + SensorPositionSetting.FileName;
            if (System.IO.File.Exists(xmlFilePath))
            {
                PositionSetting = (SensorPositionSetting)SensorPositionSetting.Deserialize(xmlFilePath);
            }
            else
            {
                PositionSetting = new SensorPositionSetting() { FilePath = xmlFilePath };
            }

            SystemConfig = new SystemConfig();
            SystemConfig.LoadXmlFile();

            HardInfoStruct = new HardInfoStruct();
            HardInfoStruct.LoadXmlFile();
        }
Esempio n. 11
0
        /// <summary>
        /// Initialize controls
        /// </summary>
        private void InitializeControls()
        {
            if (this.isMeasure)
            {
                this.tagLabels = new Label[] { lblItem0, lblItem1, lblItem2, lblItem3, lblItem4, lblItem5, lblItem6, lblItem7, lblItem8, lblItem9, lblItem10 };
                this.unitLabels = new Label[] { lblUnit0, lblUnit1, lblUnit2, lblUnit3, lblUnit4, lblUnit5, lblUnit6, lblUnit7, lblUnit8, lblUnit9, lblUnit10 };
                this.dataValueLabels = new Label[] { lblDataValue0, lblDataValue1, lblDataValue2, lblDataValue3, lblDataValue4, lblDataValue5, lblDataValue6, lblDataValue7, lblDataValue8, lblDataValue9, lblDataValue10 };
                this.dataValueLabels_Zero = new Label[] { lblDataValue_Zero0, lblDataValue_Zero1, lblDataValue_Zero2, lblDataValue_Zero3, lblDataValue_Zero4, lblDataValue_Zero5, lblDataValue_Zero6, lblDataValue_Zero7, lblDataValue_Zero8, lblDataValue_Zero9, lblDataValue_Zero10 };
            }
            else
            {
                this.tagLabels = new Label[] { lblAnlMeasItem0, lblAnlMeasItem1, lblAnlMeasItem2, lblAnlMeasItem3, lblAnlMeasItem4, lblAnlMeasItem5, lblAnlMeasItem6, lblAnlMeasItem7, lblAnlMeasItem8, lblAnlMeasItem9, lblAnlMeasItem10 };
                this.unitLabels = new Label[] { lblAnlMeasUnit0, lblAnlMeasUnit1, lblAnlMeasUnit2, lblAnlMeasUnit3, lblAnlMeasUnit4, lblAnlMeasUnit5, lblAnlMeasUnit6, lblAnlMeasUnit7, lblAnlMeasUnit8, lblAnlMeasUnit9, lblAnlMeasUnit10 };
                this.dataValueLabels = new Label[] { lblAnlDataMeas0, lblAnlDataMeas1, lblAnlDataMeas2, lblAnlDataMeas3, lblAnlDataMeas4, lblAnlDataMeas5, lblAnlDataMeas6, lblAnlDataMeas7, lblAnlDataMeas8, lblAnlDataMeas9, lblAnlDataMeas10 };
                this.dataValueLabels_Zero = new Label[] { lblAnlDataMeas_Zero0, lblAnlDataMeas_Zero1, lblAnlDataMeas_Zero2, lblAnlDataMeas_Zero3, lblAnlDataMeas_Zero4, lblAnlDataMeas_Zero5, lblAnlDataMeas_Zero6, lblAnlDataMeas_Zero7, lblAnlDataMeas_Zero8, lblAnlDataMeas_Zero9, lblAnlDataMeas_Zero10 };
                pnlAnalysis.Left = pnlMain.Left;
                pnlAnalysis.Top = pnlMain.Top;
                pnlMain.Visible = false;
                pnlAnalysis.Visible = true;

                this.tagLabelsAnl = new Label[] { lblAnlysisItem0, lblAnlysisItem1, lblAnlysisItem2, lblAnlysisItem3, lblAnlysisItem4, lblAnlysisItem5, lblAnlysisItem6, lblAnlysisItem7, lblAnlysisItem8, lblAnlysisItem9, lblAnlysisItem10 };
                this.unitLabelsAnl = new Label[] { lblAnlUnit0, lblAnlUnit1, lblAnlUnit2, lblAnlUnit3, lblAnlUnit4, lblAnlUnit5, lblAnlUnit6, lblAnlUnit7, lblAnlUnit8, lblAnlUnit9, lblAnlUnit10 };
                this.dataValueLabelsAnl = new Label[] { lblAnlData0, lblAnlData1, lblAnlData2, lblAnlData3, lblAnlData4, lblAnlData5, lblAnlData6, lblAnlData7, lblAnlData8, lblAnlData9, lblAnlData10 };

                this.calcAssignedTagNo = new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
            }

            // 各種設定読み込み
            if (this.isMeasure)
            {
                // 測定中
                this.tagSetting = RealTimeData.DataTagSetting;
                this.measSetting = SystemSetting.MeasureSetting;
                this.chSetting = SystemSetting.ChannelsSetting;
                this.relationSetting = SystemSetting.RelationSetting;
            }
            else
            {
                // 解析中
                this.tagSetting = this.analyzeData.DataTagSetting;
                this.measSetting = this.analyzeData.MeasureSetting;
                this.chSetting = this.analyzeData.ChannelsSetting;
                this.relationSetting = this.analyzeData.TagChannelRelationSetting;
            }

            // 測定項目No2の調整など
            if (this.measSetting != null && this.measSetting.MeasTagList != null)
            {
                var tagLabelList = new List<Label>();
                var dataValueLabelList = new List<Label>();
                var dataValueLabelZeroList = new List<Label>();
                var unitLabelList = new List<Label>();

                //回転数の測定項目を取得
                this.tagLabels[0].Text = (this.relationSetting.RelationList[0].TagNo_1 > 0) ? this.tagSetting.GetTagNameFromTagNo(this.relationSetting.RelationList[0].TagNo_1) : string.Empty;
                this.unitLabels[0].Text = (this.relationSetting.RelationList[0].TagNo_1 > 0) ? this.tagSetting.GetUnitFromTagNo(this.relationSetting.RelationList[0].TagNo_1) : string.Empty;

                //回転数はゼロ点無
                this.dataValueLabels_Zero[0].Visible = false;

                // 回転数は追加しておく
                tagLabelList.Add(this.tagLabels[0]);
                dataValueLabelList.Add(this.dataValueLabels[0]);
                dataValueLabelZeroList.Add(this.dataValueLabels_Zero[0]);
                unitLabelList.Add(this.unitLabels[0]);
                var heightMargin = 5;

                for (int i = 0; i < this.measSetting.MeasTagList.Length; i++)
                {
                    // タグ名と単位名の設定
                    this.tagLabels[i + 1].Text = (this.measSetting.MeasTagList[i] > 0) ? this.tagSetting.GetTagNameFromTagNo(this.measSetting.MeasTagList[i]) : string.Empty;
                    this.unitLabels[i + 1].Text = (this.measSetting.MeasTagList[i] > 0) ? this.tagSetting.GetUnitFromTagNo(this.measSetting.MeasTagList[i]) : string.Empty;

                    // 位置調整
                    if (i != 0)
                    {
                        this.tagLabels[i + 1].Top = tagLabelList.Last().Top + tagLabelList.Last().Height + heightMargin;
                        this.dataValueLabels[i + 1].Top = dataValueLabelList.Last().Top + dataValueLabelList.Last().Height + heightMargin;
                        this.dataValueLabels_Zero[i + 1].Top = this.dataValueLabels[i + 1].Top;
                        this.unitLabels[i + 1].Top = unitLabelList.Last().Top + unitLabelList.Last().Height + heightMargin;
                    }

                    tagLabelList.Add(this.tagLabels[i + 1]);
                    dataValueLabelList.Add(this.dataValueLabels[i + 1]);
                    dataValueLabelZeroList.Add(this.dataValueLabels_Zero[i + 1]);
                    unitLabelList.Add(this.unitLabels[i + 1]);

                    // 測定項目No2の有無
                    if (this.measSetting.Mode == 1)
                    {
                        //ゼロ設定を表示するため調整
                        this.dataValueLabels[i + 1].Width -= this.dataValueLabels_Zero[i + 1].Width + 3;
                        this.dataValueLabels[i + 1].Left += this.dataValueLabels_Zero[i + 1].Width + 3;

                        // センサがRでかつ基準設定ならば
                        if (this.chSetting.ChannelSettingList[i].ChKind == ChannelKindType.R
                        && this.chSetting.ChannelSettingList[i].Mode1_Trigger == Mode1TriggerType.MAIN)
                        {
                            var tag = new Controls.AutoFontSizeLabel()
                            {
                                //Name = "lblItem" + (i + 1).ToString() + "-2"
                                Name = tagLabelList.Last().Name + "-2"
                                ,
                                Top = tagLabelList.Last().Top + tagLabelList.Last().Height + heightMargin
                                ,
                                Left = this.tagLabels[0].Left
                                ,
                                Width = this.tagLabels[0].Width
                                ,
                                Height = this.tagLabels[0].Height
                                ,
                                TextAlign = this.tagLabels[0].TextAlign
                                ,
                                Font = new Font(this.tagLabels[i + 1].Font, this.tagLabels[i + 1].Font.Style)
                                ,
                                AutoFontSize = ((Controls.AutoFontSizeLabel)this.tagLabels[i + 1]).AutoFontSize
                                ,
                                MaxFontSize = ((Controls.AutoFontSizeLabel)this.tagLabels[i + 1]).MaxFontSize
                            };
                            tag.Text = (this.relationSetting.RelationList[i + 1].TagNo_2 > 0) ? this.tagSetting.GetTagNameFromTagNo(this.relationSetting.RelationList[i + 1].TagNo_2) : string.Empty;

                            if (isMeasure)
                                pnlMain.Controls.Add(tag);
                            else
                                tabPage1.Controls.Add(tag);

                            tagLabelList.Add(tag);

                            var val = new Label()
                            {
                                //Name = "lblDataValue" + (i + 1).ToString() + "-2"
                                Name = dataValueLabelList.Last().Name + "-2"
                                ,
                                Top = dataValueLabelList.Last().Top + dataValueLabelList.Last().Height + heightMargin
                                ,
                                Left = dataValueLabelList.Last().Left
                                ,
                                Width = dataValueLabelList.Last().Width
                                ,
                                Height = dataValueLabelList.Last().Height
                                ,
                                TextAlign = dataValueLabelList.Last().TextAlign
                                ,
                                Font = new Font(this.dataValueLabels[i + 1].Font, this.dataValueLabels[i + 1].Font.Style)
                                ,
                                BorderStyle = BorderStyle.Fixed3D
                                ,
                                BackColor = System.Drawing.Color.White

                            };
                            val.Text = string.Empty;
                            if (isMeasure)
                                pnlMain.Controls.Add(val);
                            else
                                tabPage1.Controls.Add(val);

                            dataValueLabelList.Add(val);

                            var zero  = new Label()
                            {
                                Name = dataValueLabelZeroList.Last().Name + "-2"
                                ,
                                Top = dataValueLabelZeroList.Last().Top + dataValueLabelZeroList.Last().Height + heightMargin
                                ,
                                Left = dataValueLabelZeroList.Last().Left
                                ,
                                Width = dataValueLabelZeroList.Last().Width
                                ,
                                Height = dataValueLabelZeroList.Last().Height
                                ,
                                TextAlign = dataValueLabelZeroList.Last().TextAlign
                                ,
                                Font = new Font(this.dataValueLabels_Zero[i + 1].Font, this.dataValueLabels_Zero[i + 1].Font.Style)
                                ,
                                BorderStyle = BorderStyle.Fixed3D
                                ,
                                BackColor = System.Drawing.Color.Transparent

                            };

                            zero.Text = string.Empty;
                            if (isMeasure)
                                pnlMain.Controls.Add(zero);
                            else
                                tabPage1.Controls.Add(zero);

                            dataValueLabelZeroList.Add(val);

                            var unit = new Controls.AutoFontSizeLabel()
                            {
                                //Name = "lblUnit" + (i + 1).ToString() + "-2"
                                Name = unitLabelList.Last().Name + "-2"
                                ,
                                Top = unitLabelList.Last().Top + unitLabelList.Last().Height + heightMargin
                                ,
                                Left = this.unitLabels[0].Left
                                ,
                                Width = this.unitLabels[0].Width
                                ,
                                Height = this.unitLabels[0].Height
                                ,
                                TextAlign = this.unitLabels[0].TextAlign
                                ,
                                Font = new Font(this.unitLabels[i + 1].Font, this.unitLabels[i + 1].Font.Style)
                                ,
                                AutoFontSize = ((Controls.AutoFontSizeLabel)this.unitLabels[i + 1]).AutoFontSize
                                ,
                                MaxFontSize = ((Controls.AutoFontSizeLabel)this.unitLabels[i + 1]).MaxFontSize

                            };
                            unit.Text = (this.relationSetting.RelationList[i + 1].TagNo_2 > 0) ? this.tagSetting.GetUnitFromTagNo(this.relationSetting.RelationList[i + 1].TagNo_2) : string.Empty;
                            if (isMeasure)
                                pnlMain.Controls.Add(unit);
                            else
                                tabPage1.Controls.Add(unit);

                            unitLabelList.Add(unit);
                        }
                    }
                }

                this.tagLabels = tagLabelList.ToArray();
                this.dataValueLabels = dataValueLabelList.ToArray();
                this.dataValueLabels_Zero = dataValueLabelZeroList.ToArray();
                this.unitLabels = unitLabelList.ToArray();

                // 回転タグ位置調整
                if (this.measSetting.Mode == 3)
                {
                    //Mode3は回転数をすべて消す
                    this.tagLabels[0].Visible = false;
                    this.dataValueLabels[0].Visible = false;
                    this.dataValueLabels_Zero[0].Visible = false;
                    this.unitLabels[0].Visible = false;

                    //消すので最終タグのラベル位置に合わせる
                    this.tagLabels[0].Top = this.tagLabels.Last().Top;
                    this.dataValueLabels[0].Top = this.dataValueLabels.Last().Top;
                    this.dataValueLabels_Zero[0].Top = this.dataValueLabels_Zero.Last().Top;
                    this.unitLabels[0].Top = this.unitLabels.Last().Top;

                }
                else if (this.measSetting.Mode == 2 && this.isMeasure)
                {
                    // 測定中Mode2では回転タグのみ表示する
                    this.tagLabels[0].Top = this.dataValueLabels[0].Top = this.dataValueLabels_Zero[0].Top = this.lblTitle.Height + heightMargin;
                    this.unitLabels[0].Top = this.tagLabels[0].Top + 2;
                    for (int i = 1; i < tagLabels.Length; i++)
                    {
                        this.tagLabels[i].Visible = this.dataValueLabels[i].Visible = this.dataValueLabels_Zero[i].Visible = this.unitLabels[i].Visible = false;
                    }
                }
                else
                {
                    this.tagLabels[0].Top = this.tagLabels.Last().Top + this.tagLabels.Last().Height + heightMargin;
                    this.dataValueLabels[0].Top = this.dataValueLabels.Last().Top + this.dataValueLabels.Last().Height + heightMargin;
                    this.dataValueLabels_Zero[0].Top = this.dataValueLabels_Zero.Last().Top + this.dataValueLabels_Zero.Last().Height + heightMargin;
                    this.unitLabels[0].Top = this.unitLabels.Last().Top + this.unitLabels.Last().Height + heightMargin;
                }

                // フォームサイズ調整
                if (isMeasure)
                    this.Height = this.unitLabels[0].Top + this.unitLabels[0].Height + lblTitle.Height + heightMargin;
                else
                {
                    this.tabControl1.Height = this.unitLabels[0].Top + this.unitLabels[0].Height + lblTitle.Height + heightMargin * 2;
                    this.pnlAnalysis.Height = this.tabControl1.Top + this.tabControl1.Height;
                    this.Height = this.tabControl1.Top + this.tabControl1.Height;
                }

                //set data point display
                var temp = string.Empty;
                var tempTagPoint = 0;
                for (int i = 1; i <= this.measSetting.MeasTagList.Length; i++)
                {
                    tempTagPoint = FindTagPoint(this.measSetting.MeasTagList[i - 1]);
                    if (tempTagPoint != 0)
                    {
                        tagPoint[i] = "#,##0." + temp.PadLeft(tempTagPoint, '0');
                    }
                    else
                    { tagPoint[i] = "#,##0"; }

                }
                tempTagPoint = FindTagPoint(this.relationSetting.RelationList[0].TagNo_1);
                this.tagPoint[0] = tempTagPoint <= 0 ? "#,##0" : "#,##0." + temp.PadLeft(tempTagPoint, '0');

            }
        }