Commit 569af27c 张东亮

关闭启动按钮

1 个父辈 eabc27d3
......@@ -14,118 +14,44 @@ namespace OnlineStore.DeviceLibrary
{
//"E:\\Codes\\CSharp-Workspace\\MyProject\\WindowsService\\IPCamService\\bin\\Debug\\IPCamService.exe"
static string appPath = AppDomain.CurrentDomain.BaseDirectory;
static string serviceFilePath = ConfigHelper.Config.Get("IPCamService_FilePath", $"{appPath}IPCamService\\IPCamService.exe");
static string serviceName = ConfigHelper.Config.Get("IPCamService_ServiceName", "IPCamService");
//static string serviceFilePath = ConfigHelper.Config.Get("IPCamService_FilePath", $"{appPath}IPCamService\\IPCamService.exe");
//static string serviceName = ConfigHelper.Config.Get("IPCamService_ServiceName", "IPCamService");
/// <summary>
/// 安装服务
/// </summary>
public static void InstallService()
{
if (!IsServiceExisted(serviceName))
{
InstallService(serviceFilePath);
LogUtil.info("安装监控相机服务");
ServiceStart(serviceName);
LogUtil.info("启动监控相机服务");
}
else
{
ServiceStart(serviceName);
LogUtil.info("启动监控相机服务");
}
//if (!IsServiceExisted(serviceName))
//{
// InstallService(serviceFilePath);
// LogUtil.info("安装监控相机服务");
// ServiceStart(serviceName);
// LogUtil.info("启动监控相机服务");
//}
//else
//{
// ServiceStart(serviceName);
// LogUtil.info("启动监控相机服务");
//}
}
static string baseDir = ConfigHelper.Config.Get("IPCameraService_HttpServer", "http://localhost:8088");
public static void StartRecord(string camName,string fileName="")
{
Task.Factory.StartNew(delegate {
string url = $"{baseDir}/cam/startRecord?camName={camName}&filename={fileName}";
string res = HttpHelper.Get(url);
LogUtil.info($"开始记录视频:{fileName},{res}");
});
//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 camName)
{
Task.Factory.StartNew(delegate {
string url = $"{baseDir}/cam/stopRecord?camName={camName}";
string res = HttpHelper.Get(url);
LogUtil.info($"停止记录视频:{res}");
});
//Task.Factory.StartNew(delegate {
// string url = $"{baseDir}/cam/stopRecord?camName={camName}";
// string res = HttpHelper.Get(url);
// LogUtil.info($"停止记录视频:{res}");
//});
}
//判断服务是否存在
static bool IsServiceExisted(string serviceName)
{
ServiceController[] services = ServiceController.GetServices();
foreach (ServiceController sc in services)
{
if (sc.ServiceName.ToLower() == serviceName.ToLower())
{
return true;
}
}
return false;
}
//安装服务
static void InstallService(string serviceFilePath)
{
try
{
using (AssemblyInstaller installer = new AssemblyInstaller())
{
installer.UseNewContext = true;
installer.Path = serviceFilePath;
IDictionary savedState = new Hashtable();
installer.Install(savedState);
installer.Commit(savedState);
}
}catch (Exception ex)
{
LogUtil.error("安装监控相机服务失败",ex);
}
}
//卸载服务
static void UninstallService(string serviceFilePath)
{
using (AssemblyInstaller installer = new AssemblyInstaller())
{
installer.UseNewContext = true;
installer.Path = serviceFilePath;
installer.Uninstall(null);
}
}
//启动服务
static void ServiceStart(string serviceName)
{
try
{
using (ServiceController control = new ServiceController(serviceName))
{
if (control.Status == ServiceControllerStatus.Stopped)
{
control.Start();
}
}
}catch (Exception ex)
{
LogUtil.error($"启动监控相机服务失败",ex);
}
}
//停止服务
static void ServiceStop(string serviceName)
{
using (ServiceController control = new ServiceController(serviceName))
{
if (control.Status == ServiceControllerStatus.Running)
{
control.Stop();
}
}
}
}
}
......@@ -44,7 +44,6 @@
this.ShelfAControl = new OnlineStore.XLRStore.EquipControl();
this.ShelfBControl = new OnlineStore.XLRStore.EquipControl();
this.ReelControlB2 = new OnlineStore.XLRStore.ReelDataControl();
this.lblStatus = new System.Windows.Forms.Label();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
......@@ -53,14 +52,6 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.操作ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.启动AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.复位RToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.停止TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.设置TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
......@@ -142,7 +133,7 @@
this.tabPage2.Controls.Add(this.panel1);
this.tabPage2.Location = new System.Drawing.Point(4, 32);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(192, 64);
this.tabPage2.Size = new System.Drawing.Size(988, 602);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 设备状态 ";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -153,7 +144,7 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(192, 64);
this.panel1.Size = new System.Drawing.Size(988, 602);
this.panel1.TabIndex = 1;
//
// tableLayoutPanel1
......@@ -178,7 +169,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 19.04762F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 19.04762F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(192, 64);
this.tableLayoutPanel1.Size = new System.Drawing.Size(988, 602);
this.tableLayoutPanel1.TabIndex = 0;
//
// InputControl
......@@ -189,11 +180,11 @@
this.tableLayoutPanel1.SetColumnSpan(this.InputControl, 2);
this.InputControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.InputControl.EquipText = "上料机构";
this.InputControl.Location = new System.Drawing.Point(4, 43);
this.InputControl.Location = new System.Drawing.Point(4, 374);
this.InputControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.InputControl.MoveInfo = "暂无出入库";
this.InputControl.Name = "InputControl";
this.InputControl.Size = new System.Drawing.Size(184, 4);
this.InputControl.Size = new System.Drawing.Size(980, 106);
this.InputControl.TabIndex = 5;
this.InputControl.WorkStatus = "暂未启动";
//
......@@ -203,11 +194,11 @@
this.ReelControlA1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlA1.ColorStatus = System.Drawing.Color.White;
this.ReelControlA1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlA1.Location = new System.Drawing.Point(4, 25);
this.ReelControlA1.Location = new System.Drawing.Point(4, 204);
this.ReelControlA1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ReelControlA1.Name = "ReelControlA1";
this.ReelControlA1.ReelText = "暂存区物料";
this.ReelControlA1.Size = new System.Drawing.Size(88, 1);
this.ReelControlA1.Size = new System.Drawing.Size(486, 77);
this.ReelControlA1.TabIndex = 0;
//
// ReelControlA2
......@@ -216,11 +207,11 @@
this.ReelControlA2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlA2.ColorStatus = System.Drawing.Color.White;
this.ReelControlA2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlA2.Location = new System.Drawing.Point(4, 34);
this.ReelControlA2.Location = new System.Drawing.Point(4, 289);
this.ReelControlA2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ReelControlA2.Name = "ReelControlA2";
this.ReelControlA2.ReelText = "暂存区物料";
this.ReelControlA2.Size = new System.Drawing.Size(88, 1);
this.ReelControlA2.Size = new System.Drawing.Size(486, 77);
this.ReelControlA2.TabIndex = 1;
//
// ReelControlB1
......@@ -229,11 +220,11 @@
this.ReelControlB1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlB1.ColorStatus = System.Drawing.Color.White;
this.ReelControlB1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlB1.Location = new System.Drawing.Point(100, 25);
this.ReelControlB1.Location = new System.Drawing.Point(498, 204);
this.ReelControlB1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ReelControlB1.Name = "ReelControlB1";
this.ReelControlB1.ReelText = "暂存区物料";
this.ReelControlB1.Size = new System.Drawing.Size(88, 1);
this.ReelControlB1.Size = new System.Drawing.Size(486, 77);
this.ReelControlB1.TabIndex = 2;
//
// BoxControl
......@@ -248,7 +239,7 @@
this.BoxControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BoxControl.MoveInfo = "暂无出入库";
this.BoxControl.Name = "BoxControl";
this.BoxControl.Size = new System.Drawing.Size(184, 13);
this.BoxControl.Size = new System.Drawing.Size(980, 192);
this.BoxControl.TabIndex = 4;
this.BoxControl.WorkStatus = "暂未启动";
//
......@@ -259,11 +250,11 @@
this.ShelfAControl.ColorStatus = System.Drawing.Color.White;
this.ShelfAControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.ShelfAControl.EquipText = "A料口";
this.ShelfAControl.Location = new System.Drawing.Point(4, 55);
this.ShelfAControl.Location = new System.Drawing.Point(4, 488);
this.ShelfAControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ShelfAControl.MoveInfo = "暂无出入库";
this.ShelfAControl.Name = "ShelfAControl";
this.ShelfAControl.Size = new System.Drawing.Size(88, 5);
this.ShelfAControl.Size = new System.Drawing.Size(486, 110);
this.ShelfAControl.TabIndex = 6;
this.ShelfAControl.WorkStatus = "暂未启动";
//
......@@ -274,11 +265,11 @@
this.ShelfBControl.ColorStatus = System.Drawing.Color.White;
this.ShelfBControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.ShelfBControl.EquipText = "B料口";
this.ShelfBControl.Location = new System.Drawing.Point(100, 55);
this.ShelfBControl.Location = new System.Drawing.Point(498, 488);
this.ShelfBControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ShelfBControl.MoveInfo = "暂无出入库";
this.ShelfBControl.Name = "ShelfBControl";
this.ShelfBControl.Size = new System.Drawing.Size(88, 5);
this.ShelfBControl.Size = new System.Drawing.Size(486, 110);
this.ShelfBControl.TabIndex = 7;
this.ShelfBControl.Visible = false;
this.ShelfBControl.WorkStatus = "暂未启动";
......@@ -289,24 +280,13 @@
this.ReelControlB2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlB2.ColorStatus = System.Drawing.Color.White;
this.ReelControlB2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlB2.Location = new System.Drawing.Point(100, 34);
this.ReelControlB2.Location = new System.Drawing.Point(498, 289);
this.ReelControlB2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ReelControlB2.Name = "ReelControlB2";
this.ReelControlB2.ReelText = "暂存区物料";
this.ReelControlB2.Size = new System.Drawing.Size(88, 1);
this.ReelControlB2.Size = new System.Drawing.Size(486, 77);
this.ReelControlB2.TabIndex = 3;
//
// lblStatus
//
this.lblStatus.AutoSize = true;
this.lblStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStatus.ForeColor = System.Drawing.Color.Green;
this.lblStatus.Location = new System.Drawing.Point(29, 46);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(82, 24);
this.lblStatus.TabIndex = 92;
this.lblStatus.Text = "等待启动";
//
// lblWarnMsg
//
this.lblWarnMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
......@@ -366,70 +346,15 @@
// 操作ToolStripMenuItem
//
this.操作ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripSeparator1,
this.启动AToolStripMenuItem,
this.toolStripSeparator4,
this.复位RToolStripMenuItem,
this.toolStripSeparator3,
this.停止TToolStripMenuItem,
this.toolStripSeparator5,
this.toolStripSeparator2,
this.退出ToolStripMenuItem});
this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem";
this.操作ToolStripMenuItem.Size = new System.Drawing.Size(118, 31);
this.操作ToolStripMenuItem.Text = " 设备操作 ";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(144, 32);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(144, 32);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(144, 32);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(141, 6);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(144, 32);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(138, 32);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -584,51 +509,51 @@
// 开机自动启动ToolStripMenuItem
//
this.开机自动启动ToolStripMenuItem.Name = "开机自动启动ToolStripMenuItem";
this.开机自动启动ToolStripMenuItem.Size = new System.Drawing.Size(224, 32);
this.开机自动启动ToolStripMenuItem.Size = new System.Drawing.Size(221, 32);
this.开机自动启动ToolStripMenuItem.Text = "开机自动启动";
this.开机自动启动ToolStripMenuItem.Click += new System.EventHandler(this.开机自动启动ToolStripMenuItem_Click);
//
// toolStripSeparator15
//
this.toolStripSeparator15.Name = "toolStripSeparator15";
this.toolStripSeparator15.Size = new System.Drawing.Size(221, 6);
this.toolStripSeparator15.Size = new System.Drawing.Size(218, 6);
//
// 启用蜂鸣器ToolStripMenuItem
//
this.启用蜂鸣器ToolStripMenuItem.Name = "启用蜂鸣器ToolStripMenuItem";
this.启用蜂鸣器ToolStripMenuItem.Size = new System.Drawing.Size(224, 32);
this.启用蜂鸣器ToolStripMenuItem.Size = new System.Drawing.Size(221, 32);
this.启用蜂鸣器ToolStripMenuItem.Text = "启用蜂鸣器";
this.启用蜂鸣器ToolStripMenuItem.Click += new System.EventHandler(this.启用蜂鸣器ToolStripMenuItem_Click);
//
// toolStripSeparator25
//
this.toolStripSeparator25.Name = "toolStripSeparator25";
this.toolStripSeparator25.Size = new System.Drawing.Size(221, 6);
this.toolStripSeparator25.Size = new System.Drawing.Size(218, 6);
//
// aGVCancelStateToolStripMenuItem
//
this.aGVCancelStateToolStripMenuItem.Name = "aGVCancelStateToolStripMenuItem";
this.aGVCancelStateToolStripMenuItem.Size = new System.Drawing.Size(224, 32);
this.aGVCancelStateToolStripMenuItem.Size = new System.Drawing.Size(221, 32);
this.aGVCancelStateToolStripMenuItem.Text = "AGV信号屏蔽";
this.aGVCancelStateToolStripMenuItem.Click += new System.EventHandler(this.aGVCancelStateToolStripMenuItem_Click);
//
// toolStripSeparator17
//
this.toolStripSeparator17.Name = "toolStripSeparator17";
this.toolStripSeparator17.Size = new System.Drawing.Size(221, 6);
this.toolStripSeparator17.Size = new System.Drawing.Size(218, 6);
this.toolStripSeparator17.Visible = false;
//
// 禁用安全光栅ToolStripMenuItem
//
this.禁用安全光栅ToolStripMenuItem.Name = "禁用安全光栅ToolStripMenuItem";
this.禁用安全光栅ToolStripMenuItem.Size = new System.Drawing.Size(224, 32);
this.禁用安全光栅ToolStripMenuItem.Size = new System.Drawing.Size(221, 32);
this.禁用安全光栅ToolStripMenuItem.Text = "禁用安全光栅";
this.禁用安全光栅ToolStripMenuItem.Click += new System.EventHandler(this.启用安全光栅ToolStripMenuItem_Click);
//
// 启用门禁ToolStripMenuItem
//
this.启用门禁ToolStripMenuItem.Name = "启用门禁ToolStripMenuItem";
this.启用门禁ToolStripMenuItem.Size = new System.Drawing.Size(224, 32);
this.启用门禁ToolStripMenuItem.Size = new System.Drawing.Size(221, 32);
this.启用门禁ToolStripMenuItem.Text = "禁用门禁";
this.启用门禁ToolStripMenuItem.Visible = false;
this.启用门禁ToolStripMenuItem.Click += new System.EventHandler(this.启用门禁ToolStripMenuItem_Click);
......@@ -639,7 +564,6 @@
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1004, 721);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.lblWarnMsg);
this.Controls.Add(this.menuStrip1);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -675,19 +599,10 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
internal System.Windows.Forms.RichTextBox logBox;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label lblStatus;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Label lblWarnMsg;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem 操作ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem 启动AToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem 复位RToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem 停止TToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 设置TToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
......
......@@ -70,6 +70,7 @@ namespace OnlineStore.XLRStore
this.notifyIcon1.Visible = false;
this.ShowInTaskbar = true;
this.Cursor = Cursors.Default;
this.timer1.Start();
}
private FrmInputEquip inputEquip = null;
private FrmBoxEquip box = null;
......@@ -332,17 +333,17 @@ namespace OnlineStore.XLRStore
private void 启动所有料仓AToolStripMenuItem_Click(object sender, EventArgs e)
{
if (StoreBean.runStatus != RunStatus.Wait)
{
MessageBox.Show(StoreBean.Name + "当前状态:" + StoreBean.runStatus + ",不能启动!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (StoreBean.runStatus != RunStatus.Wait)
//{
// MessageBox.Show(StoreBean.Name + "当前状态:" + StoreBean.runStatus + ",不能启动!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
LogUtil.info("点击 开始启动");
startTimer.Interval = 300;
startTimer.Elapsed += timer_Elapsed;
startTimer.AutoReset = false;
startTimer.Enabled = true;
this.timer1.Start();
//this.timer1.Start();
}
private delegate void ShowFormDelegate();
void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
......@@ -352,10 +353,10 @@ namespace OnlineStore.XLRStore
{
return;
}
if (StoreBean.StartRun())
{
BeginInvoke(new ShowFormDelegate(ShowStatus));
}
//if (StoreBean.StartRun())
//{
// BeginInvoke(new ShowFormDelegate(ShowStatus));
//}
}
private void ShowStatus()
{
......@@ -364,18 +365,18 @@ namespace OnlineStore.XLRStore
private void formLineStatus(bool isStart)
{
启动AToolStripMenuItem.Enabled = !isStart;
停止TToolStripMenuItem.Enabled = isStart;
//启动AToolStripMenuItem.Enabled = !isStart;
//停止TToolStripMenuItem.Enabled = isStart;
}
private void 停止所有料仓TToolStripMenuItem_Click(object sender, EventArgs e)
{
if (StoreBean != null)
{
if (StoreBean.runStatus.Equals(RunStatus.Wait))
{
MessageBox.Show(StoreBean.Name + "流水线未启动,不需要停止", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (StoreBean.runStatus.Equals(RunStatus.Wait))
//{
// MessageBox.Show(StoreBean.Name + "流水线未启动,不需要停止", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
LogUtil.info(StoreBean.Name + "点击:停止");
if (StoreBean != null)
{
......@@ -387,20 +388,20 @@ namespace OnlineStore.XLRStore
private void 复位RToolStripMenuItem_Click(object sender, EventArgs e)
{
if (StoreBean.runStatus.Equals(RunStatus.Wait))
{
MessageBox.Show(StoreBean.Name + "流水线未启动,无法复位", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
LogUtil.info(StoreBean.Name + "点击:复位");
StoreBean.Reset();
//if (StoreBean.runStatus.Equals(RunStatus.Wait))
//{
// MessageBox.Show(StoreBean.Name + "流水线未启动,无法复位", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
//LogUtil.info(StoreBean.Name + "点击:复位");
//StoreBean.Reset();
}
private void FrmLineStore_FormClosed(object sender, FormClosedEventArgs e)
{
if (停止TToolStripMenuItem.Enabled)
{
停止所有料仓TToolStripMenuItem_Click(null, null);
}
//if (停止TToolStripMenuItem.Enabled)
//{
// 停止所有料仓TToolStripMenuItem_Click(null, null);
//}
//AgvClient.Dispose();
if (IOManager.instance != null)
......@@ -481,9 +482,9 @@ namespace OnlineStore.XLRStore
{
LogM();
GC.Collect();
string canScanCode = "";
// string canScanCode = "";
lblStatus.Text = StoreBean.GetRunStr() + canScanCode;
// lblStatus.Text = StoreBean.GetRunStr() + canScanCode;
string warnMsg = "";
List<DeviceBase> deviceBases = new List<DeviceBase>() { StoreManager.XLRStore, StoreManager.XLRStore.inputEquip, StoreManager.XLRStore.boxEquip };
//if (StoreManager.XLRStore.runStatus > RunStatus.Wait)
......@@ -517,29 +518,29 @@ namespace OnlineStore.XLRStore
ReelControlB1.ShowData("B进料暂存区", BufferDataManager.BInStoreInfo, input.IOValue(IO_Type.FeedB_ReelCheck));
ReelControlB2.ShowData("B出料暂存区", BufferDataManager.BOutStoreInfo, input.IOValue(IO_Type.LineB_ReelInPlaceCheck));
if (StoreBean.runStatus > RunStatus.Wait)
{
if (启动AToolStripMenuItem.Enabled.Equals(true))
{
formLineStatus(true);
}
if ((StoreBean.runStatus.Equals(RunStatus.HomeMoving) || StoreBean.runStatus.Equals(RunStatus.Reset))
&& StoreBean.alarmType.Equals(AlarmType.None))
{
SetMenuS(复位RToolStripMenuItem, false);
SetMenuS(启动AToolStripMenuItem, false);
}
else
{
SetMenuS(复位RToolStripMenuItem, true);
}
}
else
{
SetMenuS(启动AToolStripMenuItem, true);
SetMenuS(复位RToolStripMenuItem, false);
SetMenuS(停止TToolStripMenuItem, false);
}
//if (StoreBean.runStatus > RunStatus.Wait)
//{
// if (启动AToolStripMenuItem.Enabled.Equals(true))
// {
// formLineStatus(true);
// }
// if ((StoreBean.runStatus.Equals(RunStatus.HomeMoving) || StoreBean.runStatus.Equals(RunStatus.Reset))
// && StoreBean.alarmType.Equals(AlarmType.None))
// {
// SetMenuS(复位RToolStripMenuItem, false);
// SetMenuS(启动AToolStripMenuItem, false);
// }
// else
// {
// SetMenuS(复位RToolStripMenuItem, true);
// }
//}
//else
//{
// SetMenuS(启动AToolStripMenuItem, true);
// SetMenuS(复位RToolStripMenuItem, false);
// SetMenuS(停止TToolStripMenuItem, false);
//}
}
catch (Exception ex)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!