Skip to content

Commit

Permalink
feat(schema): minor schema revisions for draft/2-0-0 (#174)
Browse files Browse the repository at this point in the history
* feat: add stop position and remove on_rate_violation

* build: update static draft fixtures
  • Loading branch information
eeberhard authored Sep 13, 2024
1 parent a789521 commit c087053
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 33 deletions.
55 changes: 28 additions & 27 deletions docs/static/schemas/draft/2-0-0/application.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export type ApplicationDescription = string;
*/
export type ApplicationTags = string[];
export type LoadOnStart = ComponentIdentifier | HardwareIdentifier;
export type Identifier = string;
/**
* The path to the URDF file of the hardware
*/
Expand Down Expand Up @@ -136,7 +137,7 @@ export type LifecycleTransitionLabel =
export type SwitchControllers =
| [SwitchControllersObject, ...SwitchControllersObject[]]
| SwitchControllersObject;
export type TargetController = [string, ...string[]] | string;
export type TargetController = [Identifier, ...Identifier[]] | Identifier;
/**
* Start, restart or abort a sequence
*/
Expand Down Expand Up @@ -439,14 +440,14 @@ export interface OnStart {
* A component in the application
*/
export interface ComponentIdentifier {
component: string;
component: Identifier;
}

/**
* A hardware interface in the application
*/
export interface HardwareIdentifier {
hardware: string;
hardware: Identifier;
}

export interface StartASequence {
Expand Down Expand Up @@ -500,7 +501,6 @@ export interface HardwareEvents {
export interface HardwareStateTransitions {
on_load?: Events;
on_error?: Events;
on_rate_violation?: Events;
on_unload?: Events;
}

Expand Down Expand Up @@ -529,33 +529,33 @@ export interface Events {
* A controller associated with a particular hardware interface
*/
export interface ControllerIdentifier {
hardware: string;
controller: string;
hardware: Identifier;
controller: Identifier;
}

export interface SetComponentParameterObject {
component: string;
component: Identifier;
parameter: ParameterName;
value: NewParameterValue;
}

export interface SetControllerParameterObject {
controller: string;
hardware: string;
controller: Identifier;
hardware: Identifier;
parameter: ParameterName;
value: NewParameterValue;
}

export interface CallComponentServiceObject {
component: string;
service: string;
component: Identifier;
service: Identifier;
payload?: ServicePayload;
}

export interface CallControllerServiceObject {
controller: string;
hardware: string;
service: string;
controller: Identifier;
hardware: Identifier;
service: Identifier;
payload?: ServicePayload;
}

Expand All @@ -564,11 +564,11 @@ export interface CallControllerServiceObject {
*/
export interface LifecycleTransitionObject {
transition: LifecycleTransitionLabel;
component: string;
component: Identifier;
}

export interface SwitchControllersObject {
hardware: string;
hardware: Identifier;
activate?: TargetController;
deactivate?: TargetController;
}
Expand Down Expand Up @@ -788,57 +788,57 @@ export interface Conditions {
* A condition depending on the runtime state of a component predicate
*/
export interface ComponentPredicateCondition {
component: string;
predicate: string;
component: Identifier;
predicate: Identifier;
}

/**
* A condition depending on the runtime state of a controller predicate
*/
export interface ControllerPredicateCondition {
controller: string;
hardware: string;
predicate: string;
controller: Identifier;
hardware: Identifier;
predicate: Identifier;
}

/**
* A condition depending on the runtime state of a component
*/
export interface ComponentStateCondition {
component: string;
component: Identifier;
state: ComponentState;
}

/**
* A condition depending on the runtime state of a controller
*/
export interface ControllerStateCondition {
controller: string;
hardware: string;
controller: Identifier;
hardware: Identifier;
state: ControllerState;
}

/**
* A condition depending on the runtime state of a hardware interface
*/
export interface HardwareStateCondition {
hardware: string;
hardware: Identifier;
state: HardwareState;
}

/**
* A condition depending on the runtime state of a sequence
*/
export interface SequenceStateCondition {
sequence: string;
sequence: Identifier;
state: SequenceState;
}

/**
* A condition depending on the runtime state of another condition
*/
export interface ReferenceCondition {
condition: string;
condition: Identifier;
}

/**
Expand Down Expand Up @@ -895,6 +895,7 @@ export interface BlockingConditionStepWithTimeout {
export interface Graph {
positions?: {
on_start?: Position;
stop?: Position;
buttons?: {
[k: string]: Position;
};
Expand Down
6 changes: 3 additions & 3 deletions docs/static/schemas/draft/2-0-0/application.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@
"on_error": {
"$ref": "#/$defs/events"
},
"on_rate_violation": {
"$ref": "#/$defs/events"
},
"on_unload": {
"$ref": "#/$defs/events"
}
Expand Down Expand Up @@ -968,6 +965,9 @@
"on_start": {
"$ref": "#/properties/graph/$defs/position"
},
"stop": {
"$ref": "#/properties/graph/$defs/position"
},
"buttons": {
"$ref": "#/properties/graph/$defs/position_group"
},
Expand Down
3 changes: 3 additions & 0 deletions schemas/applications/schema/graph.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"on_start": {
"$ref": "#/$defs/position"
},
"stop": {
"$ref": "#/$defs/position"
},
"buttons": {
"$ref": "#/$defs/position_group"
},
Expand Down
3 changes: 0 additions & 3 deletions schemas/applications/schema/hardware.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@
"on_error": {
"$ref": "events.schema.json"
},
"on_rate_violation": {
"$ref": "events.schema.json"
},
"on_unload": {
"$ref": "events.schema.json"
}
Expand Down

0 comments on commit c087053

Please sign in to comment.