private void 条码模块协议分析实验ToolStripMenuItem_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.条码模块); BarcodeCommandItem item = new BarcodeCommandItem(); FrmSerialPort frmSP = new FrmSerialPort(item, spci); frmSP.Text = "条码模块协议分析实验"; frmSP.ShowDialog(); }
private void tsmi上位机控制GPRS进行数据无线传输试验_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.GSM模块串口设置); FrmSerialPort frmSP = new FrmSerialPort(spci); frmSP.Text = "上位机控制GSM/GPRS进行无线数据传输实验"; //frmSP.flag = 4;//上位机控制GSM/GPRS进行无线数据传输实验 frmSP.ShowDialog(); }
private void 高频RFID协议实验ToolStripMenuItem_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.高频RFID串口设置); HFCommandItem item = new HFCommandItem(); FrmSerialPort frmSP = new FrmSerialPort(item, spci); frmSP.Text = "高频RFID协议分析实验"; frmSP.ShowDialog(); }
private void tsmi条码识别实验_Click(object sender, EventArgs e) { SerialPortConfigItem spci = ConfigManager.GetConfigItem(SerialPortConfigItemName.条码模块); BarcodeCommandItem item = new BarcodeCommandItem(); FrmSerialPort frmSP = new FrmSerialPort(item, spci); frmSP.Text = "条码模块协议分析实验"; frmSP.ShowDialog(); }
public static SerialPortConfigItem GetConfigItem(SerialPortConfigItemName itemName) { SerialPortConfigItem spci = null; string name = Enum.GetName(typeof(SerialPortConfigItemName) , itemName); spci = new SerialPortConfigItem(name); ConfigManager.SetSerialPortConfigurnation(ref spci); return(spci); }
public static bool SaveSerialPortConfigurnation(SerialPortConfigItem spci) { Debug.WriteLine(string.Format( "SaveSerialPortConfigurnation -> {0}" , spci.toString())); bool bR = false; DataSet dsAppSettings = new DataSet(); try { if (rfidCheck_CheckOn.InitialDB()) { object returnO = null; returnO = SQLiteHelper.ExecuteScalar(rfidCheck_CheckOn.dbPath , sqlSelectConfigItem , new object[1] { spci.ConfigName }); if (returnO != null) { // update SQLiteHelper.ExecuteScalar(rfidCheck_CheckOn.dbPath , sqlUpdateConfigItem , new object[6] { spci.SpName, spci.SpBaudRate, spci.SpParity , spci.SpStopBits, spci.SpDataBits, spci.ConfigName }); } else { SQLiteHelper.ExecuteScalar(rfidCheck_CheckOn.dbPath , sqlInsertConfigItem , new object[6] { spci.ConfigName, spci.SpName, spci.SpBaudRate, spci.SpParity , spci.SpStopBits, spci.SpDataBits } ); } } bR = true; } catch (System.Exception ex) { MessageBox.Show("配置文件出现错误!" + ex.Message); bR = false; } return(bR); }
private void TSMItem上位机控制GSMGPRS模块短信收发实验_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.GSM模块串口设置); FrmSerialPort frmSP = new FrmSerialPort(spci); frmSP.Text = "上位机控制GSM/GPRS模块短信收发实验"; //frmSP.flag = 2;//上位机控制GSM/GPRS模块基本实验 frmSP.ShowDialog(); }
private void gPRS实验ToolStripMenuItem_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.GSM模块串口设置); GPRSCommandItem ci = new GPRSCommandItem(); FrmSerialPort frmSP = new FrmSerialPort(ci, spci); frmSP.Text = "GSM/GPRS模块协议分析实验"; //frmSP.flag = 1;//上位机控制GSM/GPRS模块基本实验 frmSP.ShowDialog(); }
private void 协议分析ToolStripMenuItem_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.Zigbee模块串口设置); FrmSerialPort frmSP = new FrmSerialPort(spci); frmSP.SetShowDataStyle(SerialPortDataStyle.Hex); //frmSP.flag = 0;//串口基本实验 frmSP.Text = "Zigbee协议分析实验"; frmSP.ShowDialog(); }
private void tsmi上位机控制GPRS通话实验_Click(object sender, EventArgs e) { SerialPortConfigItem spci = ConfigManager.GetConfigItem(SerialPortConfigItemName.GSM模块串口设置); FrmSerialPort frmSP = new FrmSerialPort(spci); frmSP.Text = "上位机控制GSM/GPRS模块通话基本实验"; //frmSP.flag = 3;//上位机控制GSM/GPRS模块通话基本实验 frmSP.ShowDialog(); }
private void tSMItem上位机控制GSMGPRS模块基本实验_Click(object sender, EventArgs e) { SerialPortConfigItem spci = ConfigManager.GetConfigItem(SerialPortConfigItemName.GSM模块串口设置); GPRSCommandItem ci = new GPRSCommandItem(); FrmSerialPort frmSP = new FrmSerialPort(ci, spci); frmSP.Text = "上位机控制GSM/GPRS模块基本实验"; //frmSP.flag = 1;//上位机控制GSM/GPRS模块基本实验 frmSP.ShowDialog(); }
private void TSMItem串口通信实验_Click(object sender, EventArgs e) { //SerialPortConfigItem spci = // SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.CommonSerialPortConfig); SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.常用串口设置); FrmSerialPort frmSP = new FrmSerialPort(spci); //frmSP.flag = 0;//串口基本实验 frmSP.Text = "串口通信基础实验"; frmSP.ShowDialog(); }
private void 通信分析试验ToolStripMenuItem_Click(object sender, EventArgs e) { SerialPortConfigItem spci = SerialPortConfigItem.GetConfigItem(SerialPortConfigItemName.超高频RFID串口设置); UhfCommandItem uhfItem = new UhfCommandItem(); FrmSerialPort frmSP = new FrmSerialPort(uhfItem, spci); frmSP.SetShowDataStyle(SerialPortDataStyle.Hex); frmSP.SetSendDataStyle(SerialPortDataStyle.Hex); frmSP.Text = "RFID模块通信分析实验"; //frmSP.flag = 5;//RFID模块通信分析实验 frmSP.ShowDialog(); }
public static SerialPortConfigItem GetConfigItem(SerialPortConfigItemName itemName) { SerialPortConfigItem spci = null; string name = Enum.GetName(typeof(SerialPortConfigItemName) , itemName); string[] items = nsConfigDB.ConfigDB.getConfig(configTableName, name); if (items == null) { spci = new SerialPortConfigItem(itemName); } else { spci = new SerialPortConfigItem(name, items[1], items[2]); } return(spci); }
public static void SetSerialPortConfigurnation(ref SerialPortConfigItem spci) { if (null == spci) { return; } DataSet ds = null; try { if (rfidCheck_CheckOn.InitialDB()) { ds = SQLiteHelper.ExecuteDataSet(rfidCheck_CheckOn.dbPath, sqlSelectConfigItem , new object[1] { spci.ConfigName, } ); } if (ds != null && ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; spci.SpName = dr["PortName"].ToString(); spci.SpBaudRate = dr["BaudRate"].ToString(); spci.SpParity = dr["Parity"].ToString(); spci.SpStopBits = dr["StopBits"].ToString(); spci.SpDataBits = dr["DataBits"].ToString(); Debug.WriteLine(string.Format( "SetSerialPortConfigurnation -> {0}" , spci.toString())); } } } catch (System.Exception ex) { MessageBox.Show("读取配置数据时出现错误!" + ex.Message); } return; }