|
|
|
|
using Aucma.Core.Palletiz.Models;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using log4net;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public partial class HandPalletizViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(HandPalletizViewModel));
|
|
|
|
|
|
|
|
|
|
#region 货道信息
|
|
|
|
|
private int LevelNo = 1;
|
|
|
|
|
private int BinNo = 1;
|
|
|
|
|
private int PortNo = 1;
|
|
|
|
|
private int RangeNo = 1;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public static StackInfoModel TempStackInfo = new StackInfoModel();
|
|
|
|
|
|
|
|
|
|
public HandPalletizViewModel() {
|
|
|
|
|
PromptInfo("请选择信息下传......", "White");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 分垛信息下传
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分垛信息下传
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
public void Save()
|
|
|
|
|
{
|
|
|
|
|
PromptInfo("分垛信息下传中......", "White");
|
|
|
|
|
DialogResult cr = MessageBox.Show("是否确认下传分垛信息?", "系统提醒", MessageBoxButtons.OKCancel);
|
|
|
|
|
if (cr != DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
TempStackInfo.LevelNo = LevelNo;
|
|
|
|
|
TempStackInfo.BinNo = (BinNo - 1) * 2 + PortNo + ((LevelNo - 1) * 10);
|
|
|
|
|
TempStackInfo.PortNo = PortNo;
|
|
|
|
|
TempStackInfo.RangeNo = RangeNo;
|
|
|
|
|
|
|
|
|
|
bool backResult = true;// ControlStackingScan.DownLoadInInfo(TempStackInfo);
|
|
|
|
|
if (backResult)
|
|
|
|
|
{
|
|
|
|
|
PromptInfo("分垛信息下传成功!", "White");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PromptInfo("分垛信息下传失败!", "Red");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 提示信息
|
|
|
|
|
|
|
|
|
|
private string msgTxt;
|
|
|
|
|
|
|
|
|
|
public string MsgTxt
|
|
|
|
|
{
|
|
|
|
|
get => msgTxt;
|
|
|
|
|
set => SetProperty(ref msgTxt, value);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 字体颜色
|
|
|
|
|
|
|
|
|
|
private string? msgColor;
|
|
|
|
|
|
|
|
|
|
public string? MsgColor
|
|
|
|
|
{
|
|
|
|
|
get => msgColor;
|
|
|
|
|
set => SetProperty(ref msgColor, value);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 提示信息
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提示信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="mesg">提示信息</param>
|
|
|
|
|
/// <param name="color">提示信息颜色</param>
|
|
|
|
|
public void PromptInfo(string mesg, string color)
|
|
|
|
|
{
|
|
|
|
|
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
MsgTxt = mesg;
|
|
|
|
|
MsgColor = color;
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|