|
|
@ -10,7 +10,7 @@ namespace Rs.Framework
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public static class ImageProcess
|
|
|
|
public static class ImageProcess
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static UInt64 imageNum = 0;
|
|
|
|
//static UInt64 imageNum = 0;
|
|
|
|
public static ManualResetEvent manualTriggerEvent = new ManualResetEvent(false);
|
|
|
|
public static ManualResetEvent manualTriggerEvent = new ManualResetEvent(false);
|
|
|
|
public static ManualResetEvent autoTriggerEvent = new ManualResetEvent(false);
|
|
|
|
public static ManualResetEvent autoTriggerEvent = new ManualResetEvent(false);
|
|
|
|
|
|
|
|
|
|
|
@ -19,12 +19,12 @@ namespace Rs.Framework
|
|
|
|
|
|
|
|
|
|
|
|
public static void AddManualTrigger(HObject obj)
|
|
|
|
public static void AddManualTrigger(HObject obj)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
imageNum++;
|
|
|
|
//imageNum++;
|
|
|
|
if (imageNum>20)
|
|
|
|
//if (imageNum>20)
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
GC.Collect();
|
|
|
|
// GC.Collect();
|
|
|
|
imageNum = 0;
|
|
|
|
// imageNum = 0;
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
manualTriggerList.Add(obj);
|
|
|
|
manualTriggerList.Add(obj);
|
|
|
|
manualTriggerEvent.Set();
|
|
|
|
manualTriggerEvent.Set();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -33,6 +33,7 @@ namespace Rs.Framework
|
|
|
|
{
|
|
|
|
{
|
|
|
|
manualTriggerList.Clear();
|
|
|
|
manualTriggerList.Clear();
|
|
|
|
manualTriggerEvent.Reset();
|
|
|
|
manualTriggerEvent.Reset();
|
|
|
|
|
|
|
|
GC.Collect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static HObject GetManualImage()
|
|
|
|
public static HObject GetManualImage()
|
|
|
@ -51,21 +52,23 @@ namespace Rs.Framework
|
|
|
|
|
|
|
|
|
|
|
|
public static void AddAutoTrigger(HObject obj)
|
|
|
|
public static void AddAutoTrigger(HObject obj)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
imageNum++;
|
|
|
|
//imageNum++;
|
|
|
|
if (imageNum > 20)
|
|
|
|
//if (imageNum > 20)
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
LogHelper.Debug($"imagenum={imageNum},释放内存");
|
|
|
|
// LogHelper.Debug($"imagenum={imageNum},释放内存");
|
|
|
|
GC.Collect();
|
|
|
|
// GC.Collect();
|
|
|
|
imageNum = 0;
|
|
|
|
// imageNum = 0;
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
autoTriggerList.Add(obj);
|
|
|
|
autoTriggerList.Add(obj);
|
|
|
|
autoTriggerEvent.Set();
|
|
|
|
autoTriggerEvent.Set();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void ClearAutoTrigger()
|
|
|
|
public static void ClearAutoTrigger()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
autoTriggerList.Clear();
|
|
|
|
autoTriggerList.Clear();
|
|
|
|
autoTriggerEvent.Reset();
|
|
|
|
autoTriggerEvent.Reset();
|
|
|
|
|
|
|
|
GC.Collect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|