|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561 |
- 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); }));
- }
- }
- }
|