@oicl/openbridge-webcomponents 0.0.15-dev-20240916083108 → 0.0.15-dev-20240923184809

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. package/.storybook/main.ts +8 -0
  2. package/.storybook/preview.ts +2 -0
  3. package/__snapshots__/building-blocks-watch--advice.png +0 -0
  4. package/__snapshots__/building-blocks-watch-flat--primary.png +0 -0
  5. package/__snapshots__/navigation-instruments-azimuth-thruster--in-command-at-setpoint-disable-auto-setpoint.png +0 -0
  6. package/__snapshots__/navigation-instruments-azimuth-thruster--in-command-at-setpoint.png +0 -0
  7. package/__snapshots__/navigation-instruments-azimuth-thruster--in-command.png +0 -0
  8. package/__snapshots__/navigation-instruments-azimuth-thruster--pod.png +0 -0
  9. package/__snapshots__/navigation-instruments-azimuth-thruster--single-direction-with-propeller.png +0 -0
  10. package/__snapshots__/navigation-instruments-azimuth-thruster--single-direction.png +0 -0
  11. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--large.png +0 -0
  12. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--medium.png +0 -0
  13. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--no-command.png +0 -0
  14. package/__snapshots__/navigation-instruments-compass--primary.png +0 -0
  15. package/__snapshots__/navigation-instruments-compass-flat--primary.png +0 -0
  16. package/__snapshots__/navigation-instruments-compass-flat--with-fov-indicator.png +0 -0
  17. package/__snapshots__/navigation-instruments-main-engine--active.png +0 -0
  18. package/__snapshots__/navigation-instruments-main-engine--in-command.png +0 -0
  19. package/__snapshots__/navigation-instruments-main-engine--off.png +0 -0
  20. package/__snapshots__/navigation-instruments-thruster--tunnel.png +0 -0
  21. package/custom-elements.json +2184 -660
  22. package/dist/navigation-instruments/azimuth-thruster/azimuth-thruster.d.ts.map +1 -1
  23. package/dist/navigation-instruments/azimuth-thruster/azimuth-thruster.js +2 -1
  24. package/dist/navigation-instruments/azimuth-thruster/azimuth-thruster.js.map +1 -1
  25. package/dist/navigation-instruments/compass/arrow.d.ts +7 -0
  26. package/dist/navigation-instruments/compass/arrow.d.ts.map +1 -0
  27. package/dist/navigation-instruments/compass/arrow.js +59 -0
  28. package/dist/navigation-instruments/compass/arrow.js.map +1 -0
  29. package/dist/navigation-instruments/compass/compass.d.ts +23 -0
  30. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -0
  31. package/dist/navigation-instruments/compass/compass.js +139 -0
  32. package/dist/navigation-instruments/compass/compass.js.map +1 -0
  33. package/dist/navigation-instruments/compass/radial-tickmark.d.ts +4 -0
  34. package/dist/navigation-instruments/compass/radial-tickmark.d.ts.map +1 -0
  35. package/dist/navigation-instruments/compass/radial-tickmark.js +69 -0
  36. package/dist/navigation-instruments/compass/radial-tickmark.js.map +1 -0
  37. package/dist/navigation-instruments/compass-flat/compass-flat.css.js +29 -0
  38. package/dist/navigation-instruments/compass-flat/compass-flat.css.js.map +1 -0
  39. package/dist/navigation-instruments/compass-flat/compass-flat.d.ts +45 -0
  40. package/dist/navigation-instruments/compass-flat/compass-flat.d.ts.map +1 -0
  41. package/dist/navigation-instruments/compass-flat/compass-flat.js +223 -0
  42. package/dist/navigation-instruments/compass-flat/compass-flat.js.map +1 -0
  43. package/dist/navigation-instruments/main-engine/main-engine.css.js +22 -0
  44. package/dist/navigation-instruments/main-engine/main-engine.css.js.map +1 -0
  45. package/dist/navigation-instruments/main-engine/main-engine.d.ts +29 -0
  46. package/dist/navigation-instruments/main-engine/main-engine.d.ts.map +1 -0
  47. package/dist/navigation-instruments/main-engine/main-engine.js +196 -0
  48. package/dist/navigation-instruments/main-engine/main-engine.js.map +1 -0
  49. package/dist/navigation-instruments/thruster/advice.d.ts.map +1 -1
  50. package/dist/navigation-instruments/thruster/advice.js +9 -5
  51. package/dist/navigation-instruments/thruster/advice.js.map +1 -1
  52. package/dist/navigation-instruments/thruster/thruster.d.ts +54 -1
  53. package/dist/navigation-instruments/thruster/thruster.d.ts.map +1 -1
  54. package/dist/navigation-instruments/thruster/thruster.js +163 -99
  55. package/dist/navigation-instruments/thruster/thruster.js.map +1 -1
  56. package/dist/navigation-instruments/watch/advice.js +1 -1
  57. package/dist/navigation-instruments/watch/advice.js.map +1 -1
  58. package/dist/navigation-instruments/watch/label.d.ts +3 -0
  59. package/dist/navigation-instruments/watch/label.d.ts.map +1 -0
  60. package/dist/navigation-instruments/watch/label.js +68 -0
  61. package/dist/navigation-instruments/watch/label.js.map +1 -0
  62. package/dist/navigation-instruments/watch/watch.css.js +15 -14
  63. package/dist/navigation-instruments/watch/watch.css.js.map +1 -1
  64. package/dist/navigation-instruments/watch/watch.d.ts +3 -0
  65. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  66. package/dist/navigation-instruments/watch/watch.js +34 -1
  67. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  68. package/dist/navigation-instruments/watch-flat/tickmark-flat.d.ts +20 -0
  69. package/dist/navigation-instruments/watch-flat/tickmark-flat.d.ts.map +1 -0
  70. package/dist/navigation-instruments/watch-flat/tickmark-flat.js +53 -0
  71. package/dist/navigation-instruments/watch-flat/tickmark-flat.js.map +1 -0
  72. package/dist/navigation-instruments/watch-flat/watch-flat.css.js +32 -0
  73. package/dist/navigation-instruments/watch-flat/watch-flat.css.js.map +1 -0
  74. package/dist/navigation-instruments/watch-flat/watch-flat.d.ts +29 -0
  75. package/dist/navigation-instruments/watch-flat/watch-flat.d.ts.map +1 -0
  76. package/dist/navigation-instruments/watch-flat/watch-flat.js +184 -0
  77. package/dist/navigation-instruments/watch-flat/watch-flat.js.map +1 -0
  78. package/dist/svghelpers/rectangular.d.ts +1 -0
  79. package/dist/svghelpers/rectangular.d.ts.map +1 -1
  80. package/dist/svghelpers/rectangular.js +3 -2
  81. package/dist/svghelpers/rectangular.js.map +1 -1
  82. package/package.json +16 -11
  83. package/src/navigation-instruments/azimuth-thruster/azimuth-thruster.ts +1 -0
  84. package/src/navigation-instruments/compass/arrow.ts +61 -0
  85. package/src/navigation-instruments/compass/compass.stories.ts +37 -0
  86. package/src/navigation-instruments/compass/compass.ts +132 -0
  87. package/src/navigation-instruments/compass/radial-tickmark.ts +77 -0
  88. package/src/navigation-instruments/compass-flat/compass-flat.css +23 -0
  89. package/src/navigation-instruments/compass-flat/compass-flat.stories.ts +35 -0
  90. package/src/navigation-instruments/compass-flat/compass-flat.ts +221 -0
  91. package/src/navigation-instruments/main-engine/main-engine.css +17 -0
  92. package/src/navigation-instruments/main-engine/main-engine.stories.ts +54 -0
  93. package/src/navigation-instruments/main-engine/main-engine.ts +160 -0
  94. package/src/navigation-instruments/thruster/advice.ts +9 -5
  95. package/src/navigation-instruments/thruster/thruster.stories.ts +1 -0
  96. package/src/navigation-instruments/thruster/thruster.ts +205 -113
  97. package/src/navigation-instruments/watch/advice.ts +1 -1
  98. package/src/navigation-instruments/watch/label.ts +69 -0
  99. package/src/navigation-instruments/watch/watch.css +7 -7
  100. package/src/navigation-instruments/watch/watch.ts +30 -1
  101. package/src/navigation-instruments/watch-flat/tickmark-flat.ts +62 -0
  102. package/src/navigation-instruments/watch-flat/watch-flat.css +19 -0
  103. package/src/navigation-instruments/watch-flat/watch-flat.stories.ts +17 -0
  104. package/src/navigation-instruments/watch-flat/watch-flat.ts +148 -0
  105. package/src/palettes/variables.css +1343 -1343
  106. package/src/svghelpers/rectangular.ts +6 -3
