예제 #1
0
 public static async Task <bool> InitAll()
 {
     return(await Task <bool> .Run(() =>
     {
         Sleep(3000);
         io.Close();
         Sleep(200);
         HIOKI7012.ClosePort();
         Sleep(200);
         Hioki3239.ClosePort();
         Sleep(200);
         osc.Close();
         Sleep(200);
         WaveFormGenerator.Close();
         Sleep(200);
         FindSerialPort.GetDeviceNames();
         Sleep(500);
         Flags.StateEpx64 = General.io.InitEpx64R(0x7F);//0111 1111  ※P7入力 その他出力
         if (!Flags.StateEpx64)
         {
             return false;
         }
         Flags.State7012 = HIOKI7012.Init7012();
         if (!Flags.State7012)
         {
             return false;
         }
         Flags.State323x = Hioki3239.Init323x();
         if (!Flags.State323x)
         {
             return false;
         }
         Flags.State5107B = General.osc.Init();
         if (!Flags.State5107B)
         {
             return false;
         }
         Flags.StateWavGen = WaveFormGenerator.Initialize();
         if (!Flags.StateWavGen)
         {
             return false;
         }
         return true;
     }));
 }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();
            App._naviTest = FrameTest.NavigationService;
            App._naviConf = FrameConf.NavigationService;
            App._naviHelp = FrameHelp.NavigationService;
            App._naviInfo = FrameInfo.NavigationService;

            this.MouseLeftButtonDown += (sender, e) => this.DragMove();//ウィンドウ全体でドラッグ可能にする

            this.DataContext = State.VmMainWindow;



            //タイマーの設定
            timerTextInput          = new DispatcherTimer(DispatcherPriority.Normal);
            timerTextInput.Interval = TimeSpan.FromMilliseconds(1000);
            timerTextInput.Tick    += timerTextInput_Tick;
            timerTextInput.Start();

            GetInfo();

            //カレントディレクトリの取得
            State.CurrDir = Directory.GetCurrentDirectory();

            //試験用パラメータのロード
            State.LoadConfigData();

            FindSerialPort.GetDeviceNames();
            General.Init周辺機器();//非同期処理です



            InitMainForm();//メインフォーム初期

            this.WindowState = WindowState.Maximized;

            //メタルモード設定(デフォルトは禁止とする)
            Flags.MetalModeSw = false;

            State.SetSerialInfo();
            State.VmMainWindow.SerialNumber = State.シリアルナンバー年月部分 + State.NewSerial.ToString("D5");
        }