在排料区增加取料失败处理选择

master
lhiven 2 years ago
parent b3277c6f8b
commit 95561e2415

@ -35,6 +35,49 @@ namespace Rs.MotionPlat.Commom
public DateTime Time { get; set; } = DateTime.Now;
public override string ToString() => JsonConvert.SerializeObject(this, new StringEnumConverter());
/// <summary>
/// 获取json,最后一个可能不是合法json
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
/// <exception cref="FormatException">嵌套太深</exception>
public static IEnumerable<string> GetJsons(string msg)
{
int curlyBrackets = 0, startIndex = 0, len = msg.Length, i = 0;
for (; i < len; ++i)
{
switch (msg[i])
{
case '{':
if (curlyBrackets < 0)
{
curlyBrackets = 0;
}
if (++curlyBrackets == 1)
{
startIndex = i;
}
else if (curlyBrackets > 100)
{
throw new FormatException("nesting too deep");
}
break;
case '}':
if (--curlyBrackets == 0)
{
int end = i + 1;
yield return msg.Substring(startIndex,end-startIndex);
startIndex = end;
}
break;
}
}
if (startIndex < len)
yield return msg.Substring(startIndex);
yield break;
}
}
public class SchedulingConnectionInfo : Scheduling
@ -48,6 +91,8 @@ namespace Rs.MotionPlat.Commom
}
}
/// <summary>
/// 上下料
/// </summary>
@ -740,6 +785,10 @@ namespace Rs.MotionPlat.Commom
/// 倒计时结束时按下的按钮
/// </summary>
public ETipButton CountdownResult { get; set; } = ETipButton.Yes;
/// <summary>
/// 定制弹窗按钮文本内容
/// </summary>
public Dictionary<ETipButton, string> ButtonContexts { get; set; }
public SchedulingMessageBox() { }

@ -100,6 +100,17 @@ namespace Rs.MotionPlat.Flow
tilist.AddRange(changeTaskList.Where(tr => tr.Dealed == false));
return tilist;
}
/// <summary>
/// 清除未执行的任务
/// </summary>
public void ClearUndoTask()
{
List<TurnoverInfo> removeList = loadTaskList.Where(t => t.Dealed == false).ToList();
foreach(var t in removeList)
{
loadTaskList.Remove(t);
}
}
public void AddTurnoverResult(Nozzle nozzle)

