增加在空跑时是否启用料仓

master
lhiven 1 year ago
parent eaeb63b0c3
commit 7ab3cb19d2

@ -22,6 +22,19 @@ namespace Rs.Framework
{
#region newpro
/// <summary>
/// 启用料仓
/// </summary>
[ParameterInit("bool", "true", "system", "启用料仓")]
public static bool EnableStock
{
get
{
return SysConfigParam.GetValue<bool>(nameof(EnableStock));
}
}
public static ECardMode CardMode
{
get;

@ -189,7 +189,16 @@ namespace Rs.MotionPlat.Flow
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
flowStep = EDischargeFlowStep.;
if(GlobalVar.RunSpace&&!GlobalVar.EnableStock)
{
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
flowStep = EDischargeFlowStep.;
}
else
{
flowStep = EDischargeFlowStep.;
}
}
else if(button== EButtonType.Cancel)
{
@ -274,106 +283,55 @@ namespace Rs.MotionPlat.Flow
}
else
{
//换料盘
//GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
//先判断是否时最后一盘料,如果时最后一盘料,则提示客户换料
//if(Stock2Flow.Instance.GetCurrentLayer()==1)
if(StockManager.GetCurrentLayer(2)==1)
if(GlobalVar.RunSpace&&!GlobalVar.EnableStock)
{
EButtonType btn = Msgbox.ShowTipDialog( EButtonType.Retry| EButtonType.EndInput,"Please change tray","tip",true);
if(btn== EButtonType.Retry)
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
takeSlotIndex = 1;
}
else
{
//换料盘
//GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
//先判断是否时最后一盘料,如果时最后一盘料,则提示客户换料
//if(Stock2Flow.Instance.GetCurrentLayer()==1)
if (StockManager.GetCurrentLayer(2) == 1)
{
EButtonType btn = Msgbox.ShowTipDialog(EButtonType.Retry | EButtonType.EndInput, "Please change tray", "tip", true);
if (btn == EButtonType.Retry)
{
//先把轴移动到安全位
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
//TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
//Stock2Flow.Instance.PrepareTray();
StockManager.PrepareTray(2);
TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
}
else if (btn == EButtonType.EndInput)
{
GlobalVar.Clear = true;
}
}
else
{
//先把轴移动到安全位
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
//TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
//Stock2Flow.Instance.PrepareTray();
StockManager.PrepareTray(2);
TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
}
else if(btn== EButtonType.EndInput)
{
GlobalVar.Clear = true;
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
takeSlotIndex = 1;
}
}
else
{
//先把轴移动到安全位
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
takeSlotIndex = 1;
}
}
}
break;
case EDischargeFlowStep.:
if(GlobalVar.RunSpace)
ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex);
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
if (productLocationResult != null || GlobalVar.RunSpace)
{
//对结果进行处理
flowStep = EDischargeFlowStep.;
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
}
else
{
ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex);
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
if (productLocationResult != null)
{
//foreach (ProductLocationResult item in results)
//{
// if(item.Result== EOneGrabSixteenResult.Slant || item.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail)
// {
// bool exit = false;
// while (!exit)
// {
// //凡是定位失败的,需要定位重拍
// ProductLocationResult vr = FixedGrabProductFlow.Instance.Grab(ETrayType.Input, item.SlotIndex);
// if (vr.Result == EOneGrabSixteenResult.Ok)//拍照OK
// {
// item.Change(vr.SN, vr.OffsetX, vr.OffsetY);
// exit = true;
// }
// else if (vr.Result == EOneGrabSixteenResult.Slant)//拍照失败
// {
// //报警弹框
// EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Skip| EButtonType.Retry, $"穴位{item.SlotIndex}定位失败,请把产品手动取走后点击跳过");
// if (buttonSelect == EButtonType.Skip)
// {
// GlobalTray.InputTray.ChangeStatus(item.SlotIndex, ESlotStatus.NotHave);
// exit = true;
// }
// }
// else if (vr.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)//定位成功,拍照失败
// {
// //这里需要把产品取到拍照NG料盘中
// //取料
// Nozzle idleNozzle = NozzleManager.GetIdelNozzle();
// StockTakeFlow.Instance.Take(item.SlotIndex, idleNozzle.NozzleIndex);
// //放料
// TraySlot noProductSlot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave);
// if (noProductSlot != null)
// {
// StockPlaceFlow.Instance.Place(ETrayType.ReTest, noProductSlot.Index, idleNozzle.NozzleIndex);
// }
// else
// {
// Msgbox.ShowDialog(EButtonType.Ok, "Retest料盘已放满请更换料盘更换完成后点击确定");
// GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
// ThreePointLocationFlow.Instance.Location(ETrayType.ReTest);
// //放料
// noProductSlot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave);
// StockPlaceFlow.Instance.Place(ETrayType.ReTest, noProductSlot.Index, idleNozzle.NozzleIndex);
// }
// exit = true;
// }
// }
// }
//}
//对结果进行处理
flowStep = EDischargeFlowStep.;
}
}
break;
case EDischargeFlowStep.:
ProductLocationResult ret = productLocationResult.Where(r => r.SlotIndex == takeSlotIndex).FirstOrDefault();
@ -720,10 +678,19 @@ namespace Rs.MotionPlat.Flow
//{
// DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock);
//}
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok, true, true);
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
ThreePointLocationFlow.Instance.Location(ETrayType.Ok);
if(GlobalVar.RunSpace&& !GlobalVar.EnableStock)
{
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
ThreePointLocationFlow.Instance.Location(ETrayType.Ok);
}
else
{
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok, true, true);
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
ThreePointLocationFlow.Instance.Location(ETrayType.Ok);
}
//料盘已满
}
}
@ -768,10 +735,18 @@ namespace Rs.MotionPlat.Flow
}
else
{
//提示更换料盘
Msgbox.ShowTipDialog(EButtonType.Ok, "NG tray full,please change tray and click ok button", "tip", true);
ThreePointLocationFlow.Instance.Location(ETrayType.Ng);
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
if (GlobalVar.RunSpace && !GlobalVar.EnableStock)
{
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
}
else
{
//提示更换料盘
Msgbox.ShowTipDialog(EButtonType.Ok, "NG tray full,please change tray and click ok button", "tip", true);
ThreePointLocationFlow.Instance.Location(ETrayType.Ng);
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
}
}
}
}

