Commit 4a5f2091 张东亮

20221101

1 个父辈 47d45d7d
......@@ -62,23 +62,23 @@ namespace OnlineStore.DeviceLibrary
{
Bitmap bmp = AcqImage(name);
if (bmp != null)
{
if (IsRecord)
{
cnt++;
Task.Factory.StartNew(delegate
{
SaveImage("box_A", cnt);
});
Task.Factory.StartNew(delegate
{
SaveImage("box_B", cnt);
});
if ((DateTime.Now - dateTime).TotalMinutes > 2)
StopRecord();
}
//{
// if (IsRecord)
// {
// cnt++;
// Task.Factory.StartNew(delegate
// {
// SaveImage("box_A", cnt);
// });
// Task.Factory.StartNew(delegate
// {
// SaveImage("box_B", cnt);
// });
// if ((DateTime.Now - dateTime).TotalMinutes > 2)
// StopRecord();
// }
camera_event?.Invoke(new CameraArgs(name, bmp));
}
// }
Thread.Sleep(300);
}
}
......@@ -207,23 +207,23 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public void StartRecord(bool isTest = false)
{
if (isTest)
{
inOutPosInfo = new InOutPosInfo("code" + DateTime.Now.ToString("mmssfff"), DateTime.Now.ToString("yyyyMMddhh"));
}
else
{
inOutPosInfo = MoveInfo.MoveParam.PosInfo.ToCopy();
}
cnt = 0;
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 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;
ffmpegA.SetParam(inputfolderA, outputfolderA, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4");
ffmpegB.SetParam(inputfolderB, outputfolderB, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4");
dateTime = DateTime.Now;
IsRecord = true;
//if (isTest)
//{
// inOutPosInfo = new InOutPosInfo("code" + DateTime.Now.ToString("mmssfff"), DateTime.Now.ToString("yyyyMMddhh"));
//}
//else
//{
// inOutPosInfo = MoveInfo.MoveParam.PosInfo.ToCopy();
//}
//cnt = 0;
//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 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;
//ffmpegA.SetParam(inputfolderA, outputfolderA, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4");
//ffmpegB.SetParam(inputfolderB, outputfolderB, $"{DateTime.Now.ToString("hhmmss")}_{inOutPosInfo.barcode}.mp4");
//dateTime = DateTime.Now;
//IsRecord = true;
}
/// <summary>
/// 停止记录
......@@ -233,9 +233,9 @@ namespace OnlineStore.DeviceLibrary
if (!IsRecord)
return;
IsRecord = false;
LogUtil.info("监控视频开始转换");
Task task1 = ffmpegA.ConvertImgsToMp4();
Task task2 = ffmpegB.ConvertImgsToMp4();
//LogUtil.info("监控视频开始转换");
//Task task1 = ffmpegA.ConvertImgsToMp4();
//Task task2 = ffmpegB.ConvertImgsToMp4();
//Task.WaitAll(new Task[] { task1, task2 }, TimeSpan.FromMinutes(1));
//LogUtil.info("监控视频转换完成");
}
......
......@@ -95,6 +95,8 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
if (posDebugInfo.IsPause)
return;
switch (MoveInfo.MoveStep)
{
case StepEnum.SP_00_1_StartPosDebug:
......@@ -443,6 +445,7 @@ namespace OnlineStore.DeviceLibrary
/// 停止调试
/// </summary>
public bool IsBreak { get; set; } = false;
public bool IsPause { get; set; } = false;
/// <summary>
/// 是否是最后一个抽屉
/// </summary>
......@@ -481,13 +484,19 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer < config.Cols_In_Drawer)
{
PreColInDrawer = CurColInDrawer;
CurColInDrawer++;
if (CurColInDrawer == 2)
CurColInDrawer = 17;
else
CurColInDrawer++;
}
else
{
PreRowInDrawer = CurRowInDrawer;
PreColInDrawer = CurColInDrawer;
CurRowInDrawer++;
if (CurRowInDrawer == 1)
CurRowInDrawer = 3;
else
CurRowInDrawer++;
}
}
else//轴在目标层
......@@ -495,7 +504,10 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer < EndColInDrawer)
{
PreColInDrawer = CurColInDrawer;
CurColInDrawer++;
if (CurColInDrawer == 2)
CurColInDrawer = 17;
else
CurColInDrawer++;
}
}
}
......@@ -505,7 +517,10 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer == config.Cols_In_Drawer)
{
PreColInDrawer = CurColInDrawer;
CurColInDrawer--;
if (CurColInDrawer == 17)
CurColInDrawer = 2;
else
CurColInDrawer--;
}
else if (CurColInDrawer == 1)
{
......@@ -520,13 +535,19 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer > 1)
{
PreColInDrawer = CurColInDrawer;
CurColInDrawer--;
if (CurColInDrawer == 17)
CurColInDrawer = 2;
else
CurColInDrawer--;
}
else
{
PreRowInDrawer = CurRowInDrawer;
PreColInDrawer = CurColInDrawer;
CurRowInDrawer++;
if (CurRowInDrawer == 1)
CurRowInDrawer = 3;
else
CurRowInDrawer++;
}
}
else//轴在目标层
......@@ -534,7 +555,10 @@ namespace OnlineStore.DeviceLibrary
if (CurColInDrawer > EndColInDrawer)
{
PreColInDrawer = CurColInDrawer;
CurColInDrawer--;
if (CurColInDrawer == 17)
CurColInDrawer = 2;
else
CurColInDrawer--;
}
}
}
......
......@@ -114,5 +114,15 @@ namespace OnlineStore.XLRStore
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!