@ -1,4 +1,5 @@
using Newtonsoft.Json;
using HalconDotNet;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Rs.Framework;
using Rs.MotionPlat.Commom;
@ -9,6 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Rs.MotionPlat.Flow
{
@ -69,143 +71,152 @@ namespace Rs.MotionPlat.Flow
}
private void Client_DataRecived(System.Net.Sockets.Socket socket, byte[] data)
{
string msg=Encoding.UTF8.GetString(data);
//LogHelper.TestCenterLog("接收:"+msg);
ReciveTaskEvent?.Invoke(msg);
Scheduling schedule = JsonConvert.DeserializeObject<Scheduling>(msg);
EInstruction eInstructioneInstruction = schedule.Instruction;
switch (eInstructioneInstruction)
string msg = Encoding.UTF8.GetString(data);
foreach (string json in Scheduling.GetJsons(msg))
{
case EInstruction.InquireSiloStatus:
break;
case EInstruction.InquireConnectionInfo:
SchedulingConnectionInfo info = JsonConvert.DeserializeObject<SchedulingConnectionInfo>(msg);
info.Type = SchedulingConnectionInfo.EType.Scheduling;
client.Send(info.ToString());
LogHelper.Debug(info.ToString());
ReplayTaskEvent?.Invoke(info.ToString());
break;
case EInstruction.LoadAndUnload:
LogHelper.TestCenterLog("接收:" + msg);
MachineManage.Instance.RunState = ERunState.Busying;
sm = JsonConvert.DeserializeObject<SchedulingMaterial>(msg);
schedulResult = new SchedulingResult() { Instruction = sm.Instruction, State = ERunState.Busying, GroupID = sm.GroupID, TurnoverID = sm.TurnoverID };
string buffer = schedulResult.ToString();
client.Send(buffer);
LogHelper.TestCenterLog(buffer);
LoadAndUnloadTask.Instance.Add(sm);
MessageQueue.Instance.Insert(sm.Instruction.ToString());
ReplayTaskEvent?.Invoke(schedulResult.ToString());
break;
case EInstruction.CancelLoadAndUnload:
//schedulResult = new SchedulingResult() { Instruction = EInstruction.CancelLoadAndUnload, State = ERunState.Busying, GroupID = sm.GroupID, TurnoverID = sm.TurnoverID };
client.Send(schedule.ToString());
break;
case EInstruction.InquireStatus:
SchedulingStatusInfo statusInto=JsonConvert.DeserializeObject<SchedulingStatusInfo>(msg);
switch (statusInto.Type)
{
case SchedulingStatusInfo.InfoType.State:
statusInto.Info = MachineManage.Instance.RunState.ToString();// ERunState.Waiting.ToString();
//MessageQueue.Instance.Insert(statusInto.Info);
//File.AppendAllText("c://runstate.txt",statusInto.Info.ToString()+"\r\n");
break;
case SchedulingStatusInfo.InfoType.RunStatus:
statusInto.Info = MachineManage.Instance.RunStatus.ToString();// ERunStatus.Started.ToString();
break;
case SchedulingStatusInfo.InfoType.RunMode:
statusInto.Info = MachineManage.Instance.RunMode.ToString();
break;
case SchedulingStatusInfo.InfoType.InitializeState:
statusInto.Info = MachineManage.Instance.InitializeState.ToString();// EInitializeState.Initialized.ToString();
break;
case SchedulingStatusInfo.InfoType.AssignMode:
statusInto.Info = EAssignMode.Normal.ToString();
break;
case SchedulingStatusInfo.InfoType.Temperature:
statusInto.Info = "22";
break;
default:
break;
}
client.Send(statusInto.ToString());
LogHelper.Debug(statusInto.ToString());
ReplayTaskEvent?.Invoke(statusInto.ToString());
break;
case EInstruction.SwitchStatus:
SchedulingStatusInfo switchStatus=JsonConvert.DeserializeObject<SchedulingStatusInfo>(msg);
SwitchStatus(switchStatus);
//MachineManage.Instance.MachineStatus= EMachineStatus.
//if (ss.TryConvertInfoTo<ERunMode>(out ERunMode runMode))
// MachineManage.Instance.RunMode = runMode;
//client.Send(ss.ToString());
//ReplayTaskEvent?.Invoke(ss.ToString());
break;
case EInstruction.ClearAlarm:
break;
case EInstruction.GetRecipeList:
SchedulingResult sr = JsonConvert.DeserializeObject<SchedulingResult>(msg);
sr.Message = "Default";
client.Send(sr.ToString());
ReplayTaskEvent?.Invoke(sr.ToString());
break;
case EInstruction.SetRecipe:
break;
case EInstruction.GetCurrentRecipe:
SchedulingResult srcur = JsonConvert.DeserializeObject<SchedulingResult>(msg);
srcur.Message = "Default";
client.Send(srcur.ToString());
ReplayTaskEvent?.Invoke(srcur.ToString());
break;
case EInstruction.TurnoverReady:
break;
case EInstruction.ChangeState:
SchedulingResult cs = JsonConvert.DeserializeObject<SchedulingResult>(msg);
client.Send(cs.ToString());
ReplayTaskEvent?.Invoke(cs.ToString());
break;
case EInstruction.ShowMessage:
break;
case EInstruction.CloseMessage:
break;
case EInstruction.MachineButtonDown:
break;
case EInstruction.MachineButtonUp:
break;
case EInstruction.TrayProductRange:
break;
case EInstruction.ClearTrayProductRange:
schedulResult = JsonConvert.DeserializeObject<SchedulingResult>(msg);
client.Send(schedulResult.ToString());
ReplayTaskEvent?.Invoke(schedulResult.ToString());
break;
case EInstruction.RequestSwitchTray:
break;
case EInstruction.BeginSwitchTray:
break;
case EInstruction.MoveScanner:
break;
case EInstruction.InquireMoveScannerState:
break;
case EInstruction.SetAlarms:
break;
case EInstruction.CancelAlarms:
break;
case EInstruction.IsLastBeforeTray:
break;
case EInstruction.EndInput:
break;
case EInstruction.TakingError:
break;
case EInstruction.CancelTakingError:
break;
case EInstruction.Rearrange:
break;
case EInstruction.RearrangeResult:
break;
case EInstruction.ScanBarcode:
break;
Scheduling schedule = JsonConvert.DeserializeObject<Scheduling>(json);
EInstruction eInstructioneInstruction = schedule.Instruction;
switch (eInstructioneInstruction)
{
case EInstruction.InquireSiloStatus:
break;
case EInstruction.InquireConnectionInfo:
SchedulingConnectionInfo info = JsonConvert.DeserializeObject<SchedulingConnectionInfo>(json);
info.Type = SchedulingConnectionInfo.EType.Scheduling;
client.Send(info.ToString());
LogHelper.Debug(info.ToString());
ReplayTaskEvent?.Invoke(info.ToString());
break;
case EInstruction.LoadAndUnload:
LogHelper.Debug("接收:" + json);
MachineManage.Instance.RunState = ERunState.Busying;
sm = JsonConvert.DeserializeObject<SchedulingMaterial>(json);
schedulResult = new SchedulingResult() { Instruction = sm.Instruction, State = ERunState.Busying, GroupID = sm.GroupID, TurnoverID = sm.TurnoverID };
string buffer = schedulResult.ToString();
client.Send(buffer);
LogHelper.TestCenterLog(buffer);
LoadAndUnloadTask.Instance.Add(sm);
MessageQueue.Instance.Insert(sm.Instruction.ToString());
ReplayTaskEvent?.Invoke(schedulResult.ToString());
break;
case EInstruction.CancelLoadAndUnload:
//schedulResult = new SchedulingResult() { Instruction = EInstruction.CancelLoadAndUnload, State = ERunState.Busying, GroupID = sm.GroupID, TurnoverID = sm.TurnoverID };
client.Send(schedule.ToString());
break;
case EInstruction.InquireStatus:
SchedulingStatusInfo statusInto = JsonConvert.DeserializeObject<SchedulingStatusInfo>(json);
switch (statusInto.Type)
{
case SchedulingStatusInfo.InfoType.State:
statusInto.Info = MachineManage.Instance.RunState.ToString();// ERunState.Waiting.ToString();
//MessageQueue.Instance.Insert(statusInto.Info);
//File.AppendAllText("c://runstate.txt",statusInto.Info.ToString()+"\r\n");
break;
case SchedulingStatusInfo.InfoType.RunStatus:
statusInto.Info = MachineManage.Instance.RunStatus.ToString();// ERunStatus.Started.ToString();
break;
case SchedulingStatusInfo.InfoType.RunMode:
statusInto.Info = MachineManage.Instance.RunMode.ToString();
break;
case SchedulingStatusInfo.InfoType.InitializeState:
statusInto.Info = MachineManage.Instance.InitializeState.ToString();// EInitializeState.Initialized.ToString();
break;
case SchedulingStatusInfo.InfoType.AssignMode:
statusInto.Info = EAssignMode.Normal.ToString();
break;
case SchedulingStatusInfo.InfoType.Temperature:
statusInto.Info = "22";
break;
default:
break;
}
client.Send(statusInto.ToString());
LogHelper.Debug(statusInto.ToString());
ReplayTaskEvent?.Invoke(statusInto.ToString());
break;
case EInstruction.SwitchStatus:
SchedulingStatusInfo switchStatus = JsonConvert.DeserializeObject<SchedulingStatusInfo>(msg);
SwitchStatus(switchStatus);
//MachineManage.Instance.MachineStatus= EMachineStatus.
//if (ss.TryConvertInfoTo<ERunMode>(out ERunMode runMode))
// MachineManage.Instance.RunMode = runMode;
//client.Send(ss.ToString());
//ReplayTaskEvent?.Invoke(ss.ToString());
break;
case EInstruction.ClearAlarm:
break;
case EInstruction.GetRecipeList:
SchedulingResult sr = JsonConvert.DeserializeObject<SchedulingResult>(msg);
sr.Message = "Default";
client.Send(sr.ToString());
ReplayTaskEvent?.Invoke(sr.ToString());
break;
case EInstruction.SetRecipe:
break;
case EInstruction.GetCurrentRecipe:
SchedulingResult srcur = JsonConvert.DeserializeObject<SchedulingResult>(msg);
srcur.Message = "Default";
client.Send(srcur.ToString());
ReplayTaskEvent?.Invoke(srcur.ToString());
break;
case EInstruction.TurnoverReady:
break;
case EInstruction.ChangeState:
SchedulingResult cs = JsonConvert.DeserializeObject<SchedulingResult>(msg);
client.Send(cs.ToString());
ReplayTaskEvent?.Invoke(cs.ToString());
break;
case EInstruction.ShowMessage:
break;
case EInstruction.CloseMessage:
SchedulingMessageBox mbox = JsonConvert.DeserializeObject<SchedulingMessageBox>(json);
break;
case EInstruction.MachineButtonDown:
break;
case EInstruction.MachineButtonUp:
break;
case EInstruction.TrayProductRange:
break;
case EInstruction.ClearTrayProductRange:
schedulResult = JsonConvert.DeserializeObject<SchedulingResult>(msg);
client.Send(schedulResult.ToString());
ReplayTaskEvent?.Invoke(schedulResult.ToString());
break;
case EInstruction.RequestSwitchTray:
break;
case EInstruction.BeginSwitchTray:
break;
case EInstruction.MoveScanner:
break;
case EInstruction.InquireMoveScannerState:
break;
case EInstruction.SetAlarms:
break;
case EInstruction.CancelAlarms:
break;
case EInstruction.IsLastBeforeTray:
break;
case EInstruction.EndInput:
break;
case EInstruction.TakingError:
break;
case EInstruction.CancelTakingError:
break;
case EInstruction.Rearrange:
break;
case EInstruction.RearrangeResult:
break;
case EInstruction.ScanBarcode:
break;
}
}
//string msg=Encoding.UTF8.GetString(data);
//LogHelper.TestCenterLog("接收:"+msg);
//ReciveTaskEvent?.Invoke(msg);
}
/// <summary>
@ -263,5 +274,18 @@ namespace Rs.MotionPlat.Flow
string content = LoadAndUnloadTask.Instance.GetTestUnLoadString();
return client.Send(content) > 0;
}
public int Send(string content)
{
return client.Send(content);
}
public void EndInput()
{
Scheduling s = new Scheduling();
s.Instruction = EInstruction.EndInput;
string content = JsonConvert.SerializeObject(s, new StringEnumConverter());
client.Send(content);
}
}
}

