diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj index b5146049..3a68670b 100644 --- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj +++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj @@ -76,6 +76,7 @@ + @@ -88,6 +89,7 @@ + @@ -114,6 +116,7 @@ + @@ -186,6 +189,7 @@ + @@ -264,10 +268,12 @@ + + @@ -277,6 +283,7 @@ + @@ -296,6 +303,7 @@ + diff --git a/BPASmartClient.CustomResource/Image/textBox.png b/BPASmartClient.CustomResource/Image/textBox.png new file mode 100644 index 00000000..2231646c Binary files /dev/null and b/BPASmartClient.CustomResource/Image/textBox.png differ diff --git a/BPASmartClient.CustomResource/Image/光柱.png b/BPASmartClient.CustomResource/Image/光柱.png new file mode 100644 index 00000000..da3a0b42 Binary files /dev/null and b/BPASmartClient.CustomResource/Image/光柱.png differ diff --git a/BPASmartClient.CustomResource/Image/弹窗2.png b/BPASmartClient.CustomResource/Image/弹窗2.png new file mode 100644 index 00000000..6f69f62a Binary files /dev/null and b/BPASmartClient.CustomResource/Image/弹窗2.png differ diff --git a/BPASmartClient.CustomResource/Image/蓝边框.png b/BPASmartClient.CustomResource/Image/蓝边框.png new file mode 100644 index 00000000..61b3ac5a Binary files /dev/null and b/BPASmartClient.CustomResource/Image/蓝边框.png differ diff --git a/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs b/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs index 91b14921..3c19179c 100644 --- a/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs +++ b/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs @@ -12,45 +12,48 @@ namespace BPASmartClient.CustomResource.Pages.Model { } + /// /// 1 号滚筒线故障 /// - [Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort LOneRollerTrouble { get; set; } /// /// 2 号滚筒线故障 /// - [Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort LTwoRollerTrouble { get; set; } /// /// 3 号滚筒线故障 /// - [Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort LThreeRollerTrouble { get; set; } /// /// 1 号炒锅滚筒运行故障 /// - [Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort FryPotOneRollerTrouble { get; set; } /// /// 2 号炒锅滚筒运行故障 /// - [Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort FryPotTwoRollerTrouble { get; set; } /// /// 3 号炒锅滚筒运行故障 /// - [Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort FryPotThreeRollerTrouble { get; set; } /// /// 4 号炒锅滚筒运行故障 /// - [Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort FryPotFourRollerTrouble { get; set; } /// /// 5 号炒锅滚筒运行故障 /// - [Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] + [Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] public ushort FryPotFiveRollerTrouble { get; set; } + + } } diff --git a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs index 1db6aa44..f3b0efb4 100644 --- a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs +++ b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs @@ -9,23 +9,23 @@ using System.Threading.Tasks; namespace BPASmartClient.CustomResource.Pages.Model { - public class UserInfo:ObservableObject + public class UserInfo : ObservableObject { public String LastLogInTime { get; set; } = "无"; public List userTreeViewModels { get; set; } - public string Id { get { return _id; }set { _id = value;OnPropertyChanged(); } } + public string Id { get { return _id; } set { _id = value; OnPropertyChanged(); } } private string _id; - public Permission permission { get { return _perimission; } set { _perimission = value;OnPropertyChanged(); } } + public Permission permission { get { return _perimission; } set { _perimission = value; OnPropertyChanged(); } } private Permission _perimission; - public string UserName { get { return _userName; } set { _userName = value;OnPropertyChanged(); } } - private string _userName; + public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } } + private string _userName = "admin"; - public string Password { get { return _password; } set { _password = value;OnPropertyChanged(); } } - private string _password; + public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } } + private string _password = "admin"; public string CardId { get; set; } = String.Empty; diff --git a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml index 9abfd756..5247d35a 100644 --- a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml +++ b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml @@ -373,8 +373,9 @@ - - + + + + + + \ No newline at end of file diff --git a/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml new file mode 100644 index 00000000..12af351a --- /dev/null +++ b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml.cs b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml.cs new file mode 100644 index 00000000..f4651dac --- /dev/null +++ b/BPASmartClient.CustomResource/UserControls/BatchingMachine.xaml.cs @@ -0,0 +1,28 @@ +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.Navigation; +using System.Windows.Shapes; + +namespace BPASmartClient.CustomResource.UserControls +{ + /// + /// BatchingMachine.xaml 的交互逻辑 + /// + public partial class BatchingMachine : UserControl + { + public BatchingMachine() + { + InitializeComponent(); + } + } +} diff --git a/BPASmartClient.CustomResource/UserControls/Cylinder.xaml b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml new file mode 100644 index 00000000..97f5d6f8 --- /dev/null +++ b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BPASmartClient.CustomResource/UserControls/Cylinder.xaml.cs b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml.cs new file mode 100644 index 00000000..b115ba13 --- /dev/null +++ b/BPASmartClient.CustomResource/UserControls/Cylinder.xaml.cs @@ -0,0 +1,31 @@ +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.Navigation; +using System.Windows.Shapes; + +namespace BPASmartClient.CustomResource.UserControls +{ + /// + /// Cylinder.xaml 的交互逻辑 + /// + public partial class Cylinder : UserControl + { + public Cylinder() + { + InitializeComponent(); + + } + + + } +} diff --git a/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml b/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml index 68a35f91..35310f71 100644 --- a/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml +++ b/BPASmartClient.CustomResource/UserControls/MotorBottle.xaml @@ -9,17 +9,23 @@ d:DesignWidth="700" mc:Ignorable="d"> - + + Height="257" + HorizontalAlignment="Center" + VerticalAlignment="Top" /> + Height="386" + HorizontalAlignment="Left" + VerticalAlignment="Center" /> + HorizontalAlignment="Center" + VerticalAlignment="Top" + Fill="Red" /> @@ -36,7 +44,10 @@ - + - + @@ -55,7 +70,11 @@ Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:1" /> - + diff --git a/BPASmartClient.Helper/BPASmartClient.Helper.csproj b/BPASmartClient.Helper/BPASmartClient.Helper.csproj index 743e00b3..4dda4155 100644 --- a/BPASmartClient.Helper/BPASmartClient.Helper.csproj +++ b/BPASmartClient.Helper/BPASmartClient.Helper.csproj @@ -2,6 +2,7 @@ net6.0 + True diff --git a/BPASmartClient.Helper/DataRecord.cs b/BPASmartClient.Helper/DataRecord.cs new file mode 100644 index 00000000..72c81029 --- /dev/null +++ b/BPASmartClient.Helper/DataRecord.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.Serialization.Formatters.Binary; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.Helper +{ + public class DataRecord + { + + /// + /// 读取序列化文件 + /// + /// 需要读取序列化文件的文件名,包括后缀名 + /// 返回序列化读取到的信息,需要自行转换成对应的类型 + public ReadT Read(string FilePath) + { + if (File.Exists(FilePath)) + { + FileStream fs = new FileStream(FilePath, FileMode.Open); + BinaryFormatter bf = new BinaryFormatter(); + var res = (ReadT)bf.Deserialize(fs); + fs.Close(); + return res; + } + return default; + } + + /// + /// 保存序列化文件 + /// + /// 需要通过序列化保存的对象 + /// 设置保存的文件名,包括后缀名,后缀名可以自定义 + public void Save(SaveT obj, string FileName) + { + Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\ProductionData")); + string path = $"{AppDomain.CurrentDomain.BaseDirectory}AccessFile\\ProductionData\\{FileName}"; + if (obj != null) + { + FileStream fs = new FileStream(path, FileMode.Create); + BinaryFormatter bf = new BinaryFormatter();//创建一个二进制格式化器 + bf?.Serialize(fs, obj); + fs.Close(); + } + } + + } +} diff --git a/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj b/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj index a55223f5..8282b987 100644 --- a/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj +++ b/BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj @@ -20,6 +20,7 @@ + diff --git a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs index 4affbc7e..a2fe649c 100644 --- a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs +++ b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs @@ -26,8 +26,8 @@ namespace BPASmartClient.Model /// /// 原料重量设置 /// - public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } - private uint _mRawMaterialWeight; + public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } + private float _mRawMaterialWeight; /// @@ -86,7 +86,7 @@ namespace BPASmartClient.Model /// /// 原料设备执行状态 - /// 1:空闲状态 + /// 1:等待配料 /// 2:下料中 /// 3:下料完成 /// diff --git a/DosingSystem/App.xaml b/DosingSystem/App.xaml index b4732c63..4fea0d7a 100644 --- a/DosingSystem/App.xaml +++ b/DosingSystem/App.xaml @@ -17,6 +17,7 @@ + diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs index 6bece580..2ec8c014 100644 --- a/DosingSystem/App.xaml.cs +++ b/DosingSystem/App.xaml.cs @@ -30,12 +30,13 @@ namespace BPASmartClient.DosingSystem MenuInit(); DataInit(); DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化 - + //NewMaterialDeviceParView newMaterialDeviceParView = new NewMaterialDeviceParView(); + //newMaterialDeviceParView.ShowDialog(); MainView mv = new MainView(); //mv.Show(); LoginView lv = new LoginView(); var res = lv.ShowDialog(); - if (res != null && res == true) + if (res != null && res == true) { MessageLog.GetInstance.ShowUserLog("用户登录"); mv.Show(); diff --git a/DosingSystem/Converter/RunStatusConvert.cs b/DosingSystem/Converter/RunStatusConvert.cs new file mode 100644 index 00000000..7ac57ada --- /dev/null +++ b/DosingSystem/Converter/RunStatusConvert.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace BPASmartClient.DosingSystem.Converter +{ + public class RunStatusConvert : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is int tempValue) + { + if (tempValue == 1) return ":等待配料"; + if (tempValue == 2) return ":配料中"; + if (tempValue == 3) return ":配料完成"; + } + return ":未知"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/DosingSystem/Model/DeviceAddress.cs b/DosingSystem/Model/DeviceAddress.cs index ba25028c..7752c667 100644 --- a/DosingSystem/Model/DeviceAddress.cs +++ b/DosingSystem/Model/DeviceAddress.cs @@ -16,27 +16,72 @@ namespace BPASmartClient.DosingSystem.Model /// /// 料仓重量反馈起始地址 /// - public static string WeightFeedback { get; set; } = "LW52";//LW204 + public static string WeightFeedback { get; set; } = "LW52"; /// /// 重量设置地址 /// - public static string WeightSet { get; set; } = "LW21";//LW200 + public static string WeightSet { get; set; } = "LW21"; /// /// 启动信号地址 /// - public static string Start { get; set; } = "LW20";//LW210 + public static string Start { get; set; } = "LW20"; /// /// 下料重量反馈地址 /// - public static string CutWeightFeedback { get; set; } = "LW54";//LW202 + public static string CutWeightFeedback { get; set; } = "LW54"; + + /// + /// 设备编号 + /// + public static string DeviceNum { get; set; } = "LW57"; /// /// 设备运行状态地址 /// - public static string RunStatus { get; set; } = "LW51";//LW206 + public static string RunStatus { get; set; } = "LW60"; + + /// + /// 慢加重量 + /// + public static string SlowlyAddWeight { get; set; } = "LW23"; + + /// + /// 提前关阀重量 + /// + public static string PreCloseValveWeight { get; set; } = "LW25"; + + /// + /// 快加速度 + /// + public static string RapidAcceleration { get; set; } = "LW27"; + + /// + /// 慢加速度 + /// + public static string SlowAcceleration { get; set; } = "LW29"; + + /// + /// 伺服手动速度 + /// + public static string ServoManualSpeed { get; set; } = "LW31"; + + /// + /// 料仓上限重量 + /// + public static string SiloUpperLimitWeight { get; set; } = "LW33"; + + /// + /// 料仓下限重量 + /// + public static string LowerLimitWeightOfSilo { get; set; } = "LW35"; + + /// + /// 搅拌速度 + /// + public static string StirringSpeed { get; set; } = "LW37"; } diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs index db5dad76..a1258241 100644 --- a/DosingSystem/Model/DeviceInquire.cs +++ b/DosingSystem/Model/DeviceInquire.cs @@ -87,7 +87,7 @@ namespace BPASmartClient.DosingSystem.Model DS.modbusTcp.ConnectOk = new Action(() => { - string DeviceName = DS.modbusTcp.GetString(DeviceAddress.DeviceName, 20);//读取设备名称 + string DeviceName = DS.modbusTcp.GetString(DeviceAddress.DeviceName, 20).Trim();//读取设备名称 if (DeviceName.Length > 0) { DeviceLists.TryAdd(ip, DS); @@ -111,9 +111,9 @@ namespace BPASmartClient.DosingSystem.Model } } } - if(Global.DeviceRawMaterials.Count > 0) + if (Global.DeviceRawMaterials.Count > 0) { - if(Global.DeviceRawMaterials.FirstOrDefault(p=>p.RawMaterialName == DeviceName) == null) + if (Global.DeviceRawMaterials.FirstOrDefault(p => p.RawMaterialName == DeviceName) == null) { Global.DeviceRawMaterials.Add(new RawMaterialModel() { RawMaterialName = DeviceName, DeviceIp = ip ,RawMaterialSource = 1}); } @@ -146,7 +146,7 @@ namespace BPASmartClient.DosingSystem.Model { DeviceListViewModel.devices.Remove(res); var item = Global.DeviceRawMaterials.FirstOrDefault(P => P.RawMaterialName == res.DeviceName); - if (item!=null) Global.DeviceRawMaterials.Remove(item); + if (item != null) Global.DeviceRawMaterials.Remove(item); })); if (DeviceLists.ContainsKey(ip)) DeviceLists[ip].Dispose(); @@ -176,7 +176,7 @@ namespace BPASmartClient.DosingSystem.Model /// public RawMaterialDeviceStatus deviceStatus { get; set; } = new RawMaterialDeviceStatus(); - + public ModbusTcp modbusTcp = new ModbusTcp(); @@ -198,8 +198,11 @@ namespace BPASmartClient.DosingSystem.Model } //获取设备料仓剩余重量 - deviceStatus.WeightFeedback = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback) * 10; - deviceStatus.CutWeightFeedback = this.modbusTcp.GetUint(DeviceAddress.CutWeightFeedback) * 10; + deviceStatus.WeightFeedback = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback); + var resddd = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback); + var rrr = this.modbusTcp.Read(DeviceAddress.WeightFeedback); + var t = this.modbusTcp.GetReal(DeviceAddress.CutWeightFeedback); + Thread.Sleep(100); }), $"{DeviceName} 开始监听", true); } @@ -221,11 +224,11 @@ namespace BPASmartClient.DosingSystem.Model ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听"); } - public void Start(uint Value) + public void Start(float Value) { if (modbusTcp.Connected) { - modbusTcp.SetUint(DeviceAddress.WeightSet, Value);//写入配方量 + modbusTcp.SetReal(DeviceAddress.WeightSet, Value);//写入配方量 modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入 } } diff --git a/DosingSystem/Model/DevicePar.cs b/DosingSystem/Model/DevicePar.cs new file mode 100644 index 00000000..e3e7efbc --- /dev/null +++ b/DosingSystem/Model/DevicePar.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.DosingSystem.Model +{ + public class DevicePar + { + /// + /// 慢加重量 + /// + public float SlowlyAddWeight { get; set; } + + /// + /// 提前关阀重量 + /// + public float PreCloseValveWeight { get; set; } + + /// + /// 快加速度 + /// + public int RapidAcceleration { get; set; } + + /// + /// 慢加速度 + /// + public int SlowAcceleration { get; set; } + + /// + /// 伺服手动速度 + /// + public int ServoManualSpeed { get; set; } + + /// + /// 料仓上限重量 + /// + public int SiloUpperLimitWeight { get; set; } + + /// + /// 料仓下限重量 + /// + public int LowerLimitWeightOfSilo { get; set; } + + /// + /// 搅拌速度 + /// + public int StirringSpeed { get; set; } + } +} diff --git a/DosingSystem/Model/RecipeProcess.cs b/DosingSystem/Model/RecipeProcess.cs new file mode 100644 index 00000000..23864689 --- /dev/null +++ b/DosingSystem/Model/RecipeProcess.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Toolkit.Mvvm.ComponentModel; + +namespace BPASmartClient.DosingSystem.Model +{ + public class RecipeProcess : ObservableObject + { + public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } + private string _mRawMaterialName; + + + public int RawMaterialStatus { get { return _mRawMaterialStatus; } set { _mRawMaterialStatus = value; OnPropertyChanged(); } } + private int _mRawMaterialStatus; + + } +} diff --git a/DosingSystem/View/DeviceListView.xaml b/DosingSystem/View/DeviceListView.xaml index 19d96251..7021d8db 100644 --- a/DosingSystem/View/DeviceListView.xaml +++ b/DosingSystem/View/DeviceListView.xaml @@ -44,15 +44,7 @@ - - - - - - + @@ -129,6 +122,7 @@ Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" + Foreground="#00BEFA" Width="130" Height="30" Margin="0,0,0,10" @@ -136,8 +130,12 @@ VerticalAlignment="Bottom" Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}" CommandParameter="{Binding IpAddress}" - Content="修改设备名称" - IsEnabled="{Binding IsEnable}" /> + Content="修改原料名称" + IsEnabled="{Binding IsEnable}"> + + + + diff --git a/DosingSystem/View/HardwareStatusView.xaml b/DosingSystem/View/HardwareStatusView.xaml index 7562583c..405d9e5f 100644 --- a/DosingSystem/View/HardwareStatusView.xaml +++ b/DosingSystem/View/HardwareStatusView.xaml @@ -21,7 +21,7 @@ - - + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -180,16 +246,21 @@ Grid.Row="1" Width="{Binding ElementName=gr, Path=ActualWidth}" Height="{Binding ElementName=gr, Path=ActualHeight}" - Margin="0,0,400,0" + Margin="10,0,400,0" ConveyorBeltWidth="70" - Direction="1" - StrokeBrush="Red" + Direction="0" + StrokeBrush="#00BEFA" StrokeDashArray="1.5 1.5" - StrokeFillBrush="Red" + StrokeFillBrush="#00BEFA" StrokeThickness="2" /> + + + + + - + diff --git a/DosingSystem/View/NewMaterialDeviceParView.xaml b/DosingSystem/View/NewMaterialDeviceParView.xaml new file mode 100644 index 00000000..56e9ec52 --- /dev/null +++ b/DosingSystem/View/NewMaterialDeviceParView.xaml @@ -0,0 +1,362 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,25 +427,28 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/FryPot_DosingSystem/View/FlowProcessView.xaml.cs b/FryPot_DosingSystem/View/FlowProcessView.xaml.cs index 318c8402..57576935 100644 --- a/FryPot_DosingSystem/View/FlowProcessView.xaml.cs +++ b/FryPot_DosingSystem/View/FlowProcessView.xaml.cs @@ -1,4 +1,5 @@ using BPASmartClient.Helper; +using FryPot_DosingSystem.Model; using System; using System.Collections.Generic; using System.Linq; @@ -20,16 +21,93 @@ namespace FryPot_DosingSystem.View /// public partial class FlowProcessView : Window { + public FlowProcessView() { InitializeComponent(); this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); }; ActionManage.GetInstance.CancelRegister("CloseFlowProcessView"); - ActionManage.GetInstance.Register(new Action(() => { + ActionManage.GetInstance.Register(new Action(() => + { this.Close(); }), "CloseFlowProcessView"); + + } - + private void Label_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + Label txt = sender as Label; + if (txt != null) + { + StackPanel oldSp = FindFirstVisualChild(itemcontrols, "stk"); + if (oldSp != null) + oldSp.Background = new SolidColorBrush(Color.FromRgb(38, 76, 115)); + StackPanel sp = VisualTreeHelper.GetParent(txt) as StackPanel; + sp.Background = new SolidColorBrush(Color.FromRgb(8, 20, 36)); + ActionManage.GetInstance.Send("CurrentItemId", txt.Content); + } + } + + + public StackPanel FindFirstVisualChild(DependencyObject obj, string childName) + { + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) + { + DependencyObject child = VisualTreeHelper.GetChild(obj, i); + if (child != null && child is StackPanel && child.GetValue(NameProperty).ToString() == childName) + { + if (child is StackPanel stack && stack.Background?.ToString() == "#FF081424") + return stack; + } + else + { + StackPanel SP = FindFirstVisualChild(child, childName); + if (SP != null) + { + return SP; + } + } + } + return null; + } + + //private void ComboBox_KeyUp(object sender, KeyEventArgs e) + //{ + // var res = sender as ComboBox; + // Json.Read(); + + // if (res.Text != null && res.Text != String.Empty) + // { + // var datas = Json.Data.Names.Where(s => s.Contains(res.Text.Trim())); + // // var datas = Json.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim())); + // if (datas.Count() > 0) + // { + // res.ItemsSource = datas; + // res.IsDropDownOpen = true; + // } + // else + // { + // res.IsDropDownOpen = false; + // } + // } + //} + + //private void ComboBox_LostFocus(object sender, RoutedEventArgs e) + //{ + // var res = sender as ComboBox; + // if (res.Text != null && res.Text != String.Empty) + // { + // if (!Json.Data.Names.Contains(res.Text.Trim()))//判断是否存在原料 + // { + // //FlowProcessNames.GetInstance.Names.Add(res.Text.Trim()); + // //Json.Data = FlowProcessNames.GetInstance; + // Json.Data.Names.Add(res.Text.Trim()); + // Json.Save(); + + // } + + // } + //} } } diff --git a/FryPot_DosingSystem/View/MainWindow.xaml.cs b/FryPot_DosingSystem/View/MainWindow.xaml.cs index 73691795..87151823 100644 --- a/FryPot_DosingSystem/View/MainWindow.xaml.cs +++ b/FryPot_DosingSystem/View/MainWindow.xaml.cs @@ -40,7 +40,7 @@ namespace FryPot_DosingSystem.View var res = JsonConvert.DeserializeObject(o.ToString()); }); - HubHelper.GetInstance.Connect("192.168.1.56", 8089); + HubHelper.GetInstance.Connect("192.168.1.40", 8089); } protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) diff --git a/FryPot_DosingSystem/View/NewRecipeView.xaml.cs b/FryPot_DosingSystem/View/NewRecipeView.xaml.cs index a923dbfd..efac7617 100644 --- a/FryPot_DosingSystem/View/NewRecipeView.xaml.cs +++ b/FryPot_DosingSystem/View/NewRecipeView.xaml.cs @@ -40,7 +40,7 @@ namespace FryPot_DosingSystem.View var res = sender as ComboBox; Json.Read(); - if (res.Text != null) + if (res.Text != null && res.Text != String.Empty) { var datas = Json.Data.Names.Where(s => s.Contains(res.Text.Trim())); // var datas = Json.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim())); @@ -59,7 +59,7 @@ namespace FryPot_DosingSystem.View private void ComboBox_LostFocus(object sender, RoutedEventArgs e) { var res = sender as ComboBox; - if (res.Text != null) + if (res.Text != null && res.Text != String.Empty) { if (!MaterialNames.GetInstance.Names.Contains(res.Text.Trim()))//判断是否存在原料 { diff --git a/FryPot_DosingSystem/View/RecipesSendDown.xaml b/FryPot_DosingSystem/View/RecipesSendDown.xaml new file mode 100644 index 00000000..eaa15085 --- /dev/null +++ b/FryPot_DosingSystem/View/RecipesSendDown.xaml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FryPot_DosingSystem/View/RecipesSendDown.xaml.cs b/FryPot_DosingSystem/View/RecipesSendDown.xaml.cs new file mode 100644 index 00000000..2b243032 --- /dev/null +++ b/FryPot_DosingSystem/View/RecipesSendDown.xaml.cs @@ -0,0 +1,28 @@ +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.Navigation; +using System.Windows.Shapes; + +namespace FryPot_DosingSystem.View +{ + /// + /// RecipesSendDown.xaml 的交互逻辑 + /// + public partial class RecipesSendDown : UserControl + { + public RecipesSendDown() + { + InitializeComponent(); + } + } +} diff --git a/FryPot_DosingSystem/ViewModel/DebugViewModel.cs b/FryPot_DosingSystem/ViewModel/DebugViewModel.cs index afbcbdd8..4f8ff62a 100644 --- a/FryPot_DosingSystem/ViewModel/DebugViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/DebugViewModel.cs @@ -22,7 +22,7 @@ namespace FryPot_DosingSystem.ViewModel public RelayCommand FryPotInputArrive { get; set; } public RelayCommand FryPotEmptyRollerArrive { get; set; } public RelayCommand LineOneTaskExit { get; set; } - + public RelayCommand LineOneRecipeComSignal { get; set; } public RelayCommand AGVLOneArrive { get; set; } public RelayCommand AGVFryPotDownArrive { get; set; } @@ -36,7 +36,7 @@ namespace FryPot_DosingSystem.ViewModel public RelayCommand FryPotTwoInputArrive { get; set; } public RelayCommand FryPotTwoEmptyRollerArrive { get; set; } public RelayCommand LineTwoTaskExit { get; set; } - + public RelayCommand LineTwoRecipeComSignal { get; set; } public RelayCommand AGVLTwoArrive { get; set; } public RelayCommand AGVFryPotTwoDownArrive { get; set; } @@ -49,6 +49,7 @@ namespace FryPot_DosingSystem.ViewModel public RelayCommand FryPotThreeInputArrive { get; set; } public RelayCommand FryPotThreeEmptyRollerArrive { get; set; } public RelayCommand LineThreeTaskExit { get; set; } + public RelayCommand LineThreeRecipeComSignal { get; set; } public RelayCommand AGVLThreeArrive { get; set; } public RelayCommand AGVFryPotThreeDownArrive { get; set; } @@ -69,10 +70,11 @@ namespace FryPot_DosingSystem.ViewModel public RelayCommand AgvLineThreeLoadEmptyCom { get; set; } public RelayCommand CleanPlateCallAgv { get; set; } public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料 - public RelayCommand AgvArriveLineFourLoc { get; set; } - + public RelayCommand AgvArriveCleanPlateLocCom { get; set; }//下料完成 + public RelayCommand AgvArriveLineFourLoc { get; set; }//下料 + public RelayCommand AgvArriveLineFourLocCom { get; set; }//4号线空桶下料完成 public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料 - + public RelayCommand AgvArriveCleanPlateLocLoadCom { get; set; }//上料完成 public RelayCommand EmptyRollerCleanTaskRestart { get; set; } public DebugViewModel() { @@ -80,7 +82,31 @@ namespace FryPot_DosingSystem.ViewModel { ActionManage.GetInstance.Send("AgvDebug"); })); + AgvArriveCleanPlateLocCom = new RelayCommand(() => + { + ActionManage.GetInstance.Send("AgvArriveCleanPlateLocCom"); + }); + AgvArriveLineFourLocCom = new RelayCommand(() => + { + ActionManage.GetInstance.Send("AgvArriveLineFourLocCom"); + }); + AgvArriveCleanPlateLocLoadCom = new RelayCommand(() => + { + ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoadCom"); + }); + LineOneRecipeComSignal = new RelayCommand(() => + { + ActionManage.GetInstance.Send("LineOneRecipeComSignal"); + }); + LineTwoRecipeComSignal = new RelayCommand(() => + { + ActionManage.GetInstance.Send("LineTwoRecipeComSignal"); + }); + LineThreeRecipeComSignal = new RelayCommand(() => + { + ActionManage.GetInstance.Send("LineThreeRecipeComSignal"); + }); EmptyRollerCleanTaskRestart = new RelayCommand(() => { diff --git a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs index aad1f5bf..42198778 100644 --- a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs @@ -13,65 +13,162 @@ namespace FryPot_DosingSystem.ViewModel internal class FlowProcessSetViewModel { public int Id { get; set; } = 0; + public static int materialNum { get; set; } public ObservableCollection flowProcessModels { get; set; } = new ObservableCollection(); - public string currnetRecipeName { get; set;} + public string currentRecipeName { get; set; } + public static int currentItemId { get; set; } public RelayCommand CloseWindowCommand { get; set; } + public ObservableCollection FlowItems { get; set; } = new ObservableCollection(); public RelayCommand ConfirmCommand { get; set; } + public RelayCommand AddLastFlowItemCommand { get; set; } + public RelayCommand AddFrontFlowItemCommand { get; set; } + public RelayCommand DeleteFlowItemCommand { get; set; } public FlowProcessSetViewModel() { + Json.Read(); + // FlowProcessNames.GetInstance.Names = Json.Data.Names; + FlowItems = Json.Data.Names; + ActionManage.GetInstance.Register(new Action((obj) => + { + if (obj != null) + try + { + currentItemId = Convert.ToInt32(obj); + } + catch (Exception) + { + + } + }), "CurrentItemId"); + //ActionManage.GetInstance.Register(new Action(obj => + //{ + // if (obj != null) + // materialNum = Convert.ToInt32(obj); + //}), "MaterialNum"); ActionManage.GetInstance.Register(new Action(recipeName => { if (recipeName != null) { - currnetRecipeName = recipeName.ToString(); + currentRecipeName = recipeName.ToString(); var res = Json.Data.Recipes.FirstOrDefault(p => p.FlowProcess.RecipeName == recipeName.ToString()); if (res != null && res is NewRecipeModel recipe) //编辑已有工艺 { - //flowProcessModels = recipe.FlowProcess.fpModels; + foreach (var item in recipe.materialCollection) + { + if (!FlowItems.Contains(item.MaterialName)) + FlowItems.Insert(0, item.MaterialName);//下拉框 + } foreach (var item in recipe.FlowProcess.fpModels) { - flowProcessModels.Add(new FlowProcessModel { Id = item.Id, FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime }); + flowProcessModels.Add(new FlowProcessModel {FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime }); } + + // ActionManage.GetInstance.Send("MaterialNum", recipe.materialCollection.Count); } else//创建新工艺 { - var name = Json.Data.Recipes.FirstOrDefault(p=>p.RecipeName==recipeName.ToString()); + var name = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == recipeName.ToString()); if (name != null) { name.FlowProcess.RecipeName = recipeName.ToString(); - flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = "油" }); - Id++; + foreach (var item in name.materialCollection) { - flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = item.MaterialName }); - Id++; + + if (!FlowItems.Contains(item.MaterialName)) + FlowItems.Insert(0, item.MaterialName);//下拉框 } - name.FlowProcess.fpModels= flowProcessModels; + ActionManage.GetInstance.Send("MaterialNum", name.materialCollection.Count); + name.FlowProcess.fpModels = flowProcessModels; } - + } } - + }), "EditFlowProcess"); CloseWindowCommand = new RelayCommand(() => { - ActionManage.GetInstance.Send("CloseFlowProcessView"); }); ConfirmCommand = new RelayCommand(() => { - var name = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == currnetRecipeName.ToString()); + var name = Json.Data.Recipes.FirstOrDefault(p => p.RecipeName == currentRecipeName.ToString()); if (name != null) { - name.FlowProcess.RecipeName = currnetRecipeName.ToString(); - name.FlowProcess.fpModels = flowProcessModels; + name.FlowProcess.RecipeName = currentRecipeName.ToString(); + // name.FlowProcess.fpModels = flowProcessModels; + name.FlowProcess.fpModels.Clear(); + foreach (var item in flowProcessModels) + { + name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime }); + } + foreach (var item in name.materialCollection) + { + string s= Json.Data.Names.FirstOrDefault(p=>p == item.MaterialName); + Json.Data.Names.Remove(s); + } } Json.Save(); + + + Json.Save(); ActionManage.GetInstance.Send("CloseFlowProcessView"); }); + + AddFrontFlowItemCommand = new RelayCommand(() => + { + try + { + if (currentItemId == 0) + { + flowProcessModels.Insert(0, new FlowProcessModel()); + } + else + { + flowProcessModels.Insert(currentItemId, new FlowProcessModel()); + currentItemId = currentItemId + 1; + } + } + catch (Exception) + { + + //throw; + } + + }); + AddLastFlowItemCommand = new RelayCommand(() => + { + try + { + if (flowProcessModels.Count <= 0) + { + flowProcessModels.Insert(0, new FlowProcessModel()); + + } + else if (currentItemId != 0) + { + flowProcessModels.Insert(currentItemId + 1, new FlowProcessModel()); + } + else + { + flowProcessModels.Add(new FlowProcessModel()); + } + } + catch (Exception) + { + + // throw; + } + }); + DeleteFlowItemCommand = new RelayCommand(() => + { + if (flowProcessModels.Count > 0) + flowProcessModels.RemoveAt(currentItemId); + currentItemId = 0; + }); } } } diff --git a/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs b/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs index e54fb21b..f2ee52ae 100644 --- a/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs @@ -118,7 +118,7 @@ namespace FryPot_DosingSystem.ViewModel } else { - MessageBox.Show("配方名称重复,请重命名!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("配方名称重复或为空,请重命名!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } diff --git a/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs b/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs index 66075fef..76622ed2 100644 --- a/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs @@ -1,4 +1,6 @@ -using BPASmartClient.Helper; +using BPASmartClient.CustomResource.UserControls; +using BPASmartClient.CustomResource.UserControls.MessageShow; +using BPASmartClient.Helper; using BPASmartClient.Message; using FryPot_DosingSystem.Model; using Microsoft.Toolkit.Mvvm.ComponentModel; @@ -38,13 +40,15 @@ namespace FryPot_DosingSystem.ViewModel if (res != null) { RecipeSetDown(new NewRecipeModel[] { res }); - res.RecipeSetInfo = "配方下发成功"; - Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; }); + //res.RecipeSetInfo = "配方下发成功"; + //Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; }); + NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!"); } else { - res.RecipeSetInfo = "配方下发失败"; - Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; }); + //res.RecipeSetInfo = "配方下发失败"; + //Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; }); + NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"配方下发失败!"); } } @@ -53,23 +57,28 @@ namespace FryPot_DosingSystem.ViewModel { if (Recipes != null) { - //foreach (var recipeModel in Recipes) - //{ - // RecipeSetDown(recipeModel); - //} - RecipeSetDown(Recipes.ToArray()); - Task.Run(() => + try + { + RecipeSetDown(Recipes.ToArray()); + NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"所有配方下发成功!"); + } + catch (Exception) { - foreach (var item in Recipes) - { - item.RecipeSetInfo = "下发成功"; - } - Thread.Sleep(1500); - foreach (var item in Recipes) - { - item.RecipeSetInfo = string.Empty; - } - }); + + NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"配方下发失败!"); + } + //Task.Run(() => + //{ + // foreach (var item in Recipes) + // { + // item.RecipeSetInfo = "下发成功"; + // } + // Thread.Sleep(1500); + // foreach (var item in Recipes) + // { + // item.RecipeSetInfo = string.Empty; + // } + //}); } diff --git a/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs b/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs index 35e078a1..86734c42 100644 --- a/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs @@ -1,4 +1,6 @@ using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.CustomResource.UserControls; +using BPASmartClient.CustomResource.UserControls.MessageShow; using BPASmartClient.Helper; using FryPot_DosingSystem.Model; using FryPot_DosingSystem.View; @@ -83,6 +85,7 @@ namespace FryPot_DosingSystem.ViewModel { Json.Save(); count = recipeModels.Count; + NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!"); })); EditRecipeCommand = new RelayCommand((Id) => { diff --git a/SmartClient.sln b/SmartClient.sln index f2ae20db..e2b2a72e 100644 --- a/SmartClient.sln +++ b/SmartClient.sln @@ -132,6 +132,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JXJFoodBigSt EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JXJFoodSmallStation", "BPASmartClient.JXJFoodSmallStation\BPASmartClient.JXJFoodSmallStation.csproj", "{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFDemo", "WPFDemo\WPFDemo.csproj", "{A456D582-D910-4CA2-8620-6D8F63344B47}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1266,6 +1268,26 @@ Global {D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x64.Build.0 = Release|Any CPU {D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x86.ActiveCfg = Release|Any CPU {D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x86.Build.0 = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|ARM.ActiveCfg = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|ARM.Build.0 = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|ARM64.Build.0 = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|x64.ActiveCfg = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|x64.Build.0 = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|x86.ActiveCfg = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Debug|x86.Build.0 = Debug|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|Any CPU.Build.0 = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|ARM.ActiveCfg = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|ARM.Build.0 = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|ARM64.ActiveCfg = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|ARM64.Build.0 = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|x64.ActiveCfg = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|x64.Build.0 = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|x86.ActiveCfg = Release|Any CPU + {A456D582-D910-4CA2-8620-6D8F63344B47}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1327,6 +1349,7 @@ Global {D1F2379E-1755-4B50-9D67-15C960C33FFA} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} {FA695D7E-6F12-4483-A16D-8494609FAE68} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} {D609C4CF-FA5C-4D39-B12F-07A60FFE5E40} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} + {A456D582-D910-4CA2-8620-6D8F63344B47} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} diff --git a/TestDemo/Form1.cs b/TestDemo/Form1.cs index 1845f8b3..ab65440e 100644 --- a/TestDemo/Form1.cs +++ b/TestDemo/Form1.cs @@ -11,24 +11,23 @@ namespace TestDemo public Form1() { InitializeComponent(); - HubHelper.GetInstance.Connect("192.168.1.14", 8089); } private void button1_Click(object sender, EventArgs e) { AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); string value = JsonConvert.SerializeObject(aGVToUpSystem); - string url = $"http://192.168.1.14:8089/apicallback/quicktron/robotjob/report?sign={value}"; + string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/report?sign={value}"; var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); } private void button2_Click(object sender, EventArgs e) { - Upstreamrequest aGVToUpSystem = new Upstreamrequest(); string value = JsonConvert.SerializeObject(aGVToUpSystem); - string url = $"http://192.168.1.14:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}"; + string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}"; var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); + } } } \ No newline at end of file diff --git a/WPFDemo/App.xaml b/WPFDemo/App.xaml new file mode 100644 index 00000000..fae8c33d --- /dev/null +++ b/WPFDemo/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPFDemo/App.xaml.cs b/WPFDemo/App.xaml.cs new file mode 100644 index 00000000..5bde2402 --- /dev/null +++ b/WPFDemo/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace WPFDemo +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/WPFDemo/AssemblyInfo.cs b/WPFDemo/AssemblyInfo.cs new file mode 100644 index 00000000..8b5504ec --- /dev/null +++ b/WPFDemo/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/WPFDemo/MainWindow.xaml b/WPFDemo/MainWindow.xaml new file mode 100644 index 00000000..b542c9f7 --- /dev/null +++ b/WPFDemo/MainWindow.xaml @@ -0,0 +1,23 @@ + + + + + + + +