|
- using BPASmartClient.AGV;
- using BPA.Helper;
- using FryPot_DosingSystem.Control;
- using FryPot_DosingSystem.ViewModel;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- 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.Navigation;
- using System.Windows.Shapes;
-
- namespace FryPot_DosingSystem.View
- {
- /// <summary>
- /// DebugView.xaml 的交互逻辑
- /// </summary>
- public partial class DebugView : UserControl
- {
- public DebugView()
- {
- InitializeComponent();
- }
- string taskId = string.Empty;
- private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (sender is ComboBox cbo)
- {
- if (cbo.SelectedValue != null)
- {
- ActionManage.GetInstance.Send("EightWorkLoc",cbo.SelectedValue);
- }
- }
- }
-
- private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
- {
- if (sender is ComboBox cbo)
- {
- if (cbo.SelectedValue != null)
- {
- ActionManage.GetInstance.Send("TwoEightWorkLoc", cbo.SelectedValue);
- }
- }
- }
-
- private void ComboBox_SelectionChanged_2(object sender, SelectionChangedEventArgs e)
- {
- if (sender is ComboBox cbo)
- {
- if (cbo.SelectedValue != null)
- {
- ActionManage.GetInstance.Send("ThreeEightWorkLoc", cbo.SelectedValue);
- }
- }
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1060", 0);
- // AGVHelper.GetInstance.AgvFromLineOneToFryFourLoadRoller(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvToLineTwoLoadRoller(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_2(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvFromLineTwoToFryFiveLoadRoller(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_3(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvToLineThreeLoadRoller(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_4(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveFryPotOne(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_5(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveFryPotTwo(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_6(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveFryPotThree(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_7(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveFryPotFour(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_8(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveFryPotFive(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_9(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveLOneToClean(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_10(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveLTwoToClean(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_11(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvLeaveLThreeToClean(Guid.NewGuid().ToString("D"));
- }
-
- private void Button_Click_12(object sender, RoutedEventArgs e)
- {
- AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(Guid.NewGuid().ToString("D"));
-
- }
- /// <summary>
- /// 回桶线信号复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_13(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1067",0);
- }
- /// <summary>
- /// 空桶洗桶信号复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_14(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1065", 0);
- }
- /// <summary>
- /// 线体1AGV进料复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_15(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1052", 0);
- }
- /// <summary>
- /// 线体2AGV进料复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_16(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1053", 0);
- }
- /// <summary>
- /// 线体3AGV进料复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_17(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1054", 0);
- }
- /// <summary>
- /// 炒锅1进桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_18(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1055", 0);
- }
- /// <summary>
- /// 炒锅2进桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_19(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1056", 0);
- }
- /// <summary>
- /// 炒锅3进桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_20(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1057", 0);
- }
- /// <summary>
- /// 炒锅4进桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_21(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1058", 0);
- }
- /// <summary>
- /// 炒锅5进桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_22(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1059", 0);
- }
- /// <summary>
- /// 炒锅1出桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_23(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1060", 0);
- }
- /// <summary>
- /// 炒锅2出桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_24(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1061", 0);
- }
- /// <summary>
- /// 炒锅3出桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_25(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1062", 0);
- }
- /// <summary>
- /// 炒锅4出桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_26(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1063", 0);
- }
- /// <summary>
- /// 炒锅5出桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_27(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1064", 0);
- }
- /// <summary>
- /// 洗桶机出桶复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_28(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1066", 0);
- }
- /// <summary>
- /// 炒锅1空桶AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_29(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1060", 1);
- }
- /// <summary>
- /// 炒锅2空桶AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_30(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1061", 1);
- }
- /// <summary>
- /// 炒锅3空桶AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_31(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1062", 1);
- }
- /// <summary>
- /// 炒锅4空桶AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_32(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1063", 1);
- }
- /// <summary>
- /// 炒锅5空桶AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_33(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1064", 1);
- }
- /// <summary>
- /// 线体1AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_34(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1052", 1);
- }
- /// <summary>
- /// 线体2AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_35(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1053", 1);
- }
- /// <summary>
- /// 线体3AGV到位信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_36(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1054", 1);
- }
- /// <summary>
- /// 洗桶机出桶g
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_37(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1066", 1);
- }
- /// <summary>
- /// 炒锅1进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_38(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1055", 1);
- }
- /// <summary>
- /// 炒锅2进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_39(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1056", 1);
- }
- /// <summary>
- /// 炒锅3进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_40(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1057", 1);
- }
- /// <summary>
- /// 炒锅4进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_41(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1058", 1);
- }
- /// <summary>
- /// 炒锅5进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_42(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1059", 1);
- }
- /// <summary>
- /// 洗桶机进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_43(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1065", 1);
- }
- /// <summary>
- /// 回桶线进桶信号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_44(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1067", 1);
- }
- /// <summary>
- /// 炒锅1配方复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_45(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePotOnePlcData("D2999",1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotOnePlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅2配方复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_46(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅3配方复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_47(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePotThreePlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotThreePlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅4配方复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_48(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePotFourPlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotFourPlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅5配方复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_49(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePotFivePlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotFivePlcData("D2999", 0); }));
- }
- /// <summary>
- /// 线体1总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_50(object sender, RoutedEventArgs e)
- {
- ActionManage.GetInstance.Send("LineOneTaskExit");
- DeviceOperate.GetInstance.WritePlcData("D1052", 0);
- }
- /// <summary>
- /// 线体2总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_51(object sender, RoutedEventArgs e)
- {
- ActionManage.GetInstance.Send("LineTwoTaskExit");
- DeviceOperate.GetInstance.WritePlcData("D1053", 0);
- }
- /// <summary>
- /// 线体3总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_52(object sender, RoutedEventArgs e)
- {
- ActionManage.GetInstance.Send("LineThreeTaskExit");
- DeviceOperate.GetInstance.WritePlcData("D1054", 0);
- }
- /// <summary>
- /// 炒锅1信号总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_53(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1055", 0);
- DeviceOperate.GetInstance.WritePlcData("D1060", 0);
- DeviceOperate.GetInstance.WritePotOnePlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotOnePlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅2信号总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_54(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1056", 0);
- DeviceOperate.GetInstance.WritePlcData("D1061", 0);
- DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅3信号总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_55(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1057", 0);
- DeviceOperate.GetInstance.WritePlcData("D1062", 0);
- DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅4信号总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_56(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1058", 0);
- DeviceOperate.GetInstance.WritePlcData("D1063", 0);
- DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); }));
- }
- /// <summary>
- /// 炒锅5信号总复位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_57(object sender, RoutedEventArgs e)
- {
- DeviceOperate.GetInstance.WritePlcData("D1059", 0);
- DeviceOperate.GetInstance.WritePlcData("D1064", 0);
- DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1);
- Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); }));
- }
- }
- }
|