mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-24 02:58:36 +08:00
cef83550cb
# Description Implements **OPC UA — Vision** and uses it to build the demo the companion specifications were drafted for: an eye-in-hand camera watches a bin of parts, a language model *looks at the frame*, decides which part matches the instruction, and commands the robot through Robot Intent — with the OpenUSD viewer showing the arm move and the bin empty out. > **Draft, and stacked.** [#4195](https://github.com/OPCFoundation/UA-.NETStandard/pull/4195) has merged and master is merged in, so what is left on top of `master` is the Vision work plus the unmerged `marcschier/ai-model-management` branch, which the demo needs for the model/dataset/deployment provenance. Review the Vision commits; the AI Model Management work lands with its own PR. ## What is here **The specification, implemented.** `Opc.Ua.Vision` is generated from the spec's own `Opc.Ua.Vision.NodeSet2.xml`, vendored byte-identically (SHA-256 `79C592C6…`, verified against a fresh download and stored LF-preserved like the Robot Intent NodeSet). `Opc.Ua.Vision.Server` builds the §4.2 discovery object, sensors, the coordinate-frame tree, calibrations, media endpoints, inference pipelines and the §9 feedback methods, with rendering and inference behind injectable providers. `Opc.Ua.Vision.Client` is built on the generated ObjectType proxies and composes transforms across the frame tree, which is what turns a detection in camera coordinates into a pose a robot can act on. **Two perception paths behind one contract**, which is exactly what `InferenceLocationEnum` is for. `OnServer` is a deterministic detector derived from the stage's ground truth — no model, no network, no GPU, so CI can exercise the whole loop. `EdgeOffServer` is the agent: it sees the frame over MCP and calls `SubmitDetections`, and the Server publishes results it did not compute. A client reads `DetectionResultType` identically either way. **The agent's eyes.** `tools/Opc.Ua.Mcp.Vision` adds 22 `vision_*` tools, which with the four shared connection tools makes the `vision` profile 26; `vision_get_frame` returns the camera image as an MCP `ImageContentBlock`, so the model looks at pixels rather than reading a description of them. Tool profiles now compose — `--profile vision,robotics` yields 62 tools — so one agent can both see and act without dragging in the full 136-tool catalogue. **The cell.** `samples/Robotics/BinPickingCell` follows the spec's own Robotics-Vision Addendum: the `world → robot_base → flange → gripper_tcp` frame tree with `camera_eih` on the flange, the `HandEye` extrinsics and the `Intrinsics612x512` intrinsics — the addendum's 2448×2048 calibration scaled to the 4×4-binned grid the camera actually delivers. `samples/Robotics/BinPickingClient` hosts the composed MCP catalogue and optionally the viewer. **Documentation.** `docs/Vision.md` (~800 lines) covers the model, hosting, the build context, every topology builder, both perception paths, feedback, the MCP profile and the limitations; linked from `docs/README.md`, with the profile table in `docs/McpServer.md` and READMEs for both samples. ## Evidence, not assertions Each of these was measured on a running system rather than assumed: | Claim | Evidence | |---|---| | The camera sees the bin | 612×512 frame with the bin and all five parts in view — red `(212,47,47)`, green `(61,193,71)`, blue `(54,85,218)`, yellow `(215,196,58)`, orange `(209,119,55)` | | An agent can act on what it sees | Over MCP, `vision_get_frame` returns a 612×512 PNG that decodes from base64 to 1,254,051 bytes, the descriptor beside the detections says 612×512, and all five `BoundingBox2D` centres land **inside** the frame on the pixel colour their own detection claims | | The geometry is right | A detection composed `camera_eih → world` lands on the authored position, residual **0.0000 m** — on both the on-server and off-server paths | | The detector tracks the world | Placing a part drops the next scan from 5 detections to 4, with that part absent | | The robot obeys the agent | Scripted run took command authority and completed a pick and a place, both `Succeeded` | | Tool catalogues are honest | Counted from a running server: vision 26, robotics 40, `vision,robotics` 62, full 136, **zero duplicates** | | Every node is browsable by NodeId | Eight representative NodeIds — both folders, a pipeline, a frame, the sensor, its Calibrations folder, the HandEye calibration, the Media folder — all `Good` | That tool-count check matters because the profile tests collapse names into a `HashSet` and *cannot see* a duplicate registration — so the new tests count registrations, not names. ## Things that were wrong, and are not now Writing the tests found three defects of one kind — code that answered instead of refusing. A zero-norm quaternion was silently rewritten to identity, so a caller with an all-zero orientation got a confident wrong grasp pose. `SubmitCorrection` rewrote a null `ResultId` to empty and called the sink anyway. A bad `StageIdentifier` **killed the host process** inside native `UsdStage.Open`, via an exception .NET cannot catch. All three now refuse loudly and are pinned by tests. **Nodes that existed but could not be reached.** The node manager indexes the Vision root before configurators run, so everything the fluent builder grafted on afterwards — both folders, the pipelines with their Results and Feedback, the frames, the sensors with their optics, calibrations and media endpoints — was never added to the index. Browsing *forward from a parent* worked, because that walks `NodeState.Children` in memory; browsing any of those nodes *by its own NodeId* returned `BadNodeIdUnknown`, which is how an ordinary client and the MCP discovery tools navigate. Registration is now deferred and flushed after each configurator. The first fix covered only the DI path and left the documented non-DI fallback broken in exactly the same way, so `ConfigureVisionAsync` now exists and registers what it builds. That defect survived a green suite because every test browsed children. The new tests assert by NodeId, and were checked against the broken code — with the flush removed, they fail. **Every Method was uncallable.** The Server passed 426 unit tests while not one of its Methods could be invoked over a real session — `RunInference` returned `Bad_TooManyArguments`, and so did every other Method that takes arguments, which is all of them but `StartContinuous` and `Stop`. Three independent faults, each sufficient on its own: the Method nodes were never created (they are Optional children, and the dispatcher guards every attachment with a null check, so it silently attached nothing); nothing declared the arguments, so the stack concluded none were expected; and `MethodDeclarationId` pointed at a synthesised NodeId rather than the NodeSet declaration a client calls with, so the lookup missed the instance Method entirely. The builder now creates the Methods, the `Results` folder and the `Feedback` object when a provider or sink is configured, declares every signature, and names the right declaration. Unit tests could not have caught this: they invoke the handler delegates directly and never go through `MethodState.Call`. It took an end-to-end test over a real session. Relatedly, children created by the generated `CreateOrReplace` helpers carry no `ReferenceTypeId`, so nothing could reach them — fixed once in the build context rather than at the several dozen call sites. **And one where I was wrong.** Earlier in this branch I reversed my own agents' decision and made `SubmitDetections` accept an empty detection set, reasoning that "I looked and the bin is empty" is a correct observation and refusing it forces a correct agent to invent a detection. The reasoning is sound; it is also an argument *against* the specification rather than an implementation of it. §9.5 is normative and explicit — its StatusCode table lists `Bad_InvalidArgument` for "`Detections` empty; or `SubmitCorrection` supplies both or neither corrected array". Worse, **none of §9.5's argument rules were enforced anywhere** — the dispatcher forwarded every submission straight to the feedback sink, so conformance depended on whichever sink a host installed. They are Server obligations, so they now live in the dispatcher, ahead of the sink, proven by strict mocks that would throw if the sink were consulted. The usability problem is real and does not go away by conforming, so it is raised where it can be fixed: [opcua-drafts#70](https://github.com/marcschier/opcua-drafts/issues/70). ## Tracking the updated drafts The Vision, Robot Intent and AI Model Management NodeSets on `opcua-drafts` `main` have moved, partly because of feedback this branch raised. All three are re-vendored byte-identically — verified by comparing git blob hashes against the upstream files rather than by eye — and the implementations follow. **Two statements that were previously inexpressible now have a wire representation.** `SubmitDetections` takes `SceneIsEmpty` and `SubmitCorrection` takes `RetractAll`, so an agent can report "I examined this frame and there is nothing in it" — the terminating condition of the bin-picking task — and can retract a false positive by correcting a result down to nothing. Both are checked in both directions, because the flag is exactly what separates a deliberate empty observation from a lost payload: an empty array without the flag is refused, and the flag with an array attached is refused as two contradictory claims about one frame. Implemented in the dispatcher, the client, the MCP tools the agent drives, and the sample cell. Also absorbed: `LampType` and `LightingMode` became enums (§66), `ProfileName` became `DefaultProfileName` on the endpoint (distinct from the `ProfileName` a caller passes to `GetStreamEndpoint`, which keeps its name), AI `Invoke`/`InvokeAsync` gained `PayloadUri` under the same exactly-one rule, and AI `ListModels` gained a `ContinuationPoint` — because `MaxResults` alone puts everything past the bound permanently out of reach. **OpenUSD is on `0.9.0-alpha`**, verified on the running cell rather than by restore alone: D3D12 backend, 612×512 frame, the bin and all five parts in view and detected — the same result `0.8.0-alpha` produced. The one local workaround that survives is `VisionMethodArguments`, and its reason has changed rather than gone away: the builder materialises these Methods as Optional children through `CreateOrReplace`, which constructs the state object directly and never runs the generated factory that now carries the signatures. Checked rather than assumed — removing the declarations fails five of the eight `VisionMethodSurfaceTests`. ## Review feedback Three threads, all addressed in `0fe2803a3`: - **The AI Model Management work is now a library family, not a sample.** `src/Opc.Ua.AI` (model), `.Inference` (`IInferenceBackend` and backends), `.Server` (node manager) and `.Client` (discovery, reads, calls, artefact transfer), in the same shape as the Robotics and Vision families; the samples become `samples/AI/ModelManagementServer` and `ModelManagementClient`. The client library needed real work rather than relocation: its browsing surface was `private` inside the sample's scenario runner, so moving the file alone would have produced a library nobody could call. - **No cloud-vendor SDK is referenced anywhere.** Inference goes through `Microsoft.Extensions.AI` — an `IChatClient` is implemented by hosted services and on-device runtimes alike, which is exactly the property clause 8.1 asserts. `Azure.Identity` is gone: workload identity is not an Azure feature, every platform projects a token into a file and each SDK reads that file behind its own API, so the resolver reads it directly. The comment claiming `Microsoft.Extensions.AI` would force a `System.Text.Json` bump was stale — it pins 10.0.10, which this repository already centralises on. - **`BinPickingCell` and `BinPickingClient` moved into `samples/Robotics/`**, which is where they belonged: the cell was already linking the arm, its kinematics and both USD assets out of `IntentEnabledRobot`. ## Upstream Work that belonged elsewhere went elsewhere rather than being worked around locally: - **`openusd-dotnet` [#13](https://github.com/marcschier/openusd-dotnet/pull/13)** — merged and shipped in `0.8.0-alpha`. `SilkFrameCapture.Capture` rendered only the first capture of a session and silently returned a blank frame for every one after it. Also filed [#14](https://github.com/marcschier/openusd-dotnet/issues/14) (no camera-by-prim API) and [#15](https://github.com/marcschier/openusd-dotnet/issues/15) (skipped tests reported as passed — which fooled me for several runs). Both are fixed; this branch takes `0.8.0-alpha` and deletes two workarounds, including 143 lines of hand-rolled projection maths. - **`opcua-drafts` [#66](https://github.com/marcschier/opcua-drafts/issues/66)–[#69](https://github.com/marcschier/opcua-drafts/issues/69)** — a close read of the spec produced 22 candidate ambiguities; 12 were discarded as misreadings with clause citations and the remaining 10 filed. One is concrete: five members exist in the NodeId CSV that no clause documents. - **`opcua-drafts` [#70](https://github.com/marcschier/opcua-drafts/issues/70)** — §9.5 could not express an empty observation or a false-positive retraction. **Adopted**, with the explicit-flag resolution argued for: `SubmitDetections` gained `SceneIsEmpty`, `SubmitCorrection` gained `RetractAll`, and the corrected-array rule relaxed from *exactly one* to *at most one*. - **`opcua-drafts` [#71](https://github.com/marcschier/opcua-drafts/issues/71)** — the Vision NodeSet browse-named all 13 `InputArguments` / `OutputArguments` Properties in the Vision namespace rather than the base namespace, so a stack could not find them and every Method in the specification was uncallable. **Fixed**; this branch now tracks the corrected artefact. ## The defect underneath it all The end-to-end suite was removed earlier in this branch because nine of its fourteen tests failed on one symptom: a client could not open a pipeline's `Feedback` object or enumerate its `Results`, even though browsing the same parent listed both. Restoring it meant explaining that, and the explanation was not in Vision. `RelativePathElement` initialised **`IsInverse` to `true`**. A caller that sets a `ReferenceTypeId` and a `TargetName` — which reads as *"the child reached by this Reference"* — was therefore asking the Server for the **inverse** Reference, and got `Bad_NoMatch` with nothing in the request to suggest why. `ObjectTypeClient.ResolveChildNodeIdAsync` is such a caller, and it is what **every source-generated Optional-child accessor in the stack** is built on — the accessor whose own documentation cites `AlarmConditionTypeClient.GetShelvingStateAsync` as an example. Vision is merely where it surfaced, because Vision puts two Optional children on the path an off-Server agent must take. The sibling helper in `StateMachineTypeClientExtensions` already set `IsInverse = false` by hand, which is the shape of a trap rather than a default. The default is now forward, `ResolveChildNodeIdAsync` says so explicitly, and the existing test that had recorded `true` as *expected* now pins `false` with the reasoning. Of the forty `RelativePathElement` construction sites in the tree, that accessor was **the only one relying on the default at all** — every deliberate caller already set it. Two further defects were found underneath it, both real and both fixed: - The generated `CreateOrReplace` helpers construct a child state object directly and leave **`TypeDefinitionId`** unset as well as `ReferenceTypeId`. A child referenced by nothing cannot be browsed; one with no type definition is a malformed Object that a client filtering by type silently skips — which is exactly what `EnumerateResultsAsync` does. Normalisation moved to `VisionNodeManager`, so it also covers the case the builder cannot see: a result published **at runtime** by an inference provider, long after the address space was built. That path produced results a client could list but not read. - `Opc.Ua.AI` shipped without an `AssemblyInfo`, so the solution built with six `CA1014` warnings. I had initially "fixed" this in the Vision client with Browse-based fallbacks, on the strength of a probe that appeared to show `TranslateBrowsePathsToNodeIds` failing even for `Server → ServerStatus`. That probe was wrong: it used an unqualified `ReferenceTypeIds`, which inside a `Opc.Ua.Vision.*` namespace binds to *Vision's* `ReferenceTypeIds` and yields a nonsense NodeId. Chasing that to the end is what turned up the real cause. **The fallbacks are gone** — they would have hidden a stack-wide bug behind a Vision-shaped workaround, and one of them matched on browse name while ignoring the namespace index. `tests/Opc.Ua.Vision.Intent.Tests` is restored and back in `UA.slnx`, passing **14/14** on its own merit rather than through a client-side workaround. A registration test now pins the pipeline's `Feedback` and `Results` children, which nothing covered before. ## Running it, and what that found The demo's premise is that a language model **looks at the bin and reasons about what it sees**. Running it end to end showed it could not, for reasons no test covered, because every one of them lived between components. **The sample did not compile.** Two `CS8604` nullable errors with `TreatWarningsAsErrors`, so neither the cell server nor the demo could be started at all. Worth recording that my first explanation was wrong: CI *does* build this project - the Linux leg's `net10.0` pass compiles it, log-confirmed - so this is not a coverage gap in the workflow, and no workflow change was made. **`Pick` and `Place` never moved the arm.** They were a delay plus a gripper action, so the operations reported `Succeeded` while nothing travelled. They now solve IK once and interpolate in joint space. **And the parts never moved**: the arm swung but the bin stayed full, because nothing tied the held object to the world state. The connector now creates 11 monitored items where it created 6, and a scripted run delivers `SeqNo=151` across 10 messages where it delivered `SeqNo=3` across 1. **The frame was smuggled through a string field.** The media provider put a base64 *data URI* of the PNG into `VisionImageReferenceDataType.Uri` - a field meant to be a *reference*, while the bytes were already returned in the inline `ByteString`. Every response therefore shipped the image twice, and a 1,311,400-byte PNG became a 1,748,536-character string against a `MaxStringLength` of 65,535: **26.7x over**. That is why raising `MaxByteStringLength`, `MaxArrayLength` and `MaxMessageSize` never helped - none of them govern a `String`. Separately the MCP tool assigned raw bytes where `ImageContentBlock` requires base64, so the wire carried `"data":"�PNG..."` - every non-UTF-8 byte replaced by U+FFFD, destroying the image and inflating the response to 6.8 MB. **The camera was aimed at nothing.** The arm's home pose, the flange scan pose the Vision model declared and the joint angles in the USD stage were three independent claims about where the camera was, and they disagreed - the declared flange orientation pointed the view 86 degrees away from the projection camera. Solving them as one thing exposed two further constraints that are easy to miss: the camera has to sit off the tool axis or it photographs its own gripper, and the IK branch has to be elbow-back or a link parks under the camera and fills the frame with the arm's own upper arm. A third was a regression this branch introduced and `Opc.Ua.Robotics.Tests` caught - aiming a straight-down camera from a point on the base's own X-Z plane puts the wrist on the J4/J6 singularity, so every motion away from home fails to solve. A 15-degree camera roll, free because the camera still looks straight down, gets 25 degrees clear, which is the margin the poses before this branch had. **The frame and the detections were different images.** The sensor declared 2448x2048, the clip endpoint 1280x1024, and the renderer produced 640x512 - not even the same aspect ratio. The ground-truth detector projects through the declared intrinsics, so its boxes lived in 2448x2048 space while an agent was handed a 640x512 picture: *"pick the red cube you can see"* arrived with coordinates that pointed off the image. Everything now agrees at 612x512, an exact 4x4 bin of the native sensor with the intrinsics scaled to match; the native size stays in the model and serial number, where it describes the hardware rather than the image. **`LatestClip` was created and never written**, so it reported `Bad_NoDataAvailable` for the life of the Server and a consumer following the model - read the published frame, call the method only if there is none - never got a frame. The dispatcher now publishes a clip it has just encoded, for every Vision server rather than this sample alone. One genuine API gap turned up on the way: `OpcUaServerOptions` exposes `MaxByteStringLength`, `MaxArrayLength` and `MaxMessageSize` and **no `MaxStringLength`**, so a Server that legitimately needs a long string could not raise the limit through the hosting API at all. Added, with tests. It is not the fix for anything above - that was a design bug - but the missing knob was real. ## Not finished - **Two projects sit below the repository's 80% line coverage.** `Opc.Ua.Vision.OpenUsd` is at 71.1% — what is left only executes with a real OpenUSD stage and plugin tree, which is not on every build agent. `Opc.Ua.AI.Inference` is now at **86.7%**, up from 12.9%: the code this branch *wrote* is covered by 25 tests, and `RestChatCompletionsBackend` — previously the whole of the shortfall — is covered by 18 more against a stubbed `HttpMessageHandler`, exercising success, refusal, throttling, retry-after, timeout and cancellation without a network. Everything else clears the bar — `Opc.Ua.Vision.Server` 92.1%, `Opc.Ua.AI` 91.4%, `.Vision.Client` 88.1%, `Opc.Ua.Vision` 85.7%, `Opc.Ua.AI.Server` 80.1%, all measured with coverlet. The CI coverage gate reports itself as advisory and non-blocking. - **`SamplesCollected` is not counted here, and `docs/Vision.md` now says so.** Section 9.4 requires a Server to count a negative example (`SceneIsEmpty` / `RetractAll` carrying a `GroundTruthLabel`) exactly as it counts one carrying geometry. `VisionNodeManager` does not, and structurally cannot: `SamplesCollected` is a property of `LearningJobType`, which the *AI Model Management* companion defines, and Vision reaches the job through a `NodeId` value rather than a Reference **precisely so this model takes no dependency on the model that defines it**. What the Server does guarantee is that the negative example survives the hop intact — both flags are carried verbatim to `IVisionFeedbackSink` — so a host that binds a learning job has everything it needs to satisfy the clause on the counter it owns. Stated in the limitations rather than left implied. ## Related Issues Was stacked on #4195, now merged. No tracking issue yet for the Vision implementation itself — happy to open one if you would like the design recorded as an ADR before this goes further. ## Checklist - [x] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf) and read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc. - [x] I have added tests that prove my fix is effective or that my feature works and increased code coverage. — *Types 8562, Server 4072, Client 2123, InformationModel 1063, Robotics 540, Tools 466, Vision 442, AI 74 and the restored Vision+Intent end-to-end suite 14/14, all green on net10.0. Only `.OpenUsd` (71.1%) is below the 80% bar — see Not finished.* - [x] I have added all necessary documentation. - [x] I have verified that my changes do not introduce (new) build or analyzer warnings. — *`dotnet build UA.slnx -c Release`: 0 errors, 0 warnings.* - [x] I ran **all** tests locally using the **UA.slnx** solution against at least .net **framework** and .net **10**, and all passed. — *net48: Types 8555, Client 2126, Vision 385 green. Two net48 Server tests fail (`CreateUserManagementSeamBindsTheModelToTheServerAsync`, and `DurableDataValueQueueVerifyReferenceBatchingAsync` only under parallel load); both were confirmed **pre-existing** by re-running them with the `IsInverse` change reverted, which fails identically.* - [ ] I fixed **all** failing and flaky tests in the CI pipelines and **all** CodeQL warnings. — *The net48 build legs failed because the restored end-to-end project used `ValueTask.FromResult` / `string.Create`, which do not exist on .NET Framework; fixed in `fb57522da` and verified building on every TFM. `DisposeDrainsHeldConnectionCallbackBeforeListenerDisposal` failed once on the Ubuntu Client leg — a 13 ms timing-sensitive reverse-connect disposal test that passes locally 2123/2123 and touches no browse paths.* - [ ] I have addressed **all** PR feedback received. ## Typed Vision-guided Robotics MCP workflows The branch now also makes the demo workflow first-class in the Full MCP profile: - replaces stringified Robotics intent and mission inputs with typed request schemas and exact name-or-NodeId selectors; - adds bounded operation/mission paging, stable step-to-operation identity, retained mission discovery, and `robotics_wait_mission`; - makes `vision_run_inference` return bounded typed detection, inspection, or segmentation summaries in one call; - adds same-session `robotics_vision_pick` to select a detection and submit Pick or Pick/Place work without implicitly taking authority, retrying, cancelling, or waiting; and - starts Publish workers for classic subscriptions so an independently launched OpenUSD viewer receives live robot and part updates. The migration guide documents the intentionally breaking MCP request-schema changes. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1dab1302-19c5-4a9b-a50c-d97d389713aa Copilot-Session: a248a589-9a20-4372-868e-5d347e57001b Copilot-Session: 99d1ab42-f83a-41ab-bf3e-85bf81fadace Copilot-Session: bcbc8ac9-5abd-42a8-8bac-e10533790e2e
1606 lines
51 KiB
C#
1606 lines
51 KiB
C#
/* ========================================================================
|
|
* Copyright (c) 2005-2026 The OPC Foundation, Inc. All rights reserved.
|
|
*
|
|
* OPC Foundation MIT License 1.00
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person
|
|
* obtaining a copy of this software and associated documentation
|
|
* files (the "Software"), to deal in the Software without
|
|
* restriction, including without limitation the rights to use,
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following
|
|
* conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be
|
|
* included in all copies or substantial portions of the Software.
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
*
|
|
* The complete license agreement can be found here:
|
|
* http://opcfoundation.org/License/MIT/1.00/
|
|
* ======================================================================*/
|
|
|
|
using System.ComponentModel;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using Opc.Ua.Robotics.Client.Intent;
|
|
using Opc.Ua.RobotIntent;
|
|
|
|
namespace Opc.Ua.Mcp.Tools
|
|
{
|
|
// CLR arrays are intentional at this JSON boundary: the MCP schema generator exposes
|
|
// ArrayOf<T> as its backing memory object and cannot bind an incoming JSON array to it.
|
|
// The converter immediately projects these values into ArrayOf<T> for OPC UA APIs.
|
|
|
|
/// <summary>
|
|
/// Detail level for list operations.
|
|
/// </summary>
|
|
[JsonConverter(typeof(JsonStringEnumConverter<DetailLevel>))]
|
|
public enum DetailLevel
|
|
{
|
|
/// <summary>
|
|
/// Return concise summaries (default).
|
|
/// </summary>
|
|
Summary,
|
|
|
|
/// <summary>
|
|
/// Return full snapshots.
|
|
/// </summary>
|
|
Full
|
|
}
|
|
|
|
/// <summary>
|
|
/// Work selector for filtering operations or missions.
|
|
/// </summary>
|
|
[JsonConverter(typeof(JsonStringEnumConverter<WorkSelector>))]
|
|
public enum WorkSelector
|
|
{
|
|
/// <summary>
|
|
/// Return all operations/missions regardless of state.
|
|
/// </summary>
|
|
All,
|
|
|
|
/// <summary>
|
|
/// Return only active (non-terminal) operations/missions.
|
|
/// </summary>
|
|
Active,
|
|
|
|
/// <summary>
|
|
/// Return only terminal (succeeded/cancelled/failed) operations/missions.
|
|
/// </summary>
|
|
Terminal
|
|
}
|
|
|
|
/// <summary>
|
|
/// Discriminator for intent kinds in missions and submit tools.
|
|
/// </summary>
|
|
[JsonConverter(typeof(JsonStringEnumConverter<IntentKind>))]
|
|
public enum IntentKind
|
|
{
|
|
/// <summary>
|
|
/// Point-to-point joint motion.
|
|
/// </summary>
|
|
JointMove,
|
|
|
|
/// <summary>
|
|
/// Straight Cartesian segment.
|
|
/// </summary>
|
|
LinearMove,
|
|
|
|
/// <summary>
|
|
/// Circular arc through a via point.
|
|
/// </summary>
|
|
CircularMove,
|
|
|
|
/// <summary>
|
|
/// Time-parameterised joint trajectory.
|
|
/// </summary>
|
|
Trajectory,
|
|
|
|
/// <summary>
|
|
/// Multi-waypoint Cartesian path.
|
|
/// </summary>
|
|
CartesianPath,
|
|
|
|
/// <summary>
|
|
/// Force-controlled contact motion.
|
|
/// </summary>
|
|
Force,
|
|
|
|
/// <summary>
|
|
/// Continuous arc welding.
|
|
/// </summary>
|
|
ArcWeld,
|
|
|
|
/// <summary>
|
|
/// Discrete spot welding.
|
|
/// </summary>
|
|
SpotWeld,
|
|
|
|
/// <summary>
|
|
/// Material dispensing.
|
|
/// </summary>
|
|
Dispense,
|
|
|
|
/// <summary>
|
|
/// Fastening/joining.
|
|
/// </summary>
|
|
Fasten,
|
|
|
|
/// <summary>
|
|
/// Pattern-based palletising.
|
|
/// </summary>
|
|
Palletise,
|
|
|
|
/// <summary>
|
|
/// Surface finishing (sanding, polishing).
|
|
/// </summary>
|
|
SurfaceFinish,
|
|
|
|
/// <summary>
|
|
/// Close or activate a gripper/tool.
|
|
/// </summary>
|
|
Grasp,
|
|
|
|
/// <summary>
|
|
/// Open or deactivate a gripper/tool.
|
|
/// </summary>
|
|
Release,
|
|
|
|
/// <summary>
|
|
/// Inbound pick from a source location.
|
|
/// </summary>
|
|
Pick,
|
|
|
|
/// <summary>
|
|
/// Outbound place at a destination location.
|
|
/// </summary>
|
|
Place,
|
|
|
|
/// <summary>
|
|
/// Fit or release a docked tool.
|
|
/// </summary>
|
|
ToolChange,
|
|
|
|
/// <summary>
|
|
/// Write a controller output signal.
|
|
/// </summary>
|
|
SetOutput,
|
|
|
|
/// <summary>
|
|
/// Call a server-side program.
|
|
/// </summary>
|
|
CallProgram,
|
|
|
|
/// <summary>
|
|
/// Time or signal wait.
|
|
/// </summary>
|
|
Wait
|
|
}
|
|
|
|
/// <summary>
|
|
/// A typed named value: name + dataType tag + JSON payload.
|
|
/// </summary>
|
|
public sealed class NamedTypedValueDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the attribute or argument name.
|
|
/// </summary>
|
|
[Description("Attribute or argument name.")]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the OPC UA data type name.
|
|
/// </summary>
|
|
[Description("OPC UA data type: Boolean, Int32, UInt32, Double, String, Float, " +
|
|
"Int16, UInt16, Int64, UInt64.")]
|
|
public string? DataType { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the value as a JSON element.
|
|
/// </summary>
|
|
[Description("The value.")]
|
|
public JsonElement Value { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A 3-D position as [x, y, z] in metres.
|
|
/// </summary>
|
|
public sealed class PosePositionDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the X coordinate in metres.
|
|
/// </summary>
|
|
[Description("X coordinate in metres.")]
|
|
public double X { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Y coordinate in metres.
|
|
/// </summary>
|
|
[Description("Y coordinate in metres.")]
|
|
public double Y { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Z coordinate in metres.
|
|
/// </summary>
|
|
[Description("Z coordinate in metres.")]
|
|
public double Z { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A quaternion orientation [x, y, z, w].
|
|
/// </summary>
|
|
public sealed class QuaternionDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the X quaternion component.
|
|
/// </summary>
|
|
[Description("Quaternion X component.")]
|
|
public double X { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Y quaternion component.
|
|
/// </summary>
|
|
[Description("Quaternion Y component.")]
|
|
public double Y { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Z quaternion component.
|
|
/// </summary>
|
|
[Description("Quaternion Z component.")]
|
|
public double Z { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the W quaternion component.
|
|
/// </summary>
|
|
[Description("Quaternion W component.")]
|
|
public double W { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A 3-D pose: position in metres and quaternion orientation, with optional frame reference.
|
|
/// </summary>
|
|
public sealed class PoseDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the position in metres.
|
|
/// </summary>
|
|
[Description("Position in metres. Required.")]
|
|
public PosePositionDto? Position { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the quaternion orientation.
|
|
/// </summary>
|
|
[Description("Unit quaternion orientation [x, y, z, w]. Required.")]
|
|
public QuaternionDto? Orientation { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the optional frame name or NodeId the pose is expressed in.
|
|
/// </summary>
|
|
[Description("Optional frame selector: published FrameId, frame name/BrowseName, or NodeId.")]
|
|
public string? FrameId { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Motion constraints shared by all motion intents.
|
|
/// </summary>
|
|
public sealed class MotionConstraintsDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the speed fraction (0..1].
|
|
/// </summary>
|
|
[Description("Speed fraction within [0, 1]; 0 leaves the controller default.")]
|
|
public double SpeedFraction { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Cartesian speed limit in m/s.
|
|
/// </summary>
|
|
[Description("Cartesian speed limit in m/s.")]
|
|
public double CartesianSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Cartesian acceleration limit in m/s².
|
|
/// </summary>
|
|
[Description("Cartesian acceleration limit in m/s².")]
|
|
public double CartesianAcceleration { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the jerk limit.
|
|
/// </summary>
|
|
[Description("Jerk limit.")]
|
|
public double Jerk { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Blend/termination mode for motion transitions.
|
|
/// </summary>
|
|
public sealed class BlendDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the termination mode: Exact or Blend.
|
|
/// </summary>
|
|
[Description("Termination mode: Exact or Blend.")]
|
|
public TerminationModeEnum Termination { get; set; } = TerminationModeEnum.Exact;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the blend radius in metres.
|
|
/// </summary>
|
|
[Description("Blend radius in metres.")]
|
|
public double Radius { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Common fields shared by all intent inputs.
|
|
/// </summary>
|
|
public abstract class IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the optional intent identifier.
|
|
/// </summary>
|
|
[Description("Optional intent identifier.")]
|
|
public string? IntentId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the optional human-readable label.
|
|
/// </summary>
|
|
[Description("Optional human-readable label.")]
|
|
public string? Label { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the buffer mode: Immediate, Buffered, or Aborting.
|
|
/// </summary>
|
|
[Description("Buffer mode: Immediate, Buffered, or Aborting.")]
|
|
public BufferModeEnum? BufferMode { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the blocking mode: NonBlocking or Single.
|
|
/// </summary>
|
|
[Description("Blocking mode: NonBlocking or Single.")]
|
|
public BlockingModeEnum? BlockingMode { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Common fields for all motion intents.
|
|
/// </summary>
|
|
public abstract class MotionIntentDto : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the tool frame name or NodeId.
|
|
/// </summary>
|
|
[Description("Tool frame selector: frame name/BrowseName or NodeId.")]
|
|
public string? ToolFrame { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the motion constraints.
|
|
/// </summary>
|
|
[Description("Motion constraints.")]
|
|
public MotionConstraintsDto? Constraints { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the blend/termination for this motion.
|
|
/// </summary>
|
|
[Description("Blend/termination for this motion.")]
|
|
public BlendDto? Blend { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the speed fraction as a shorthand for constraints.speedFraction.
|
|
/// </summary>
|
|
[Description("Shorthand for constraints.speedFraction, within [0, 1].")]
|
|
public double SpeedFraction { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Cartesian speed as a shorthand for constraints.cartesianSpeed.
|
|
/// </summary>
|
|
[Description("Shorthand for constraints.cartesianSpeed.")]
|
|
public double CartesianSpeed { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a JointMove intent.
|
|
/// </summary>
|
|
public sealed class JointMoveIntentInput : MotionIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the joint target positions in radians.
|
|
/// </summary>
|
|
[Description("Joint target positions in radians. Provide this or targetPose.")]
|
|
public double[]? JointTargets { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the target pose when joint targets are not supplied.
|
|
/// </summary>
|
|
[Description("Target pose (IK solved by controller). Provide this or jointTargets.")]
|
|
public PoseDto? TargetPose { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a LinearMove intent.
|
|
/// </summary>
|
|
public sealed class LinearMoveIntentInput : MotionIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the target pose.
|
|
/// </summary>
|
|
[Description("Target pose: position in metres, unit quaternion orientation. Required.")]
|
|
public PoseDto? Target { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a CircularMove intent.
|
|
/// </summary>
|
|
public sealed class CircularMoveIntentInput : MotionIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the intermediate via point on the arc.
|
|
/// </summary>
|
|
[Description("Intermediate via point on the arc. Required.")]
|
|
public PoseDto? ViaPoint { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the end target of the arc.
|
|
/// </summary>
|
|
[Description("End target of the arc. Required.")]
|
|
public PoseDto? Target { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A single trajectory point.
|
|
/// </summary>
|
|
public sealed class TrajectoryPointDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the time from start in seconds.
|
|
/// </summary>
|
|
[Description("Time from start in seconds.")]
|
|
public double TimeFromStart { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the joint positions in radians.
|
|
/// </summary>
|
|
[Description("Joint positions in radians.")]
|
|
public double[] Positions { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Gets or sets optional joint velocities.
|
|
/// </summary>
|
|
[Description("Optional joint velocities.")]
|
|
public double[]? Velocities { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets optional joint accelerations.
|
|
/// </summary>
|
|
[Description("Optional joint accelerations.")]
|
|
public double[]? Accelerations { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Trajectory intent.
|
|
/// </summary>
|
|
public sealed class TrajectoryIntentInput : MotionIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the trajectory points.
|
|
/// </summary>
|
|
[Description("Trajectory points with timeFromStart and positions.")]
|
|
public TrajectoryPointDto[] Points { get; set; } = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// A single Cartesian path waypoint.
|
|
/// </summary>
|
|
public sealed class CartesianWaypointDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the waypoint pose.
|
|
/// </summary>
|
|
[Description("Waypoint pose. Required.")]
|
|
public PoseDto? Pose { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets optional per-waypoint blend.
|
|
/// </summary>
|
|
[Description("Optional per-waypoint blend.")]
|
|
public BlendDto? Blend { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a CartesianPath intent.
|
|
/// </summary>
|
|
public sealed class CartesianPathIntentInput : MotionIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the waypoints.
|
|
/// </summary>
|
|
[Description("Cartesian waypoints.")]
|
|
public CartesianWaypointDto[] Waypoints { get; set; } = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Force intent.
|
|
/// </summary>
|
|
public sealed class ForceIntentInput : MotionIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the force direction as a 3-element unit vector.
|
|
/// </summary>
|
|
[Description("Force direction as 3-element unit vector.")]
|
|
public double[] Direction { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Gets or sets the contact force threshold in newtons.
|
|
/// </summary>
|
|
[Description("Contact force threshold in newtons.")]
|
|
public double ContactForce { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the optional reference frame name or NodeId.
|
|
/// </summary>
|
|
[Description("Optional frame selector: published FrameId, frame name/BrowseName, or NodeId.")]
|
|
public string? FrameId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the maximum contact-search distance in metres.
|
|
/// </summary>
|
|
[Description("Maximum contact-search distance in metres.")]
|
|
public double MaxDistance { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to hold force after contact.
|
|
/// </summary>
|
|
[Description("Whether to hold force after contact.")]
|
|
public bool HoldForce { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A typed variant value: dataType tag plus JSON payload.
|
|
/// </summary>
|
|
public sealed class TypedValueDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the OPC UA data type name.
|
|
/// </summary>
|
|
[Description("OPC UA data type: Boolean, Int32, UInt32, Double, String, Float, " +
|
|
"Int16, UInt16, Int64, UInt64.")]
|
|
public string? DataType { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the value as a JSON element.
|
|
/// </summary>
|
|
[Description("The value to write.")]
|
|
public JsonElement Value { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Common fields for all process intents.
|
|
/// </summary>
|
|
public abstract class ProcessIntentDto : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the optional process program name or NodeId.
|
|
/// </summary>
|
|
[Description("Optional process program name or NodeId.")]
|
|
public string? ProcessProgram { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets optional key-value attributes as a JSON object.
|
|
/// </summary>
|
|
[Description("Optional typed key-value attributes.")]
|
|
public NamedTypedValueDto[]? Attributes { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for an ArcWeld process intent.
|
|
/// </summary>
|
|
public sealed class ArcWeldIntentInput : ProcessIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the welding voltage.
|
|
/// </summary>
|
|
[Description("Welding voltage.")]
|
|
public double Voltage { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the wire feed speed.
|
|
/// </summary>
|
|
[Description("Wire feed speed.")]
|
|
public double WireFeedSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the travel speed.
|
|
/// </summary>
|
|
[Description("Travel speed.")]
|
|
public double TravelSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether seam tracking is enabled.
|
|
/// </summary>
|
|
[Description("Whether seam tracking is enabled.")]
|
|
public bool SeamTrackingEnabled { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the weld procedure reference.
|
|
/// </summary>
|
|
[Description("Weld procedure reference.")]
|
|
public string? WeldProcedureRef { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a SpotWeld process intent.
|
|
/// </summary>
|
|
public sealed class SpotWeldIntentInput : ProcessIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the weld schedule number.
|
|
/// </summary>
|
|
[Description("Weld schedule number.")]
|
|
public uint WeldSchedule { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the gun force in newtons.
|
|
/// </summary>
|
|
[Description("Gun force in newtons.")]
|
|
public double GunForce { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Dispense process intent.
|
|
/// </summary>
|
|
public sealed class DispenseIntentInput : ProcessIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the flow rate.
|
|
/// </summary>
|
|
[Description("Flow rate.")]
|
|
public double FlowRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the bead width in metres.
|
|
/// </summary>
|
|
[Description("Bead width in metres.")]
|
|
public double BeadWidth { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the purge cycles count.
|
|
/// </summary>
|
|
[Description("Purge cycles count.")]
|
|
public uint PurgeCycles { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Fasten process intent.
|
|
/// </summary>
|
|
public sealed class FastenIntentInput : ProcessIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the joining-model node.
|
|
/// </summary>
|
|
[Description("Joining-model NodeId. Robot axes are not fastening joints.")]
|
|
public string? Joint { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the program number.
|
|
/// </summary>
|
|
[Description("Program number.")]
|
|
public uint ProgramNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the target torque in newton-metres.
|
|
/// </summary>
|
|
[Description("Target torque in Nm.")]
|
|
public double TargetTorque { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Palletise process intent.
|
|
/// </summary>
|
|
public sealed class PalletiseIntentInput : ProcessIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the pattern name or NodeId.
|
|
/// </summary>
|
|
[Description("Pattern location name or NodeId.")]
|
|
public string? Pattern { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the layer index.
|
|
/// </summary>
|
|
[Description("Layer index.")]
|
|
public uint Layer { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the row index.
|
|
/// </summary>
|
|
[Description("Row index.")]
|
|
public uint Row { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the column index.
|
|
/// </summary>
|
|
[Description("Column index.")]
|
|
public uint Column { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a SurfaceFinish process intent.
|
|
/// </summary>
|
|
public sealed class SurfaceFinishIntentInput : ProcessIntentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the contact force in newtons.
|
|
/// </summary>
|
|
[Description("Contact force in newtons.")]
|
|
public double ContactForce { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the feed rate.
|
|
/// </summary>
|
|
[Description("Feed rate.")]
|
|
public double FeedRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the tool speed.
|
|
/// </summary>
|
|
[Description("Tool speed.")]
|
|
public double ToolSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the step-over distance in metres.
|
|
/// </summary>
|
|
[Description("Step-over distance in metres.")]
|
|
public double StepOver { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Grasp intent.
|
|
/// </summary>
|
|
public sealed class GraspIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the tool name or NodeId.
|
|
/// </summary>
|
|
[Description("Tool name or NodeId to activate.")]
|
|
public string Tool { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the grasp force in newtons.
|
|
/// </summary>
|
|
[Description("Grasp force in newtons.")]
|
|
public double Force { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Release intent.
|
|
/// </summary>
|
|
public sealed class ReleaseIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the tool name or NodeId to deactivate.
|
|
/// </summary>
|
|
[Description("Tool name or NodeId to deactivate.")]
|
|
public string Tool { get; set; } = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Pick intent.
|
|
/// </summary>
|
|
public sealed class PickIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the source location name or NodeId.
|
|
/// </summary>
|
|
[Description("Source location name or NodeId.")]
|
|
public string Source { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the tool name or NodeId.
|
|
/// </summary>
|
|
[Description("Tool name or NodeId.")]
|
|
public string Tool { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the object class label of the workpiece being taken.
|
|
/// </summary>
|
|
[Description("Class label of the workpiece being taken.")]
|
|
public string? ObjectClass { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Place intent.
|
|
/// </summary>
|
|
public sealed class PlaceIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the destination location name or NodeId.
|
|
/// </summary>
|
|
[Description("Destination location name or NodeId.")]
|
|
public string Destination { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the tool name or NodeId.
|
|
/// </summary>
|
|
[Description("Tool name or NodeId.")]
|
|
public string Tool { get; set; } = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a ToolChange intent.
|
|
/// </summary>
|
|
public sealed class ToolChangeIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the tool name or NodeId to fit, or null to release.
|
|
/// </summary>
|
|
[Description("Tool name or NodeId to fit, or null to release.")]
|
|
public string? Tool { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the dock station name or NodeId.
|
|
/// </summary>
|
|
[Description("Dock station name or NodeId.")]
|
|
public string? DockStation { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a SetOutput intent.
|
|
/// </summary>
|
|
public sealed class SetOutputIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the output signal name or NodeId.
|
|
/// </summary>
|
|
[Description("Output signal name or NodeId.")]
|
|
public string Output { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the value to write with data type guidance.
|
|
/// </summary>
|
|
[Description("Value to write. Required, with an explicit dataType.")]
|
|
public TypedValueDto? Value { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a CallProgram intent.
|
|
/// </summary>
|
|
public sealed class CallProgramIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the program name or NodeId.
|
|
/// </summary>
|
|
[Description("Program name or NodeId.")]
|
|
public string Program { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets optional arguments as a JSON object of name/value pairs.
|
|
/// </summary>
|
|
[Description("Optional typed arguments.")]
|
|
public NamedTypedValueDto[]? Arguments { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a Wait intent.
|
|
/// </summary>
|
|
public sealed class WaitIntentInput : IntentCommonDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the wait duration in seconds.
|
|
/// </summary>
|
|
[Description("Wait duration in seconds.")]
|
|
public double Duration { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the signal name or NodeId to wait for.
|
|
/// </summary>
|
|
[Description("Signal name or NodeId to wait for.")]
|
|
public string? Signal { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Typed input for a mission step, carrying a discriminated intent.
|
|
/// </summary>
|
|
public sealed class MissionStepInput
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the step identifier.
|
|
/// </summary>
|
|
[Description("Step identifier.")]
|
|
public string StepId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the optional sequence identifier.
|
|
/// </summary>
|
|
[Description("Optional sequence identifier.")]
|
|
public uint? SequenceId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether the step is released for execution.
|
|
/// </summary>
|
|
[Description("Whether the step is released for execution.")]
|
|
public bool Released { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the error policy: Abort or Skip.
|
|
/// </summary>
|
|
[Description("Error policy: Abort or Skip.")]
|
|
public ErrorPolicyEnum? ErrorPolicy { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the fallback step identifier on error.
|
|
/// </summary>
|
|
[Description("Fallback step identifier on error.")]
|
|
public string? FallbackStepId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the intent for this step.
|
|
/// </summary>
|
|
[Description("The intent for this step. Required.")]
|
|
public MissionIntentInput? Intent { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A flat discriminated union for mission step intents.
|
|
/// </summary>
|
|
public sealed class MissionIntentInput
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the intent kind discriminator.
|
|
/// </summary>
|
|
[Description("Intent kind discriminator.")]
|
|
public IntentKind Kind { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the optional intent identifier.
|
|
/// </summary>
|
|
[Description("Optional intent identifier.")]
|
|
public string? IntentId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the optional human-readable label.
|
|
/// </summary>
|
|
[Description("Optional human-readable label.")]
|
|
public string? Label { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the buffer mode.
|
|
/// </summary>
|
|
[Description("Buffer mode: Immediate, Buffered, or Aborting.")]
|
|
public BufferModeEnum? BufferMode { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the blocking mode.
|
|
/// </summary>
|
|
[Description("Blocking mode: NonBlocking or Single.")]
|
|
public BlockingModeEnum? BlockingMode { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the motion tool frame.
|
|
/// </summary>
|
|
[Description("Motion tool frame name or NodeId.")]
|
|
public string? ToolFrame { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the motion constraints.
|
|
/// </summary>
|
|
[Description("Motion constraints.")]
|
|
public MotionConstraintsDto? Constraints { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the blend parameters.
|
|
/// </summary>
|
|
[Description("Motion blend parameters.")]
|
|
public BlendDto? Blend { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the speed fraction shorthand.
|
|
/// </summary>
|
|
[Description("Optional speed fraction within [0, 1].")]
|
|
public double? SpeedFraction { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Cartesian speed shorthand.
|
|
/// </summary>
|
|
[Description("Optional Cartesian speed in m/s.")]
|
|
public double? CartesianSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the process program.
|
|
/// </summary>
|
|
[Description("Optional process program name or NodeId.")]
|
|
public string? ProcessProgram { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the process attributes.
|
|
/// </summary>
|
|
[Description("Optional typed process attributes.")]
|
|
public NamedTypedValueDto[]? Attributes { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets joint targets for JointMove.
|
|
/// </summary>
|
|
[Description("JointMove targets in radians.")]
|
|
public double[]? JointTargets { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the target pose for JointMove, LinearMove, or CircularMove.
|
|
/// </summary>
|
|
[Description("Target pose for the selected motion kind.")]
|
|
public PoseDto? Target { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the intermediate pose for CircularMove.
|
|
/// </summary>
|
|
[Description("CircularMove intermediate pose.")]
|
|
public PoseDto? ViaPoint { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets trajectory points.
|
|
/// </summary>
|
|
[Description("Trajectory points.")]
|
|
public TrajectoryPointDto[]? Points { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets Cartesian path waypoints.
|
|
/// </summary>
|
|
[Description("Cartesian path waypoints.")]
|
|
public CartesianWaypointDto[]? Waypoints { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Force direction.
|
|
/// </summary>
|
|
[Description("Force direction as a three-element unit vector.")]
|
|
public double[]? Direction { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the contact force.
|
|
/// </summary>
|
|
[Description("Contact force in newtons.")]
|
|
public double? ContactForce { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Force reference frame.
|
|
/// </summary>
|
|
[Description("Force reference frame name or NodeId.")]
|
|
public string? FrameId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the maximum Force search distance.
|
|
/// </summary>
|
|
[Description("Maximum Force search distance in metres.")]
|
|
public double? MaxDistance { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets whether Force holds after contact.
|
|
/// </summary>
|
|
[Description("Whether Force holds after contact.")]
|
|
public bool? HoldForce { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ArcWeld voltage.
|
|
/// </summary>
|
|
[Description("ArcWeld voltage.")]
|
|
public double? Voltage { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ArcWeld wire feed speed.
|
|
/// </summary>
|
|
[Description("ArcWeld wire feed speed.")]
|
|
public double? WireFeedSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ArcWeld travel speed.
|
|
/// </summary>
|
|
[Description("ArcWeld travel speed.")]
|
|
public double? TravelSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets whether ArcWeld seam tracking is enabled.
|
|
/// </summary>
|
|
[Description("Whether ArcWeld seam tracking is enabled.")]
|
|
public bool? SeamTrackingEnabled { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ArcWeld procedure reference.
|
|
/// </summary>
|
|
[Description("ArcWeld procedure reference.")]
|
|
public string? WeldProcedureRef { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SpotWeld schedule.
|
|
/// </summary>
|
|
[Description("SpotWeld schedule.")]
|
|
public uint? WeldSchedule { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SpotWeld gun force.
|
|
/// </summary>
|
|
[Description("SpotWeld gun force in newtons.")]
|
|
public double? GunForce { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Dispense flow rate.
|
|
/// </summary>
|
|
[Description("Dispense flow rate.")]
|
|
public double? FlowRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Dispense bead width.
|
|
/// </summary>
|
|
[Description("Dispense bead width in metres.")]
|
|
public double? BeadWidth { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Dispense purge cycles.
|
|
/// </summary>
|
|
[Description("Dispense purge cycles.")]
|
|
public uint? PurgeCycles { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Fasten joining node.
|
|
/// </summary>
|
|
[Description("Fasten joining-model NodeId.")]
|
|
public string? Joint { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Fasten program number.
|
|
/// </summary>
|
|
[Description("Fasten program number.")]
|
|
public uint? ProgramNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Fasten target torque.
|
|
/// </summary>
|
|
[Description("Fasten target torque in Nm.")]
|
|
public double? TargetTorque { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Palletise pattern.
|
|
/// </summary>
|
|
[Description("Palletise pattern name or NodeId.")]
|
|
public string? Pattern { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Palletise layer.
|
|
/// </summary>
|
|
[Description("Palletise layer index.")]
|
|
public uint? Layer { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Palletise row.
|
|
/// </summary>
|
|
[Description("Palletise row index.")]
|
|
public uint? Row { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Palletise column.
|
|
/// </summary>
|
|
[Description("Palletise column index.")]
|
|
public uint? Column { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SurfaceFinish feed rate.
|
|
/// </summary>
|
|
[Description("SurfaceFinish feed rate.")]
|
|
public double? FeedRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SurfaceFinish tool speed.
|
|
/// </summary>
|
|
[Description("SurfaceFinish tool speed.")]
|
|
public double? ToolSpeed { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SurfaceFinish step-over.
|
|
/// </summary>
|
|
[Description("SurfaceFinish step-over in metres.")]
|
|
public double? StepOver { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the tool used by Grasp, Release, Pick, Place, or ToolChange.
|
|
/// </summary>
|
|
[Description("Tool name or NodeId.")]
|
|
public string? Tool { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Grasp force.
|
|
/// </summary>
|
|
[Description("Grasp force in newtons.")]
|
|
public double? Force { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Pick source.
|
|
/// </summary>
|
|
[Description("Pick source location name or NodeId.")]
|
|
public string? Source { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Pick object class.
|
|
/// </summary>
|
|
[Description("Pick object class label.")]
|
|
public string? ObjectClass { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Place destination.
|
|
/// </summary>
|
|
[Description("Place destination location name or NodeId.")]
|
|
public string? Destination { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ToolChange dock station.
|
|
/// </summary>
|
|
[Description("ToolChange dock station name or NodeId.")]
|
|
public string? DockStation { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SetOutput signal.
|
|
/// </summary>
|
|
[Description("SetOutput signal name or NodeId.")]
|
|
public string? Output { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the SetOutput value.
|
|
/// </summary>
|
|
[Description("SetOutput typed value.")]
|
|
public TypedValueDto? Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the program to call.
|
|
/// </summary>
|
|
[Description("Program name or NodeId.")]
|
|
public string? Program { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the program arguments.
|
|
/// </summary>
|
|
[Description("Optional typed program arguments.")]
|
|
public NamedTypedValueDto[]? Arguments { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Wait duration.
|
|
/// </summary>
|
|
[Description("Wait duration in seconds.")]
|
|
public double? Duration { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Wait signal.
|
|
/// </summary>
|
|
[Description("Wait signal name or NodeId.")]
|
|
public string? Signal { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A mission transition between steps.
|
|
/// </summary>
|
|
public sealed class MissionTransitionInput
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the source step identifier.
|
|
/// </summary>
|
|
[Description("Source step identifier.")]
|
|
public string FromStepId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the target step identifier.
|
|
/// </summary>
|
|
[Description("Target step identifier.")]
|
|
public string ToStepId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the divergence kind: Alternative or Parallel.
|
|
/// </summary>
|
|
[Description("Divergence kind: Alternative or Parallel.")]
|
|
public DivergenceKindEnum? DivergenceKind { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Query parameters for listing operations with paging.
|
|
/// </summary>
|
|
public sealed class OperationListQuery
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets an optional intent identifier to filter by.
|
|
/// </summary>
|
|
[Description("Optional intent identifier to filter by.")]
|
|
public string? IntentId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets an optional mission identifier to filter by.
|
|
/// </summary>
|
|
[Description("Optional mission identifier to filter by.")]
|
|
public string? MissionId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets an optional execution state filter.
|
|
/// </summary>
|
|
[Description("Execution state filter.")]
|
|
public ExecutionStateEnum? ExecutionState { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the work selector: All, Active, or Terminal.
|
|
/// </summary>
|
|
[Description("Work selector: All (default), Active, or Terminal.")]
|
|
public WorkSelector Work { get; set; } = WorkSelector.All;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the detail level: Summary or Full.
|
|
/// </summary>
|
|
[Description("Detail level: Summary (default) or Full.")]
|
|
public DetailLevel Detail { get; set; } = DetailLevel.Summary;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the maximum page size (default 20, max 100).
|
|
/// </summary>
|
|
[Description("Maximum page size (default 20, max 100).")]
|
|
public int? PageSize { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the opaque cursor for the next page.
|
|
/// </summary>
|
|
[Description("Opaque cursor for continuation.")]
|
|
public string? Cursor { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A summary operation snapshot, omitting pose and full output.
|
|
/// </summary>
|
|
public sealed class OperationSummary
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the operation NodeId string.
|
|
/// </summary>
|
|
[Description("Operation NodeId.")]
|
|
public string Operation { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the intent identifier.
|
|
/// </summary>
|
|
[Description("Intent identifier.")]
|
|
public string IntentId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the execution state name.
|
|
/// </summary>
|
|
[Description("Execution state.")]
|
|
public ExecutionStateEnum ExecutionState { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the progress fraction, or -1 when unknown.
|
|
/// </summary>
|
|
[Description("Progress fraction, or -1 when unknown.")]
|
|
public double Progress { get; set; } = -1;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the queue position.
|
|
/// </summary>
|
|
[Description("Queue position (1=next, 0=not queued).")]
|
|
public uint QueuePosition { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the failure reason.
|
|
/// </summary>
|
|
[Description("Failure classification when in a terminal state.")]
|
|
public IntentFailureEnum? Failure { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a human-readable message.
|
|
/// </summary>
|
|
[Description("Human-readable message.")]
|
|
public string? Message { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the mission identifier.
|
|
/// </summary>
|
|
[Description("Mission identifier, if applicable.")]
|
|
public string? MissionId { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Paged result for operation listing.
|
|
/// </summary>
|
|
public sealed class OperationListResult
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the total matching operations.
|
|
/// </summary>
|
|
[Description("Total number of matching operations.")]
|
|
public int Total { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the returned count.
|
|
/// </summary>
|
|
[Description("Number of items on this page.")]
|
|
public int Returned { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the next cursor, or null if no more pages.
|
|
/// </summary>
|
|
[Description("Opaque cursor for the next page, or null.")]
|
|
public string? NextCursor { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets summaries when detail is 'summary'.
|
|
/// </summary>
|
|
[Description("Operation summaries.")]
|
|
public OperationSummary[]? Summaries { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets full snapshots when detail is 'full'.
|
|
/// </summary>
|
|
[Description("Full operation snapshots.")]
|
|
public IntentOperationSnapshot[]? Operations { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Query parameters for listing missions with paging.
|
|
/// </summary>
|
|
public sealed class MissionListQuery
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets an optional mission identifier to filter by.
|
|
/// </summary>
|
|
[Description("Optional mission identifier to filter by.")]
|
|
public string? MissionId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets an optional execution state filter.
|
|
/// </summary>
|
|
[Description("Execution state filter.")]
|
|
public ExecutionStateEnum? ExecutionState { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the work selector: All, Active, or Terminal.
|
|
/// </summary>
|
|
[Description("Work selector: All (default), Active, or Terminal.")]
|
|
public WorkSelector Work { get; set; } = WorkSelector.All;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the detail level: Summary or Full.
|
|
/// </summary>
|
|
[Description("Detail level: Summary (default) or Full.")]
|
|
public DetailLevel Detail { get; set; } = DetailLevel.Summary;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the maximum page size (default 20, max 100).
|
|
/// </summary>
|
|
[Description("Maximum page size (default 20, max 100).")]
|
|
public int? PageSize { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the opaque cursor for the next page.
|
|
/// </summary>
|
|
[Description("Opaque cursor for continuation.")]
|
|
public string? Cursor { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A concise mission summary.
|
|
/// </summary>
|
|
public sealed class MissionSummary
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the mission NodeId string.
|
|
/// </summary>
|
|
[Description("Mission NodeId.")]
|
|
public string MissionNode { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the mission identifier.
|
|
/// </summary>
|
|
[Description("Mission identifier.")]
|
|
public string MissionId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the mission update identifier.
|
|
/// </summary>
|
|
[Description("Mission update identifier.")]
|
|
public uint MissionUpdateId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the execution state name.
|
|
/// </summary>
|
|
[Description("Execution state.")]
|
|
public ExecutionStateEnum ExecutionState { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the currently executing step identifier.
|
|
/// </summary>
|
|
[Description("Currently executing step.")]
|
|
public string? CurrentStepId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the failure reason.
|
|
/// </summary>
|
|
[Description("Failure classification when in a terminal state.")]
|
|
public IntentFailureEnum? Failure { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a human-readable message.
|
|
/// </summary>
|
|
[Description("Human-readable message.")]
|
|
public string? Message { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the number of released steps.
|
|
/// </summary>
|
|
[Description("Number of released steps.")]
|
|
public uint ReleasedStepCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the per-step operation summaries.
|
|
/// </summary>
|
|
[Description("Per-step operation summaries: stepId, intentId, operation NodeId, state.")]
|
|
public MissionStepOperationSummary[] Steps { get; set; } = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// A concise per-step summary within a mission.
|
|
/// </summary>
|
|
public sealed class MissionStepOperationSummary
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the step identifier.
|
|
/// </summary>
|
|
[Description("Step identifier.")]
|
|
public string StepId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the intent identifier.
|
|
/// </summary>
|
|
[Description("Intent identifier.")]
|
|
public string IntentId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the operation NodeId string, or null if not yet executing.
|
|
/// </summary>
|
|
[Description("Operation NodeId, or null if not yet executing.")]
|
|
public string? Operation { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the step execution state.
|
|
/// </summary>
|
|
[Description("Step execution state.")]
|
|
public ExecutionStateEnum State { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Paged result for mission listing.
|
|
/// </summary>
|
|
public sealed class MissionListResult
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the total matching missions.
|
|
/// </summary>
|
|
[Description("Total number of matching missions.")]
|
|
public int Total { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the returned count.
|
|
/// </summary>
|
|
[Description("Number of items on this page.")]
|
|
public int Returned { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the next cursor, or null if no more pages.
|
|
/// </summary>
|
|
[Description("Opaque cursor for the next page, or null.")]
|
|
public string? NextCursor { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets summaries when detail is 'summary'.
|
|
/// </summary>
|
|
[Description("Mission summaries.")]
|
|
public MissionSummary[]? Summaries { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets full snapshots when detail is 'full'.
|
|
/// </summary>
|
|
[Description("Full mission snapshots.")]
|
|
public MissionSnapshot[]? Missions { get; set; }
|
|
}
|
|
}
|