1、增加在周转盘手动拍照扫码功能。

2、保压模组增加手动一键上下功能
develop
lhiven 3 months ago
parent 1a2fdec3e2
commit daed3f3852

@ -259,12 +259,19 @@ namespace Rs.MotionPlat.Flow.Camera
public static string FindCode(HObject images,HObject _barCodeRegion)
{
HObject imgReduaced = null;
try
{
// HOperatorSet.GenRectangle1(out HObject searchRegion, new HTuple(1533), new HTuple(731), new HTuple(1751), new HTuple(1071));
//HOperatorSet.GenRectangle1(out HObject searchRegion,row1, col1, row2, col2);
HOperatorSet.ReduceDomain(images, _barCodeRegion, out HObject imgReduaced);
if(_barCodeRegion!=null)
{
HOperatorSet.ReduceDomain(images, _barCodeRegion, out imgReduaced);
}
else
{
imgReduaced=images;
}
//HOperatorSet.Emphasize(imgReduaced, out HObject imageEmphasize, new HTuple(7), new HTuple(7), new HTuple(1));
//HOperatorSet.CropDomain(imgReduaced, out HObject imagePart);
//HOperatorSet.WriteImage(imagePart, "bmp", 0, "d://images/11");

@ -0,0 +1,299 @@
using Rs.Controls;
using Rs.Framework;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys.Trays;
using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Rs.MotionPlat.Commom.SchedulingMessageBox;
using Rs.Motion;
namespace Rs.MotionPlat.Flow.SubFlow
{
enum EManualPressDownFlowStep
{
,
,
1,
1,
2,
2,
}
/// <summary>
/// 手动把保压头压下
/// </summary>
public class ManualPressDownFlow
{
private static ManualPressDownFlow instance;
public static ManualPressDownFlow Instance
{
get
{
if(instance == null)
instance = new ManualPressDownFlow();
return instance;
}
}
private bool finished = true;
private EManualPressDownFlowStep step = EManualPressDownFlowStep.;
double targetTurnoverX = 0.0;
double targetTurnoverY = 0.0;
double targetPressZ = 0.0;
ErrorCode errCode = ErrorCode.Ok;
string logInfo = string.Empty;
AlarmEntity alarmEntity = new AlarmEntity();
public void Down()
{
if (!finished)
return;
finished = false;
step = EManualPressDownFlowStep.;
while (!finished)
{
switch (step)
{
case EManualPressDownFlowStep.:
{
try
{
targetTurnoverX = SysConfigParam.GetValue<double>("PressTakeX");
errCode = AxisControl.TurnoverX.MovePos(targetTurnoverX, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
targetTurnoverY = SysConfigParam.GetValue<double>("PressY");
errCode = AxisControl.TurnoverY.MovePos(targetTurnoverY, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = GetClassName() + $"到测试保压位上方,tx:{targetTurnoverX},ty:{targetTurnoverY}";
MessageQueue.Instance.Insert(logInfo);
step = EManualPressDownFlowStep.;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.TurnoverY).Transform($"{AxisAlias.TurnoverY}", errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.TurnoverX).Transform($"{AxisAlias.TurnoverX}", errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressDownFlowStep.:
{
try
{
if (Ops.IsStop(AxisControl.TurnoverX, AxisControl.TurnoverY) || GlobalVar.VirtualAxis)
{
PrintXYCurrentPos("轴xy已停止运动,");
//if(Ops.IsArrived(AxisControl.TurnoverX, AxisControl.TurnoverY) || GlobalVar.VirtualAxis)
if (AxisArrived.TurnoverXYIsInTargetPos(targetTurnoverX, targetTurnoverY))
{
logInfo = GetClassName() + $"已运动到测试保压位上方,cx:{Ops.GetCurPosition(AxisControl.TurnoverX)},cy:{Ops.GetCurPosition(AxisControl.TurnoverY)}";
MessageQueue.Instance.Insert(logInfo);
step = EManualPressDownFlowStep.1;
}
else
{
PrintXYCurrentPos($"检测轴xy不在目标位置tx:{targetTurnoverX},ty:{targetTurnoverY}");
step = EManualPressDownFlowStep.;
}
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressDownFlowStep.1:
{
try
{
if (AxisArrived.TurnoverXYIsInTargetPos(targetTurnoverX, targetTurnoverY))
{
targetPressZ = SysConfigParam.GetValue<double>("PressZ");
if (GlobalVar.SocketTrayPressEnableTwoSpeed)
{
targetPressZ = targetPressZ + GlobalVar.SocketTrayPressOneSpeedOffsetHeight;
}
errCode = AxisControl.PressZ.MovePos(targetPressZ, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = GetClassName() + $"到测试保压位下方1,tpressz:{targetPressZ}";
MessageQueue.Instance.Insert(logInfo);
step = EManualPressDownFlowStep.1;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.PressZ).Transform(errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
else
{
PrintXYCurrentPos($"检测轴xy不在目标位置tx:{targetTurnoverX},ty:{targetTurnoverY}");
step = EManualPressDownFlowStep.;
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressDownFlowStep.1:
{
try
{
if (Ops.IsStop(AxisControl.PressZ) || GlobalVar.VirtualAxis)
{
PrintPressZCurrentPos("轴pressz已停止运动,");
if (AxisArrived.TurnoverXYIsInTargetPos(targetTurnoverX, targetTurnoverY))
{
if (AxisArrived.PressZIsInTargetPos(targetPressZ))
{
logInfo = GetClassName() + $"已到测试保压位下方1 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}";
MessageQueue.Instance.Insert(logInfo);
step = EManualPressDownFlowStep.2;
}
else
{
PrintPressZCurrentPos($"检测到轴pressz不在目标位置,tpressz:{targetPressZ}");
step = EManualPressDownFlowStep.1;
}
}
else
{
PrintXYCurrentPos($"检测到轴xy不在目标位置tx:{targetTurnoverX},ty:{targetTurnoverY}");
step = EManualPressDownFlowStep.;
}
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressDownFlowStep.2:
{
try
{
if (AxisArrived.TurnoverXYIsInTargetPos(targetTurnoverX, targetTurnoverY))
{
targetPressZ = SysConfigParam.GetValue<double>("PressZ");
errCode = AxisControl.PressZ.MovePos(targetPressZ, GlobalVar.SocketTrayPressOneSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = GetClassName() + $"到测试保压位下方2,tpressz:{targetPressZ}";
MessageQueue.Instance.Insert(logInfo);
step = EManualPressDownFlowStep.2;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.PressZ).Transform(errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
else
{
step = EManualPressDownFlowStep.;
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressDownFlowStep.2:
{
try
{
if (Ops.IsStop(AxisControl.PressZ) || GlobalVar.VirtualAxis)
{
PrintPressZCurrentPos("轴pressz已停止运动");
if (AxisArrived.TurnoverXYIsInTargetPos(targetTurnoverX, targetTurnoverY))
{
if (AxisArrived.PressZIsInTargetPos(targetPressZ))
{
QifuManager.Instance.Write(SysConfigParam.GetValue<float>("QifuValue"));
Thread.Sleep(200);
logInfo = GetClassName() + $"已到测试保压位下方2 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}";
MessageQueue.Instance.Insert(logInfo);
/*关闭测试穴位真空吸*/
//VacManager.TestTrayVacSuction(EVacOperator.Close, false, willTestSlot.Select(s => s.Index).ToArray());
finished = true;
}
else
{
PrintPressZCurrentPos($"检测到轴pressz不在目标位置,tpressz:{targetPressZ}");
step = EManualPressDownFlowStep.2;
}
}
else
{
PrintXYCurrentPos($"检测到轴xy不在目标位置tx:{targetTurnoverX},ty:{targetTurnoverY}");
step = EManualPressDownFlowStep.;
}
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
}
}
}
public string GetClassName()
{
return "ManualPressDownFlow-";
}
private void PrintXYCurrentPos(string prefixLog)
{
LogHelper.Debug(GetClassName() + $"{prefixLog},当前位置 cx:{Ops.GetCurPosition(AxisControl.TurnoverX)},cy:{Ops.GetCurPosition(AxisControl.TurnoverY)}");
}
private void PrintPressZCurrentPos(string prefixLog)
{
LogHelper.Debug(GetClassName() + $"{prefixLog},当前位置 cpressz:{Ops.GetCurPosition(AxisControl.PressZ)}");
}
}
}

@ -0,0 +1,261 @@
using Rs.Controls;
using Rs.Framework;
using Rs.Motion;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Rs.MotionPlat.Commom.SchedulingMessageBox;
namespace Rs.MotionPlat.Flow.SubFlow
{
enum EManualPressUpFlowStep
{
1,
1,
2,
2,
,
,
}
public class ManualPressUpFlow
{
private static ManualPressUpFlow instance;
public static ManualPressUpFlow Instance
{
get
{
if(instance == null)
instance = new ManualPressUpFlow();
return instance;
}
}
double targetTurnoverX = 0.0;
double targetTurnoverY = 0.0;
double targetPressZ = 0.0;
ErrorCode errCode = ErrorCode.Ok;
string logInfo = string.Empty;
AlarmEntity alarmEntity = new AlarmEntity();
private EManualPressUpFlowStep Step = EManualPressUpFlowStep.1;
private bool finished = true;
public void Up()
{
if (!finished)
return;
finished = false;
Step = EManualPressUpFlowStep.1;
while (!finished)
{
switch (Step)
{
case EManualPressUpFlowStep.1:
{
try
{
if (GlobalVar.SocketTrayPressEnableTwoSpeed)
{
targetPressZ = SysConfigParam.GetValue<double>("PressZ") + GlobalVar.SocketTrayPressOneSpeedOffsetHeight;
errCode = AxisControl.PressZ.MovePos(targetPressZ, GlobalVar.SocketTrayPressOneSpeed);
}
else
{
targetPressZ = SysConfigParam.GetValue<double>("PressSafeZ");
errCode = AxisControl.PressZ.MovePos(targetPressZ, GlobalVar.WholeSpeed);
}
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = GetClassName() + $"测试完成准备抬起,tpressz:{targetPressZ}";
MessageQueue.Instance.Insert(logInfo);
Step = EManualPressUpFlowStep.1;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.PressZ).Transform($"{AxisAlias.PressZ}", errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressUpFlowStep.1:
{
try
{
if (Ops.IsStop(AxisControl.PressZ) || GlobalVar.VirtualAxis)
{
PrintPressZCurrentPos("轴pressz已停止运动");
if (AxisArrived.PressZIsInTargetPos(targetPressZ))
{
logInfo = GetClassName() + $"测试完成已抬起 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}";
MessageQueue.Instance.Insert(logInfo);
Step = EManualPressUpFlowStep.2;
}
else
{
PrintPressZCurrentPos($"检测到轴pressz不在目标位置,tpressz:{targetPressZ}");
Step = EManualPressUpFlowStep.1;
}
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressUpFlowStep.2:
{
try
{
targetPressZ = SysConfigParam.GetValue<double>("PressSafeZ");
errCode = AxisControl.PressZ.MovePos(targetPressZ, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = GetClassName() + $"测试完成抬起安全位,tpressz:{targetPressZ}";
MessageQueue.Instance.Insert(logInfo);
Step = EManualPressUpFlowStep.2;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.PressZ).Transform(errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressUpFlowStep.2:
{
try
{
if (Ops.IsStop(AxisControl.PressZ) || GlobalVar.VirtualAxis)
{
if (AxisArrived.PressZIsInTargetPos(targetPressZ))
{
logInfo = GetClassName() + $"测试完成已抬起到安全位 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}";
MessageQueue.Instance.Insert(logInfo);
Step = EManualPressUpFlowStep.;
}
else
{
PrintPressZCurrentPos($"检测到轴pressz不在目标位置,tpressz:{targetPressZ}");
Step = EManualPressUpFlowStep.2;
}
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressUpFlowStep.:
{
try
{
if (CanGoTurnoverTrayPos())
{
targetTurnoverX = SysConfigParam.GetValue<double>("TurnoverDumpX");
errCode = AxisControl.TurnoverX.MovePos(targetTurnoverX, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
targetTurnoverY = SysConfigParam.GetValue<double>("TurnoverDumpY");
errCode = AxisControl.TurnoverY.MovePos(targetTurnoverY, GlobalVar.WholeSpeed);
if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = GetClassName() + $"到周转盘放料位上方,tx:{targetTurnoverX},ty:{targetTurnoverY}";
MessageQueue.Instance.Insert(logInfo);
Step = EManualPressUpFlowStep.;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.TurnoverY).Transform(errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.TurnoverX).Transform(errCode.ToString());
AlarmMessageBox.ShowDialog(alarmEntity, ETipButton.Ok, null);
finished = true;
}
}
else
{
Msg.ShowError("turnovery axis move is unsafe");
finished = true;
}
}
catch (Exception ex)
{
Msg.ShowError(ex.Message);
finished = true;
}
}
break;
case EManualPressUpFlowStep.:
if (Ops.IsStop(AxisControl.TurnoverX, AxisControl.TurnoverY) || GlobalVar.VirtualAxis)
{
PrintXYCurrentPos("轴xy已停止运动,");
if (AxisArrived.TurnoverXYIsInTargetPos(targetTurnoverX, targetTurnoverY))
{
logInfo = GetClassName() + $"已运动到周转盘放料位上方";
MessageQueue.Instance.Insert(logInfo);
finished = true;
}
else
{
PrintXYCurrentPos($"检测到xy不在目标位置,tx:{targetTurnoverX},ty:{targetTurnoverY}");
Step = EManualPressUpFlowStep.;
}
}
break;
}
}
}
public string GetClassName()
{
return "ManualPressUpFlow-";
}
private void PrintXYCurrentPos(string prefixLog)
{
LogHelper.Debug(GetClassName() + $"{prefixLog},当前位置 cx:{Ops.GetCurPosition(AxisControl.TurnoverX)},cy:{Ops.GetCurPosition(AxisControl.TurnoverY)}");
}
private void PrintPressZCurrentPos(string prefixLog)
{
LogHelper.Debug(GetClassName() + $"{prefixLog},当前位置 cpressz:{Ops.GetCurPosition(AxisControl.PressZ)}");
}
private bool CanGoTurnoverTrayPos()
{
double curPos = Ops.GetCurPosition(AxisControl.LoadY);
double maxPos = SysConfigParam.GetValue<double>("Nozzle1CenterY") + 3;
if (curPos > maxPos)
return false;
return true;
}
}
}

@ -118,7 +118,16 @@ namespace Rs.MotionPlat
button.ForeColor = Color.White;
button.BackColor = Color.FromArgb(19, 52, 104);
button.Margin = new Padding(0, 3, 0, 0);
button.ShowText = dt.Rows[i]["cardname"].ToString();
string language = Properties.Settings.Default.DefaultLanguage;
if(language=="")
{
button.ShowText = dt.Rows[i]["cardname"].ToString();
}
else
{
button.ShowText = dt.Rows[i]["cardenname"].ToString();
}
button.Dock = DockStyle.Fill;
button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderColor = System.Drawing.Color.White;
@ -142,7 +151,15 @@ namespace Rs.MotionPlat
button.ForeColor = Color.White;
button.BackColor = Color.FromArgb(19, 52, 104);
button.Margin = new Padding(0, 3, 0, 0);
button.ShowText = dt.Rows[i]["cardname"].ToString();
string language = Properties.Settings.Default.DefaultLanguage;
if (language == "zh-CN")
{
button.ShowText = dt.Rows[i]["cardname"].ToString();
}
else
{
button.ShowText = dt.Rows[i]["cardenname"].ToString();
}
button.Dock = DockStyle.Fill;
button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderColor = System.Drawing.Color.White;
@ -176,32 +193,36 @@ namespace Rs.MotionPlat
ClearSelect();
((ButtonEx)sender).Selected = true;
IIOCard card = (IIOCard)(((ButtonEx)sender).Tag);
bool needSave = false;
foreach(IIO io in card.DIn)
if(card != null)
{
if(string.IsNullOrEmpty(io.ShowEnName))
bool needSave = false;
foreach (IIO io in card.DIn)
{
io.ShowEnName = io.Name;
needSave = true;
if (string.IsNullOrEmpty(io.ShowEnName))
{
io.ShowEnName = io.Name;
needSave = true;
}
}
}
foreach (IIO io in card.DOut)
{
if (string.IsNullOrEmpty(io.ShowEnName))
foreach (IIO io in card.DOut)
{
io.ShowEnName = io.Name;
needSave = true;
if (string.IsNullOrEmpty(io.ShowEnName))
{
io.ShowEnName = io.Name;
needSave = true;
}
}
}
if(needSave)
{
card.Save();
if (needSave)
{
card.Save();
}
if (card == null) return;
string lang = Properties.Settings.Default.DefaultLanguage == "en-US" ? "EN" : "CN";
inout.LoadIO(card, btnWidth - 10, GlobalUser.UserName, lang);
}
if (card == null) return;
string lang=Properties.Settings.Default.DefaultLanguage=="en-US"?"EN":"CN";
inout.LoadIO(card, btnWidth - 10, GlobalUser.UserName,lang);
}
}
}

@ -24,6 +24,7 @@ using System.IO;
using Rs.MotionPlat.Entitys;
using static Rs.MotionPlat.Commom.SchedulingMessageBox;
using ICSharpCode.SharpZipLib.Zip;
using Rs.DataAccess;
namespace Rs.MotionPlat
{
@ -41,9 +42,9 @@ namespace Rs.MotionPlat
void CloseSubWindow()
{
foreach(Control f in panel_main.Controls)
foreach (Control f in panel_main.Controls)
{
if(f is Form && ((Form)f).Name!= "FormMain")
if (f is Form && ((Form)f).Name != "FormMain")
{
((Form)f).Close();
}
@ -69,7 +70,7 @@ namespace Rs.MotionPlat
if (button == btnData)
{
if (Properties.Settings.Default.DefaultLanguage== "zh-CN")
if (Properties.Settings.Default.DefaultLanguage == "zh-CN")
{
LanguageHelper.SetDefaultLanguage("en-US");
}
@ -86,7 +87,7 @@ namespace Rs.MotionPlat
}
else
{
if(fm.Name!= "Home")
if (fm.Name != "Home")
{
LanguageHelper.LoadLanguage(fm, fm.GetType());
}
@ -138,7 +139,7 @@ namespace Rs.MotionPlat
button.Selected = true;
CloseSubWindow();
BaseForm form = ActiveForms.Get("FormMain");
if(form!=null)
if (form != null)
{
panel_main.Controls.Add(form);
form.TopLevel = false;
@ -155,7 +156,7 @@ namespace Rs.MotionPlat
form.Visible = true;
ActiveForms.Add(form);
}
}
//else if (button == btnQuit)
//{
@ -195,13 +196,13 @@ namespace Rs.MotionPlat
}
else if (button == btnPermission)
{
if(btnPermission.ShowText.IndexOf("-")>0)
if (btnPermission.ShowText.IndexOf("-") > 0)
{
DialogResult dr = Msg.ShowQuestion("Are you sure to exit login?");
if(dr== DialogResult.OK)
if (dr == DialogResult.OK)
{
GlobalUser.UserName = "";
btnPermission.ShowText=btnPermission.ShowText.Substring(0,btnPermission.ShowText.IndexOf("-"));
btnPermission.ShowText = btnPermission.ShowText.Substring(0, btnPermission.ShowText.IndexOf("-"));
}
}
else
@ -209,7 +210,8 @@ namespace Rs.MotionPlat
selectedButton = null;
UserForm form;
form = new UserForm();
form.OnloginSuccessEvent += (uname) => {
form.OnloginSuccessEvent += (uname) =>
{
btnPermission.ShowText += $"-({uname})";
};
form.StartPosition = FormStartPosition.CenterScreen;
@ -217,7 +219,7 @@ namespace Rs.MotionPlat
form.TopMost = true;
form.ShowDialog(this);
}
}
else if (button == btnLanguage)
{
@ -248,13 +250,13 @@ namespace Rs.MotionPlat
private void ShowBtn(string btnname)
{
if(btnname== "DebugMove")
if (btnname == "DebugMove")
{
btnAbout.Enabled = true;
}
else if(btnname== "VarConfig")
else if (btnname == "VarConfig")
{
btnLanguage.Enabled = true ;
btnLanguage.Enabled = true;
}
}
@ -275,7 +277,7 @@ namespace Rs.MotionPlat
string language = Properties.Settings.Default.DefaultLanguage;
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language);
LanguageHelper.LoadLanguage(this, typeof(Home));
if(language=="zh-CN")
if (language == "zh-CN")
{
btnMain.ShowText = "主页";
btnRecipe.ShowText = "配方";
@ -321,9 +323,10 @@ namespace Rs.MotionPlat
btnMain.Selected = true;
}
timer1.Enabled = true;
lblVersion.Text ="Version:"+System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
lblVersion.Text = "Version:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
new HotKeyManager(Keys.P, 1, (o,arg) => {
new HotKeyManager(Keys.P, 1, (o, arg) =>
{
LookCamera lookCamera = new LookCamera();
lookCamera.HeaderBackgroundColor = Color.Gray;
lookCamera.TopMost = true;
@ -332,7 +335,8 @@ namespace Rs.MotionPlat
lookCamera.ShowInTaskbar = false;
lookCamera.Show();
});
new HotKeyManager(Keys.T, 1, (o, arg) => {
new HotKeyManager(Keys.T, 1, (o, arg) =>
{
MonitorTray monitorTray = new MonitorTray();
//monitorTray.TopMost = true;
//monitorTray.ShowMax = false;
@ -341,9 +345,10 @@ namespace Rs.MotionPlat
monitorTray.Show();
});
new HotKeyManager(Keys.F, 1, (o, arg) => {
new HotKeyManager(Keys.F, 1, (o, arg) =>
{
MonitorFlow mf = new MonitorFlow();
mf.StartPosition= FormStartPosition.CenterParent;
mf.StartPosition = FormStartPosition.CenterParent;
mf.HeaderBackgroundColor = Color.Gray;
mf.Show();
});
@ -357,16 +362,17 @@ namespace Rs.MotionPlat
{
timer3_Tick(null, null);
});
if(File.Exists("breakdown.csv"))
if (File.Exists("breakdown.csv"))
{
File.Delete("breakdown.csv");
}
for(int i=1;i<9;i++)
for (int i = 1; i < 9; i++)
{
if (!NozzleManager.GetNozzle(i).Enable)
GlobalTray.DischargeNozzle.ChangeStatus(i, ESlotStatus.Disable);
}
InitDb();
}
void ChangeLang()
@ -387,7 +393,7 @@ namespace Rs.MotionPlat
btnLanguage.ShowText = "标定";
btnLanguage.Invalidate();
btnPermission.ShowText = "用户";
if(!string.IsNullOrEmpty(GlobalUser.UserName))
if (!string.IsNullOrEmpty(GlobalUser.UserName))
{
btnPermission.ShowText += $"-({GlobalUser.UserName})";
}
@ -414,7 +420,7 @@ namespace Rs.MotionPlat
}
btnPermission.Invalidate();
//btnQuit.ShowText = "Quit";
// btnQuit.Invalidate();
// btnQuit.Invalidate();
btnData.ShowText = "中文";
btnData.Invalidate();
}
@ -430,13 +436,13 @@ namespace Rs.MotionPlat
private void timer1_Tick(object sender, EventArgs e)
{
GC.Collect();
if(MachineManage.Instance.MachineStatus.ToString()!=lblMachineState.Text)
if (MachineManage.Instance.MachineStatus.ToString() != lblMachineState.Text)
{
if(MachineManage.Instance.MachineStatus== EMachineStatus.NotInit)
if (MachineManage.Instance.MachineStatus == EMachineStatus.NotInit)
{
this.panel1.BackColor = Color.Red;
}
else if(MachineManage.Instance.MachineStatus== EMachineStatus.Homing || MachineManage.Instance.MachineStatus == EMachineStatus.Stop)
else if (MachineManage.Instance.MachineStatus == EMachineStatus.Homing || MachineManage.Instance.MachineStatus == EMachineStatus.Stop)
{
this.panel1.BackColor = Color.FromArgb(192, 192, 0);
}
@ -444,16 +450,16 @@ namespace Rs.MotionPlat
{
this.panel1.BackColor = Color.FromArgb(46, 46, 46);
}
lblMachineState.Text=MachineManage.Instance.MachineStatus.ToString();
lblMachineState.Text = MachineManage.Instance.MachineStatus.ToString();
}
if(MachineManage.Instance.GetLoadUnloadStatus().ToString() != lblRunState.Text.Replace("RunState:",""))
if (MachineManage.Instance.GetLoadUnloadStatus().ToString() != lblRunState.Text.Replace("RunState:", ""))
{
lblRunState.Text = "RunState:" + MachineManage.Instance.GetLoadUnloadStatus().ToString();
}
if(DischargeFlow.Instance.GetCurStep().ToString()!=lblDischargeFlow.Text.Replace("Discharge:",""))
if (DischargeFlow.Instance.GetCurStep().ToString() != lblDischargeFlow.Text.Replace("Discharge:", ""))
{
lblDischargeFlow.Text = "Discharge:"+DischargeFlow.Instance.GetCurStep().ToString();
lblDischargeFlow.Text = "Discharge:" + DischargeFlow.Instance.GetCurStep().ToString();
}
if (TurnoverFlow.Instance.GetStep().ToString() != lblTurnoverFlow.Text.Replace("Turnover:", ""))
@ -465,7 +471,7 @@ namespace Rs.MotionPlat
lblMonitorFlow.Text = "Monitor:" + MonitorSystemButton.Instance.GetStep();
}
if (MachineManage.Instance.InitializeState.ToString()!= lblInitializeState.Text.Replace("InitializeState:", ""))
if (MachineManage.Instance.InitializeState.ToString() != lblInitializeState.Text.Replace("InitializeState:", ""))
{
lblInitializeState.Text = $"InitializeState:{MachineManage.Instance.InitializeState.ToString()}";
}
@ -473,7 +479,7 @@ namespace Rs.MotionPlat
if (proc != null)
{
long userdMem = proc.WorkingSet64;
lblMemory.Text = $"Mem:{(userdMem/1024)/1024} MB";
lblMemory.Text = $"Mem:{(userdMem / 1024) / 1024} MB";
}
}
@ -539,7 +545,7 @@ namespace Rs.MotionPlat
private void timer2_Tick(object sender, EventArgs e)
{
//ClearMemory();
if(!GlobalVar.DisableIonFanCheck)
if (!GlobalVar.DisableIonFanCheck)
{
if (MachineManage.Instance.MachineStatus != EMachineStatus.NotInit)
{
@ -570,7 +576,7 @@ namespace Rs.MotionPlat
{
fanAlarms.Add("fan no.6 alarm");
}
if(fanAlarms.Count > 0)
if (fanAlarms.Count > 0)
{
fanAlarm = true;
MessageQueue.Instance.Warn(string.Join(" ", fanAlarms));
@ -582,7 +588,7 @@ namespace Rs.MotionPlat
}
else
{
if (Ops.IsOn("1号离子风报警")==false
if (Ops.IsOn("1号离子风报警") == false
&& Ops.IsOn("2号离子风报警") == false
&& Ops.IsOn("3号离子风报警") == false
&& Ops.IsOn("4号离子风报警") == false
@ -650,10 +656,10 @@ namespace Rs.MotionPlat
}
}
}
if (!GlobalVar.DisableDoor)
{
if(MachineManage.Instance.MachineStatus != EMachineStatus.NotInit && MachineManage.Instance.MachineStatus!= EMachineStatus.Stop)
if (MachineManage.Instance.MachineStatus != EMachineStatus.NotInit && MachineManage.Instance.MachineStatus != EMachineStatus.Stop)
{
if (!frontDoorAlarm)
{
@ -776,7 +782,7 @@ namespace Rs.MotionPlat
}
}
}
}
if (!GlobalVar.DisableCheckSocketLock)
{
@ -801,16 +807,16 @@ namespace Rs.MotionPlat
{
fixedCylinderAlarms.Add("back-right socket unlock");
}
if(fixedCylinderAlarms.Count > 0)
if (fixedCylinderAlarms.Count > 0)
{
fixedCylinderAlarm = true;
Ops.Stop();
PromptMessageBox.Show(AlarmConstID., string.Join(" ",fixedCylinderAlarms), SchedulingMessageBox.ETipButton.None);
PromptMessageBox.Show(AlarmConstID., string.Join(" ", fixedCylinderAlarms), SchedulingMessageBox.ETipButton.None);
}
//if (IoManager.Instance.ReadIn("左前固定气缸动位") == 0 || IoManager.Instance.ReadIn("左后固定气缸动位") == 0 || IoManager.Instance.ReadIn("右前固定气缸动位") == 0 || IoManager.Instance.ReadIn("右后固定气缸动位") == 0)
//{
// string alarmInfo = string.Empty;
// if (IoManager.Instance.ReadIn("左前固定气缸动位") == 0)
// {
@ -828,14 +834,14 @@ namespace Rs.MotionPlat
// {
// alarmInfo += "RightAfterSocketUnlock\r\n";
// }
//}
}
else
{
if (IoManager.Instance.ReadIn("左前固定气缸动位") == 1
&& IoManager.Instance.ReadIn("左后固定气缸动位") == 1
&& IoManager.Instance.ReadIn("右前固定气缸动位") == 1
if (IoManager.Instance.ReadIn("左前固定气缸动位") == 1
&& IoManager.Instance.ReadIn("左后固定气缸动位") == 1
&& IoManager.Instance.ReadIn("右前固定气缸动位") == 1
&& IoManager.Instance.ReadIn("右后固定气缸动位") == 1)
{
fixedCylinderAlarm = false;
@ -862,7 +868,7 @@ namespace Rs.MotionPlat
try
{
string dirpath = GlobalVar.ImageSavePath;// "D://images";
if(!string.IsNullOrEmpty(dirpath))
if (!string.IsNullOrEmpty(dirpath))
{
string[] dirs = Directory.GetDirectories(dirpath);
if (!Directory.Exists(dirpath))
@ -973,5 +979,37 @@ namespace Rs.MotionPlat
CopyDirectory(subdir.FullName, tempPath);
}
}
private void InitDb()
{
SqliteHelper db = new SqliteHelper();
string querySql = "pragma table_info ('IO');";
DataTable dt = db.GetDataTable(querySql);
int count = dt.AsEnumerable().Where(t => t.Field<string>("name") == "CardEnName").Count();
if (count == 0)
{
string updateSql = "alter table IO ADD COLUMN CardEnName varchar(200)";
db.ExecuteNonQuery(updateSql);
List<string> dbSql = new List<string>();
dbSql.Add("update io set cardenname='Loader_PnP_Module1#' where cardname='龙门取放料模组1#'");
dbSql.Add("update io set cardenname='Loader_PnP_Module2#' where cardname='龙门取放料模组2#'");
dbSql.Add("update io set cardenname='Left_Stocker_Area8#' where cardname='左料仓模组8#'");
dbSql.Add("update io set cardenname='Right_Stock_Area10#' where cardname='右料仓模组10#'");
dbSql.Add("update io set cardenname='Tronove_module3#' where cardname='周转模组3#'");
dbSql.Add("update io set cardenname='Shuttle4#' where cardname='周转盘模组4#'");
dbSql.Add("update io set cardenname='Shuttle5#' where cardname='周转盘模组5#'");
dbSql.Add("update io set cardenname='Test_Area6#' where cardname='测试治具6#'");
dbSql.Add("update io set cardenname='Test_Area7#' where cardname='测试治具7#'");
dbSql.Add("update io set cardenname='Left_Stocker9#' where cardname='左料仓扩展卡9#'");
dbSql.Add("update io set cardenname='Right_Stocker11#' where cardname='右料仓扩展卡11#'");
dbSql.Add("update io set cardenname='Gugao' where cardname='Gugao'");
dbSql.Add("update io set cardenname='Fixed_Fixture' where cardname='固定治具'");
foreach (string r in dbSql)
{
int rowAffect = db.ExecuteNonQuery(r);
}
}
}
}
}

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
[assembly: AssemblyVersion("20.25.12.01")]
[assembly: AssemblyVersion("20.25.14.02")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

@ -156,7 +156,7 @@ namespace Rs.MotionPlat.Recipe
hWindow_Final1.DispObj(resultRegion, "red");
lblCheckResult.Text = area.D.ToString("0.00");
if (area.D > GlobalVar.TurnoverTrayHaveOrNotGrayArea)
if (area.D > GlobalVar.StockTrayHaveOrNotGrayArea)
{
lblProductCheckResult.BackColor = Color.Green;
lblProductCheckResult.Text = "has product";

@ -29,12 +29,12 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TurnoverTrayHaveOrNot));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TurnoverTrayHaveOrNot));
this.panelEx1 = new Rs.Controls.PanelEx();
this.panelEx2 = new Rs.Controls.PanelEx();
this.panel4 = new System.Windows.Forms.Panel();
@ -69,6 +69,9 @@
this.goToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.moveToolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem();
this.grabPosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.label4 = new System.Windows.Forms.Label();
this.lblSN = new System.Windows.Forms.Label();
this.btnCheckSn = new System.Windows.Forms.Button();
this.panelEx1.SuspendLayout();
this.panelEx2.SuspendLayout();
this.panel4.SuspendLayout();
@ -85,26 +88,28 @@
//
// panelEx1
//
resources.ApplyResources(this.panelEx1, "panelEx1");
this.panelEx1.Controls.Add(this.panelEx2);
resources.ApplyResources(this.panelEx1, "panelEx1");
this.panelEx1.Name = "panelEx1";
//
// panelEx2
//
resources.ApplyResources(this.panelEx2, "panelEx2");
this.panelEx2.Controls.Add(this.panel4);
this.panelEx2.Controls.Add(this.panel3);
resources.ApplyResources(this.panelEx2, "panelEx2");
this.panelEx2.Name = "panelEx2";
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.groupBox4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// groupBox4
//
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.Controls.Add(this.btnCheckSn);
this.groupBox4.Controls.Add(this.lblSN);
this.groupBox4.Controls.Add(this.label4);
this.groupBox4.Controls.Add(this.lblProductCheckResult);
this.groupBox4.Controls.Add(this.btnCheck);
this.groupBox4.Controls.Add(this.txtTurnoverTrayHaveOrNotGrayMax);
@ -118,21 +123,22 @@
this.groupBox4.Controls.Add(this.txtTurnoverTrayHaveOrNotGrayArea);
this.groupBox4.Controls.Add(this.txtTurnoverTrayHaveOrNotGrayMin);
this.groupBox4.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.ForeColor = System.Drawing.Color.White;
this.groupBox4.Name = "groupBox4";
this.groupBox4.TabStop = false;
//
// lblProductCheckResult
//
resources.ApplyResources(this.lblProductCheckResult, "lblProductCheckResult");
this.lblProductCheckResult.BackColor = System.Drawing.Color.Red;
resources.ApplyResources(this.lblProductCheckResult, "lblProductCheckResult");
this.lblProductCheckResult.Name = "lblProductCheckResult";
//
// btnCheck
//
resources.ApplyResources(this.btnCheck, "btnCheck");
this.btnCheck.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
this.btnCheck.FlatAppearance.BorderColor = System.Drawing.Color.White;
resources.ApplyResources(this.btnCheck, "btnCheck");
this.btnCheck.ForeColor = System.Drawing.Color.White;
this.btnCheck.Name = "btnCheck";
this.btnCheck.UseVisualStyleBackColor = false;
@ -140,9 +146,9 @@
//
// txtTurnoverTrayHaveOrNotGrayMax
//
resources.ApplyResources(this.txtTurnoverTrayHaveOrNotGrayMax, "txtTurnoverTrayHaveOrNotGrayMax");
this.txtTurnoverTrayHaveOrNotGrayMax.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16)))));
this.txtTurnoverTrayHaveOrNotGrayMax.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.txtTurnoverTrayHaveOrNotGrayMax, "txtTurnoverTrayHaveOrNotGrayMax");
this.txtTurnoverTrayHaveOrNotGrayMax.ForeColor = System.Drawing.Color.White;
this.txtTurnoverTrayHaveOrNotGrayMax.Name = "txtTurnoverTrayHaveOrNotGrayMax";
this.txtTurnoverTrayHaveOrNotGrayMax.Tag = "";
@ -150,9 +156,9 @@
//
// btnGrab
//
resources.ApplyResources(this.btnGrab, "btnGrab");
this.btnGrab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
this.btnGrab.FlatAppearance.BorderColor = System.Drawing.Color.White;
resources.ApplyResources(this.btnGrab, "btnGrab");
this.btnGrab.ForeColor = System.Drawing.Color.White;
this.btnGrab.Name = "btnGrab";
this.btnGrab.UseVisualStyleBackColor = false;
@ -166,9 +172,9 @@
//
// btnDrawRegion
//
resources.ApplyResources(this.btnDrawRegion, "btnDrawRegion");
this.btnDrawRegion.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
this.btnDrawRegion.FlatAppearance.BorderColor = System.Drawing.Color.White;
resources.ApplyResources(this.btnDrawRegion, "btnDrawRegion");
this.btnDrawRegion.ForeColor = System.Drawing.Color.White;
this.btnDrawRegion.Name = "btnDrawRegion";
this.btnDrawRegion.UseVisualStyleBackColor = false;
@ -176,9 +182,9 @@
//
// btnSaveRegion
//
resources.ApplyResources(this.btnSaveRegion, "btnSaveRegion");
this.btnSaveRegion.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
this.btnSaveRegion.FlatAppearance.BorderColor = System.Drawing.Color.White;
resources.ApplyResources(this.btnSaveRegion, "btnSaveRegion");
this.btnSaveRegion.ForeColor = System.Drawing.Color.White;
this.btnSaveRegion.Name = "btnSaveRegion";
this.btnSaveRegion.UseVisualStyleBackColor = false;
@ -204,9 +210,9 @@
//
// txtTurnoverTrayHaveOrNotGrayArea
//
resources.ApplyResources(this.txtTurnoverTrayHaveOrNotGrayArea, "txtTurnoverTrayHaveOrNotGrayArea");
this.txtTurnoverTrayHaveOrNotGrayArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16)))));
this.txtTurnoverTrayHaveOrNotGrayArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.txtTurnoverTrayHaveOrNotGrayArea, "txtTurnoverTrayHaveOrNotGrayArea");
this.txtTurnoverTrayHaveOrNotGrayArea.ForeColor = System.Drawing.Color.White;
this.txtTurnoverTrayHaveOrNotGrayArea.Name = "txtTurnoverTrayHaveOrNotGrayArea";
this.txtTurnoverTrayHaveOrNotGrayArea.Tag = "";
@ -214,9 +220,9 @@
//
// txtTurnoverTrayHaveOrNotGrayMin
//
resources.ApplyResources(this.txtTurnoverTrayHaveOrNotGrayMin, "txtTurnoverTrayHaveOrNotGrayMin");
this.txtTurnoverTrayHaveOrNotGrayMin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16)))));
this.txtTurnoverTrayHaveOrNotGrayMin.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.txtTurnoverTrayHaveOrNotGrayMin, "txtTurnoverTrayHaveOrNotGrayMin");
this.txtTurnoverTrayHaveOrNotGrayMin.ForeColor = System.Drawing.Color.White;
this.txtTurnoverTrayHaveOrNotGrayMin.Name = "txtTurnoverTrayHaveOrNotGrayMin";
this.txtTurnoverTrayHaveOrNotGrayMin.Tag = "";
@ -230,15 +236,15 @@
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.hWindow_Final1);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// hWindow_Final1
//
resources.ApplyResources(this.hWindow_Final1, "hWindow_Final1");
this.hWindow_Final1.BackColor = System.Drawing.Color.Blue;
this.hWindow_Final1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.hWindow_Final1, "hWindow_Final1");
this.hWindow_Final1.DrawModel = false;
this.hWindow_Final1.ForeColor = System.Drawing.Color.White;
this.hWindow_Final1.Image = null;
@ -246,15 +252,15 @@
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Controls.Add(this.panel2);
this.panel1.Controls.Add(this.groupBox2);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.tableLayoutPanel1);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// tableLayoutPanel1
@ -265,15 +271,14 @@
//
// gboxPoints
//
resources.ApplyResources(this.gboxPoints, "gboxPoints");
this.gboxPoints.Controls.Add(this.dgvBasePoints);
resources.ApplyResources(this.gboxPoints, "gboxPoints");
this.gboxPoints.ForeColor = System.Drawing.Color.White;
this.gboxPoints.Name = "gboxPoints";
this.gboxPoints.TabStop = false;
//
// dgvBasePoints
//
resources.ApplyResources(this.dgvBasePoints, "dgvBasePoints");
this.dgvBasePoints.AllowUserToAddRows = false;
this.dgvBasePoints.AllowUserToDeleteRows = false;
this.dgvBasePoints.AllowUserToResizeColumns = false;
@ -283,6 +288,7 @@
this.dgvBasePoints.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvBasePoints.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvBasePoints.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36)))));
resources.ApplyResources(this.dgvBasePoints, "dgvBasePoints");
this.dgvBasePoints.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Index,
this.X,
@ -358,18 +364,18 @@
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.trayStock);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.ForeColor = System.Drawing.Color.White;
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// trayStock
//
resources.ApplyResources(this.trayStock, "trayStock");
this.trayStock.CanDraw = true;
this.trayStock.ColSpace = 10;
this.trayStock.ColumnNum = 8;
resources.ApplyResources(this.trayStock, "trayStock");
this.trayStock.HeadText = "TurnoverTray";
this.trayStock.InitSlotStatus = Rs.Controls.ESlotStatus.NotHave;
this.trayStock.ItemName = null;
@ -391,31 +397,49 @@
//
// contextMenuStrip1
//
resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1");
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.goToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1");
//
// goToolStripMenuItem
//
resources.ApplyResources(this.goToolStripMenuItem, "goToolStripMenuItem");
this.goToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.moveToolStripMenuItem9,
this.grabPosToolStripMenuItem});
this.goToolStripMenuItem.Name = "goToolStripMenuItem";
resources.ApplyResources(this.goToolStripMenuItem, "goToolStripMenuItem");
//
// moveToolStripMenuItem9
//
resources.ApplyResources(this.moveToolStripMenuItem9, "moveToolStripMenuItem9");
this.moveToolStripMenuItem9.Name = "moveToolStripMenuItem9";
resources.ApplyResources(this.moveToolStripMenuItem9, "moveToolStripMenuItem9");
this.moveToolStripMenuItem9.Click += new System.EventHandler(this.goToolStripMenuItem_Click);
//
// grabPosToolStripMenuItem
//
resources.ApplyResources(this.grabPosToolStripMenuItem, "grabPosToolStripMenuItem");
this.grabPosToolStripMenuItem.Name = "grabPosToolStripMenuItem";
resources.ApplyResources(this.grabPosToolStripMenuItem, "grabPosToolStripMenuItem");
this.grabPosToolStripMenuItem.Click += new System.EventHandler(this.goToolStripMenuItem_Click);
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// lblSN
//
resources.ApplyResources(this.lblSN, "lblSN");
this.lblSN.Name = "lblSN";
//
// btnCheckSn
//
this.btnCheckSn.ForeColor = System.Drawing.Color.Black;
resources.ApplyResources(this.btnCheckSn, "btnCheckSn");
this.btnCheckSn.Name = "btnCheckSn";
this.btnCheckSn.UseVisualStyleBackColor = true;
this.btnCheckSn.Click += new System.EventHandler(this.btnCheckSn_Click);
//
// TurnoverTrayHaveOrNot
//
resources.ApplyResources(this, "$this");
@ -477,5 +501,8 @@
private System.Windows.Forms.ToolStripMenuItem moveToolStripMenuItem9;
private System.Windows.Forms.Label lblProductCheckResult;
private System.Windows.Forms.ToolStripMenuItem grabPosToolStripMenuItem;
private System.Windows.Forms.Button btnCheckSn;
private System.Windows.Forms.Label lblSN;
private System.Windows.Forms.Label label4;
}
}

@ -1,5 +1,6 @@
using ChoiceTech.Halcon.Control;
using HalconDotNet;
using NPOI.SS.Formula.Functions;
using Rs.Camera;
using Rs.Controls;
using Rs.DataAccess;
@ -228,5 +229,26 @@ namespace Rs.MotionPlat.Recipe
((DataGridView)sender).Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.FromArgb(11, 16, 36);
}
}
private void btnCheckSn_Click(object sender, EventArgs e)
{
if(hWindow_Final1.Image!=null)
{
string sn = VisionManager.FindCode(hWindow_Final1.Image, null);
if (string.IsNullOrEmpty(sn))
{
lblSN.Text = "";
}
else
{
lblSN.Text = sn;
}
}
else
{
Msg.ShowError("No image,please take a picture!");
}
}
}
}

File diff suppressed because it is too large Load Diff

@ -224,6 +224,8 @@
<Compile Include="Flow\MonitorSystemButton.cs" />
<Compile Include="Flow\SubFlow\CleanOutFlow.cs" />
<Compile Include="Flow\SubFlow\FiberWarningPressFlow.cs" />
<Compile Include="Flow\SubFlow\ManualPressDownFlow.cs" />
<Compile Include="Flow\SubFlow\ManualPressUpFlow.cs" />
<Compile Include="Flow\SubFlow\NgTrayToInputTrayFlow.cs" />
<Compile Include="Flow\SubFlow\SocketVacCheck.cs" />
<Compile Include="Flow\SubFlow\TestFixtureVacSuctionCheckFlow.cs" />

File diff suppressed because it is too large Load Diff

@ -2,6 +2,7 @@
using Rs.Framework;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow;
using Rs.MotionPlat.Flow.SubFlow;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -247,5 +248,19 @@ namespace Rs.MotionPlat.SysConfig
Ops.Off($"测试{i}号穴位真空破");
}
}
private void btnUp_Click(object sender, EventArgs e)
{
Task.Run(() => {
ManualPressUpFlow.Instance.Up();
});
}
private void btnDown_Click(object sender, EventArgs e)
{
Task.Run(() => {
ManualPressDownFlow.Instance.Down();
});
}
}
}

