|
@@ -148,15 +148,15 @@ namespace NumMachine
|
|
|
while (!isClosing)
|
|
|
{
|
|
|
Thread.Sleep(REFRESHINGTIME);
|
|
|
- //定时更新号牌
|
|
|
- lock (ipHandleMap)
|
|
|
- {
|
|
|
- Dictionary<string, int>.Enumerator HandleEnumer = ipHandleMap.GetEnumerator();
|
|
|
- while (HandleEnumer.MoveNext())
|
|
|
- {
|
|
|
- ActivateSnap(HandleEnumer.Current.Value);
|
|
|
- }
|
|
|
- }
|
|
|
+ ////定时更新号牌
|
|
|
+ //lock (ipHandleMap)
|
|
|
+ //{
|
|
|
+ // Dictionary<string, int>.Enumerator HandleEnumer = ipHandleMap.GetEnumerator();
|
|
|
+ // while (HandleEnumer.MoveNext())
|
|
|
+ // {
|
|
|
+ // ActivateSnap(HandleEnumer.Current.Value);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
////读取设备ip与id映射关系
|
|
|
//lock (ipHandleMap)
|
|
|
//{
|
|
@@ -253,6 +253,7 @@ namespace NumMachine
|
|
|
id = Int32.Parse(ConfigurationManager.AppSettings.Get(ip));
|
|
|
ipIdMap.Add(ip, id);
|
|
|
idCountMap.Add(id, FILTERINGNUMBER);
|
|
|
+ GetLicensePlate(id);
|
|
|
}
|
|
|
catch (Exception) { Console.WriteLine("读取号牌机编号映射失败,配置文件填写有误"); }
|
|
|
}
|
|
@@ -537,7 +538,6 @@ namespace NumMachine
|
|
|
{
|
|
|
VzClientSDK.VzLPRClient_ForceTrigger(handle);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
///<summary>ip+port字符串转ipe</summary>
|
|
@@ -888,9 +888,21 @@ namespace NumMachine
|
|
|
{
|
|
|
if (idCountMap.ContainsKey(id))
|
|
|
{
|
|
|
+ Dictionary<string, int>.Enumerator ipidEnumer = ipIdMap.GetEnumerator();
|
|
|
+ int handle = 0;
|
|
|
+ while (ipidEnumer.MoveNext())
|
|
|
+ {
|
|
|
+ if(ipidEnumer.Current.Value == id)
|
|
|
+ {
|
|
|
+ ipHandleMap.TryGetValue(ipidEnumer.Current.Key, out handle);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
while (idCountMap[id] < FILTERINGNUMBER)
|
|
|
{
|
|
|
- Thread.Sleep(500);
|
|
|
+ Console.WriteLine(handle);
|
|
|
+ ActivateSnap(handle);
|
|
|
+ Thread.Sleep((int)(REFRESHINGTIME*0.6));
|
|
|
}
|
|
|
idCountMap[id] = 0;
|
|
|
}
|