private void tmrUpdatePositions_Tick(object sender, EventArgs e) { tmrInicializacion.Enabled = false; // Solo se ejecuta UNA vez: para cargar los controles. inicializarListViewDevices(); if (salir) { resetMarkers = false; FinalizarUpdatePositions.Set(); this.Close(); } try { if (!isLoaded) { Tools.GetInstance().DoLog("Va a cargar los datos de la zona"); Thread t = new Thread(cargaInicial); t.Start(); // Task.Factory.StartNew(() => cargaInicial()); // Actualiza los listboxes y el mapa. } } catch (Exception ex) { Tools.GetInstance().DoLog("Excepcion en tmrUpdatePositions_Tick: " + ex.Message); } }
private void cmbZones_SelectedIndexChanged(object sender, EventArgs e) { Tools.GetInstance().DoLog("Entra a cmbZones_SelectedIndexChanged()"); if (isLoaded) { try { actualDeviceName = ""; int elegido = cmbZones.SelectedIndex; Tools.GetInstance().DoLog("Elegido=" + elegido); if (elegido >= 0) { List <long> claves = listaZonas.Keys.ToList(); Tools.GetInstance().DoLog("La Cantidad de claves=" + claves.Count); if (elegido < claves.Count) { webBrowser.Document.InvokeScript("deleteAllGates"); resetMarkers = true; FinalizarUpdatePositions.Set(); // Fuerza una finalizacion del loop principal del task de update positions y posterior reseteo con el nuevo conjunto de markers Thread.Sleep(500); Tools.GetInstance().DoLog("Sigue..."); webBrowser.Document.InvokeScript("deleteAllMarkersMap"); DEVICEID = claves[elegido].ToString(); Tools.GetInstance().DoLog("DEVICEID=" + DEVICEID); string zonaDef = ""; Tools.GetInstance().cargarDatosUnaZona(ref Tools.GetInstance().ZoneName, ref zonaDef, ref triggerMode, DEVICEID, ORGID); Tools.GetInstance().DoLog("ZoneDef=" + zonaDef); crearZonaPordef(zonaDef); actualizarZonaEnMapa(); ZoomToFitZone(); //actualizarListaDevices(); actualizarListaItems(""); txtFiltro.Text = ""; } } } catch (Exception ex) { Tools.GetInstance().DoLog("Excepcion en selectedIndexChanged:" + ex.Message); } } else { Tools.GetInstance().DoLog("isLoaded dio FALSE en cmbZones_SelectedIndexChange()"); } }
private void btnClose_Click(object sender, EventArgs e) { resetMarkers = false; FinalizarUpdatePositions.Set(); this.Close(); }
private void fromLiveTrackingVG_FormClosing(object sender, FormClosingEventArgs e) { resetMarkers = false; FinalizarUpdatePositions.Set(); }