feat - 添加事件接口内容

master
SoulStar 1 month ago
parent 6b1d0ffa45
commit 32d25d5732

@ -1,4 +1,5 @@
using CFX;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -18,12 +19,14 @@ namespace Sln.Iot.CFX.Event
{
eve = new EndpointConnected()
{
CFXHandle = "CFX.S07.E022012702",
RequestNetworkUri = "amqp://host33/",
RequestTargetAddress = "/queue/SN23123"
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,4 +1,5 @@
using CFX;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -18,12 +19,12 @@ namespace Sln.Iot.CFX.Event
{
eve = new EndpointShuttingDown()
{
CFXHandle = "CFX.S07.E022012702",
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,20 @@ namespace Sln.Iot.CFX.Event
{
eve = new FaultAcknowledged()
{
Operator = new Operator()
{
ActorType = ActorType.Human,
FirstName = "王",
LastName = "晟睿",
LoginName = "admin",
OperatorIdentifier = "OP-1000"
},
FaultOccurrenceId = Guid.NewGuid()
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,20 @@ namespace Sln.Iot.CFX.Event
{
eve = new FaultCleared()
{
Operator = new Operator()
{
ActorType = ActorType.Human,
FirstName = "王",
LastName = "晟睿",
LoginName = "admin",
OperatorIdentifier = "OP-1000"
},
FaultOccurrenceId = Guid.NewGuid()
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,23 @@ namespace Sln.Iot.CFX.Event
{
eve = new FaultOccurred()
{
Fault = new Fault()
{
Cause = FaultCause.MechanicalFailure,
Severity = FaultSeverity.Error,
FaultCode = "ERROR 3943480",
FaultOccurrenceId = Guid.NewGuid(),
Lane = 1,
AccessType = AccessType.Local,
Description = "Error",
OccurredAt = DateTime.Now,
TransactionID = Guid.NewGuid(),
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,4 +1,5 @@
using CFX;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -18,12 +19,13 @@ namespace Sln.Iot.CFX.Event
{
eve = new Heartbeat()
{
CFXHandle = "CFX.S07.E012012701",
HeartbeatFrequency = TimeSpan.FromSeconds(60)
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,21 @@ namespace Sln.Iot.CFX.Event
{
eve = new LogEntryRecorded()
{
InformationId = "I1234567890",
Message = "logContent",
Importance = LogImportance.Information,
Lane = 1,
Stage = new Stage()
{
StageSequence = 1,
StageName = "工段1",
StageType = StageType.Work
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,39 @@ namespace Sln.Iot.CFX.Event
{
eve = new RecipeActivated()
{
RecipeName = "配方A",
Revision = "1.0",
Lane = 1,
ExpectedCycleTime = 1200000,
ExpectedUnitsPerWorkTransaction = 6,
ExpectedWorkTime = 1200000,
NumberOfComponentsPerUnit = 6,
WorkOrderIdentifier = new WorkOrderIdentifier()
{
WorkOrderId = "WO-1000-1000",
Batch = "WO-1000-1000-B1",
},
TargetQuantity = 500,
RelevantSurface = Surface.Unspecified,
RecipeStagesInformation = new List<RecipeStageInformation>()
{
new RecipeStageInformation()
{
Stage = new Stage()
{
StageSequence = 1,
StageName = "工段1",
StageType = StageType.Work
},
ExpectedCycleTime = 5000,
NumberOfComponentsPerUnit = 6,
},
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,23 @@ namespace Sln.Iot.CFX.Event
{
eve = new RecipeModified()
{
RecipeName = "配方A",
Revision = "1.0",
ModifiedBy = new Operator()
{
ActorType = ActorType.Human,
FirstName = "王",
LastName = "晟睿",
LoginName = "admin",
OperatorIdentifier = "OP-1000"
},
Reason = RecipeModificationReason.UpdatedGeometry,
Notes = "修改了配方的几何信息",
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,6 @@
using CFX;
using CFX.ResourcePerformance;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -24,7 +25,7 @@ namespace Sln.Iot.CFX.Event
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,6 @@
using CFX;
using CFX.ResourcePerformance;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +20,12 @@ namespace Sln.Iot.CFX.Event
{
eve = new StationOnline()
{
OfflineDuration = TimeSpan.FromMinutes(0)
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,8 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.CFX.Parameters;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +22,19 @@ namespace Sln.Iot.CFX.Event
{
eve = new StationParametersModified()
{
ModifiedParameters = new List<Parameter>()
{
new TestParameter()
{
Test1 = "1",
Test2 = "2"
}
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,12 @@ namespace Sln.Iot.CFX.Event
{
eve = new StationStateChanged()
{
NewState = ResourceState.PRD,
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,25 @@ namespace Sln.Iot.CFX.Event
{
eve = new UnitsArrived()
{
Units = new List<UnitPosition>()
{
new UnitPosition()
{
UnitIdentifier = "UNIT123456789",
PositionNumber = 1,
PositionName = "位置1",
X = 50.0,
Y = 80.0,
Rotation = 0.0,
FlipX =false,
FlipY =false
},
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,25 @@ namespace Sln.Iot.CFX.Event
{
eve = new UnitsDeparted()
{
Units = new List<UnitPosition>()
{
new UnitPosition()
{
UnitIdentifier = "UNIT123456789",
PositionNumber = 1,
PositionName = "位置1",
X = 50.0,
Y = 80.0,
Rotation = 0.0,
FlipX = false,
FlipY = false
},
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production.Processing;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,25 @@ namespace Sln.Iot.CFX.Event
{
eve = new UnitsProcessed()
{
TransactionId = Guid.NewGuid(),
OverallResult = ProcessingResult.Succeeded,
CommonProcessData = new ProcessData()
{
},
UnitProcessData = new List<ProcessedUnit>()
{
new ProcessedUnit()
{
UnitIdentifier = "ID12345",
}
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -20,12 +22,27 @@ namespace Sln.Iot.CFX.Event
{
eve = new WorkCompleted()
{
TransactionID = Guid.NewGuid(),
Result = WorkResult.Completed,
Units = new List<UnitPosition>()
{
new UnitPosition()
{
UnitIdentifier = "UNIT123456789",
PositionNumber = 1,
PositionName = "位置1",
X = 50.0,
Y = 80.0,
Rotation = 0.0,
FlipX = false,
FlipY = false
},
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,26 @@ namespace Sln.Iot.CFX.Event
{
eve = new WorkStageCompleted()
{
TransactionID = Guid.NewGuid(),
Stage = new Stage()
{
StageSequence = 1,
StageName = "工段1",
StageType = StageType.Work
},
Result = WorkResult.Completed,
PerformanceImpacts = new List<PerformanceImpact>()
{
new PerformanceImpact()
{
Cause = PerformanceImpactCause.LowFeederSpeed,
}
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,18 @@ namespace Sln.Iot.CFX.Event
{
eve = new WorkStagePaused()
{
TransactionID = Guid.NewGuid(),
Stage = new Stage()
{
StageSequence = 1,
StageName = "工段1",
StageType = StageType.Work
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,18 @@ namespace Sln.Iot.CFX.Event
{
eve = new WorkStageResumed()
{
TransactionID = Guid.NewGuid(),
Stage = new Stage()
{
StageSequence = 1,
StageName = "工段1",
StageType = StageType.Work
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -19,12 +21,18 @@ namespace Sln.Iot.CFX.Event
{
eve = new WorkStageStarted()
{
TransactionID = Guid.NewGuid(),
Stage = new Stage()
{
StageSequence = 1,
StageName = "工段1",
StageType = StageType.Work
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -1,5 +1,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.Event
{
@ -20,12 +22,27 @@ namespace Sln.Iot.CFX.Event
{
eve = new WorkStarted()
{
TransactionID = Guid.NewGuid(),
Lane = 1,
Units = new List<UnitPosition>()
{
new UnitPosition()
{
UnitIdentifier = "UNIT123456789",
PositionNumber = 1,
PositionName = "位置1",
X = 50.0,
Y = 80.0,
Rotation = 0.0,
FlipX = false,
FlipY = false
},
}
};
}
catch (Exception e)
{
SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
}
return eve;
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CFX.Structures;
using CFX;
namespace Sln.Iot.CFX.Parameters
{
public class TestParameter : Parameter
{
public string Test1 { get; set; } = string.Empty;
public string Test2 { get; set; } = string.Empty;
}
}

@ -25,6 +25,7 @@
using CFX;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -70,6 +71,7 @@ public class AreYouThereRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("端点在位查询请求数据解析异常", e);
}
}
}

@ -26,6 +26,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -61,6 +62,7 @@ public class GetActiveFaultsRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -26,6 +26,7 @@
using CFX;
using CFX.Production;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -61,6 +62,7 @@ public class GetActiveRecipeRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -25,6 +25,7 @@
using CFX;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -60,6 +61,7 @@ public class GetEndpointInformationRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -26,6 +26,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -61,6 +62,7 @@ public class HandleFaultRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -26,6 +26,7 @@
using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -61,6 +62,7 @@ public class ModifyStationParametersRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -26,6 +26,7 @@
using CFX;
using CFX.InformationSystem.UnitValidation;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -61,6 +62,7 @@ public class ValidateUnitsRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -25,6 +25,7 @@
using CFX;
using CFX.Structures;
using Sln.Iot.Serilog;
namespace Sln.Iot.CFX.RequestReceived;
@ -60,6 +61,7 @@ public class WhoIsThereRequestReceived
Message = e.Message
}
};
SerilogHelper.Instance.Error("请求数据解析异常", e);
}
}
}

@ -10,4 +10,8 @@
<PackageReference Include="CFX.CFXSDK" Version="2.0.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Sln.Iot.Serilog\Sln.Iot.Serilog.csproj" />
</ItemGroup>
</Project>

Loading…
Cancel
Save