Beispiel #1
0
 /// <summary>
 /// clone object
 /// </summary>
 /// <returns></returns>
 public object Clone()
 {
     DataTagSetting tag = new DataTagSetting();
     if (this.DataTagList != null)
     {
         tag.DataTagList = new DataTag[this.DataTagList.Length];
         for (int i = 0; i < this.DataTagList.Length; i++)
         {
              tag.DataTagList[i] = null;
              if (this.DataTagList[i] != null)
              {
                  tag.DataTagList[i] = (DataTag)this.DataTagList[i].Clone();
              }
         }
     }
     tag.FilePath = this.FilePath;
     tag.IsUpdated = this.IsUpdated;
     tag.oldValue = this.oldValue;
     return tag;
 }
Beispiel #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() - 測定開始画面のロードを終了しました。");
        }
Beispiel #3
0
 /// <summary>
 /// revert data to previous state
 /// </summary>
 public override void Revert()
 {
     DataTagSetting data = new DataTagSetting();
     //if (this.oldValue == null)
     //{
     //    if (System.IO.File.Exists(this.FilePath))
     //    {
     //        this.oldValue = (DataTagSetting)DataTagSetting.Deserialize(this.FilePath);
     //    }
     //    else
     //    {
     //        this.oldValue = new DataTagSetting();
     //    }
     //}
     this.oldValue = (DataTagSetting)DataTagSetting.Deserialize(this.FilePath);
     data = (DataTagSetting)this.oldValue;
     this.DataTagList = data.DataTagList;
     this.IsUpdated = false;
 }
Beispiel #4
0
        public CalcExpression(string Path, LogManager log)
        {
            string msg = string.Empty;
            this.log = log;
            this.calcinitFlag = false;

            this.CurFilePath = Path;
            this.xmlFilePath = Path + "\\" + DataTagSetting.FileName;
            this.xmlFilePathConstant = Path + "\\" + ConstantSetting.FileName;

            if (System.IO.File.Exists(this.xmlFilePath))
            {
                ds = (DataTagSetting)DataTagSetting.Deserialize(this.xmlFilePath);
            }
            else {
                ds = null;
                msg = this.xmlFilePath + "\n" + AppResource.GetString("ERROR_TAG_SETTING_DATATAG_FILE_NOT_FOUND");
                ShowErrorMessage(msg); }

            ct = new ConstantSetting();
            if (System.IO.File.Exists(this.xmlFilePathConstant))
            {
                ct = SettingBase.DeserializeFromXml<ConstantSetting>(this.xmlFilePathConstant);
            }
            else {
                ct = null;
                msg = this.xmlFilePathConstant + "\n" + AppResource.GetString("ERROR_TAG_SETTING_CONSTANT_FILE_NOT_FOUND");
                ShowErrorMessage(msg); }
        }
Beispiel #5
0
        /// <summary>
        /// load setting data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmTagSettingSelect_Load(object sender, EventArgs e)
        {
            int count = 0;
            try
            {
                string tempString = string.Empty;
                AppResource.SetControlsText(this);
                if(this.setting != null)
                {
                    dataGridView1.Rows.Clear();
                    if (this.setting != null && this.setting.DataTagList != null)
                    {
                        this.list.AddRange(this.setting.DataTagList);
                        count = this.setting.DataTagList.Length;
                        for (int i = 0; i < count; i++)
                        {

                            if (this.setting.DataTagList[i] != null)
                            {
                                dataGridView1.Rows.Add(new object[] { this.setting.DataTagList[i].TagNo, this.setting.DataTagList[i].GetSystemTagName(), this.setting.DataTagList[i].GetSystemUnit() });
                            }
                            else
                            {
                                dataGridView1.Rows.Add(new object[] { "-1", "---", "---" });
                            }
                        }
                        this.currentData = this.list[0];
                    }
                }
                else
                {
                    ShowErrorMessage(AppResource.GetString("ERROR_TAG_SETTING_DATATAG_FILE_NOT_FOUND"));
                    this.setting = new DataTagSetting();
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }
        }
Beispiel #6
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;
 }
        /// <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;
        }
        /// <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);
            }
        }
