|
@@ -48,6 +48,7 @@ namespace parkMonitor.server
|
|
|
private static Dictionary<string, Dictionary<NumberMachineNode, int>> filterMap = new Dictionary<string, Dictionary<NumberMachineNode, int>>();
|
|
|
/// <summary>筛选计数</summary>
|
|
|
private static int filterCount = 0;
|
|
|
+ private static double filterRatio = 0.7;
|
|
|
/// <summary>系统关闭</summary>
|
|
|
private static bool isClosing = false;
|
|
|
/// <summary>开启拍照的设备</summary>
|
|
@@ -79,6 +80,12 @@ namespace parkMonitor.server
|
|
|
VzClientSDK.VzLPRClient_Setup();
|
|
|
|
|
|
hwndMain = this.Handle;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ filterRatio = Double.Parse(ConfigurationManager.AppSettings.Get("filterRatio"));
|
|
|
+ }
|
|
|
+ catch (Exception) { UILogServer.ins.error("号牌机配置文件异常"); Log.WriteLog(LogType.NOT_DATABASE, LogFile.ERROR, "号牌机配置文件异常"); }
|
|
|
//m_sAppPath = System.IO.Directory.GetCurrentDirectory();
|
|
|
}
|
|
|
|
|
@@ -164,17 +171,17 @@ namespace parkMonitor.server
|
|
|
lock (devPicMap)
|
|
|
{
|
|
|
Dictionary<int, PictureBox>.Enumerator devEnumer = devPicMap.GetEnumerator();
|
|
|
- do
|
|
|
+ while (devEnumer.MoveNext())
|
|
|
{
|
|
|
ActivateSnap(devEnumer.Current.Key);
|
|
|
//Debug.WriteLine(lv.data.Count.ToString()+":\n"+ lv.data[lv.data.Count-1].LicenseNum+ lv.data[lv.data.Count - 1].TimeRecord);
|
|
|
- } while (devEnumer.MoveNext());
|
|
|
+ }
|
|
|
}
|
|
|
//读取设备ip与id映射关系
|
|
|
lock (ipHandleMap)
|
|
|
{
|
|
|
Dictionary<string, int>.Enumerator ipEnumer = ipHandleMap.GetEnumerator();
|
|
|
- do
|
|
|
+ while (ipEnumer.MoveNext())
|
|
|
{
|
|
|
//映射关系不存在则读取配置文件
|
|
|
lock (ipIdMap)
|
|
@@ -189,7 +196,7 @@ namespace parkMonitor.server
|
|
|
catch (Exception) { UILogServer.ins.log("读取号牌机编号映射失败,配置文件填写有误"); Log.WriteLog(LogType.NOT_DATABASE, LogFile.ERROR, "读取号牌机编号映射失败"); }
|
|
|
}
|
|
|
}
|
|
|
- } while (ipEnumer.MoveNext());
|
|
|
+ }
|
|
|
}
|
|
|
lock (LicBuffer)
|
|
|
{
|
|
@@ -461,10 +468,10 @@ namespace parkMonitor.server
|
|
|
//计算总数
|
|
|
filterCount = 0;
|
|
|
Dictionary<NumberMachineNode, int>.Enumerator countEnumer = filter.GetEnumerator();
|
|
|
- do
|
|
|
+ while (countEnumer.MoveNext())
|
|
|
{
|
|
|
filterCount += countEnumer.Current.Value;
|
|
|
- } while (countEnumer.MoveNext());
|
|
|
+ }
|
|
|
|
|
|
//达到计数限制,计算众数是否达标,达标则入队
|
|
|
if (filterCount >= FILTERINGNUMBER)
|
|
@@ -472,10 +479,10 @@ namespace parkMonitor.server
|
|
|
lock (LicBuffer)
|
|
|
{
|
|
|
Dictionary<NumberMachineNode, int>.Enumerator enumer = filter.GetEnumerator();
|
|
|
- do
|
|
|
+ while (enumer.MoveNext())
|
|
|
{
|
|
|
//遍历,筛到号牌则入队
|
|
|
- if (enumer.Current.Value >= (int)(filterCount * 0.7) && enumer.Current.Key != null && !LicBuffer.Contains(enumer.Current.Key))
|
|
|
+ if (enumer.Current.Value >= (int)(filterCount * filterRatio) && enumer.Current.Key != null && !LicBuffer.Contains(enumer.Current.Key))
|
|
|
{
|
|
|
if (nmMsg.aNode == null || nmMsg.aNode.LicenseNum == null || nmMsg.aNode.LicenseNum != enumer.Current.Key.LicenseNum)
|
|
|
{
|
|
@@ -486,7 +493,7 @@ namespace parkMonitor.server
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- } while (enumer.MoveNext());
|
|
|
+ };
|
|
|
filterCount = 0;
|
|
|
filter.Clear();
|
|
|
}
|
|
@@ -629,7 +636,7 @@ namespace parkMonitor.server
|
|
|
lock (devPicMap)
|
|
|
{
|
|
|
Dictionary<int, PictureBox>.Enumerator enumer = devPicMap.GetEnumerator();
|
|
|
- do
|
|
|
+ while (enumer.MoveNext())
|
|
|
{
|
|
|
if (enumer.Current.Key != 0)
|
|
|
{
|
|
@@ -637,7 +644,7 @@ namespace parkMonitor.server
|
|
|
VzClientSDK.VzLPRClient_Close(enumer.Current.Key);
|
|
|
flowLayoutPanel1.Controls.Remove(enumer.Current.Value);
|
|
|
}
|
|
|
- } while (enumer.MoveNext());
|
|
|
+ }
|
|
|
isClosing = true;
|
|
|
devPicMap.Clear();
|
|
|
}
|
|
@@ -737,7 +744,7 @@ namespace parkMonitor.server
|
|
|
lock (ipIdMap)
|
|
|
{
|
|
|
Dictionary<string, int>.Enumerator enumerator = ipIdMap.GetEnumerator();
|
|
|
- do
|
|
|
+ while (enumerator.MoveNext())
|
|
|
{
|
|
|
// if (enumerator.Current.Value == cmd.id && ipHandleMap.TryGetValue(enumerator.Current.Key, out int handle))
|
|
|
int handle = 0;
|
|
@@ -746,7 +753,7 @@ namespace parkMonitor.server
|
|
|
snapshotDevHandle = handle;
|
|
|
break;
|
|
|
}
|
|
|
- } while (enumerator.MoveNext());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|