You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AUCMA_SCADA/Aucma.Core.Palletiz/Views/HandPalletizView.xaml.cs

182 lines
5.7 KiB
C#

using Admin.Core.Model;
using Aucma.Core.Palletiz.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Aucma.Core.Palletiz.Views
{
/// <summary>
/// DirectionItemWindow.xaml 的交互逻辑
/// </summary>
public partial class HandPalletizView : Window
{
private string store = "A";
private int space = 1;
/// <summary>
/// 货道分流
/// </summary>
private string spaceDirection = "左";
/// <summary>
/// 转向角度
/// </summary>
private int range = 90;
public HandPalletizView()
{
InitializeComponent();
this.DataContext = new HandPalletizViewModel();
}
#region 所属仓库选择
private void btn_A_Click(object sender, RoutedEventArgs e)
{
this.btn_A.Background = Brushes.Lime;
this.btn_B.Background = Brushes.DarkCyan;
store = "A";
}
private void btn_B_Click(object sender, RoutedEventArgs e)
{
this.btn_A.Background = Brushes.DarkCyan;
this.btn_B.Background = Brushes.Lime;
store = "B";
}
#endregion
#region 目的货道选择
private void btn_space1_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.Lime;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.DarkCyan;
space = 1;
}
private void btn_space2_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.DarkCyan;
btn_space2.Background = Brushes.Lime;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.DarkCyan;
space = 2;
}
private void btn_space3_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.DarkCyan;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.Lime;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.DarkCyan;
space = 3;
}
private void btn_space4_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.DarkCyan;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.Lime;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.DarkCyan;
space = 4;
}
private void btn_space5_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.DarkCyan;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.Lime;
btn_space6.Background = Brushes.DarkCyan;
space = 5;
}
private void btn_space6_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.DarkCyan;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.Lime;
space = 6;
}
#endregion
#region 货道分流选择
private void btn_left_Click(object sender, RoutedEventArgs e)
{
btn_left.Background = Brushes.Lime;
btn_right.Background = Brushes.DarkCyan;
spaceDirection = "左";
}
private void btn_right_Click(object sender, RoutedEventArgs e)
{
btn_left.Background = Brushes.DarkCyan;
btn_right.Background = Brushes.Lime;
spaceDirection = "右";
}
#endregion
#region 转向角度设置Brushes.DarkCyan
private void btn_range90_Click(object sender, RoutedEventArgs e)
{
btn_range90.Background = Brushes.Lime;
btn_range180.Background = Brushes.DarkCyan;
//btn_range270.Background = Brushes.DarkCyan;
range = 90;
}
private void btn_range180_Click(object sender, RoutedEventArgs e)
{
btn_range90.Background = Brushes.DarkCyan;
btn_range180.Background = Brushes.Lime;
// btn_range270.Background = Brushes.DarkCyan;
range = 180;
}
private void btn_range270_Click(object sender, RoutedEventArgs e)
{
btn_range90.Background = Brushes.DarkCyan;
btn_range180.Background = Brushes.DarkCyan;
//btn_range270.Background = Brushes.Lime;
range = 270;
}
#endregion
private void Button_Click_1(object sender, RoutedEventArgs e)
{
this.window.Close();
}
}
}