refactor(driver-s7): extract S7DriverOptions to .Contracts with parallel CpuType enum
Introduces Driver.S7.Contracts (dependency-free POCO project) and moves S7DriverOptions / S7ProbeOptions / S7TagDefinition / S7DataType into it. Adds S7CpuType enum mirroring S7.Net.CpuType exactly (7 values with explicit integer codes). Runtime S7CpuTypeMap bridges S7CpuType → S7.Net.CpuType at the single Plc construction site in S7Driver.InitializeAsync. S7DriverFactoryExtensions and S7CommandBase updated to use S7CpuType; test files updated to match (S7_1500Profile, S7DriverScaffoldTests). AdminUI can now reference Driver.S7.Contracts without pulling in S7netplus.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using CliFx.Attributes;
|
||||
using ZB.MOM.WW.OtOpcUa.Driver.Cli.Common;
|
||||
using S7NetCpuType = global::S7.Net.CpuType;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Driver.S7.Cli;
|
||||
|
||||
@@ -24,7 +23,7 @@ public abstract class S7CommandBase : DriverCommandBase
|
||||
[CommandOption("cpu", 'c', Description =
|
||||
"S7 CPU family: S7200 / S7200Smart / S7300 / S7400 / S71200 / S71500 " +
|
||||
"(default S71500). Determines the ISO-TSAP slot byte.")]
|
||||
public S7NetCpuType CpuType { get; init; } = S7NetCpuType.S71500;
|
||||
public S7CpuType CpuType { get; init; } = S7CpuType.S71500;
|
||||
|
||||
/// <summary>Gets the rack number.</summary>
|
||||
[CommandOption("rack", Description = "Rack number (default 0 — single-rack).")]
|
||||
|
||||
Reference in New Issue
Block a user