Beispiel #9
0
        /// <summary>
        /// form open
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmTagSetting_Load(object sender, EventArgs e)
        {
            cboTagKind.DataSource = dtKind;
            if (dtKind.Rows.Count > 0)
            {
                cboTagKind.SelectedIndex = 0;
            }
            if (this.IsMeasure)
            { this.dataTagSetting = SystemSetting.DataTagSetting; }
            else
            { this.dataTagSetting = AnalyzeData.DataTagSetting; }
            if (this.dataTagSetting != null)
            {
                dgvTagList.Rows.Clear();
                if (this.dataTagSetting != null && this.dataTagSetting.DataTagList != null)
                {
                    this.list.AddRange(this.dataTagSetting.DataTagList);
                    int count = this.dataTagSetting.DataTagList.Length;
                    count = count > 300 ? 300 : count;
                    for (int i = 0; i < count; i++)
                    {
                        if (this.dataTagSetting.DataTagList[i] != null)
                        {
                            dgvTagList.Rows.Add(new object[] { this.dataTagSetting.DataTagList[i].TagNo, this.dataTagSetting.DataTagList[i].GetSystemTagName(), this.dataTagSetting.DataTagList[i].GetSystemUnit() });
                        }
                        else
                        {
                            dgvTagList.Rows.Add(new object[] { "---", "---", "---" });
                        }
                    }
                    if (count > 0)
                    {
                        ShowInfo(this.dataTagSetting.DataTagList[0]);
                    }
                }
            }
            else { ShowErrorMessage(AppResource.GetString("ERROR_TAG_SETTING_DATATAG_FILE_NOT_FOUND")); }
            this.constantSetting = new ConstantSetting();
            if (this.IsMeasure)
            {
                if (SystemSetting.ConstantSetting != null)
                { this.constantSetting = SystemSetting.ConstantSetting; }
                else { ShowErrorMessage(AppResource.GetString("ERROR_TAG_SETTING_CONSTANT_FILE_NOT_FOUND")); }
            }
            else
            { this.constantSetting = AnalyzeData.ConstantSetting; }
            this.dirtyFlag = false;

            PutLog("start frmTagSetting");
            if (!IsMeasure)
            {
                if (dgvTagList.RowCount > 0)
                {
                    for (int i = 0; i < dgvTagList.RowCount; i++)
                    {
                        if (this.dataTagSetting.DataTagList[i].TagKind == 0 && !this.dataTagSetting.DataTagList[i].IsBlank)
                        {
                            dgvTagList.Rows[i].ReadOnly = true;
                            dgvTagList.Rows[i].DefaultCellStyle.BackColor = Color.Gray;
                        }
                    }
                }
            }
        }
Beispiel #10
0
 /// <summary>
 /// 測定項目設定ボタンイベント
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnTagSetting_Click(object sender, EventArgs e)
 {
     try
     {
         if (cmbColor.Visible)
         { cmbColor.Visible = false; }
         using (var f = new RM_3000.Forms.Settings.frmTagSetting(this.log) { AnalyzeData = this.analyzeData })
         {
             if (f.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
             {
                 this.analyzeData.DataTagSetting = (DataTagSetting)DataTagSetting.Deserialize(this.analyzeData.DataTagSetting.FilePath);
                 this.tagSetting = this.analyzeData.DataTagSetting;
                 LoadCalcTag();
             }
         }
     }
     catch (Exception ex)
     {
         ShowErrorMessage(ex);
     }
 }
Beispiel #11
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;
                }
            }
        }
Beispiel #12
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);
                }

            }
        }
Beispiel #13
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();
        }
Beispiel #14
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');

            }
        }