40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using CommonUsage.Protocols.VDA5050.Messages;
|
|
using CommonUsage.Protocols.VDA5050.Objects;
|
|
|
|
namespace StandardScene.CarTypes
|
|
{
|
|
public class VDA5050Commons
|
|
{
|
|
private static uint _headerId = 0; // Tracks the current header ID.
|
|
private static readonly string _protocolVersion = "1.0"; // Example protocol version.
|
|
private static readonly string _manufacturer = "YourManufacturer"; // Replace with your manufacturer.
|
|
private static readonly string _serialNumber = "test-01"; // Replace with your AGV's serial number.
|
|
|
|
public static instanceAction CreateInstanceAction(string actionId, string actionType)
|
|
{
|
|
return new instanceAction
|
|
{
|
|
headerId = ++_headerId, // Increment header ID for each message.
|
|
timestamp = DateTime.UtcNow.ToString("o"), // ISO 8601 timestamp.
|
|
version = _protocolVersion,
|
|
manufacturer = _manufacturer,
|
|
serialNumber = _serialNumber,
|
|
actions = new List<actionState>
|
|
{
|
|
new actionState
|
|
{
|
|
actionId = actionId,
|
|
actionType = actionType,
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|