CameraShotCls.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Common;
  2. using MeterPlugInLibrary;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace CarRemoteMeter
  9. {
  10. /// <summary>
  11. /// 截图调用类
  12. /// </summary>
  13. public class CameraShotCls
  14. {
  15. public void Connection()
  16. {
  17. foreach (DhCameraShot shot in CarCache.cameraShots)
  18. {
  19. shot.Connection();
  20. }
  21. }
  22. public void Close()
  23. {
  24. foreach (DhCameraShot shot in CarCache.cameraShots)
  25. {
  26. shot.Close();
  27. }
  28. }
  29. /// <summary>
  30. /// 截图
  31. /// </summary>
  32. /// <param name="actualFirstNo">作业编号</param>
  33. public void CapPic(string actualFirstNo)
  34. {
  35. int iCnt = 1; //抓拍摄像头配置顺序必须是前面2个
  36. foreach (DhCameraShot shot in CarCache.cameraShots)
  37. {
  38. shot.CapPic(iCnt < 3 ? 0 : 1, PbCache.path + string.Format("\\imgShort\\tempImg\\{0}_{1}_{2}.jpg", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo, iCnt));
  39. iCnt++;
  40. }
  41. }
  42. /// <summary>
  43. /// 连接视频截图并关闭
  44. /// </summary>
  45. /// <param name="actualFirstNo">作业编号</param>
  46. public void CapMethod(string actualFirstNo)
  47. {
  48. Connection();
  49. CapPic(actualFirstNo);
  50. Close();
  51. }
  52. }
  53. }