Commit 4a5f2091 张东亮

20221101

1 个父辈 47d45d7d
...@@ -62,23 +62,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -62,23 +62,23 @@ namespace OnlineStore.DeviceLibrary
{ {
Bitmap bmp = AcqImage(name); Bitmap bmp = AcqImage(name);
if (bmp != null) if (bmp != null)
{ //{
if (IsRecord) // if (IsRecord)
{ // {
cnt++; // cnt++;
Task.Factory.StartNew(delegate // Task.Factory.StartNew(delegate
{ // {
SaveImage("box_A", cnt); // SaveImage("box_A", cnt);
}); // });
Task.Factory.StartNew(delegate // Task.Factory.StartNew(delegate
{ // {
SaveImage("box_B", cnt); // SaveImage("box_B", cnt);
}); // });
if ((DateTime.Now - dateTime).TotalMinutes > 2) // if ((DateTime.Now - dateTime).TotalMinutes > 2)
StopRecord(); // StopRecord();
} // }
camera_event?.Invoke(new CameraArgs(name, bmp)); camera_event?.Invoke(new CameraArgs(name, bmp));
} // }
Thread.Sleep(300); Thread.Sleep(300);
} }
} }
...@@ -207,23 +207,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -207,23 +207,23 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public void StartRecord(bool isTest = false) public void StartRecord(bool isTest = false)
{ {
if (isTest) //if (isTest)
{ //{
inOutPosInfo = new InOutPosInfo("code" + DateTime.Now.ToString("mmssfff"), DateTime.Now.ToString("yyyyMMddhh")); // inOutPosInfo = new InOutPosInfo("code" + DateTime.Now.ToString("mmssfff"), DateTime.Now.ToString("yyyyMMddhh"));
} //}
else //else
{ //{
inOutPosInfo = MoveInfo.MoveParam.PosInfo.ToCopy(); // inOutPosInfo = MoveInfo.MoveParam.PosInfo.ToCopy();
} //}
cnt = 0; //cnt = 0;
string inputfolderA = Application.StartupPath + imgPath + "box_A\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId; //string inputfolderA = Application.StartupPath + imgPath + "box_A\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId;
string inputfolderB = Application.StartupPath + imgPath + "box_B\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId; //string inputfolderB = Application.StartupPath + imgPath + "box_B\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId;
string outputfolderA = Application.StartupPath + "\\Videos\\box_A\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId; //string outputfolderA = Application.StartupPath + "\\Videos\\box_A\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId;
string outputfolderB = Application.StartupPath + "\\Videos\\box_B\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId; //string outputfolderB = Application.StartupPath + "\\Videos\\box_B\\" + DateTime.Now.ToString("yyyyMMdd") + "\\" + inOutPosInfo.PosId;
ffmpegA.SetParam(inputfolderA, outputfolderA, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4"); //ffmpegA.SetParam(inputfolderA, outputfolderA, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4");
ffmpegB.SetParam(inputfolderB, outputfolderB, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4"); //ffmpegB.SetParam(inputfolderB, outputfolderB, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4");
dateTime = DateTime.Now; //dateTime = DateTime.Now;
IsRecord = true; //IsRecord = true;
} }
/// <summary> /// <summary>
/// 停止记录 /// 停止记录
...@@ -233,9 +233,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -233,9 +233,9 @@ namespace OnlineStore.DeviceLibrary
if (!IsRecord) if (!IsRecord)
return; return;
IsRecord = false; IsRecord = false;
LogUtil.info("监控视频开始转换"); //LogUtil.info("监控视频开始转换");
Task task1 = ffmpegA.ConvertImgsToMp4(); //Task task1 = ffmpegA.ConvertImgsToMp4();
Task task2 = ffmpegB.ConvertImgsToMp4(); //Task task2 = ffmpegB.ConvertImgsToMp4();
//Task.WaitAll(new Task[] { task1, task2 }, TimeSpan.FromMinutes(1)); //Task.WaitAll(new Task[] { task1, task2 }, TimeSpan.FromMinutes(1));
//LogUtil.info("监控视频转换完成"); //LogUtil.info("监控视频转换完成");
} }
......
...@@ -95,6 +95,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -95,6 +95,8 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
if (posDebugInfo.IsPause)
return;
switch (MoveInfo.MoveStep) switch (MoveInfo.MoveStep)
{ {
case StepEnum.SP_00_1_StartPosDebug: case StepEnum.SP_00_1_StartPosDebug:
...@@ -443,6 +445,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -443,6 +445,7 @@ namespace OnlineStore.DeviceLibrary
/// 停止调试 /// 停止调试
/// </summary> /// </summary>
public bool IsBreak { get; set; } = false; public bool IsBreak { get; set; } = false;
public bool IsPause { get; set; } = false;
/// <summary> /// <summary>
/// 是否是最后一个抽屉 /// 是否是最后一个抽屉
/// </summary> /// </summary>
...@@ -481,12 +484,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -481,12 +484,18 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer < config.Cols_In_Drawer) if (CurColInDrawer < config.Cols_In_Drawer)
{ {
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurColInDrawer == 2)
CurColInDrawer = 17;
else
CurColInDrawer++; CurColInDrawer++;
} }
else else
{ {
PreRowInDrawer = CurRowInDrawer; PreRowInDrawer = CurRowInDrawer;
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurRowInDrawer == 1)
CurRowInDrawer = 3;
else
CurRowInDrawer++; CurRowInDrawer++;
} }
} }
...@@ -495,6 +504,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -495,6 +504,9 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer < EndColInDrawer) if (CurColInDrawer < EndColInDrawer)
{ {
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurColInDrawer == 2)
CurColInDrawer = 17;
else
CurColInDrawer++; CurColInDrawer++;
} }
} }
...@@ -505,6 +517,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -505,6 +517,9 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer == config.Cols_In_Drawer) if (CurColInDrawer == config.Cols_In_Drawer)
{ {
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurColInDrawer == 17)
CurColInDrawer = 2;
else
CurColInDrawer--; CurColInDrawer--;
} }
else if (CurColInDrawer == 1) else if (CurColInDrawer == 1)
...@@ -520,12 +535,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -520,12 +535,18 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer > 1) if (CurColInDrawer > 1)
{ {
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurColInDrawer == 17)
CurColInDrawer = 2;
else
CurColInDrawer--; CurColInDrawer--;
} }
else else
{ {
PreRowInDrawer = CurRowInDrawer; PreRowInDrawer = CurRowInDrawer;
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurRowInDrawer == 1)
CurRowInDrawer = 3;
else
CurRowInDrawer++; CurRowInDrawer++;
} }
} }
...@@ -534,6 +555,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -534,6 +555,9 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer > EndColInDrawer) if (CurColInDrawer > EndColInDrawer)
{ {
PreColInDrawer = CurColInDrawer; PreColInDrawer = CurColInDrawer;
if (CurColInDrawer == 17)
CurColInDrawer = 2;
else
CurColInDrawer--; CurColInDrawer--;
} }
} }
......
...@@ -114,5 +114,15 @@ namespace OnlineStore.XLRStore ...@@ -114,5 +114,15 @@ namespace OnlineStore.XLRStore
LogUtil.error("打开行走机构循环测试时出错:", ex); LogUtil.error("打开行走机构循环测试时出错:", ex);
} }
} }
private void button3_Click(object sender, EventArgs e)
{
boxEquip.posDebugInfo.IsPause = false;
}
private void button2_Click(object sender, EventArgs e)
{
boxEquip.posDebugInfo.IsPause = true;
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!