|
@@ -42,12 +42,19 @@ namespace SCADA_DAQ.Customer
|
|
|
/// </summary>
|
|
|
public List<StackSlnModel> StackSlnList { get; set; }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
public UctFrmPalletizingManual()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
ToolBar.Visibility = Visibility.Collapsed;
|
|
|
plc = MachineServer.GetInstance().GetMachine<SampleMachine>("Device1");
|
|
|
AxisGroup.SetMacBinding(plc);
|
|
|
+
|
|
|
+ plc.CaptureFinished += Plc_CaptureFinished;
|
|
|
+ plc.StackStarted += Plc_StackStarted; ;
|
|
|
+ plc.StackFinished += Plc_StackFinished; ;
|
|
|
//Stacksln.Text = "码垛方案:";
|
|
|
//BoardWidth.Value = "0.0";
|
|
|
//BoardWidth.TitleValue = "栈板宽度:";
|
|
@@ -99,6 +106,45 @@ namespace SCADA_DAQ.Customer
|
|
|
stackParameter.PropertyChanged += StackParameter_PropertyChanged;
|
|
|
}
|
|
|
|
|
|
+ private void Plc_StackFinished(object sender, StackFinishEventArgs e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Plc_StackStarted(object sender, StackStartEventArgs e)
|
|
|
+ {
|
|
|
+ Dispatcher.Invoke(() =>
|
|
|
+ {
|
|
|
+ D3_Stack.Clear();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Plc_CaptureFinished(object sender, CaputerFinishEventArgs e)
|
|
|
+ {
|
|
|
+ Dispatcher.Invoke(() =>
|
|
|
+ {
|
|
|
+ D3_Stack.Add3DBox(new StackBoxModel()
|
|
|
+ {
|
|
|
+ BoxHeight = stackParameter.BoxHeight,
|
|
|
+ BoxLabel = "三倍",
|
|
|
+ BoxLength = stackParameter.BoxLength,
|
|
|
+ BoxWidth = stackParameter.BoxWidth,
|
|
|
+ LabelLocation = stackParameter.LableLocation,
|
|
|
+ CaptureInfo = e.CurrentCapture
|
|
|
+ //Width=stackParameter.BoardWidth,
|
|
|
+ //Height=stackParameter.BoardLength,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ protected override void CloseThis()
|
|
|
+ {
|
|
|
+ base.CloseThis();
|
|
|
+ plc.CaptureFinished -= Plc_CaptureFinished;
|
|
|
+ }
|
|
|
private void StackParameter_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
|
{
|
|
|
if (e.PropertyName == nameof(stackParameter.SlnName))
|
|
@@ -110,7 +156,13 @@ namespace SCADA_DAQ.Customer
|
|
|
plc.SetSln(sln);
|
|
|
|
|
|
var stack = new StackManage();
|
|
|
- var layer1 = stack.CreateLayout(null, stackParameter, 32, sln.LayoutId);
|
|
|
+ var boxSource = new List<StackBoxModel>();
|
|
|
+ for (int i = 0; i < 32; i++)
|
|
|
+ {
|
|
|
+ boxSource.Add(new StackBoxModel());
|
|
|
+ }
|
|
|
+ var layer1 = stack.CreateLayout(boxSource, stackParameter, 32, sln.LayoutId);
|
|
|
+ layer1 = stack.GetBestLayerBoxs(layer1, stackParameter);
|
|
|
board1.Init(stackParameter, layer1);
|
|
|
}
|
|
|
}
|