ThreadPool.QueueUserWorkItem (_ =>
{
This. Invoke (MethodInvoker) (() =>
{
Try
{
Lock (M_OBJLOCK5)
{
if (Evis.count!= evss.count) return; Exception occurred, return does not extract
foreach (Entityvehicleinfo evi in Evis)
{
int mcuid = Evi. Mcuid;
Add Geographic information
Entityvehicleinfo vehicleinfo = null;
Vehicleinfo = Datareader.instance.htvehicleinfo[mcuid]asentityvehicleinfo;
if (Vehicleinfo = null) return;
int add_infoindex = DGVVEHICLEINFO.ROWS.ADD (1);
DataGridViewRow row = Dgvvehicleinfo.rows[add_infoindex];
Dituhelper.getaddressbygps (Vehicleinfo.longitude, Vehicleinfo.latitude, Add_infoindex);
Row. cells["Vehicleinfomcuid"]. Value = Vehicleinfo.mcuid;
Row. cells["Vehicleno"]. Value = Vehicleinfo.vehicleno;
Row. cells["ONLINE"]. Value = Vehicleinfo.online;
Row. cells["ACC". Value = VEHICLEINFO.ACC;
Row. cells["Longitude"]. Value = vehicleInfo.Longitude.ToString ("F5");
Row. cells["LATITUDE"]. Value = vehicleInfo.Latitude.ToString ("F5");
Row. cells["ANGLE"]. Value =utilityhelper.angle2direction ((int) vehicleinfo.angle);
Row. cells["VELOCITY"]. Value = vehicleinfo.velocity;
Row. cells["Locationstate"]. Value = vehicleinfo.locationstate;
Row. cells["Receivetime"]. Value = Vehicleinfo.receivetime;
Add status information
Entityvehiclestate vehiclestate = null;
Vehiclestate = datareader.instance.htvehiclestate[mcuid]asentityvehiclestate;
if (vehiclestate = null) return;
int add_stateindex = DGVVEHICLESTATE.ROWS.ADD (1);
DataGridViewRow row2 = Dgvvehiclestate.rows[add_stateindex];
Row2. cells["Vehiclenos"]. Value = VehicleInfo.VehicleNo.ToString ();
Vehicleinfo = null;
Row2. cells["Positiontime"]. Value = VehicleState.PositionTime.ToString ();
Row2. cells["Stopfuel"]. Value = Vehiclestate.stopfuel? " Yes ":" No ";
Row2. cells["Fuelcut"]. Value = Vehiclestate.fuelcut? "Oil power Off": "Through oil and electricity";
Row2. cells["Autodefence"]. Value = vehiclestate.autofence? " Fortification ":" To Prevent ";
Row2. cells["Trunkboot"]. Value = Vehiclestate.trunkboot? " Open ": Close";
Row2. cells["braking"]. Value = vehiclestate.braking? "Brake down": "Brake release";
Row2. cells["Dooropen"]. Value = Vehiclestate.dooropen? "Open": "Close";
Row2. cells["Accon"]. Value = Vehiclestate.accon? "Ignition": "flameout";
Row2. cells["Powersaver"]. Value = Vehiclestate.powersaver? " Yes ":" No ";
Vehiclestate = null;
}
}
}
catch (Exception ex)
{
Loghelper.writeln ("Instance_notifyinfo" + Ex.) StackTrace);
}
}));
});
The effect is as follows: