/// <summary> /// 画面の設定を保存する /// </summary> void SaveDisplayInfo() { ns_IniFile.SettingIni _ini = new ns_IniFile.SettingIni(); System.Text.StringBuilder SetData = new System.Text.StringBuilder(); //動画 SetData.Clear(); SetData.Append(SaveDisplayInfo_Movie(0, txt_movie_1.Text)); SetData.Append(","); SetData.Append(SaveDisplayInfo_Movie(1, txt_movie_2.Text)); SetData.Append(","); SetData.Append(SaveDisplayInfo_Movie(2, txt_movie_3.Text)); SetData.Append(","); SetData.Append(SaveDisplayInfo_Movie(3, txt_movie_4.Text)); _ini.Func_SetIni(ns_IniFile.SettingIni.IniFileID.DISPLAY, SetData.ToString()); //画面の結合 SetData.Clear(); SetData.Append(checkBox_display_1.IsChecked.ToString()); SetData.Append(","); SetData.Append(checkBox_display_2.IsChecked.ToString()); SetData.Append(","); SetData.Append(checkBox_display_3.IsChecked.ToString()); SetData.Append(","); SetData.Append(checkBox_display_4.IsChecked.ToString()); SetData.Append(","); SetData.Append(radioButton_Horizon.IsChecked.ToString()); SetData.Append(","); SetData.Append(radioButton_Vertical.IsChecked.ToString()); _ini.Func_SetIni(ns_IniFile.SettingIni.IniFileID.OPTION, SetData.ToString()); }
/// <summary> /// USB接続 /// </summary> void InitUSBConnect() { //接続中であれば一度閉じる _usb.Close(); //USBと接続する ns_IniFile.SettingIni _ini = new ns_IniFile.SettingIni(); string[] GetData; _ini.Func_getIni(ns_IniFile.SettingIni.IniFileID.USB, out GetData); try { _usb.PortNM = GetData[0]; _usb.Bps = Int32.Parse(GetData[1]); _usb.DataBit = Int32.Parse(GetData[2]); _usb.Open(); if (_usb.ErrMsg != string.Empty) { AddLog(_usb.ErrMsg); } //USBに接続できた場合 if (_usb != null) { //センサーを初期化する _InOutFile = new ManageInOutFile(); } } catch { MessageBox.Show("Iniファイルに誤りがあります。\r\n ファイルが存在するか確認して下さい。", "【エラー】デバイスのチェック"); _isClosed = true; } }
/// <summary> /// 前回の設定を呼び出す /// </summary> void InitDisplayInfo() { ns_IniFile.SettingIni _ini = new ns_IniFile.SettingIni(); string[] GetData; //動画 _ini.Func_getIni(ns_IniFile.SettingIni.IniFileID.DISPLAY, out GetData); if (GetData[0].Length > 0) { SetMovieInfo(lbl_movie_1, txt_movie_1, 0, GetData[0]); } if (GetData[1].Length > 0) { SetMovieInfo(lbl_movie_2, txt_movie_2, 1, GetData[1]); } if (GetData[2].Length > 0) { SetMovieInfo(lbl_movie_3, txt_movie_3, 2, GetData[2]); } if (GetData[3].Length > 0) { SetMovieInfo(lbl_movie_4, txt_movie_4, 3, GetData[3]); } //画像の結合 _ini.Func_getIni(ns_IniFile.SettingIni.IniFileID.OPTION, out GetData); checkBox_display_1.IsChecked = Convert.ToBoolean(GetData[0]); checkBox_display_2.IsChecked = Convert.ToBoolean(GetData[1]); checkBox_display_3.IsChecked = Convert.ToBoolean(GetData[2]); checkBox_display_4.IsChecked = Convert.ToBoolean(GetData[3]); radioButton_Horizon.IsChecked = Convert.ToBoolean(GetData[4]); radioButton_Vertical.IsChecked = Convert.ToBoolean(GetData[5]); }