Commit 486ec025 张东亮

取出出库料盘状态在出库期间无法使用

1 个父辈 c9421220
......@@ -3,6 +3,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration.Install;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Text;
......@@ -21,6 +22,10 @@ namespace DeviceLibrary
/// </summary>
public static void InstallService()
{
if (!File.Exists(serviceFilePath))
{
return;
}
if (!IsServiceExisted(serviceName))
{
InstallService(serviceFilePath);
......@@ -35,17 +40,28 @@ namespace DeviceLibrary
}
}
static string baseDir = ConfigHelper.Config.Get("IPCameraService_HttpServer", "http://localhost:8088");
public static void StartRecord(string fileName="")
static string camName = ConfigHelper.Config.Get("IPCameraService_CamName", "cam1");
public static void StartRecord(string fileName = "")
{
string url = $"{baseDir}/cam/startRecord?camName=cam1&filename={fileName}";
string res=HttpHelper.Get(url);
LogUtil.info($"开始记录视频:{fileName},{res}");
if (!IsServiceExisted(serviceName)) return;
Task.Factory.StartNew(delegate
{
string url = $"{baseDir}/cam/startRecord?camName={camName}&filename={fileName}";
string res = HttpHelper.Get(url);
LogUtil.info($"开始记录视频:{fileName},{res}");
});
}
public static void StopRecord()
{
string url = $"{baseDir}/cam/stopRecord?camName=cam1";
string res = HttpHelper.Get(url);
LogUtil.info($"停止记录视频:{res}");
if (!IsServiceExisted(serviceName)) return;
Task.Factory.StartNew(delegate
{
string url = $"{baseDir}/cam/stopRecord?camName={camName}";
string res = HttpHelper.Get(url);
LogUtil.info($"停止记录视频:{res}");
});
}
//判断服务是否存在
static bool IsServiceExisted(string serviceName)
......@@ -74,9 +90,10 @@ namespace DeviceLibrary
installer.Install(savedState);
installer.Commit(savedState);
}
}catch (Exception ex)
}
catch (Exception ex)
{
LogUtil.error("安装监控相机服务失败",ex);
LogUtil.error("安装监控相机服务失败", ex);
}
}
......@@ -103,9 +120,10 @@ namespace DeviceLibrary
control.Start();
}
}
}catch (Exception ex)
}
catch (Exception ex)
{
LogUtil.error($"启动监控相机服务失败",ex);
LogUtil.error($"启动监控相机服务失败", ex);
}
}
......
......@@ -8,6 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static DeviceLibrary.MainMachine;
namespace DeviceLibrary
{
......@@ -445,10 +446,16 @@ namespace DeviceLibrary
{
map[ParamDefine.closeLock] = ParamDefine.enable;
}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep >= MoveStep.StringLoad_04
&& RobotManage.mainMachine.StringMoveInfo.MoveStep < MoveStep.StringOut_01)
map[ParamDefine.takeOutReel] = ParamDefine.enable;
var step = RobotManage.mainMachine.StringMoveInfo.MoveStep;
if ((step >= MoveStep.StringLoad_04 && step < MoveStep.StringOut_01))
{
if (RobotManage.mainMachine.StringState.Equals(StringStateE.OutStore) && RobotManage.mainMachine.ServerCM.queueTaskCount == 0)
{
map[ParamDefine.takeOutReel] = ParamDefine.enable;
}
else
map[ParamDefine.takeOutReel] = ParamDefine.enable;
}
if (RobotManage.mainMachine.IOValue(IO_Type.NGDoor_Open).Equals(IO_VALUE.HIGH))
{
map[ParamDefine.confirmReelOut] = ParamDefine.enable;
......
......@@ -50,7 +50,8 @@ namespace TheMachine
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 8);
this.tableLayoutPanel.Location = new System.Drawing.Point(21, 18);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
......@@ -59,17 +60,17 @@ namespace TheMachine
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 245);
this.tableLayoutPanel.Size = new System.Drawing.Size(973, 551);
this.tableLayoutPanel.TabIndex = 0;
//
// labelProductName
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(60, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelProductName.Location = new System.Drawing.Point(140, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 36);
this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(354, 16);
this.labelProductName.Size = new System.Drawing.Size(826, 36);
this.labelProductName.TabIndex = 19;
this.labelProductName.Tag = "not";
this.labelProductName.Text = "产品名称";
......@@ -78,11 +79,11 @@ namespace TheMachine
// labelVersion
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(60, 24);
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 16);
this.labelVersion.Location = new System.Drawing.Point(140, 55);
this.labelVersion.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 36);
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(354, 16);
this.labelVersion.Size = new System.Drawing.Size(826, 36);
this.labelVersion.TabIndex = 0;
this.labelVersion.Tag = "not";
this.labelVersion.Text = "版本";
......@@ -92,11 +93,11 @@ namespace TheMachine
// labelCopyright
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(60, 48);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCopyright.Location = new System.Drawing.Point(140, 110);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 36);
this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(354, 16);
this.labelCopyright.Size = new System.Drawing.Size(826, 36);
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Tag = "not";
this.labelCopyright.Text = "版权";
......@@ -105,11 +106,11 @@ namespace TheMachine
// labelCompanyName
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(60, 72);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCompanyName.Location = new System.Drawing.Point(140, 165);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 36);
this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(354, 16);
this.labelCompanyName.Size = new System.Drawing.Size(826, 36);
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "公司名称";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -117,13 +118,13 @@ namespace TheMachine
// textBoxDescription
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(60, 99);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.textBoxDescription.Location = new System.Drawing.Point(140, 227);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(14, 7, 7, 7);
this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(354, 116);
this.textBoxDescription.Size = new System.Drawing.Size(826, 261);
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Tag = "not";
......@@ -133,9 +134,10 @@ namespace TheMachine
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(339, 222);
this.okButton.Location = new System.Drawing.Point(791, 502);
this.okButton.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 20);
this.okButton.Size = new System.Drawing.Size(175, 42);
this.okButton.TabIndex = 24;
this.okButton.Text = "确定";
this.okButton.Click += new System.EventHandler(this.okButton_Click);
......@@ -143,15 +145,16 @@ namespace TheMachine
// AboutBox1
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 27F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(435, 261);
this.ClientSize = new System.Drawing.Size(1015, 587);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox1";
this.Padding = new System.Windows.Forms.Padding(9, 8, 9, 8);
this.Padding = new System.Windows.Forms.Padding(21, 18, 21, 18);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
......
......@@ -3,7 +3,9 @@ using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
......@@ -53,7 +55,11 @@ namespace TheMachine
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
Process current = Process.GetCurrentProcess();
FileInfo fileInfo = new FileInfo(current.MainModule.FileName);
DateTime dateTime = fileInfo.LastWriteTime;
string version = $"{dateTime.Year % 10}.{dateTime.Month}.{dateTime.Day.ToString("00")}{dateTime.Hour.ToString("00")}";
return version;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!