public void OneClickTest() { Thread.Sleep(BandTime * 1000); AgentDll.btn_Continue(); Thread.Sleep(CommonTime * 1000 * 2); AgentDll.btn_Password(); Thread.Sleep(PatientTime * 1000); AgentDll.btn_Demographics(); Thread.Sleep(CommonTime * 1000); AgentDll.btn_LoadPatientData(); Thread.Sleep(CommonTime * 2000); AgentDll.choose_one_patient(); Thread.Sleep(CommonTime * 1000); AgentDll.btn_Previous_Patient(); Thread.Sleep(CommonTime * 1000); //AgentDll.btn_Previous_Patient(); Thread.Sleep(CommonTime * 1000); AgentDll.btn_PatForm1_Close(); Thread.Sleep(CommonTime * 1000); AgentDll.btn_Calibration(); Thread.Sleep(CommonTime * 1000); AgentDll.manul_Calib_device(); Thread.Sleep(CommonTime * 1000); AgentDll.start_test(); Thread.Sleep(PrepareTime * 1000); AgentDll.do_test(); Thread.Sleep(CommonTime * 1000); AgentDll.export_report(); Thread.Sleep(5 * 1000); }
private void ExportXML() { string dbpath = "C:\\Clasp32\\DATA\\data.db3"; try { if (File.Exists(infoFile)) { File.Delete(infoFile); } if (File.Exists(matrixFile)) { File.Delete(matrixFile); } Thread.Sleep(200); AgentDll.dump_table(dbpath, "Info", infoFile); Thread.Sleep(200); AgentDll.dump_table(dbpath, "Conscida", matrixFile); Thread.Sleep(200); AgentDll.dump_table(dbpath, "Risks", risksFile); } catch (Exception ex) { WriteLog(ex.ToString()); string str = ex.ToString(); } }
private void button4_Click(object sender, EventArgs e) { try { AgentDll.exit_target(); } catch (Exception ex) { MessageBox.Show("Agent关闭进程失败" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); WriteLog("Agent关闭进程失败" + ex.ToString()); } }
private void button3_Click(object sender, EventArgs e) { try { AgentDll.launchEx(true); } catch (Exception ex) { MessageBox.Show("Agent启动失败" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); WriteLog("Agent启动失败" + ex.ToString()); } }
private void button13_Click(object sender, EventArgs e) { bool isCon = AgentDll.check_dev_con(); if (isCon) { MessageBox.Show("设备已经连接"); } else { MessageBox.Show("设备没有连接"); } }
public bool TestHead() { bool rtn = false; StringBuilder buf = new StringBuilder(1024); AgentDll.btn_check_head_band(buf); string txt = buf.ToString(); if (txt == "HEAD_OK") { rtn = true; } return(rtn); }
public bool TestRF() { bool rtn = false; StringBuilder buf = new StringBuilder(1024); AgentDll.btn_check_rfoot_band(buf); string txt = buf.ToString(); if (txt == "RFOOT_OK") { rtn = true; } return(rtn); }
private void button15_Click(object sender, EventArgs e) { bool rtn = false; StringBuilder buf = new StringBuilder(1024); AgentDll.btn_check_head_band(buf); string txt = buf.ToString(); if (txt == "HEAD_OK") { rtn = true; } if (rtn) { MessageBox.Show("头部绑带正常"); } else { MessageBox.Show("头部绑带不正常"); } }
private void button1_Click(object sender, EventArgs e) { string name = "test1113"; string birthday = "2018-07-21"; string location = "wh"; string sex = "Male"; string sql = string.Format("INSERT INTO patient VALUES (NULL, '{0}', '{1}', '{2}', '中国', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, '{3}', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, 0, 0, 10, 0, 0, 76, 88, 85, 91, 98, 64, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 1, 1, 1, 1, 1, 2, NULL, NULL, NULL);", name, birthday, location, sex); string clearSql = "Delete from patient"; string dbpath = "C:\\Clasp32\\DATA\\data.db3"; try { AgentDll.exec_sql(dbpath, clearSql); AgentDll.exec_sql(dbpath, sql); MessageBox.Show("数据插入成功"); } catch (Exception ex) { MessageBox.Show("dbAgent数据插入失败" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); WriteLog("dbAgent数据插入失败" + ex.ToString()); } }
public void ExecSql(string dbpath, string sql) { AgentDll.exec_sql(dbpath, sql); }
private void button14_Click(object sender, EventArgs e) { AgentDll.btn_tformcomport_close(); }
public void Nutrition() { Thread.Sleep(CommonTime * 1000); AgentDll.nutr_load(); }
public void Risk() { Thread.Sleep(CommonTime * 1000); AgentDll.risk_load_data(); }
private void button5_Click(object sender, EventArgs e) { AgentDll.btn_Continue(); }
public void Emotion() { Thread.Sleep(CommonTime * 1000); AgentDll.make_emotion_chart(); }
public void TestLaunch(bool bShow) { AgentDll.launchEx(bShow); Thread.Sleep(StartUp * 1000); }
public void ExportReport() { Thread.Sleep(CommonTime * 1000); AgentDll.export_report(); }
public void CloseBandTest() { AgentDll.btn_tformcomport_close(); }
public void TestStart() { AgentDll.start_test(); Thread.Sleep(PrepareTime * 1000); AgentDll.do_test(); }