@ -5,6 +5,7 @@ using Rs.Framework;
using Rs.Motion;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow.Space;
using Rs.MotionPlat.MsgBox;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -326,13 +327,48 @@ namespace Rs.MotionPlat.Flow
FetchNum++;
if (FetchNum == 6)
{
DialogResult dr = Msg.ShowError($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定", MessageBoxButtons.RetryCancel);
if(dr== DialogResult.Retry)
//DialogResult dr = Msg.ShowError($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定", MessageBoxButtons.RetryCancel);
CloseResult cr = new TakeFailMsg().ShowMsg($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定");
if (cr.Result == ECloseButton.Retry)
{
FetchNum = 0;
flowStep = EWorkFlowStep.;
}
else
else if (cr.Result == ECloseButton.Skip)//switch
{
FetchNum = 0;
if (curTask.FromType == TurnoverType.Turnover)
{
GlobalTray.TurnoverTray.ChangeStatus(curTask.FromIndex + 1, ESlotStatus.NotHave);
}
else if (curTask.FromType == TurnoverType.ToBeTested)
{
GlobalTray.InputTray.ChangeStatus(GlobalTray.InputTray.GetSlot(ESlotStatus.Have).Index, ESlotStatus.NotHave);
}
if (LoadAndUnloadTask.Instance.GetTaskNum(curTask.taskMode) > 0 && NozzleManager.GetNozzlesByStatus(ENozzleStatus.IDLE).Count > 0)
{
flowStep = EWorkFlowStep.;
}
else
{
flowStep = EWorkFlowStep.;
}
}
else if(cr.Result== ECloseButton.EndInput)
{
FetchNum = 0;
TestCenter.Instance.EndInput();
LoadAndUnloadTask.Instance.ClearUndoTask();
if(NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload).Count>0)
{
flowStep = EWorkFlowStep.;
}
else
{
flowStep = EWorkFlowStep.;
}
}
else if (cr.Result == ECloseButton.Continue)
{
FetchNum = 0;
curNozzle.Status = ENozzleStatus.ToUnload;
@ -343,8 +379,6 @@ namespace Rs.MotionPlat.Flow
curNozzle.ToIndex = curTask.ToIndex;
curTask.SuckerNo = curNozzle.NozzleIndex;
curNozzle.TurnoverGUID = curTask.GUID;
FetchNum = 0;
if (curTask.FromType == TurnoverType.Turnover)
{
curNozzle.SN = curTask.SN;
@ -503,6 +537,7 @@ namespace Rs.MotionPlat.Flow
}
//CameraOkEvent?.Invoke(imgs, mrs);
OnMatchResult?.Invoke(mrs);
//TestCenter.Instance.EndInput();
flowStep = EWorkFlowStep.;
//Thread.Sleep(2000);
}

@ -0,0 +1,147 @@
namespace Rs.MotionPlat.MsgBox
{
partial class TakeFailMsg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel2 = new System.Windows.Forms.Panel();
this.btnContinue = new System.Windows.Forms.Button();
this.btnRetry = new System.Windows.Forms.Button();
this.btnSkip = new System.Windows.Forms.Button();
this.btnEndInput = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel2
//
this.panel2.Controls.Add(this.btnContinue);
this.panel2.Controls.Add(this.btnRetry);
this.panel2.Controls.Add(this.btnSkip);
this.panel2.Controls.Add(this.btnEndInput);
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel2.Location = new System.Drawing.Point(0, 234);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(476, 48);
this.panel2.TabIndex = 4;
//
// btnContinue
//
this.btnContinue.Location = new System.Drawing.Point(373, 3);
this.btnContinue.Name = "btnContinue";
this.btnContinue.Size = new System.Drawing.Size(89, 39);
this.btnContinue.TabIndex = 0;
this.btnContinue.Text = "继续";
this.btnContinue.UseVisualStyleBackColor = true;
this.btnContinue.Click += new System.EventHandler(this.btnContinue_Click);
//
// btnRetry
//
this.btnRetry.Location = new System.Drawing.Point(260, 3);
this.btnRetry.Name = "btnRetry";
this.btnRetry.Size = new System.Drawing.Size(89, 39);
this.btnRetry.TabIndex = 0;
this.btnRetry.Text = "重试";
this.btnRetry.UseVisualStyleBackColor = true;
this.btnRetry.Click += new System.EventHandler(this.btnRetry_Click);
//
// btnSkip
//
this.btnSkip.Location = new System.Drawing.Point(147, 4);
this.btnSkip.Name = "btnSkip";
this.btnSkip.Size = new System.Drawing.Size(89, 39);
this.btnSkip.TabIndex = 0;
this.btnSkip.Text = "跳过";
this.btnSkip.UseVisualStyleBackColor = true;
this.btnSkip.Click += new System.EventHandler(this.btnSkip_Click);
//
// btnEndInput
//
this.btnEndInput.Location = new System.Drawing.Point(34, 4);
this.btnEndInput.Name = "btnEndInput";
this.btnEndInput.Size = new System.Drawing.Size(89, 39);
this.btnEndInput.TabIndex = 0;
this.btnEndInput.Text = "结束上料";
this.btnEndInput.UseVisualStyleBackColor = true;
this.btnEndInput.Click += new System.EventHandler(this.btnEndInput_Click);
//
// panel1
//
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 40);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(476, 194);
this.panel1.TabIndex = 5;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(476, 194);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TakeFailMsg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
this.ClientSize = new System.Drawing.Size(476, 282);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.HeadText = "提示";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TakeFailMsg";
this.ShowMax = false;
this.ShowMin = false;
this.Text = "TakeFailMsg";
this.Controls.SetChildIndex(this.panel2, 0);
this.Controls.SetChildIndex(this.panel1, 0);
this.panel2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnRetry;
private System.Windows.Forms.Button btnSkip;
private System.Windows.Forms.Button btnEndInput;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnContinue;
private System.Windows.Forms.Label label1;
}
}

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Rs.MotionPlat.MsgBox
{
public partial class TakeFailMsg : BaseFormHeader
{
CloseResult result = new CloseResult();
public TakeFailMsg()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterScreen;
}
public CloseResult ShowMsg(string msg)
{
this.label1.Text = msg;
this.ShowDialog();
return result;
}
private void btnEndInput_Click(object sender, EventArgs e)
{
result.Result = ECloseButton.EndInput;
this.Close();
}
private void btnSkip_Click(object sender, EventArgs e)
{
result.Result = ECloseButton.Skip;
this.Close();
}
private void btnRetry_Click(object sender, EventArgs e)
{
result.Result = ECloseButton.Retry;
this.Close();
}
private void btnContinue_Click(object sender, EventArgs e)
{
result.Result = ECloseButton.Continue;
this.Close();
}
}
public enum ECloseButton
{
EndInput,
Skip,
Retry,
Continue
}
public class CloseResult
{
public ECloseButton Result { get; set; }
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -217,6 +217,12 @@
<Compile Include="MoveDebug.designer.cs">
<DependentUpon>MoveDebug.cs</DependentUpon>
</Compile>
<Compile Include="MsgBox\TakeFailMsg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MsgBox\TakeFailMsg.Designer.cs">
<DependentUpon>TakeFailMsg.cs</DependentUpon>
</Compile>
<Compile Include="OldTest.cs">
<SubType>Form</SubType>
</Compile>
@ -429,6 +435,9 @@
<EmbeddedResource Include="MoveDebug.resx">
<DependentUpon>MoveDebug.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MsgBox\TakeFailMsg.resx">
<DependentUpon>TakeFailMsg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OldTest.resx">
<DependentUpon>OldTest.cs</DependentUpon>
</EmbeddedResource>

@ -121,8 +121,6 @@
this.btnTeachNozzleZ2GrabHeight = new System.Windows.Forms.Button();
this.btnTeachNozzleZ3GrabHeight = new System.Windows.Forms.Button();
this.btnTeachNozzleZ1GrabHeight = new System.Windows.Forms.Button();
this.button9 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
this.panelEx1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
@ -1468,33 +1466,11 @@
this.btnTeachNozzleZ1GrabHeight.UseVisualStyleBackColor = false;
this.btnTeachNozzleZ1GrabHeight.Click += new System.EventHandler(this.Teach_Click);
//
// button9
//
this.button9.Location = new System.Drawing.Point(1262, 102);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(75, 23);
this.button9.TabIndex = 4;
this.button9.Text = "button9";
this.button9.UseVisualStyleBackColor = true;
this.button9.Click += new System.EventHandler(this.button9_Click);
//
// button10
//
this.button10.Location = new System.Drawing.Point(1262, 181);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(75, 23);
this.button10.TabIndex = 4;
this.button10.Text = "button9";
this.button10.UseVisualStyleBackColor = true;
this.button10.Click += new System.EventHandler(this.button10_Click);
//
// StartPosConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1405, 704);
this.Controls.Add(this.button10);
this.Controls.Add(this.button9);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.panelEx1);
@ -1609,7 +1585,5 @@
private System.Windows.Forms.Button btnTeachNozzleZ2GrabHeight;
private System.Windows.Forms.Button btnTeachNozzleZ3GrabHeight;
private System.Windows.Forms.Button btnTeachNozzleZ1GrabHeight;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
}
}

@ -1,4 +1,7 @@
using Rs.Controls;
using HalconDotNet;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json;
using Rs.Controls;
using Rs.Framework;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow;
@ -11,6 +14,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static Rs.MotionPlat.Commom.SchedulingMessageBox;
using Rs.MotionPlat.MsgBox;
namespace Rs.MotionPlat.SysConfig
{
@ -58,7 +63,20 @@ namespace Rs.MotionPlat.SysConfig
private void button10_Click(object sender, EventArgs e)
{
Ops.HomeAndGoStartPos(nozz);
SchedulingMessageBox s = new SchedulingMessageBox();
s.ID = 111;
s.ButtonContexts = new Dictionary<ETipButton, string>() { { ETipButton.Retry, "abc"} };
s.Instruction = EInstruction.ShowMessage;
s.Message = "hello";
s.Button = SchedulingMessageBox.ETipButton.RetrySkip;
string content = JsonConvert.SerializeObject(s, new StringEnumConverter());
TestCenter.Instance.Send(content);
}
private void button12_Click(object sender, EventArgs e)
{
TakeFailMsg msg = new TakeFailMsg();
CloseResult cr = msg.ShowMsg("dfsd");
}
}
}

Loading…
Cancel
Save