コード例 #1
0
ファイル: TestForm.cs プロジェクト: sh932111/BrainProject
 public void callWordList()
 {
     HttpWorker httpWorker = new HttpWorker(HttpWorker.wordList, httpResponse);
     JSONObject form = new JSONObject();
     httpWorker.setData(form);
     httpWorker.httpWorker();
 }
コード例 #2
0
ファイル: OrderView.cs プロジェクト: sh932111/BrainProject
 private void getOrderView()
 {
     HttpWorker httpWorker = new HttpWorker(HttpWorker.orderView, httpResponse);
     JSONObject form = new JSONObject();
     form.setString("orderID", orderID);
     form.setString("showTranslate", "true");
     httpWorker.setData(form);
     httpWorker.httpWorker();
     WaitDialog.show();
 }
コード例 #3
0
ファイル: DoTest.cs プロジェクト: sh932111/BrainProject
 private void finishBtn_Click(object sender, EventArgs e)
 {
     DialogResult myResult = MessageBox.Show("確定答題完成", "正要交卷,確定已經上傳答案了嗎??", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     if ( myResult  == DialogResult.Yes)
     {
         HttpWorker httpWorker = new HttpWorker(HttpWorker.orderFinish, httpResponse);
         JSONObject form = new JSONObject();
         form.setString("orderID", configManager.getOrderID());
         httpWorker.setData(form);
         httpWorker.httpWorker();
         WaitDialog.show();
     }
 }
コード例 #4
0
ファイル: OrderList.cs プロジェクト: sh932111/BrainProject
 private void getOrderList()
 {
     if (isClient)
     {
         FloderUtils floder = new FloderUtils(this.outPath);
         ArrayList pathes = floder.listAllOrder();
         resultList = pathes;
         reloadList();
     }
     else
     {
         HttpWorker httpWorker = new HttpWorker(HttpWorker.orderList, httpResponse);
         JSONObject form = new JSONObject();
         form.setString("status", "4");
         httpWorker.setData(form);
         httpWorker.httpWorker();
         WaitDialog.show();
     }
 }
コード例 #5
0
ファイル: Main.cs プロジェクト: sh932111/BrainProject
 private void btnCheck_Click(object sender, EventArgs e)
 {
     if (outputText.Text.Length == 0)
     {
         FolderBrowserDialog path = new FolderBrowserDialog();
         path.ShowDialog();
         outputText.Text = path.SelectedPath;
     }
     if (outputText.Text.Length == 0)
     {
         MessageBox.Show("尚未選擇輸出路徑!");
         return;
     }
     if (textTestTime.Text.Length == 0 || textUserName.Text.Length == 0 || textUserYearOld.Text.Length == 0 || textWordNum.Text.Length == 0)
     {
         MessageBox.Show("欄位都為必填!");
         return;
     }
     ArrayList list = bluetooth_list.getResult();
     if (list.Count == 0)
     {
         MessageBox.Show("尚未選擇Device!");
         return;
     }
     ChromeUtils.closeChrome();
     Boolean isclient = checkBoxClient.Checked;
     if (isclient)
     {
         BluetoothDeviceManager manager = (BluetoothDeviceManager)list[0];
         string order_id = DateTime.Now.ToString("yyyyMMddHHmmss");
         ConfigManager config_manager = new ConfigManager(order_id, outputText.Text, int.Parse(textTestTime.Text), manager, true, isclient, textUserName.Text, textUserYearOld.Text);
         MessageBox.Show("準備好了?確定後開始測試");
         ArrayList formList = new ArrayList();
         formList.Add(this);
         formList.Add(bluetooth_list);
         new Memory(config_manager,formList);
     }
     else
     {
         BluetoothDeviceManager manager = (BluetoothDeviceManager)list[0];
         HttpWorker httpWorker = new HttpWorker(HttpWorker.orderCreate, httpResponse);
         JSONObject form = new JSONObject();
         form.setString("deviceAddress", manager.getDeviceAddress());
         form.setString("userName", textUserName.Text);
         form.setString("userYearOld", textUserYearOld.Text);
         form.setString("wordNum", textWordNum.Text);
         form.setString("testTime", textTestTime.Text);
         httpWorker.setData(form);
         httpWorker.httpWorker();
         WaitDialog.show();
     }
 }
コード例 #6
0
ファイル: Memory.cs プロジェクト: sh932111/BrainProject
 private void stopTimer()
 {
     stopWorker();
     time = 0;
     brainReceiver.stop();
     if (!configManager.getIsTest())
     {
         ChromeUtils.closeChrome();
         this.Close();
         ShowExDialog.show("第三步、測試單字", Properties.Resources.test);
         DoTest doTest = new DoTest(configManager);
         doTest.Show();
         doTest.Location = new Point(0, 0);
         ChromeUtils.openChrome(ChromeUtils.testURL + configManager.getOrderID());
     }
     else
     {
         WindowsMediaPlayer newMedia = new WindowsMediaPlayer();
         newMedia.URL = @"sound.mp3";
         newMedia.controls.play();
         if (configManager.getIsClient())
         {
             WriteFile writeFile = new WriteFile(this.runPath);
             writeFile.clientSave(configManager);
             this.Close();
             BrainChart view = new BrainChart(this.runPath,false,true);
             view.Show();
         }
         else
         {
             HttpWorker httpWorker = new HttpWorker(HttpWorker.orderFinish, httpResponse);
             JSONObject form = new JSONObject();
             form.setString("orderID", configManager.getOrderID());
             httpWorker.setData(form);
             httpWorker.httpWorker();
             WaitDialog.show();
         }
     }
 }