DocumentFile docLink = null;//暂存点击到的位置的链接 public frmEquipmentConfig() { InitializeComponent(); //this.numCountofGroup.Value = (decimal)this.ctl.getClassroomConfig(0); this.numCountofGroup.Value = (decimal)this.configCtl.GetGroupCount(); //this.numCountofRow.Value = (decimal)this.ctl.getClassroomConfig(1); //this.numCountofColumn.Value = (decimal)this.ctl.getClassroomConfig(2); if (MemoryTable.isInitialized == false) { MemoryTable.initializeTabes(); } this.dtRoomConfig = MemoryTable.dtRoomConfig; //dtRoomConfig = this.configCtl.getAllRoomConfigInfo(); //dtRoomConfig.Columns.Add("totalColumn", typeof(int)); //dtRoomConfig.Columns["totalColumn"].Expression = "Sum(ICOLUMN)"; //dtRoomConfig.Columns.Add("maxGroup", typeof(int)); //dtRoomConfig.Columns["maxGroup"].Expression = "Max(IGROUP)"; this.Shown += new EventHandler(frmEquipmentConfig_Shown); this.FormClosing += new FormClosingEventHandler(frmEquipmentConfig_FormClosing); this.FormClosed += new FormClosedEventHandler(frmEquipmentConfig_FormClosed); MiddleWareCore.set_mode(MiddleWareMode.设备绑定); MiddleWareCore.event_receiver = this; }
private void ShowPerson() { DataTable myData = StudentManagement.GetPersonDataTable(); dataGridView1.DataSource = myData; int iNumberofStudents = myData.Rows.Count; this.groupBox2.Text = "学生列表 共有学生" + iNumberofStudents.ToString() + "名"; this.dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); int headerW = this.dataGridView1.RowHeadersWidth; int columnsW = 0; DataGridViewColumnCollection columns = this.dataGridView1.Columns; for (int i = 0; i < columns.Count; i++) { columnsW += columns[i].Width; } if (columnsW + headerW < this.dataGridView1.Width) { int leftTotalWidht = this.dataGridView1.Width - columnsW - headerW; int eachColumnAddedWidth = leftTotalWidht / columns.Count; for (int i = 0; i < columns.Count; i++) { columns[i].Width += eachColumnAddedWidth; } } MiddleWareCore.set_mode(MiddleWareMode.学生卡绑定, this); }
void test_实时互动1() { //接收到一个标签数据 MiddleWareCore.set_mode(MiddleWareMode.实时互动); string cmd1 = "[select,master_node,equip000001,stu000001,01,A]"; MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd1)); IntelligentEvent evt1 = MiddleWareCore.get_a_event(); if (evt1.epcID == "stu000001" && evt1.localDeviceID == "master_node" && evt1.remoteDeviceID == "equip000001" && evt1.questionID == "01" && evt1.questionValue == "A" && evt1.event_unit_list[0] == IntelligentEventUnit.new_epc) { Debug.WriteLine("True"); } else { Debug.WriteLine("False"); } //找到该学生的信息,包括学生姓名、位置、选择 //查找学生信息 Person person = MemoryTable.getPersonByEpc(evt1.epcID); if (person.id_num == "CE4D9397871") { Debug.WriteLine("True"); } else { Debug.WriteLine("False"); } }
void Form1_FormClosing(object sender, FormClosingEventArgs e) { //保存考勤信息 if (this.SaveCheckInfo()) { } MiddleWareCore.set_mode(MiddleWareMode.无); }
private void pbTest_Click(object sender, EventArgs e) { //Program.frmTest.Show(); frmRTTest frm = new frmRTTest(); MiddleWareCore.set_mode(MiddleWareMode.课堂测验); frm.ShowDialog(); }
// 291,147 #endregion #region 初始化 public frmSelect() { InitializeComponent(); this.form_initial_width = this.Width; this.right_groups_initial_left = this.groupBox_command.Left; this.right_groups_initial_width = this.groupBox_command.Width; this.form_initial_heigth = this.Height; this.shown_width = this.right_groups_initial_width + 15; this.shown_heigth = this.groupBox_command.Height + this.groupPie.Height + 30; //this.btn1.BackColor = this.clrNotKnown; //this.btn2.BackColor = this.clrA; //this.btn3.BackColor = this.clrB; //this.btn4.BackColor = this.clrC; //this.btn5.BackColor = this.clrD; //this.initialInfoTable(); //InitializePanelControl(); //InitialClassRoom(); //this.groupBoxChair.Visible = fals; bSeatVisible = true; this.groupBoxChair.Visible = false; //this.btnHideSeat.Text = "显示座位(&S)"; this.Width = this.shown_width; this.Height = this.shown_heigth; this.Left = this.Left + this.form_initial_width - this.shown_width; this.groupPie.Left = 5; this.groupBox_command.Left = 5; //this.groupPie.Left = 5; //this.btnMin.Left = this.Width - 100 - 5; //this.btnClearState.Left = this.btnMin.Left - 100; //this.btnQuit.Left = this.Width - 10 - this.btnQuit.Width; Screen[] screens = System.Windows.Forms.Screen.AllScreens; for (int i = 0; i < screens.Length; i++) { Screen sc = screens[i]; if (sc.Primary == true) { Rectangle rect = sc.WorkingArea; //this.Left = (int)(rect.Width * 0.7); this.Top = (int)(rect.Height * 0.1); } } this.initialInfoTable(); InitializePanelControl(); InitialClassRoom(); this.FormClosing += new FormClosingEventHandler(Form1_FormClosing); this.FormClosed += new FormClosedEventHandler(frmSelect_FormClosed); this.VisibleChanged += new EventHandler(frmSelect_VisibleChanged); MiddleWareCore.event_receiver = this; MiddleWareCore.set_mode(MiddleWareMode.即时互动); }
private void button1_Click(object sender, EventArgs e) { frmCheckInitctl.insert_record(this.lblCheckGuid.Text, this.dtpStart.Text, this.dtpEnd.Text, this.txtInfo.Text, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); frmCheck check = new frmCheck(this.lblCheckGuid.Text, this.dtpStart.Text, this.dtpEnd.Text); check.ShowDialog(); MiddleWareCore.set_mode(intelligentMiddleWare.MiddleWareMode.考勤); this.Close(); }
void Form1_VisibleChanged(object sender, EventArgs e) { this.Top = Program.frmFloat.Height + Program.frmFloat.Top; this.Left = Program.frmFloat.Left; if (this.Visible == true) { this.clearSelectStatus(); MiddleWareCore.set_mode(MiddleWareMode.无, this); } }
public void prepare_handler() { this.initialInfoTable(); MiddleWareCore.set_mode(MiddleWareMode.课堂测验, this); Program.frmFloat.setLegend(this.textList, this.styleList); Program.frmClassRoom.setCallBackInvoker(this);//点击座位时的回调 Program.frmClassRoom.resetClassRoomState(); setPieToInitializeState(); this.Show(); }
//设置当前题目的答题状态,包括作为和饼图 void reset_test_status() { DataRow[] rows = this.dtQuestion_answer_record.Select(string.Format("question_id = '{0}'", current_question_id)); int total_student_count = this.studentInfoTable.Rows.Count; int iAnswered = rows.Length; int iUnknown = total_student_count - iAnswered; string strUnknown = iUnknown.ToString(); string strAnswered = iAnswered.ToString(); m_panelDrawing.Values = new decimal[] { iUnknown, iAnswered }; m_panelDrawing.Texts = new string[] { iUnknown.ToString(), iAnswered.ToString() }; MiddleWareCore.set_mode(MiddleWareMode.课堂测验); //for (int j = 0; j < this.studentInfoTable.Rows.Count; j++) //{ // DataRow dr = this.studentInfoTable.Rows[j]; // string student_id = dr["STUDENTID"].ToString(); // DataRow[] rowsForDuplicate = this.mapConfigsTable.Select("studenID = '" + student_id + "'"); // if (rowsForDuplicate.Length > 0)//说明已经有过对应 // { // int groupIndex2 = int.Parse(rowsForDuplicate[0]["IGROUP"].ToString()); // Carbinet _carbinet2 = this.groups[groupIndex2]; // _carbinet2.setDocBGImage((string)rowsForDuplicate[0]["EQUIPEMNTID"], imgNormal); // _carbinet2.setDocText((string)rowsForDuplicate[0]["EQUIPEMNTID"], ""); // rowsForDuplicate[0]["studenID"] = ""; // } //} //for (int i = 0; i < rows.Length; i++) //{ // string student_id = rows[i]["student_id"].ToString(); // rows = this.studentInfoTable.Select("STUDENTID = '" + student_id + "'"); // rowsMap = this.mapConfigsTable.Select("EQUIPEMNTID = '" + remoteDeviceID + "'"); // if (rows.Length > 0 && rowsMap.Length > 0) // { // string answer = question_value; // int groupIndex = int.Parse(rowsMap[0]["IGROUP"].ToString()); // studentName = (string)rows[0]["NAME"]; // Carbinet _carbinet = this.groups[groupIndex]; // _carbinet.setDocText(remoteDeviceID, studentName); // //这里要处理一下同一个学生用不一个设备发送答案的情况 // // 根据就是每一次客户端发送信息时,服务端都要把发送过来的标签和设备重新绑定一次 // // 如果之前绑定过并且和现在的不同,则说明该标签之前用别的设备发送过信息 // rowsMap[0]["studenID"] = epcID;//这里把设备和标签绑定到一起 // _carbinet.setDocBGImage(remoteDeviceID, imgAnswered); // } //} }
public void prepare_handler() { MiddleWareCore.set_mode(MiddleWareMode.考勤, this); Program.frmFloat.setLegend(this.textList, this.styleList); initialInfoTable(); setPieToInitializeState(); Program.frmClassRoom.resetClassRoomState(); Program.frmClassRoom.setCallBackInvoker(this);//点击座位时的回调 this.formToNotify.show_tip("正在考勤"); }
private void ShowPerson() { DataTable myData = rfidCheck_CheckOn.GetPersonDataSet(); //if (null == myDataSet) //{ // return; //} //dataGridView1.DataSource = myDataSet.Tables[0]; dataGridView1.DataSource = myData; int iNumberofStudents = myData.Rows.Count; this.groupBox2.Text = "学生列表 共有学生" + iNumberofStudents.ToString() + "名"; this.dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); int headerW = this.dataGridView1.RowHeadersWidth; int columnsW = 0; DataGridViewColumnCollection columns = this.dataGridView1.Columns; for (int i = 0; i < columns.Count; i++) { columnsW += columns[i].Width; } if (columnsW + headerW < this.dataGridView1.Width) { int leftTotalWidht = this.dataGridView1.Width - columnsW - headerW; int eachColumnAddedWidth = leftTotalWidht / columns.Count; for (int i = 0; i < columns.Count; i++) { columns[i].Width += eachColumnAddedWidth; } } /* * * dataGridView1.Columns[0].HeaderText = "学号"; * dataGridView1.Columns[1].HeaderText = "姓名"; * dataGridView1.Columns[2].HeaderText = "电话"; * dataGridView1.Columns[3].HeaderText = "邮箱"; */ MiddleWareCore.set_mode(MiddleWareMode.学生卡绑定); MiddleWareCore.event_receiver = this; }
void test_实时互动5() { //接收到一个标签数据 MiddleWareCore.set_mode(MiddleWareMode.实时互动); string cmd1 = "[select,master_node,subnode1,,01,A]"; MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd1)); IntelligentEvent evt1 = MiddleWareCore.get_a_event(); if (evt1 == null || evt1.name == IntelligentEvent.event_empty) { Debug.WriteLine("True"); } else { Debug.WriteLine("False"); } }
void test_实时互动3() { //标签重复 MiddleWareCore.set_mode(MiddleWareMode.实时互动); string cmd3_1 = "[select,master_node,subnode2,rfid01,01,A]"; string cmd3_2 = "[select,master_node,subnode2,rfid01,01,A]"; MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd3_1)); MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd3_2)); IntelligentEvent evt3 = MiddleWareCore.get_a_event(); if (evt3.event_unit_list.IndexOf(IntelligentEventUnit.repeat_epc) >= 0) { Debug.WriteLine("True"); } else { Debug.WriteLine("False"); } }
void test_实时互动2() { //接收到同一个标签在另一个设备上 MiddleWareCore.set_mode(MiddleWareMode.实时互动); string cmd2_1 = "[select,master_node,subnode1,rfid01,01,A]"; string cmd2_2 = "[select,master_node,subnode2,rfid01,01,A]"; MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd2_2)); MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd2_1)); IntelligentEvent evt2 = MiddleWareCore.get_a_event(); if (evt2.event_unit_list.IndexOf(IntelligentEventUnit.epc_on_another_device) >= 0) { Debug.WriteLine("True"); } else { Debug.WriteLine("False"); } }
private void test_考勤1() { MiddleWareCore.set_mode(MiddleWareMode.考勤); string cmd1 = "[select,master_node,subnode1,rfid01,01,A]"; MiddleWareCore.Set_new_data(ProtocolHelper.getProtocolHelper(cmd1)); IntelligentEvent evt1 = MiddleWareCore.get_a_event(); if (evt1.epcID == "rfid01" && evt1.localDeviceID == "master_node" && evt1.remoteDeviceID == "subnode1" && evt1.questionID == "01" && evt1.questionValue == "A" && evt1.event_unit_list[0] == IntelligentEventUnit.new_epc) { Debug.WriteLine("True"); } else { Debug.WriteLine("False"); } }
public frmEquipmentConfig() { InitializeComponent(); this.numCountofGroup.Value = MemoryTable.dtRoomConfig.Rows.Count; setCmbSelectItems((int)this.numCountofGroup.Value); setDefaultCountOfColumnAndRow(); Program.frmClassRoom.resetClassRoomState(); //this.refreshChairEquipmentID(); this.Shown += new EventHandler(frmEquipmentConfig_Shown); this.FormClosing += new FormClosingEventHandler(frmEquipmentConfig_FormClosing); this.numCountofGroup.ValueChanged += new System.EventHandler(this.numCountofGroup_ValueChanged); this.cmbSelectedRow.SelectedIndexChanged += new System.EventHandler(this.cmbSelectedRow_SelectedIndexChanged); this.numCountofRow.ValueChanged += new System.EventHandler(this.numCountofRow_ValueChanged); this.numCountofColumn.ValueChanged += new System.EventHandler(this.numCountofColumn_ValueChanged); MiddleWareCore.set_mode(MiddleWareMode.设备绑定); MiddleWareCore.event_receiver = this; }
//设置当前题目的答题状态 private void reset_test_status(string question_id) { DataRow[] rows = this.dtQuestion_answer_record.Select(string.Format("question_id = '{0}'", question_id)); int total_student_count = MemoryTable.studentInfoTable.Rows.Count; int iAnswered = rows.Length; int iUnknown = total_student_count - iAnswered; NotifyFormToRefreshPie(this.getValueList(iUnknown, iAnswered), true); MiddleWareCore.set_mode(MiddleWareMode.课堂测验); Program.frmClassRoom.resetClassRoomState(); //设置教室座位 根据问题查找学生ID,然后根据ID查找位置 for (int i = 0; i < rows.Length; i++) { string studentID = (string)rows[i]["student_id"]; equipmentPosition ep = MemoryTable.getEquipmentInfoByEpc(studentID); Person psn = MemoryTable.getPersonByEpc(studentID); Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), DocumentFileState.Green); Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), psn.name); } }
public frmCheck() { InitializeComponent(); PieChart1.ItemStyle.SurfaceAlphaTransparency = 0.92F; PieChart1.FocusedItemStyle.SurfaceAlphaTransparency = 0.92F; PieChart1.FocusedItemStyle.SurfaceBrightnessFactor = 0.3F; PieChart1.Inclination = 1.047F; PieChart1.AutoSizePie = true; PieChart1.Thickness = 31; PieChart1.Rotation = 0.1396263F; PieChart1.ShowEdges = false; //PieChart1.Radius = 90F; Screen[] screens = System.Windows.Forms.Screen.AllScreens; for (int i = 0; i < screens.Length; i++) { Screen sc = screens[i]; if (sc.Primary == true) { Rectangle rect = sc.WorkingArea; //this.Left = (int)(rect.Width * 0.7); this.Left = (int)(rect.Width - this.Width - 50); this.Top = (int)(rect.Height * 0.1); } } this.initialInfoTable(); InitializePanelControl(); this.FormClosing += new FormClosingEventHandler(Form1_FormClosing); this.FormClosed += new FormClosedEventHandler(Form1_FormClosed); this.VisibleChanged += new EventHandler(Form1_VisibleChanged); MiddleWareCore.set_mode(MiddleWareMode.考勤, this); }
public frmCheck() { InitializeComponent(); this.initialInfoTable(); InitializePanelControl(); InitialClassRoom(); this.Shown += new EventHandler(Form1_Shown); this.FormClosing += new FormClosingEventHandler(Form1_FormClosing); this.FormClosed += new FormClosedEventHandler(Form1_FormClosed); this.VisibleChanged += new EventHandler(Form1_VisibleChanged); MiddleWareCore.event_receiver = this; MiddleWareCore.set_mode(MiddleWareMode.考勤); //thread_listening = new Thread(new ThreadStart(begin_wait_event)); //thread_listening.Start(); //backgroundWorker1.DoWork += new DoWorkEventHandler(BackgroundThreadWork); //backgroundWorker1.WorkerSupportsCancellation = true; //this.backgroundWorker1.WorkerReportsProgress = true; //this.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged); //backgroundWorker1.RunWorkerAsync(null); }