File diff suppressed because it is too large Load Diff

@ -64,9 +64,6 @@
this.button29 = new System.Windows.Forms.Button();
this.button28 = new System.Windows.Forms.Button();
this.button30 = new System.Windows.Forms.Button();
this.button31 = new System.Windows.Forms.Button();
this.button32 = new System.Windows.Forms.Button();
this.ioStatus1 = new Rs.Controls.IOStatus();
this.SuspendLayout();
//
// btnTurnoverSlotException
@ -422,60 +419,20 @@
//
// button30
//
this.button30.Location = new System.Drawing.Point(1105, 506);
this.button30.Location = new System.Drawing.Point(368, 710);
this.button30.Name = "button30";
this.button30.Size = new System.Drawing.Size(75, 23);
this.button30.Size = new System.Drawing.Size(91, 23);
this.button30.TabIndex = 8;
this.button30.Text = "button30";
this.button30.Text = "选择正确的";
this.button30.UseVisualStyleBackColor = true;
this.button30.Visible = false;
this.button30.Click += new System.EventHandler(this.button30_Click);
//
// button31
//
this.button31.Location = new System.Drawing.Point(1086, 639);
this.button31.Name = "button31";
this.button31.Size = new System.Drawing.Size(75, 23);
this.button31.TabIndex = 9;
this.button31.Text = "敲击";
this.button31.UseVisualStyleBackColor = true;
this.button31.Click += new System.EventHandler(this.button31_Click);
//
// button32
//
this.button32.Location = new System.Drawing.Point(540, 732);
this.button32.Name = "button32";
this.button32.Size = new System.Drawing.Size(75, 23);
this.button32.TabIndex = 10;
this.button32.Text = "button32";
this.button32.UseVisualStyleBackColor = true;
this.button32.Click += new System.EventHandler(this.button32_Click);
//
// ioStatus1
//
this.ioStatus1.Disabled = false;
this.ioStatus1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.ioStatus1.IoID = ((ushort)(0));
this.ioStatus1.IoNO = ((ushort)(0));
this.ioStatus1.Location = new System.Drawing.Point(447, 169);
this.ioStatus1.Name = "ioStatus1";
this.ioStatus1.Passed = false;
this.ioStatus1.Radius = 5;
this.ioStatus1.Reverse = false;
this.ioStatus1.ShowNo = true;
this.ioStatus1.Size = new System.Drawing.Size(168, 36);
this.ioStatus1.Status = 1;
this.ioStatus1.TabIndex = 11;
this.ioStatus1.Text = "fsdfad";
this.ioStatus1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TestFrm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1336, 854);
this.Controls.Add(this.ioStatus1);
this.Controls.Add(this.button32);
this.Controls.Add(this.button31);
this.Controls.Add(this.button30);
this.Controls.Add(this.button28);
this.Controls.Add(this.button29);
@ -556,8 +513,5 @@
private System.Windows.Forms.Button button29;
private System.Windows.Forms.Button button28;
private System.Windows.Forms.Button button30;
private System.Windows.Forms.Button button31;
private System.Windows.Forms.Button button32;
private Controls.IOStatus ioStatus1;
}
}