@ -39,6 +39,7 @@
this.cboxVirtualAxis = new System.Windows.Forms.CheckBox();
this.cboxCheckSafeEnable = new System.Windows.Forms.CheckBox();
this.cboxEnableIndexTimeStatistics = new System.Windows.Forms.CheckBox();
this.cboxEnableStock = new System.Windows.Forms.CheckBox();
this.cboxRunSpace = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.btnSaveRelCategory = new System.Windows.Forms.Button();
@ -149,6 +150,7 @@
this.groupBox8.Controls.Add(this.cboxVirtualAxis);
this.groupBox8.Controls.Add(this.cboxCheckSafeEnable);
this.groupBox8.Controls.Add(this.cboxEnableIndexTimeStatistics);
this.groupBox8.Controls.Add(this.cboxEnableStock);
this.groupBox8.Controls.Add(this.cboxRunSpace);
resources.ApplyResources(this.groupBox8, "groupBox8");
this.groupBox8.ForeColor = System.Drawing.Color.White;
@ -215,6 +217,13 @@
this.cboxEnableIndexTimeStatistics.UseVisualStyleBackColor = true;
this.cboxEnableIndexTimeStatistics.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged);
//
// cboxEnableStock
//
resources.ApplyResources(this.cboxEnableStock, "cboxEnableStock");
this.cboxEnableStock.Name = "cboxEnableStock";
this.cboxEnableStock.UseVisualStyleBackColor = true;
this.cboxEnableStock.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged);
//
// cboxRunSpace
//
resources.ApplyResources(this.cboxRunSpace, "cboxRunSpace");
@ -934,5 +943,6 @@
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnSaveRelCategory;
private System.Windows.Forms.CheckBox cboxEnableStock;
}
}

@ -94,7 +94,7 @@ namespace Rs.MotionPlat.SysConfig
PositionHelper.BindPosition(groupBox8);
if(GlobalUser.IsVender() || GlobalUser.IsSuper())
{
cboxRunSpace.Visible = cboxVirtualAxis.Visible = cboxEnableVirtuleBarCode.Visible = cboxInputTrayLoop.Visible = cboxCheckSafeEnable.Visible = cboxEnableIndexTimeStatistics.Visible = true;
cboxEnableStock.Visible = cboxRunSpace.Visible = cboxVirtualAxis.Visible = cboxEnableVirtuleBarCode.Visible = cboxInputTrayLoop.Visible = cboxCheckSafeEnable.Visible = cboxEnableIndexTimeStatistics.Visible = true;
}
dataGridView1.AutoGenerateColumns = false;
BindMenu();

@ -384,6 +384,39 @@
<data name="&gt;&gt;cboxEnableIndexTimeStatistics.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="cboxEnableStock.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cboxEnableStock.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cboxEnableStock.Location" type="System.Drawing.Point, System.Drawing">
<value>174, 224</value>
</data>
<data name="cboxEnableStock.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value>
</data>
<data name="cboxEnableStock.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="cboxEnableStock.Text" xml:space="preserve">
<value>是否启用料仓</value>
</data>
<data name="cboxEnableStock.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;cboxEnableStock.Name" xml:space="preserve">
<value>cboxEnableStock</value>
</data>
<data name="&gt;&gt;cboxEnableStock.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboxEnableStock.Parent" xml:space="preserve">
<value>groupBox8</value>
</data>
<data name="&gt;&gt;cboxEnableStock.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="cboxRunSpace.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -415,7 +448,7 @@
<value>groupBox8</value>
</data>
<data name="&gt;&gt;cboxRunSpace.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="groupBox8.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -2686,6 +2719,6 @@
<value>CommonConfig</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=1.20.24.9, Culture=neutral, PublicKeyToken=null</value>
<value>Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=1.20.24.10, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
Loading…
Cancel
Save