@@ -1 +1 @@
1
- {"version":3,"file":"azimuth-thruster.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/azimuth-thruster/azimuth-thruster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAiB,MAAM,KAAK,CAAC;AAE/C,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,EAAc,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAWpD,qBACa,kBAAmB,SAAQ,UAAU;IACtB,KAAK,SAAK;IACV,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5D,eAAe,EAAE,OAAO,CAAS;IACN,QAAQ,EAAE,OAAO,CAAS;IAC1B,0BAA0B,EAAE,OAAO,CAAS;IAC7C,2BAA2B,EAAE,MAAM,CAAK;IAExC,MAAM,SAAK;IACX,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7D,gBAAgB,EAAE,OAAO,CAAS;IACR,4BAA4B,EAAE,MAAM,CAAO;IAC1C,2BAA2B,EAAE,OAAO,CAAS;IAC9C,4BAA4B,EAAE,MAAM,CAAK;IACzC,KAAK,EAAE,eAAe,CAA6B;IACnD,OAAO,EAAE,MAAM,CAAK;IACnB,SAAS,EAAE,OAAO,CAAS;IACX,YAAY,EAAE,WAAW,EAAE,CAAM;IACjC,aAAa,EAAE,YAAY,EAAE,CAAM;IACnD,eAAe,EAAE,OAAO,CAAS;IAClC,YAAY,EAAE,aAAa,CAAsB;IACjD,eAAe,EAAE,aAAa,CAAsB;IAE9E,IAAI,mBAAmB,YAgBtB;IAED,OAAO,KAAK,cAAc,GAoBzB;IAEQ,MAAM;IAsDf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
1
+ {"version":3,"file":"azimuth-thruster.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/azimuth-thruster/azimuth-thruster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAiB,MAAM,KAAK,CAAC;AAE/C,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,EAAc,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAWpD,qBACa,kBAAmB,SAAQ,UAAU;IACtB,KAAK,SAAK;IACV,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5D,eAAe,EAAE,OAAO,CAAS;IACN,QAAQ,EAAE,OAAO,CAAS;IAC1B,0BAA0B,EAAE,OAAO,CAAS;IAC7C,2BAA2B,EAAE,MAAM,CAAK;IAExC,MAAM,SAAK;IACX,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7D,gBAAgB,EAAE,OAAO,CAAS;IACR,4BAA4B,EAAE,MAAM,CAAO;IAC1C,2BAA2B,EAAE,OAAO,CAAS;IAC9C,4BAA4B,EAAE,MAAM,CAAK;IACzC,KAAK,EAAE,eAAe,CAA6B;IACnD,OAAO,EAAE,MAAM,CAAK;IACnB,SAAS,EAAE,OAAO,CAAS;IACX,YAAY,EAAE,WAAW,EAAE,CAAM;IACjC,aAAa,EAAE,YAAY,EAAE,CAAM;IACnD,eAAe,EAAE,OAAO,CAAS;IAClC,YAAY,EAAE,aAAa,CAAsB;IACjD,eAAe,EAAE,aAAa,CAAsB;IAE9E,IAAI,mBAAmB,YAgBtB;IAED,OAAO,KAAK,cAAc,GAoBzB;IAEQ,MAAM;IAuDf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
@@ -118,7 +118,8 @@ let ObcAzimuthThruster = class extends LitElement {
118
118
  touching: this.touching,
119
119
  advices: this.thrustAdvices,
120
120
  topPropeller: this.topPropeller,
121
- bottomPropeller: this.bottomPropeller
121
+ bottomPropeller: this.bottomPropeller,
122
+ narrow: true
122
123
  })}
123
124
  </svg>
124
125
  </g>
@@ -1 +1 @@
1
- {"version":3,"file":"azimuth-thruster.js","sources":["../../../src/navigation-instruments/azimuth-thruster/azimuth-thruster.ts"],"sourcesContent":["import {LitElement, svg, unsafeCSS} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {InstrumentState} from '../types';\nimport {thruster} from '../thruster/thruster';\nimport '../watch/watch';\nimport componentStyle from './azimuth-thruster.css?inline';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {AdviceState, AngleAdvice, AngleAdviceRaw} from '../watch/advice';\nimport {Tickmark, TickmarkType} from '../watch/tickmark';\nimport {LinearAdvice} from '../thruster/advice';\nimport {PropellerType} from '../thruster/propeller';\n\nfunction mapAngle0to360(angle: number): number {\n const a = angle % 360;\n if (a >= 0) {\n return a;\n } else {\n return a + 360;\n }\n}\n\n@customElement('obc-azimuth-thruster')\nexport class ObcAzimuthThruster extends LitElement {\n @property({type: Number}) angle = 0;\n @property({type: Number}) angleSetpoint: number | undefined;\n @property({type: Boolean})\n atAngleSetpoint: boolean = false;\n @property({type: Boolean}) touching: boolean = false;\n @property({type: Boolean}) disableAutoAtAngleSetpoint: boolean = false;\n @property({type: Number}) autoAtAngleSetpointDeadband: number = 2;\n\n @property({type: Number}) thrust = 0;\n @property({type: Number}) thrustSetpoint: number | undefined;\n @property({type: Boolean})\n atThrustSetpoint: boolean = false;\n @property({type: Number}) thrustSetpointAtZeroDeadband: number = 0.1;\n @property({type: Boolean}) disableAutoAtThrustSetpoint: boolean = false;\n @property({type: Number}) autoAtThrustSetpointDeadband: number = 1;\n @property({type: String}) state: InstrumentState = InstrumentState.inCommand;\n @property({type: Number}) loading: number = 0;\n @property({type: Boolean}) noPadding: boolean = false;\n @property({type: Array, attribute: false}) angleAdvices: AngleAdvice[] = [];\n @property({type: Array, attribute: false}) thrustAdvices: LinearAdvice[] = [];\n @property({type: Boolean}) singleDirection: boolean = false;\n @property({type: String}) topPropeller: PropellerType = PropellerType.none;\n @property({type: String}) bottomPropeller: PropellerType = PropellerType.none;\n\n get atAngleSetpointCalc() {\n if (this.angleSetpoint === undefined) {\n return false;\n }\n\n if (this.touching) {\n return false;\n }\n\n if (!this.disableAutoAtAngleSetpoint) {\n return (\n Math.abs(this.angle - this.angleSetpoint) <\n this.autoAtAngleSetpointDeadband\n );\n }\n return this.atAngleSetpoint;\n }\n\n private get angleAdviceRaw(): AngleAdviceRaw[] {\n return this.angleAdvices.map((advice) => {\n const triggered =\n mapAngle0to360(this.angle) >= mapAngle0to360(advice.minAngle) &&\n mapAngle0to360(this.angle) <= mapAngle0to360(advice.maxAngle);\n let state: AdviceState;\n if (triggered) {\n state = AdviceState.triggered;\n } else if (advice.hinted) {\n state = AdviceState.hinted;\n } else {\n state = AdviceState.regular;\n }\n return {\n minAngle: advice.minAngle,\n maxAngle: advice.maxAngle,\n type: advice.type,\n state,\n };\n });\n }\n\n override render() {\n const rotateAngle = this.angle;\n\n const watchfaceTicksOn =\n this.state === InstrumentState.active ||\n this.state === InstrumentState.inCommand;\n\n let tickmarks: Tickmark[] = [];\n if (watchfaceTicksOn) {\n tickmarks = [\n {angle: 0, type: TickmarkType.main},\n {angle: 90, type: TickmarkType.primary},\n {angle: 180, type: TickmarkType.primary},\n {angle: 270, type: TickmarkType.primary},\n ];\n }\n\n const viewBox = this.noPadding ? '-192 -192 384 384' : '-200 -200 400 400';\n\n return svg`\n <div class=\"container\">\n <obc-watch \n .tickmarks=${tickmarks}\n .state=${this.state} \n .angleSetpoint=${this.angleSetpoint}\n .atAngleSetpoint=${this.atAngleSetpointCalc}\n .padding=${ifDefined(this.noPadding ? 16 : undefined)}\n .advices=${this.angleAdviceRaw}\n ></obc-watch>\n <svg viewBox=${viewBox} xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"rotate(${rotateAngle})\">\n <svg width=\"320\" height=\"320\" y =\"-160\" x=\"-160\" viewBox=\"-160 -160 320 320\">\n ${thruster(this.thrust, this.thrustSetpoint, this.state, {\n atSetpoint: this.atThrustSetpoint,\n singleSided: true,\n singleDirection: false,\n singleDirectionHalfSize: this.singleDirection,\n tunnel: false,\n autoAtSetpoint: !this.disableAutoAtThrustSetpoint,\n autoSetpointDeadband: this.autoAtThrustSetpointDeadband,\n setpointAtZeroDeadband: this.thrustSetpointAtZeroDeadband,\n touching: this.touching,\n advices: this.thrustAdvices,\n topPropeller: this.topPropeller,\n bottomPropeller: this.bottomPropeller,\n })}\n </svg>\n </g>\n </svg>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-azimuth-thruster': ObcAzimuthThruster;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,eAAe,OAAuB;AAC7C,QAAM,IAAI,QAAQ;AAClB,MAAI,KAAK,GAAG;AACH,WAAA;AAAA,EAAA,OACF;AACL,WAAO,IAAI;AAAA,EACb;AACF;AAGa,IAAA,qBAAN,cAAiC,WAAW;AAAA,EAA5C,cAAA;AAAA,UAAA,GAAA,SAAA;AAC6B,SAAA,QAAA;AAGP,SAAA,kBAAA;AACoB,SAAA,WAAA;AACkB,SAAA,6BAAA;AACD,SAAA,8BAAA;AAE7B,SAAA,SAAA;AAGP,SAAA,mBAAA;AACqC,SAAA,+BAAA;AACC,SAAA,8BAAA;AACD,SAAA,+BAAA;AACvC,SAAA,QAAyB,gBAAgB;AACvB,SAAA,UAAA;AACI,SAAA,YAAA;AACL,SAAA,eAA8B;AAC9B,SAAA,gBAAgC;AACrB,SAAA,kBAAA;AAC5B,SAAA,eAA8B,cAAc;AAC5C,SAAA,kBAAiC,cAAc;AAAA,EAAA;AAAA,EAEzE,IAAI,sBAAsB;AACpB,QAAA,KAAK,kBAAkB,QAAW;AAC7B,aAAA;AAAA,IACT;AAEA,QAAI,KAAK,UAAU;AACV,aAAA;AAAA,IACT;AAEI,QAAA,CAAC,KAAK,4BAA4B;AACpC,aACE,KAAK,IAAI,KAAK,QAAQ,KAAK,aAAa,IACxC,KAAK;AAAA,IAET;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,iBAAmC;AAC7C,WAAO,KAAK,aAAa,IAAI,CAAC,WAAW;AACvC,YAAM,YACJ,eAAe,KAAK,KAAK,KAAK,eAAe,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AAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAfb,mBAee,WAAA,gCAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAhBb,mBAgBe,WAAA,SAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAjBb,mBAiBe,WAAA,WAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GAlBd,mBAkBgB,WAAA,aAAA,CAAA;AACgB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAnB9B,mBAmBgC,WAAA,gBAAA,CAAA;AACA,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GApB9B,mBAoBgC,WAAA,iBAAA,CAAA;AAChB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GArBd,mBAqBgB,WAAA,mBAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAtBb,mBAsBe,WAAA,gBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAvBb,mBAuBe,WAAA,mBAAA,CAAA;AAvBf,qBAAN,gBAAA;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB,kBAAA;"}
1
+ {"version":3,"file":"azimuth-thruster.js","sources":["../../../src/navigation-instruments/azimuth-thruster/azimuth-thruster.ts"],"sourcesContent":["import {LitElement, svg, unsafeCSS} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {InstrumentState} from '../types';\nimport {thruster} from '../thruster/thruster';\nimport '../watch/watch';\nimport componentStyle from './azimuth-thruster.css?inline';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {AdviceState, AngleAdvice, AngleAdviceRaw} from '../watch/advice';\nimport {Tickmark, TickmarkType} from '../watch/tickmark';\nimport {LinearAdvice} from '../thruster/advice';\nimport {PropellerType} from '../thruster/propeller';\n\nfunction mapAngle0to360(angle: number): number {\n const a = angle % 360;\n if (a >= 0) {\n return a;\n } else {\n return a + 360;\n }\n}\n\n@customElement('obc-azimuth-thruster')\nexport class ObcAzimuthThruster extends LitElement {\n @property({type: Number}) angle = 0;\n @property({type: Number}) angleSetpoint: number | undefined;\n @property({type: Boolean})\n atAngleSetpoint: boolean = false;\n @property({type: Boolean}) touching: boolean = false;\n @property({type: Boolean}) disableAutoAtAngleSetpoint: boolean = false;\n @property({type: Number}) autoAtAngleSetpointDeadband: number = 2;\n\n @property({type: Number}) thrust = 0;\n @property({type: Number}) thrustSetpoint: number | undefined;\n @property({type: Boolean})\n atThrustSetpoint: boolean = false;\n @property({type: Number}) thrustSetpointAtZeroDeadband: number = 0.1;\n @property({type: Boolean}) disableAutoAtThrustSetpoint: boolean = false;\n @property({type: Number}) autoAtThrustSetpointDeadband: number = 1;\n @property({type: String}) state: InstrumentState = InstrumentState.inCommand;\n @property({type: Number}) loading: number = 0;\n @property({type: Boolean}) noPadding: boolean = false;\n @property({type: Array, attribute: false}) angleAdvices: AngleAdvice[] = [];\n @property({type: Array, attribute: false}) thrustAdvices: LinearAdvice[] = [];\n @property({type: Boolean}) singleDirection: boolean = false;\n @property({type: String}) topPropeller: PropellerType = PropellerType.none;\n @property({type: String}) bottomPropeller: PropellerType = PropellerType.none;\n\n get atAngleSetpointCalc() {\n if (this.angleSetpoint === undefined) {\n return false;\n }\n\n if (this.touching) {\n return false;\n }\n\n if (!this.disableAutoAtAngleSetpoint) {\n return (\n Math.abs(this.angle - this.angleSetpoint) <\n this.autoAtAngleSetpointDeadband\n );\n }\n return this.atAngleSetpoint;\n }\n\n private get angleAdviceRaw(): AngleAdviceRaw[] {\n return this.angleAdvices.map((advice) => {\n const triggered =\n mapAngle0to360(this.angle) >= mapAngle0to360(advice.minAngle) &&\n mapAngle0to360(this.angle) <= mapAngle0to360(advice.maxAngle);\n let state: AdviceState;\n if (triggered) {\n state = AdviceState.triggered;\n } else if (advice.hinted) {\n state = AdviceState.hinted;\n } else {\n state = AdviceState.regular;\n }\n return {\n minAngle: advice.minAngle,\n maxAngle: advice.maxAngle,\n type: advice.type,\n state,\n };\n });\n }\n\n override render() {\n const rotateAngle = this.angle;\n\n const watchfaceTicksOn =\n this.state === InstrumentState.active ||\n this.state === InstrumentState.inCommand;\n\n let tickmarks: Tickmark[] = [];\n if (watchfaceTicksOn) {\n tickmarks = [\n {angle: 0, type: TickmarkType.main},\n {angle: 90, type: TickmarkType.primary},\n {angle: 180, type: TickmarkType.primary},\n {angle: 270, type: TickmarkType.primary},\n ];\n }\n\n const viewBox = this.noPadding ? '-192 -192 384 384' : '-200 -200 400 400';\n\n return svg`\n <div class=\"container\">\n <obc-watch \n .tickmarks=${tickmarks}\n .state=${this.state} \n .angleSetpoint=${this.angleSetpoint}\n .atAngleSetpoint=${this.atAngleSetpointCalc}\n .padding=${ifDefined(this.noPadding ? 16 : undefined)}\n .advices=${this.angleAdviceRaw}\n ></obc-watch>\n <svg viewBox=${viewBox} xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"rotate(${rotateAngle})\">\n <svg width=\"320\" height=\"320\" y =\"-160\" x=\"-160\" viewBox=\"-160 -160 320 320\">\n ${thruster(this.thrust, this.thrustSetpoint, this.state, {\n atSetpoint: this.atThrustSetpoint,\n singleSided: true,\n singleDirection: false,\n singleDirectionHalfSize: this.singleDirection,\n tunnel: false,\n autoAtSetpoint: !this.disableAutoAtThrustSetpoint,\n autoSetpointDeadband: this.autoAtThrustSetpointDeadband,\n setpointAtZeroDeadband: this.thrustSetpointAtZeroDeadband,\n touching: this.touching,\n advices: this.thrustAdvices,\n topPropeller: this.topPropeller,\n bottomPropeller: this.bottomPropeller,\n narrow: true,\n })}\n </svg>\n </g>\n </svg>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLEl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,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAjBb,mBAiBe,WAAA,WAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GAlBd,mBAkBgB,WAAA,aAAA,CAAA;AACgB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAnB9B,mBAmBgC,WAAA,gBAAA,CAAA;AACA,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GApB9B,mBAoBgC,WAAA,iBAAA,CAAA;AAChB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GArBd,mBAqBgB,WAAA,mBAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAtBb,mBAsBe,WAAA,gBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAvBb,mBAuBe,WAAA,mBAAA,CAAA;AAvBf,qBAAN,gBAAA;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB,kBAAA;"}
@@ -0,0 +1,7 @@
1
+ import { SVGTemplateResult } from 'lit';
2
+ export declare enum ArrowStyle {
3
+ HDG = "HDG",
4
+ COG = "COG"
5
+ }
6
+ export declare function arrow(style: ArrowStyle, angle: number): SVGTemplateResult | SVGTemplateResult[];
7
+ //# sourceMappingURL=arrow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAM,MAAM,KAAK,CAAC;AAE3C,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED,wBAAgB,KAAK,CACnB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,GACZ,iBAAiB,GAAG,iBAAiB,EAAE,CAkDzC"}
@@ -0,0 +1,59 @@
1
+ import { svg } from "lit";
2
+ var ArrowStyle = /* @__PURE__ */ ((ArrowStyle2) => {
3
+ ArrowStyle2["HDG"] = "HDG";
4
+ ArrowStyle2["COG"] = "COG";
5
+ return ArrowStyle2;
6
+ })(ArrowStyle || {});
7
+ function arrow(style, angle) {
8
+ const colorName = "var(--instrument-enhanced-secondary-color)";
9
+ if (style === "HDG") {
10
+ return svg`
11
+ <g transform="translate(-32, -${256}) rotate(${angle}, 32, 256)">
12
+ <rect x="28" y="118" width="8" height="139" rx="4" fill="${colorName}" />
13
+ <rect x="30.0039" y="256" width="4" height="156" rx="2" fill="${colorName}" />
14
+ <circle cx="32" cy="256" r="8" fill="${colorName}" />
15
+ <mask
16
+ id="mask0_262_65165"
17
+ style="mask-type:luminance"
18
+ maskUnits="userSpaceOnUse"
19
+ x="8"
20
+ y="94"
21
+ width="48"
22
+ height="50"
23
+ >
24
+ <path
25
+ d="M13.2833 140.564L32 96L50.7167 140.564C51.4569 142.326 49.54 144.023 47.8805 143.075L32 136L16.1195 143.075C14.46 144.023 12.5432 142.326 13.2833 140.564Z"
26
+ fill="white"
27
+ stroke="black"
28
+ />
29
+ </mask>
30
+ <g mask="url(#mask0_262_65165)">
31
+ <path
32
+ d="M13.2833 140.564L32 96L50.7167 140.564C51.4569 142.326 49.54 144.023 47.8805 143.075L32 136L16.1195 143.075C14.46 144.023 12.5432 142.326 13.2833 140.564Z"
33
+ fill="${colorName}"
34
+ />
35
+ </g>
36
+ </g>
37
+ `;
38
+ } else if (style === "COG") {
39
+ return svg`
40
+ <g transform="translate(-32, -${256}) rotate(${angle}, 32, 256)">
41
+ <path
42
+ fill-rule="evenodd"
43
+ clip-rule="evenodd"
44
+ d="M13.2833 140.564C12.5431 142.326 14.46 144.023 16.1195 143.075L32 136L47.8805 143.075C49.54 144.023 51.4568 142.326 50.7167 140.564L32 96L13.2833 140.564ZM32 106.33L19.2545 136.676L32 131.393L44.7455 136.676L32 106.33ZM49.865 139.602L49.8625 139.6L49.865 139.602Z"
45
+ fill="${colorName}"
46
+ />
47
+ <rect x="30" y="133" width="4" height="124" rx="2" fill="${colorName}" />
48
+ <circle cx="32" cy="256" r="4" fill="${colorName}" />
49
+ </g>
50
+ `;
51
+ } else {
52
+ return [];
53
+ }
54
+ }
55
+ export {
56
+ ArrowStyle,
57
+ arrow
58
+ };
59
+ //# sourceMappingURL=arrow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow.js","sources":["../../../src/navigation-instruments/compass/arrow.ts"],"sourcesContent":["import {SVGTemplateResult, svg} from 'lit';\n\nexport enum ArrowStyle {\n HDG = 'HDG',\n COG = 'COG',\n}\n\nexport function arrow(\n style: ArrowStyle,\n angle: number\n): SVGTemplateResult | SVGTemplateResult[] {\n const colorName = 'var(--instrument-enhanced-secondary-color)';\n\n if (style === ArrowStyle.HDG) {\n return svg`\n <g transform=\"translate(-32, -${256}) rotate(${angle}, 32, 256)\">\n <rect x=\"28\" y=\"118\" width=\"8\" height=\"139\" rx=\"4\" fill=\"${colorName}\" />\n <rect x=\"30.0039\" y=\"256\" width=\"4\" height=\"156\" rx=\"2\" fill=\"${colorName}\" />\n <circle cx=\"32\" cy=\"256\" r=\"8\" fill=\"${colorName}\" />\n <mask\n id=\"mask0_262_65165\"\n style=\"mask-type:luminance\"\n maskUnits=\"userSpaceOnUse\"\n x=\"8\"\n y=\"94\"\n width=\"48\"\n height=\"50\"\n >\n <path\n d=\"M13.2833 140.564L32 96L50.7167 140.564C51.4569 142.326 49.54 144.023 47.8805 143.075L32 136L16.1195 143.075C14.46 144.023 12.5432 142.326 13.2833 140.564Z\"\n fill=\"white\"\n stroke=\"black\"\n />\n </mask>\n <g mask=\"url(#mask0_262_65165)\">\n <path\n d=\"M13.2833 140.564L32 96L50.7167 140.564C51.4569 142.326 49.54 144.023 47.8805 143.075L32 136L16.1195 143.075C14.46 144.023 12.5432 142.326 13.2833 140.564Z\"\n fill=\"${colorName}\"\n />\n </g>\n </g>\n `;\n } else if (style === ArrowStyle.COG) {\n return svg`\n <g transform=\"translate(-32, -${256}) rotate(${angle}, 32, 256)\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M13.2833 140.564C12.5431 142.326 14.46 144.023 16.1195 143.075L32 136L47.8805 143.075C49.54 144.023 51.4568 142.326 50.7167 140.564L32 96L13.2833 140.564ZM32 106.33L19.2545 136.676L32 131.393L44.7455 136.676L32 106.33ZM49.865 139.602L49.8625 139.6L49.865 139.602Z\"\n fill=\"${colorName}\"\n />\n <rect x=\"30\" y=\"133\" width=\"4\" height=\"124\" rx=\"2\" fill=\"${colorName}\" />\n <circle cx=\"32\" cy=\"256\" r=\"4\" fill=\"${colorName}\" />\n </g>\n `;\n } else {\n return [];\n }\n\n // return [...shaft, circle, arrowTip];\n}\n"],"names":["ArrowStyle"],"mappings":";AAEY,IAAA,+BAAAA,gBAAL;AACLA,cAAA,KAAM,IAAA;AACNA,cAAA,KAAM,IAAA;AAFIA,SAAAA;AAAA,GAAA,cAAA,CAAA,CAAA;AAKI,SAAA,MACd,OACA,OACyC;AACzC,QAAM,YAAY;AAElB,MAAI,UAAU,OAAgB;AACrB,WAAA;AAAA,sCAC2B,GAAG,YAAY,KAAK;AAAA,mEACS,SAAS;AAAA,wEACJ,SAAS;AAAA,+CAClC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAmBpC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA,WAKhB,UAAU,OAAgB;AAC5B,WAAA;AAAA,sCAC2B,GAAG,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKxC,SAAS;AAAA;AAAA,mEAEwC,SAAS;AAAA,+CAC7B,SAAS;AAAA;AAAA;AAAA,EAAA,OAG/C;AACL,WAAO;EACT;AAGF;"}
@@ -0,0 +1,23 @@
1
+ import { LitElement } from 'lit';
2
+ import '../watch/watch';
3
+ import { AngleAdvice } from '../watch/advice';
4
+ export declare class ObcCompass extends LitElement {
5
+ heading: number;
6
+ courseOverGround: number;
7
+ padding: number;
8
+ headingAdvices: AngleAdvice[];
9
+ containerWidth: number;
10
+ private resizeObserver;
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
13
+ private adjustPadding;
14
+ private get angleAdviceRaw();
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ static styles: import("lit").CSSResult;
17
+ }
18
+ declare global {
19
+ interface HTMLElementTagNameMap {
20
+ 'obc-compass': ObcCompass;
21
+ }
22
+ }
23
+ //# sourceMappingURL=compass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compass.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass/compass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,gBAAgB,CAAC;AAGxB,OAAO,EAGL,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AAGzB,qBACa,UAAW,SAAQ,UAAU;IACd,OAAO,SAAK;IACZ,gBAAgB,SAAK;IACrB,OAAO,SAAM;IACI,cAAc,EAAE,WAAW,EAAE,CAAM;IACpD,cAAc,SAAK;IAE7C,OAAO,CAAC,cAAc,CAKnB;IAEM,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,aAAa;IAarB,OAAO,KAAK,cAAc,GAUzB;IAEQ,MAAM;IAqCf,OAAgB,MAAM,0BAwBpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -0,0 +1,139 @@
1
+ import { css, LitElement, html } from "lit";
2
+ import { property, customElement } from "lit/decorators.js";
3
+ import "../watch/watch.js";
4
+ import { TickmarkType } from "../watch/tickmark.js";
5
+ import { arrow, ArrowStyle } from "./arrow.js";
6
+ import { AdviceState, AdviceType } from "../watch/advice.js";
7
+ import { radialTickmarks } from "./radial-tickmark.js";
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __decorateClass = (decorators, target, key, kind) => {
11
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
12
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
+ if (decorator = decorators[i])
14
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
15
+ if (kind && result)
16
+ __defProp(target, key, result);
17
+ return result;
18
+ };
19
+ let ObcCompass = class extends LitElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.heading = 0;
23
+ this.courseOverGround = 0;
24
+ this.padding = 48;
25
+ this.headingAdvices = [];
26
+ this.containerWidth = 0;
27
+ this.resizeObserver = new ResizeObserver((entries) => {
28
+ for (const entry of entries) {
29
+ this.containerWidth = entry.contentRect.width;
30
+ this.adjustPadding();
31
+ }
32
+ });
33
+ }
34
+ connectedCallback() {
35
+ super.connectedCallback();
36
+ this.resizeObserver.observe(this);
37
+ }
38
+ disconnectedCallback() {
39
+ super.disconnectedCallback();
40
+ this.resizeObserver.unobserve(this);
41
+ }
42
+ adjustPadding() {
43
+ const deltaWidth = 512 - this.containerWidth;
44
+ const steps = deltaWidth / 128;
45
+ let deltaPadding = 0;
46
+ if (deltaWidth > 0) {
47
+ deltaPadding = steps * 48;
48
+ } else {
49
+ deltaPadding = steps * 6;
50
+ }
51
+ this.padding = 72 + deltaPadding;
52
+ }
53
+ get angleAdviceRaw() {
54
+ return this.headingAdvices.map(({ minAngle, maxAngle, hinted, type }) => {
55
+ const state = this.heading >= minAngle && this.heading <= maxAngle ? AdviceState.triggered : hinted ? AdviceState.hinted : AdviceState.regular;
56
+ return { minAngle, maxAngle, type, state };
57
+ });
58
+ }
59
+ render() {
60
+ const tickmarks = [
61
+ { angle: 0, type: TickmarkType.main },
62
+ { angle: 90, type: TickmarkType.main },
63
+ { angle: 180, type: TickmarkType.main },
64
+ { angle: 270, type: TickmarkType.main }
65
+ ];
66
+ const rt = this.headingAdvices.map(
67
+ ({ minAngle, maxAngle, type }) => radialTickmarks(
68
+ minAngle,
69
+ maxAngle,
70
+ type === AdviceType.caution ? TickmarkType.secondary : void 0
71
+ )
72
+ );
73
+ const width = (176 + this.padding) * 2;
74
+ const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;
75
+ return html`
76
+ <div class="container">
77
+ <obc-watch
78
+ .padding=${this.padding}
79
+ .advices=${this.angleAdviceRaw}
80
+ .tickmarks=${tickmarks}
81
+ .labelFrameEnabled=${true}
82
+ .crosshairEnabled=${true}
83
+ >
84
+ </obc-watch>
85
+ <svg viewBox="${viewBox}">
86
+ ${rt} ${arrow(ArrowStyle.HDG, this.heading)}
87
+ ${arrow(ArrowStyle.COG, this.courseOverGround)}
88
+ </svg>
89
+ </div>
90
+ `;
91
+ }
92
+ };
93
+ ObcCompass.styles = css`
94
+ * {
95
+ box-sizing: border-box;
96
+ }
97
+
98
+ .container {
99
+ position: relative;
100
+ width: 100%;
101
+ height: 100%;
102
+ }
103
+
104
+ .container > * {
105
+ position: absolute;
106
+ top: 0;
107
+ left: 0;
108
+ width: 100%;
109
+ height: 100%;
110
+ }
111
+
112
+ :host {
113
+ display: block;
114
+ width: 100%;
115
+ height: 100%;
116
+ }
117
+ `;
118
+ __decorateClass([
119
+ property({ type: Number })
120
+ ], ObcCompass.prototype, "heading", 2);
121
+ __decorateClass([
122
+ property({ type: Number })
123
+ ], ObcCompass.prototype, "courseOverGround", 2);
124
+ __decorateClass([
125
+ property({ type: Number })
126
+ ], ObcCompass.prototype, "padding", 2);
127
+ __decorateClass([
128
+ property({ type: Array, attribute: false })
129
+ ], ObcCompass.prototype, "headingAdvices", 2);
130
+ __decorateClass([
131
+ property({ type: Number })
132
+ ], ObcCompass.prototype, "containerWidth", 2);
133
+ ObcCompass = __decorateClass([
134
+ customElement("obc-compass")
135
+ ], ObcCompass);
136
+ export {
137
+ ObcCompass
138
+ };
139
+ //# sourceMappingURL=compass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compass.js","sources":["../../../src/navigation-instruments/compass/compass.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport '../watch/watch';\nimport {Tickmark, TickmarkType} from '../watch/tickmark';\nimport {arrow, ArrowStyle} from './arrow';\nimport {\n AdviceState,\n AdviceType,\n AngleAdvice,\n AngleAdviceRaw,\n} from '../watch/advice';\nimport {radialTickmarks} from './radial-tickmark';\n\n@customElement('obc-compass')\nexport class ObcCompass extends LitElement {\n @property({type: Number}) heading = 0;\n @property({type: Number}) courseOverGround = 0;\n @property({type: Number}) padding = 48;\n @property({type: Array, attribute: false}) headingAdvices: AngleAdvice[] = [];\n @property({type: Number}) containerWidth = 0;\n\n private resizeObserver: ResizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n this.containerWidth = entry.contentRect.width;\n this.adjustPadding();\n }\n });\n\n override connectedCallback() {\n super.connectedCallback();\n this.resizeObserver.observe(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.unobserve(this);\n }\n\n private adjustPadding() {\n const deltaWidth = 512 - this.containerWidth;\n const steps = deltaWidth / 128;\n let deltaPadding = 0;\n if (deltaWidth > 0) {\n deltaPadding = steps * 48;\n } else {\n deltaPadding = steps * 6;\n }\n\n this.padding = 72 + deltaPadding;\n }\n\n private get angleAdviceRaw(): AngleAdviceRaw[] {\n return this.headingAdvices.map(({minAngle, maxAngle, hinted, type}) => {\n const state =\n this.heading >= minAngle && this.heading <= maxAngle\n ? AdviceState.triggered\n : hinted\n ? AdviceState.hinted\n : AdviceState.regular;\n return {minAngle, maxAngle, type, state};\n });\n }\n\n override render() {\n const tickmarks: Tickmark[] = [\n {angle: 0, type: TickmarkType.main},\n {angle: 90, type: TickmarkType.main},\n {angle: 180, type: TickmarkType.main},\n {angle: 270, type: TickmarkType.main},\n ];\n\n const rt = this.headingAdvices.map(({minAngle, maxAngle, type}) =>\n radialTickmarks(\n minAngle,\n maxAngle,\n type === AdviceType.caution ? TickmarkType.secondary : undefined\n )\n );\n\n const width = (176 + this.padding) * 2;\n const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n\n return html`\n <div class=\"container\">\n <obc-watch\n .padding=${this.padding}\n .advices=${this.angleAdviceRaw}\n .tickmarks=${tickmarks}\n .labelFrameEnabled=${true}\n .crosshairEnabled=${true}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\">\n ${rt} ${arrow(ArrowStyle.HDG, this.heading)}\n ${arrow(ArrowStyle.COG, this.courseOverGround)}\n </svg>\n </div>\n `;\n }\n\n static override styles = css`\n * {\n box-sizing: border-box;\n }\n\n .container {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .container > * {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass': ObcCompass;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAca,IAAA,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA;AAC+B,SAAA,UAAA;AACS,SAAA,mBAAA;AACT,SAAA,UAAA;AACO,SAAA,iBAAgC;AAChC,SAAA,iBAAA;AAE3C,SAAQ,iBAAiC,IAAI,eAAe,CAAC,YAAY;AACvE,iBAAW,SAAS,SAAS;AACtB,aAAA,iBAAiB,MAAM,YAAY;AACxC,aAAK,cAAc;AAAA,MACrB;AAAA,IAAA,CACD;AAAA,EAAA;AAAA,EAEQ,oBAAoB;AAC3B,UAAM,kBAAkB;AACnB,SAAA,eAAe,QAAQ,IAAI;AAAA,EAClC;AAAA,EAES,uBAAuB;AAC9B,UAAM,qBAAqB;AACtB,SAAA,eAAe,UAAU,IAAI;AA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,CAAC;AAAA,YACzC,MAAM,WAAW,KAAK,KAAK,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA,EAItD;AA2BF;AA/Ga,WAsFK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AArFC,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GADb,WACe,WAAA,WAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAFb,WAEe,WAAA,oBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAHb,WAGe,WAAA,WAAA,CAAA;AACiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAJ9B,WAIgC,WAAA,kBAAA,CAAA;AACjB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GALb,WAKe,WAAA,kBAAA,CAAA;AALf,aAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,UAAA;"}
@@ -0,0 +1,4 @@
1
+ import { SVGTemplateResult } from 'lit';
2
+ import { TickmarkType } from '../watch/tickmark';
3
+ export declare function radialTickmarks(minAngle: number, maxAngle: number, type: TickmarkType | undefined): SVGTemplateResult[];
4
+ //# sourceMappingURL=radial-tickmark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-tickmark.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass/radial-tickmark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAM,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAC,YAAY,EAA+B,MAAM,mBAAmB,CAAC;AAE7E,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,GAAG,SAAS,GAC7B,iBAAiB,EAAE,CAqErB"}
@@ -0,0 +1,69 @@
1
+ import { svg } from "lit";
2
+ import { TickmarkType, tickmarkColor, TickmarkStyle } from "../watch/tickmark.js";
3
+ function radialTickmarks(minAngle, maxAngle, type) {
4
+ if (type === TickmarkType.main || type === TickmarkType.tertiary) {
5
+ throw new Error(
6
+ "Only secondary tickmarks or undefined tickmarks (dots) are supported"
7
+ );
8
+ }
9
+ const origin = { x: 0, y: 0 };
10
+ const radius = 320 / 2;
11
+ const strokeWidth = "1.2";
12
+ const margin = 1.5;
13
+ const colorName = tickmarkColor(TickmarkStyle.hinted);
14
+ const tickWidth = type === TickmarkType.secondary ? 4 : 1;
15
+ const tickmarks = [];
16
+ const sinMin = Math.sin(minAngle * Math.PI / 180);
17
+ const cosMin = Math.cos(minAngle * Math.PI / 180);
18
+ const sinMax = Math.sin(maxAngle * Math.PI / 180);
19
+ const cosMax = Math.cos(maxAngle * Math.PI / 180);
20
+ const deltaIncrement = tickWidth * margin;
21
+ for (let deltaR = 0; deltaR <= radius; deltaR += deltaIncrement) {
22
+ const xMin = origin.x + sinMin * deltaR;
23
+ const yMin = origin.y - cosMin * deltaR;
24
+ const xMax = origin.x + sinMax * deltaR;
25
+ const yMax = origin.y - cosMax * deltaR;
26
+ if (type === void 0) {
27
+ const size = 1;
28
+ tickmarks.push(
29
+ svg`<rect
30
+ x=${xMin - size / 2}
31
+ y=${yMin - size / 2}
32
+ width=${size}
33
+ height=${size}
34
+ fill=${colorName}
35
+ transform="rotate(${minAngle} ${xMin} ${yMin})"
36
+ vector-effect="non-scaling-stroke"/>`
37
+ );
38
+ tickmarks.push(
39
+ svg`<rect
40
+ x=${xMax - size / 2}
41
+ y=${yMax - size / 2}
42
+ width=${size}
43
+ height=${size}
44
+ fill=${colorName}
45
+ transform="rotate(${maxAngle} ${xMax} ${yMax})"
46
+ vector-effect="non-scaling-stroke"/>`
47
+ );
48
+ } else {
49
+ const currentRadius = Math.min(deltaR + tickWidth, radius);
50
+ const x2Min = origin.x + sinMin * currentRadius;
51
+ const y2Min = origin.y - cosMin * currentRadius;
52
+ const x2Max = origin.x + sinMax * currentRadius;
53
+ const y2Max = origin.y - cosMax * currentRadius;
54
+ tickmarks.push(
55
+ svg`<line x1=${xMin} y1=${yMin} x2=${x2Min} y2=${y2Min} stroke=${colorName} stroke-width=${strokeWidth} vector-effect="non-scaling-stroke"/>`
56
+ );
57
+ tickmarks.push(
58
+ svg`<line x1=${xMax} y1=${yMax} x2=${x2Max} y2=${y2Max} stroke=${colorName} stroke-width=${strokeWidth} vector-effect="non-scaling-stroke"/>`
59
+ );
60
+ if (currentRadius >= radius)
61
+ break;
62
+ }
63
+ }
64
+ return tickmarks;
65
+ }
66
+ export {
67
+ radialTickmarks
68
+ };
69
+ //# sourceMappingURL=radial-tickmark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-tickmark.js","sources":["../../../src/navigation-instruments/compass/radial-tickmark.ts"],"sourcesContent":["import {SVGTemplateResult, svg} from 'lit';\nimport {TickmarkType, TickmarkStyle, tickmarkColor} from '../watch/tickmark';\n\nexport function radialTickmarks(\n minAngle: number,\n maxAngle: number,\n type: TickmarkType | undefined\n): SVGTemplateResult[] {\n if (type === TickmarkType.main || type === TickmarkType.tertiary) {\n throw new Error(\n 'Only secondary tickmarks or undefined tickmarks (dots) are supported'\n );\n }\n\n const origin = {x: 0, y: 0};\n const radius = 320 / 2;\n const strokeWidth = '1.2';\n const margin = 1.5;\n const colorName = tickmarkColor(TickmarkStyle.hinted);\n const tickWidth = type === TickmarkType.secondary ? 4 : 1;\n const tickmarks: SVGTemplateResult[] = [];\n\n const sinMin = Math.sin((minAngle * Math.PI) / 180);\n const cosMin = Math.cos((minAngle * Math.PI) / 180);\n const sinMax = Math.sin((maxAngle * Math.PI) / 180);\n const cosMax = Math.cos((maxAngle * Math.PI) / 180);\n\n const deltaIncrement = tickWidth * margin;\n\n for (let deltaR = 0; deltaR <= radius; deltaR += deltaIncrement) {\n const xMin = origin.x + sinMin * deltaR;\n const yMin = origin.y - cosMin * deltaR;\n const xMax = origin.x + sinMax * deltaR;\n const yMax = origin.y - cosMax * deltaR;\n\n if (type === undefined) {\n const size = 1;\n tickmarks.push(\n svg`<rect \n x=${xMin - size / 2} \n y=${yMin - size / 2} \n width=${size} \n height=${size} \n fill=${colorName} \n transform=\"rotate(${minAngle} ${xMin} ${yMin})\" \n vector-effect=\"non-scaling-stroke\"/>`\n );\n tickmarks.push(\n svg`<rect \n x=${xMax - size / 2} \n y=${yMax - size / 2} \n width=${size} \n height=${size} \n fill=${colorName} \n transform=\"rotate(${maxAngle} ${xMax} ${yMax})\" \n vector-effect=\"non-scaling-stroke\"/>`\n );\n } else {\n const currentRadius = Math.min(deltaR + tickWidth, radius);\n const x2Min = origin.x + sinMin * currentRadius;\n const y2Min = origin.y - cosMin * currentRadius;\n const x2Max = origin.x + sinMax * currentRadius;\n const y2Max = origin.y - cosMax * currentRadius;\n\n tickmarks.push(\n svg`<line x1=${xMin} y1=${yMin} x2=${x2Min} y2=${y2Min} stroke=${colorName} stroke-width=${strokeWidth} vector-effect=\"non-scaling-stroke\"/>`\n );\n tickmarks.push(\n svg`<line x1=${xMax} y1=${yMax} x2=${x2Max} y2=${y2Max} stroke=${colorName} stroke-width=${strokeWidth} vector-effect=\"non-scaling-stroke\"/>`\n );\n\n if (currentRadius >= radius) break;\n }\n }\n\n return tickmarks;\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,gBACd,UACA,UACA,MACqB;AACrB,MAAI,SAAS,aAAa,QAAQ,SAAS,aAAa,UAAU;AAChE,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAEA,QAAM,SAAS,EAAC,GAAG,GAAG,GAAG,EAAC;AAC1B,QAAM,SAAS,MAAM;AACrB,QAAM,cAAc;AACpB,QAAM,SAAS;AACT,QAAA,YAAY,cAAc,cAAc,MAAM;AACpD,QAAM,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AAW,SAAS,iBAAiB,WAAW;AAAA,MAAA;AAE9F,gBAAA;AAAA,QACR,eAAe,IAAI,OAAO,IAAI,OAAO,KAAK,OAAO,KAAK,WAAW,SAAS,iBAAiB,WAAW;AAAA,MAAA;AAGxG,UAAI,iBAAiB;AAAQ;AAAA,IAC/B;AAAA,EACF;AAEO,SAAA;AACT;"}
@@ -0,0 +1,29 @@
1
+ import { css } from "lit";
2
+ const componentStyle = css`* {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ .container {
7
+ position: relative;
8
+ width: 100%;
9
+ height: 100%;
10
+ }
11
+
12
+ .container > * {
13
+ position: absolute;
14
+ top: 0;
15
+ left: 0;
16
+ width: 100%;
17
+ height: 100%;
18
+ }
19
+
20
+ :host {
21
+ display: block;
22
+ width: 100%;
23
+ height: 100%;
24
+ }
25
+ `;
26
+ export {
27
+ componentStyle as default
28
+ };
29
+ //# sourceMappingURL=compass-flat.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compass-flat.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,45 @@
1
+ import { LitElement } from 'lit';
2
+ import '../watch-flat/watch-flat';
3
+ export declare enum LabelPosition {
4
+ top = -45,
5
+ bottom = 50
6
+ }
7
+ export declare enum LabelStyle {
8
+ regular = "var(--instrument-tick-mark-secondary-color)"
9
+ }
10
+ export interface Label {
11
+ x: number;
12
+ y: LabelPosition;
13
+ text: string;
14
+ }
15
+ export declare class ObcCompassFlat extends LitElement {
16
+ noPadding: boolean;
17
+ FOVIndicator: boolean;
18
+ padding: number;
19
+ heading: number;
20
+ courseOverGround: number;
21
+ tickInterval: number;
22
+ FOV: number;
23
+ minFOV: number;
24
+ maxFOV: number;
25
+ labels: Label[];
26
+ containerWidth: number;
27
+ private resizeObserver;
28
+ connectedCallback(): void;
29
+ disconnectedCallback(): void;
30
+ private updateLabels;
31
+ private generateIntervalTickmarks;
32
+ private generateCardinalTickmarks;
33
+ private generateTickmarks;
34
+ private renderFOVIndicator;
35
+ private get HDGSvg();
36
+ private COGSvg;
37
+ render(): import("lit-html").TemplateResult<2>;
38
+ static styles: import("lit").CSSResult;
39
+ }
40
+ declare global {
41
+ interface HTMLElementTagNameMap {
42
+ 'obc-compass-flat': ObcCompassFlat;
43
+ }
44
+ }
45
+ //# sourceMappingURL=compass-flat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compass-flat.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-flat/compass-flat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoC,MAAM,KAAK,CAAC;AAIlE,OAAO,0BAA0B,CAAC;AAElC,oBAAY,aAAa;IACvB,GAAG,MAAM;IACT,MAAM,KAAK;CACZ;AAED,oBAAY,UAAU;IACpB,OAAO,gDAAgD;CACxD;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,aAAa,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBACa,cAAe,SAAQ,UAAU;IACjB,SAAS,EAAE,OAAO,CAAQ;IAC1B,YAAY,EAAE,OAAO,CAAS;IAC/B,OAAO,EAAE,MAAM,CAAM;IACrB,OAAO,SAAK;IACZ,gBAAgB,SAAK;IACrB,YAAY,SAAK;IACjB,GAAG,SAAM;IACT,MAAM,SAAM;IACZ,MAAM,SAAO;IACvC,MAAM,EAAE,KAAK,EAAE,CAAM;IAEK,cAAc,SAAK;IAE7C,OAAO,CAAC,cAAc,CAKnB;IAEM,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,YAAY;IAsCpB,OAAO,CAAC,yBAAyB;IAwBjC,OAAO,CAAC,yBAAyB;IAUjC,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,kBAAkB;IAmC1B,OAAO,KAAK,MAAM,GAIjB;IAED,OAAO,CAAC,MAAM;IAQL,MAAM;IAgCf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}