Skip to content

Commit

Permalink
Capability type improvements (#748)
Browse files Browse the repository at this point in the history
* Mark StrobeSpeed.speed/StrobeDuration.duration as required in docs
* Make IrisEffect.speed/FrostEffect.speed optional in schema
  -> Bump schema version
* Add capability type hints in editor to avoid common mistakes
  • Loading branch information
fxedel committed Jan 15, 2019
1 parent cf9e6c6 commit a573e2e
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/capability-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ To make common percentage values more readable, one can use specific keywords to
</tr>
<tr>
<th valign="top" scope="row" id="strobespeed">StrobeSpeed</th>
<td valign="top">speed<br><sub>:grey_question: optional</sub></td>
<td valign="top">speed<br><sub>:star2: required</sub></td>
<td valign="top">Entity <em>Speed</em></td>
<td valign="top">global, doesn't activate strobe directly</td>
</tr>
<tr>
<th valign="top" scope="row" id="strobeduration">StrobeDuration</th>
<td valign="top">duration<br><sub>:grey_question: optional</sub></td>
<td valign="top">duration<br><sub>:star2: required</sub></td>
<td valign="top">Entity <em>Time</em></td>
<td valign="top"></td>
</tr>
Expand Down
10 changes: 2 additions & 8 deletions schemas/capability.json
Original file line number Diff line number Diff line change
Expand Up @@ -1010,10 +1010,7 @@
"switchChannels": {}
},
"required": ["effectName"],
"oneOf": [
{ "required": ["speed"] },
{ "required": ["speedStart"] }
],
"not": { "required": ["speed", "speedStart"] },
"dependencies": {
"speedStart": ["speedEnd"],
"speedEnd": ["speedStart"]
Expand Down Expand Up @@ -1070,10 +1067,7 @@
"switchChannels": {}
},
"required": ["effectName"],
"oneOf": [
{ "required": ["speed"] },
{ "required": ["speedStart"] }
],
"not": { "required": ["speed", "speedStart"] },
"dependencies": {
"speedStart": ["speedEnd"],
"speedEnd": ["speedStart"]
Expand Down
2 changes: 1 addition & 1 deletion schemas/fixture-redirect.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/OpenLightingProject/open-fixture-library/master/schemas/fixture-redirect.json",

"version": "11.0.0",
"version": "11.0.1",

"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/OpenLightingProject/open-fixture-library/master/schemas/fixture.json",

"version": "11.0.0",
"version": "11.0.1",

"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/manufacturers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/OpenLightingProject/open-fixture-library/master/schemas/manufacturers.json",

"version": "11.0.0",
"version": "11.0.1",

"type": "object",
"propertyNames": {
Expand Down
2 changes: 1 addition & 1 deletion ui/components/editor-capabilities/ColorPreset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `This capability enables a static predefined color (mix). Use WheelSlot for color wheel filters.`,
hint: `This capability enables a static predefined RGB/CMY color. Use WheelSlot for color wheel filters.`,
defaultData: {
comment: ``,
colors: null,
Expand Down
1 change: 1 addition & 0 deletions ui/components/editor-capabilities/FrostEffect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `This capability enables a non-static frost effect, e.g. pulse. Use the Frost type instead if a static frost intensity can be chosen.`,
defaultData: {
effectName: ``,
speed: ``,
Expand Down
1 change: 1 addition & 0 deletions ui/components/editor-capabilities/IrisEffect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `This capability enables a non-static iris effect, e.g. pulse. Use the Iris type instead if a static degree of opening can be chosen.`,
defaultData: {
effectName: ``,
speed: ``,
Expand Down
1 change: 1 addition & 0 deletions ui/components/editor-capabilities/Rotation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `Only use this if no other type is applicable. Note that some types like WheelSlot and Prism also allow setting a rotation angle / speed value.`,
defaultData: {
speedOrAngle: `speed`,
speed: ``,
Expand Down
1 change: 1 addition & 0 deletions ui/components/editor-capabilities/Speed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `Only use this if no other type is applicable. Note that some types like Effect, PanContinuous or Rotation also allow setting a speed value.`,
defaultData: {
speed: null,
speedStart: `slow`,
Expand Down
2 changes: 1 addition & 1 deletion ui/components/editor-capabilities/StrobeSpeed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `Doesn't activate strobe, only controls the strobe speed.`,
hint: `Doesn't activate strobe, only controls the strobe frequency when another channel is set to a ShutterStrobe capability with shutter effect 'Strobe'.`,
defaultData: {
speed: null,
speedStart: `Hz`,
Expand Down
2 changes: 1 addition & 1 deletion ui/components/editor-capabilities/WheelRotation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
data() {
return {
properties: schemaProperties,
hint: `Rotation of the whole wheel (i.e. over all wheel slots). Use WheelSlotRotation if only the slot itself (e.g. a Gobo) rotates in this capability.`,
hint: `Rotation of the whole wheel (i.e. over all wheel slots). Use WheelSlotRotation if only the slot itself (e.g. a Gobo) rotates in this capability. If the fixture doesn't have a physical color wheel, use Effect with ColorFade/ColorJump preset instead.`,
defaultData: {
speedOrAngle: `speed`,
speed: null,
Expand Down

0 comments on commit a573e2e

Please sign in to comment.