/** * Verifica se o veiculo se encontra dentro da cerca para liberacao da trava */ private void lckMng() { Telemetria telemetria = trackerController.getTelemetria(); if (telemetria != null) { if (telemetria.IsInsideOfFence()) { trackerController.lockVehicle(lockVehicle); } else { trackerController.lockVehicle(true); } } }
/* * Atualiza as informacoes na tela sobre a cerca virtual */ void updateStatusFence() { Telemetria telemetria = trackerController.getTelemetria(); if (telemetria == null) { lFence.BackColor = Color.Gray; btn_unlock.Enabled = false; } else if (telemetria.IsInsideOfFence()) { lFence.BackColor = Color.Green; btn_unlock.Enabled = true; } else { lFence.BackColor = Color.Red; btn_unlock.Enabled = false; } }
internal bool PointIsInsidePolygon(Telemetria data) { bool ret = false; if (data != null) { PointLatLng p = new PointLatLng(data.Latitude, data.Longitude); int i = 0; foreach (GMapPolygon poly in mapOverlay.Polygons) { data.setInsideOfFence(i++, poly.IsInside(p)); if (data.IsInsideOfFence()) { ret = true; } } } return(ret); }