ThreadPool. QueueUserWorkItem (_ =>
{
This. Invoke (MethodInvoker) () =>
{
Try
{
Lock (m_objLock5)
{
If (EVIs. Count! = Evss. Count) return; // if an exception occurs, no extraction is returned.
Foreach (EntityVehicleInfo evi in EVIs)
{
Int mcuid = evi. MCUID;
/// // Add Location 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. longpolling, 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 ["longpolling"]. Value = vehicleInfo. longpolling. 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? "Power-off": "power-off ";
Row2.Cells ["AUTODEFENCE"]. Value = vehicleState. AutoFence? "Fortification": "anti-DDoS ";
Row2.Cells ["TRUNKBOOT"]. Value = vehicleState. TrunkBoot? "Enable": "Disable ";
Row2.Cells ["BRAKING"]. Value = vehicleState. Braking? "Brake on": "brake on 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_policyinfo" + ex. StackTrace );
}
}));
});
The effect is as follows: