/// <summary> /// Обновить списки /// </summary> private void updateLists() { listView1.Items.Clear(); foreach (int id in CasLP16.Instance.getIDsOfPLUs()) { PLU plu = CasLP16.Instance.GetPLUbyID(id); ListViewItem lvi = listView1.Items.Add(plu.ID.ToString()); lvi.SubItems.Add(plu.Code.ToString()); lvi.SubItems.Add(plu.ProductName1); lvi.SubItems.Add(plu.ProductName2.ToString()); lvi.SubItems.Add(plu.Price.ToString()); lvi.SubItems.Add(plu.LiveTime.ToString()); lvi.SubItems.Add(plu.TaraWeight.ToString()); lvi.SubItems.Add(plu.GroupCode.ToString()); lvi.SubItems.Add(plu.MessageID.ToString()); lvi.Tag = plu; } ///Обновляем сообщения lvMSG.Items.Clear(); foreach (int id in CasLP16.Instance.getIDsOfMSGs()) { MSG msg = CasLP16.Instance.GetMSGbyID(id); ListViewItem lvi = lvMSG.Items.Add(msg.ID.ToString()); lvi.SubItems.Add(msg.Text); lvi.Tag = msg; } tbMessage.Text = ""; tbMessage.Enabled = false; Application.DoEvents(); if (!ScaleOpt.GetBoolOpt(ScaleOpt.OptType.Monitoring)) { saveSummarys(); } }
/// <summary> /// Запускает поток, проверяющий внесение новых данных /// </summary> public static void StartMonitoring() { if (!ScaleOpt.GetBoolOpt(ScaleOpt.OptType.Monitoring)) { return; } _scaleFormActive = false; _scanSmrs = true; Thread scaner = new Thread(listener); scaner.IsBackground = true; scaner.Start(); }
private void tabControl1_Selected(object sender, TabControlEventArgs e) { if (tabControl1.SelectedTab == tpOptions) { tbAddress.Text = ScaleOpt.GetStrOpt(ScaleOpt.OptType.ScaleAddres); tbPort.Text = ScaleOpt.GetStrOpt(ScaleOpt.OptType.ScalePort); tbSF.Text = ScaleOpt.GetStrOpt(ScaleOpt.OptType.ScanPLUFrom); tbSU.Text = ScaleOpt.GetStrOpt(ScaleOpt.OptType.ScanPLUUntil); nudScanFreq.Value = ScaleOpt.GetIntOpt(ScaleOpt.OptType.ScanDelay); tbMSGsf.Text = ScaleOpt.GetStrOpt(ScaleOpt.OptType.ScanMSGFrom); tbMSGsu.Text = ScaleOpt.GetStrOpt(ScaleOpt.OptType.ScanMSGUntil); chMonitor.Checked = nudScanFreq.Enabled = ScaleOpt.GetBoolOpt(ScaleOpt.OptType.Monitoring); } }