@ -2,6 +2,9 @@
using Rs.Controls;
using Rs.Framework;
using Rs.Motion;
using Rs.Motion.Base;
using Rs.Motion.GugaoPulse;
using Rs.Motion.Ztm;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Entitys.Trays;
@ -449,51 +452,63 @@ namespace Rs.MotionPlat
private void button30_Click(object sender, EventArgs e)
{
Task.Run(() =>
List<IIOCard> cards = IoManager.Instance.GetCards();
foreach (var item in cards)
{
SlotProductHasOrNotResult haveProduct = UpCameraCheckFlow.Instance.CheckStockTrayHasProduct(ETrayType.Input, 2, true);
//OnStockTrayProductHasOrNotResult?.Invoke(haveProduct);
});
}
private void button31_Click(object sender, EventArgs e)
{
TrayShake.ShakeAsync(ETrayType.Input);
}
private void button32_Click(object sender, EventArgs e)
{
TurnoverTrayManager.Instance.Slot(1).SN = "1";
TurnoverTrayManager.Instance.Slot(2).SN = "2";
TurnoverTrayManager.Instance.Slot(3).SN = "1";
TurnoverTrayManager.Instance.Slot(4).SN = "3";
TurnoverTrayManager.Instance.Slot(5).SN = "4";
TurnoverTrayManager.Instance.Slot(6).SN = "5";
TurnoverTrayManager.Instance.Slot(7).SN = "2";
TurnoverTrayManager.Instance.Slot(8).SN = "7";
List<TurnoverTraySlot> slotList= new List<TurnoverTraySlot>();
slotList.Add(TurnoverTrayManager.Instance.Slot(1));
slotList.Add(TurnoverTrayManager.Instance.Slot(2));
slotList.Add(TurnoverTrayManager.Instance.Slot(3));
slotList.Add(TurnoverTrayManager.Instance.Slot(4));
slotList.Add(TurnoverTrayManager.Instance.Slot(5));
slotList.Add(TurnoverTrayManager.Instance.Slot(6));
slotList.Add(TurnoverTrayManager.Instance.Slot(7));
slotList.Add(TurnoverTrayManager.Instance.Slot(8));
string filename = $"D:\\work\\Rs.SkyLine\\Rs.SkyLine\\bin\\Debug\\IO_ShowEnName\\{item.Vender.Replace("Pulse","")}{item.CardID}.xml";
if(item.Vender=="ztm")
{
ZtmIOCard iocard = new ZtmIOCard();
XmlSerializerHelper.Instance.Deserialize<ZtmIOCard>(filename, out iocard);
if(iocard!=null)
{
foreach (var iioin in iocard.DIn)
{
var ent = item.DIn.Where(i => i.Name == iioin.Name).FirstOrDefault();
if(ent!=null)
{
ent.ShowEnName = iioin.ShowEnName;
}
}
foreach (var iioout in iocard.DOut)
{
var ent = item.DOut.Where(i => i.Name == iioout.Name).FirstOrDefault();
if (ent != null)
{
ent.ShowEnName = iioout.ShowEnName;
}
}
}
}
else
{
GLinkIOCard iocard = new GLinkIOCard();
XmlSerializerHelper.Instance.Deserialize<GLinkIOCard>(filename, out iocard);
if (iocard != null)
{
foreach (var iioin in iocard.DIn)
{
var ent = item.DIn.Where(i => i.Name == iioin.Name).FirstOrDefault();
if (ent != null)
{
ent.ShowEnName = iioin.ShowEnName;
}
}
var gb = slotList.GroupBy(s => s.SN).Where(aa=>aa.Count()>=2).ToList();
List<string> repeatMsg = new List<string>();
foreach (var item in gb)
{
string repeatSnSlot = string.Join(" eq ", item.Select(s => s.Index));
repeatMsg.Add(repeatSnSlot);
foreach (var iioout in iocard.DOut)
{
var ent = item.DOut.Where(i => i.Name == iioout.Name).FirstOrDefault();
if (ent != null)
{
ent.ShowEnName = iioout.ShowEnName;
}
}
}
}
item.Save();
}
string msg = string.Join(",", repeatMsg);
}
}
}

Loading…
Cancel
Save