添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
using MainShell.Common;
|
||||
using MainShell.Models;
|
||||
using MainShell.Process;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.Manual.Model
|
||||
{
|
||||
[Export(typeof(IParameter))]
|
||||
public class DieBondingManualSetting : ParameterBase
|
||||
{
|
||||
public DieBondingManualSysItem DieBondingManualSysItem { get; set; } = new DieBondingManualSysItem();
|
||||
|
||||
public override void Copy(IParameter source)
|
||||
{
|
||||
if (source is DieBondingManualSetting item)
|
||||
{
|
||||
this.DieBondingManualSysItem = item.DieBondingManualSysItem.Clone() as DieBondingManualSysItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DieBondingManualSysItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private RegionModel _substrateRegion = new RegionModel();
|
||||
|
||||
public RegionModel SubstrateRegion
|
||||
{
|
||||
get { return _substrateRegion; }
|
||||
set { SetAndNotify(ref _substrateRegion, value); }
|
||||
}
|
||||
|
||||
private RegionModel _dieRegion = new RegionModel();
|
||||
|
||||
public RegionModel DieRegion
|
||||
{
|
||||
get { return _dieRegion; }
|
||||
set { SetAndNotify(ref _dieRegion, value); }
|
||||
}
|
||||
|
||||
private TransPathType _transPathType = TransPathType.Sequence;
|
||||
|
||||
public TransPathType TransPathType
|
||||
{
|
||||
get { return _transPathType; }
|
||||
set { SetAndNotify(ref _transPathType, value); }
|
||||
}
|
||||
|
||||
private DieTransferRowTraversalStrategy _padRowDirectionStrategy = DieTransferRowTraversalStrategy.AllPositive;
|
||||
|
||||
public DieTransferRowTraversalStrategy PadRowDirectionStrategy
|
||||
{
|
||||
get { return _padRowDirectionStrategy; }
|
||||
set { SetAndNotify(ref _padRowDirectionStrategy, value); }
|
||||
}
|
||||
|
||||
private DieTransferRowTraversalStrategy _dieRowDirectionStrategy = DieTransferRowTraversalStrategy.Serpentine;
|
||||
|
||||
public DieTransferRowTraversalStrategy DieRowDirectionStrategy
|
||||
{
|
||||
get { return _dieRowDirectionStrategy; }
|
||||
set { SetAndNotify(ref _dieRowDirectionStrategy, value); }
|
||||
}
|
||||
|
||||
//使用自动计算芯片模式
|
||||
private bool _autoDieRegionModeEnable = false;
|
||||
|
||||
public bool AutoDieRegionModeEnable
|
||||
{
|
||||
get { return _autoDieRegionModeEnable; }
|
||||
set { SetAndNotify(ref _autoDieRegionModeEnable, value); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return new DieBondingManualSysItem()
|
||||
{
|
||||
SubstrateRegion = this.SubstrateRegion.Clone() as RegionModel,
|
||||
DieRegion = this.DieRegion.Clone() as RegionModel,
|
||||
TransPathType = this.TransPathType,
|
||||
PadRowDirectionStrategy = this.PadRowDirectionStrategy,
|
||||
DieRowDirectionStrategy = this.DieRowDirectionStrategy,
|
||||
AutoDieRegionModeEnable = this.AutoDieRegionModeEnable
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using MainShell.Common;
|
||||
using MainShell.Alarm;
|
||||
using MainShell.Process;
|
||||
using MainShell.Recipe.Models;
|
||||
using MW.WorkFlow;
|
||||
using StyletIoC;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace MainShell.Manual.Model
|
||||
{
|
||||
public abstract class OperateViewModelBase : CameraBaseViewModel
|
||||
{
|
||||
private const int WorkflowFaultAlarmId = 20000;
|
||||
|
||||
[Inject]
|
||||
public WorkflowRunner Runner { get; set; }
|
||||
|
||||
[Inject]
|
||||
public AlarmOperate AlarmOperate { get; set; }
|
||||
|
||||
|
||||
public virtual async Task StopProcess()
|
||||
{
|
||||
await Runner.StopAsync();
|
||||
}
|
||||
|
||||
protected async Task<WorkflowRunCompletedEventArgs> RunManualActivityAsync(IActivity activity, WorkflowContext context, bool showSuccessDialog = true)
|
||||
{
|
||||
var result = await Runner.RunActivityWithResultAsync(activity, context);
|
||||
ShowWorkflowResultDialog(result, context, activity != null ? activity.Name : null, showSuccessDialog);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected bool IsWorkflowCompleted(WorkflowRunCompletedEventArgs result)
|
||||
{
|
||||
return result != null && result.FinalState == WorkflowState.Completed;
|
||||
}
|
||||
|
||||
private void ShowWorkflowResultDialog(WorkflowRunCompletedEventArgs result, WorkflowContext context, string activityName, bool showSuccessDialog)
|
||||
{
|
||||
if (result == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CommonUti.RunOnUi(() =>
|
||||
{
|
||||
switch (result.FinalState)
|
||||
{
|
||||
case WorkflowState.Faulted:
|
||||
ShowWorkflowFaultAlarm(result, context, activityName);
|
||||
break;
|
||||
case WorkflowState.Canceled:
|
||||
MwMessageBox.Show("流程已取消!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
break;
|
||||
case WorkflowState.Completed:
|
||||
if (showSuccessDialog)
|
||||
{
|
||||
MwMessageBox.Show("流程执行成功。", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void ShowWorkflowFaultAlarm(WorkflowRunCompletedEventArgs result, WorkflowContext context, string activityName)
|
||||
{
|
||||
if (AlarmOperate == null)
|
||||
{
|
||||
MwMessageBox.Show("流程执行过程中发生异常!", result.Error, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
AlarmOperate.Alert(WorkflowFaultAlarmId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user