示例#1
0
        private void httpResponse(JSONObject response)
        {
            WaitDialog.close();
            int error_code = response.getInt("error_code");

            if (error_code == 0)
            {
                FloderUtils folder      = new FloderUtils(outPath);
                JSONObject  value       = response.getJSONObject("value");
                string      file_path   = folder.createDeviceFolder(value.getString("deviceAddress"), orderID);
                BrainChart  brainCharts = new BrainChart(file_path, true, false, null);
                //brainCharts.Location = new Point(350, 45);
                //brainCharts.TopLevel = false;
                //this.Controls.Add(brainCharts);
                brainCharts.Show();
                brainCharts.Location = new Point(0, 0);
                resultList.Clear();
                JSONArray list = response.getJSONArray("list");
                for (int i = 0; i < list.Count; i++)
                {
                    JSONObject item = list.getJSONObject(i);
                    resultList.Add(item);
                }
                reloadList();
                setValue(value);
            }
            else
            {
                string message = response.getString("message");
                MessageBox.Show(message);
            }
        }
示例#2
0
 private void httpResponse(JSONObject response)
 {
     WaitDialog.close();
     int error_code = response.getInt("error_code");
     if (error_code == 0)
     {
         FloderUtils folder = new FloderUtils(outPath);
         JSONObject value = response.getJSONObject("value");
         string file_path = folder.createDeviceFolder(value.getString("deviceAddress"), orderID);
         BrainChart brainCharts = new BrainChart(file_path,true,false);
         //brainCharts.Location = new Point(350, 45);
         //brainCharts.TopLevel = false;
         //this.Controls.Add(brainCharts);
         brainCharts.Show();
         brainCharts.Location = new Point(0, 0);
         resultList.Clear();
         JSONArray list = response.getJSONArray("list");
         for (int i = 0; i < list.Count; i++)
         {
             JSONObject item = list.getJSONObject(i);
             resultList.Add(item);
         }
         reloadList();
         setValue(value);
     }
     else
     {
         string message = response.getString("message");
         MessageBox.Show(message);
     }
 }
示例#3
0
        private void bigBtn_Click(object sender, EventArgs e)
        {
            BrainChart brain_chart = new BrainChart(this.outPath, false, false, configManager);

            brain_chart.Show();
            brain_chart.bigStyle();
        }
示例#4
0
 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, configManager);
             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();
         }
     }
 }
示例#5
0
 private void bluetoothListView_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (bluetoothList.SelectedItems.Count > 0)
     {
         ListView.SelectedListViewItemCollection selected = bluetoothList.SelectedItems;
         string     indexStr = selected[0].SubItems[0].Text;
         int        index    = int.Parse(indexStr);
         JSONObject manager  = (JSONObject)resultList[index];
         string     orderID  = manager.getString("orderID");
         string     path     = manager.getString("path");
         if (path.Length > 0)
         {
             BrainChart view = new BrainChart(path, false, false, null);
             view.Show();
         }
         else
         {
             OrderView view = new OrderView(orderID, outPath);
             view.Show();
         }
     }
 }
示例#6
0
 private void bluetoothListView_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (bluetoothList.SelectedItems.Count > 0)
     {
         ListView.SelectedListViewItemCollection selected = bluetoothList.SelectedItems;
         string indexStr = selected[0].SubItems[0].Text;
         int index = int.Parse(indexStr);
         JSONObject manager = (JSONObject)resultList[index];
         string orderID = manager.getString("orderID");
         string path = manager.getString("path");
         if (path.Length > 0)
         {
             BrainChart view = new BrainChart(path, false,false);
             view.Show();
         }
         else
         {
             OrderView view = new OrderView(orderID, outPath);
             view.Show();
         }
     }
 }
示例#7
0
 private void bigBtn_Click(object sender, EventArgs e)
 {
     BrainChart brain_chart = new BrainChart(this.outPath,false,false);
     brain_chart.Show();
     brain_chart.bigStyle();
 }
示例#8
0
 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();
         }
     }
 }