@@ -15,13 +15,26 @@ namespace BPASmartClient.AgvApi.Controllers | |||
/// <param name="sign"></param> | |||
/// <returns></returns> | |||
[HttpPost("report")] | |||
public string report(AGVToUpSystemBody ent) | |||
public string report(string ent) | |||
{ | |||
if (ent != null) | |||
{ | |||
Factory.GetInstance.SendReport(ent); | |||
try | |||
{ | |||
var res = JsonConvert.DeserializeObject<AGVToUpSystem>(ent); | |||
if (res != null) | |||
{ | |||
Factory.GetInstance.SendReport(res); | |||
return "SUCCESS"; | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
return ex.ToString(); | |||
} | |||
} | |||
return "SUCCESS"; | |||
return "Error"; | |||
} | |||
/// <summary> | |||
@@ -30,13 +43,27 @@ namespace BPASmartClient.AgvApi.Controllers | |||
/// <param name="upstreamrequest"></param> | |||
/// <returns></returns> | |||
[HttpPost("upstreamrequest")] | |||
public string upstreamrequest(UpstreamrequestBody upstreamrequest) | |||
public string upstreamrequest(string upstreamrequest) | |||
{ | |||
if (upstreamrequest != null) | |||
{ | |||
Factory.GetInstance.SendUpstreamrequest(upstreamrequest); | |||
try | |||
{ | |||
var res = JsonConvert.DeserializeObject<Upstreamrequest>(upstreamrequest); | |||
if (res != null) | |||
{ | |||
Factory.GetInstance.SendUpstreamrequest(upstreamrequest); | |||
return "SUCCESS"; | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
return ex.ToString(); | |||
} | |||
} | |||
return "SUCCESS"; | |||
return "Error"; | |||
} | |||
} | |||
} |
@@ -1,6 +1,8 @@ | |||
using BPASmartClient.AgvApi; | |||
using Microsoft.AspNetCore.Cors.Infrastructure; | |||
var builder = WebApplication.CreateBuilder(args); | |||
// Add services to the container. | |||
@@ -15,9 +15,7 @@ namespace BPASmartClient.HubHelper | |||
public void Connect() | |||
{ | |||
hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl("http://localhost:5175/personhub").Build();//连接 | |||
//AGV搬运任务上报后执行的委托 | |||
hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl("http://localhost:8089/personhub").Build();//连接 | |||
hubConnection.On<object>("Report", (s) => | |||
{ | |||
Report?.Invoke(s); | |||
@@ -115,10 +115,10 @@ namespace BPASmartClient.MorkS | |||
WriteRecipeBoms(); | |||
} | |||
}); | |||
} | |||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | |||
{ | |||
var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid); | |||
@@ -362,7 +362,7 @@ namespace BPASmartClient.MorkS | |||
{ | |||
if (ushort.TryParse(item.BatchingLoc, out ushort loc)) | |||
{ | |||
DeviceProcessLogShow($"位置:={loc},检测开关1:{alarm.Supply1_LossBowl},检测开关1:{alarm.Supply2_LossBowl}"); | |||
//DeviceProcessLogShow($"位置:={loc},检测开关1:{alarm.Supply1_LossBowl},检测开关1:{alarm.Supply2_LossBowl}"); | |||
if (loc == 10 && !alarm.Supply1_LossBowl) | |||
{ | |||
BowLoc = loc; | |||
@@ -375,10 +375,14 @@ namespace BPASmartClient.MorkS | |||
} | |||
} | |||
} | |||
if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo)) | |||
if (BowLoc >= 10 && BowLoc <= 11) | |||
{ | |||
orderLocInfo.Loc = BowLoc; | |||
BowlControl(orderLocInfo); | |||
if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo)) | |||
{ | |||
orderLocInfo.Loc = BowLoc; | |||
BowlControl(orderLocInfo); | |||
} | |||
} | |||
} | |||
} | |||
@@ -597,9 +601,13 @@ namespace BPASmartClient.MorkS | |||
int OutMealRequstCount = mORKS.CookNoodlesComplete.Where(p => p == true).ToList().Count; | |||
int mlCount = mORKS.NoodleCookerStatus.Where(p => p == true).ToList().Count; | |||
int index = Array.FindIndex(mORKS.CookNodelId, p => p == mORKS.IngredientsCompleteId); | |||
bool isok = index >= 0 && index < mORKS.CookNoodlesComplete.Length && mORKS.CookNoodlesComplete[index]; | |||
mORKS.PriorityJudgment = Delay.GetInstance("取餐优先级判断").Start(mORKS.TurntableLocLists.Count > 0 && !mORKS.TurntableLowerLimit, 4); | |||
mORKS.RobotTaskInterlock = OutMealRequstCount > 0 && mORKS.AllowFallNoodle && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment); | |||
//mORKS.RobotTaskInterlock = OutMealRequstCount > 0 && mORKS.AllowFallNoodle && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment); | |||
mORKS.RobotTaskInterlock = isok && mORKS.AllowFallNoodle && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment); | |||
} | |||
@@ -34,15 +34,6 @@ namespace BPASmartClient.DosingSystem | |||
else | |||
mv.Close(); | |||
//MainWindow mw = new MainWindow(); | |||
//LoginView lv = new LoginView(); | |||
//var res = lv.ShowDialog(); | |||
//if (res != null && res == true) | |||
// mw.Show(); | |||
//else | |||
// mw.Close(); | |||
} | |||
protected override void OnExit(ExitEventArgs e) | |||
@@ -16,7 +16,6 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.6" /> | |||
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> | |||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | |||
<PackageReference Include="NModbus" Version="3.0.72" /> | |||
@@ -112,7 +112,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FryPot_DosingSystem", "FryP | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.ZhuoDian", "BPASmartClient.ZhuoDian\BPASmartClient.ZhuoDian.csproj", "{D3705A39-9875-4BB1-B592-C551A6DC6D87}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{67A46DBB-5984-4287-942F-5C392C0CBFAA}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{67A46DBB-5984-4287-942F-5C392C0CBFAA}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestDemo", "TestDemo\TestDemo.csproj", "{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
@@ -1068,6 +1070,26 @@ Global | |||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x64.Build.0 = Release|Any CPU | |||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x86.ActiveCfg = Release|Any CPU | |||
{67A46DBB-5984-4287-942F-5C392C0CBFAA}.Release|x86.Build.0 = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|ARM.Build.0 = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|ARM64.Build.0 = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|x64.Build.0 = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Debug|x86.Build.0 = Debug|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|ARM.ActiveCfg = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|ARM.Build.0 = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|ARM64.ActiveCfg = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|ARM64.Build.0 = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|x64.ActiveCfg = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|x64.Build.0 = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|x86.ActiveCfg = Release|Any CPU | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3}.Release|x86.Build.0 = Release|Any CPU | |||
EndGlobalSection | |||
GlobalSection(SolutionProperties) = preSolution | |||
HideSolutionNode = FALSE | |||
@@ -1121,6 +1143,7 @@ Global | |||
{6C0485D5-5840-405D-9A2E-292ADA2D3A8B} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||
{D3705A39-9875-4BB1-B592-C551A6DC6D87} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||
{67A46DBB-5984-4287-942F-5C392C0CBFAA} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | |||
{BB0015E4-7F01-49BC-AC26-1F9FCCB24FE3} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||
EndGlobalSection | |||
GlobalSection(ExtensibilityGlobals) = postSolution | |||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | |||
@@ -0,0 +1,60 @@ | |||
namespace TestDemo | |||
{ | |||
partial class Form1 | |||
{ | |||
/// <summary> | |||
/// Required designer variable. | |||
/// </summary> | |||
private System.ComponentModel.IContainer components = null; | |||
/// <summary> | |||
/// Clean up any resources being used. | |||
/// </summary> | |||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
protected override void Dispose(bool disposing) | |||
{ | |||
if (disposing && (components != null)) | |||
{ | |||
components.Dispose(); | |||
} | |||
base.Dispose(disposing); | |||
} | |||
#region Windows Form Designer generated code | |||
/// <summary> | |||
/// Required method for Designer support - do not modify | |||
/// the contents of this method with the code editor. | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.button1 = new System.Windows.Forms.Button(); | |||
this.SuspendLayout(); | |||
// | |||
// button1 | |||
// | |||
this.button1.Location = new System.Drawing.Point(12, 12); | |||
this.button1.Name = "button1"; | |||
this.button1.Size = new System.Drawing.Size(97, 43); | |||
this.button1.TabIndex = 0; | |||
this.button1.Text = "button1"; | |||
this.button1.UseVisualStyleBackColor = true; | |||
this.button1.Click += new System.EventHandler(this.button1_Click); | |||
// | |||
// Form1 | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(641, 298); | |||
this.Controls.Add(this.button1); | |||
this.Name = "Form1"; | |||
this.Text = "Form1"; | |||
this.ResumeLayout(false); | |||
} | |||
#endregion | |||
private Button button1; | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
using BPASmartClient.AGV.Feedback; | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.Http; | |||
using Newtonsoft.Json; | |||
namespace TestDemo | |||
{ | |||
public partial class Form1 : Form | |||
{ | |||
public Form1() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void button1_Click(object sender, EventArgs e) | |||
{ | |||
string url = "http://192.168.1.56:8089"; | |||
AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); | |||
string value = JsonConvert.SerializeObject(aGVToUpSystem); | |||
var res = APIHelper.GetInstance.HttpRequest(url, "", value, RequestType.POST); | |||
} | |||
} | |||
} |
@@ -0,0 +1,60 @@ | |||
<root> | |||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
<xsd:element name="root" msdata:IsDataSet="true"> | |||
<xsd:complexType> | |||
<xsd:choice maxOccurs="unbounded"> | |||
<xsd:element name="metadata"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||
<xsd:attribute name="type" type="xsd:string" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="assembly"> | |||
<xsd:complexType> | |||
<xsd:attribute name="alias" type="xsd:string" /> | |||
<xsd:attribute name="name" type="xsd:string" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="data"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
<xsd:attribute ref="xml:space" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
<xsd:element name="resheader"> | |||
<xsd:complexType> | |||
<xsd:sequence> | |||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
</xsd:sequence> | |||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:choice> | |||
</xsd:complexType> | |||
</xsd:element> | |||
</xsd:schema> | |||
<resheader name="resmimetype"> | |||
<value>text/microsoft-resx</value> | |||
</resheader> | |||
<resheader name="version"> | |||
<value>2.0</value> | |||
</resheader> | |||
<resheader name="reader"> | |||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<resheader name="writer"> | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
</root> |
@@ -0,0 +1,17 @@ | |||
namespace TestDemo | |||
{ | |||
internal static class Program | |||
{ | |||
/// <summary> | |||
/// The main entry point for the application. | |||
/// </summary> | |||
[STAThread] | |||
static void Main() | |||
{ | |||
// To customize application configuration such as set high DPI settings or default font, | |||
// see https://aka.ms/applicationconfiguration. | |||
ApplicationConfiguration.Initialize(); | |||
Application.Run(new Form1()); | |||
} | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<OutputType>WinExe</OutputType> | |||
<TargetFramework>net6.0-windows</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<UseWindowsForms>true</UseWindowsForms> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.AGV\BPASmartClient.AGV.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Http\BPASmartClient.Http.csproj" /> | |||
</ItemGroup> | |||
</Project> |