# HG changeset patch # User drewp@bigasterisk.com # Date 2022-06-01 19:21:06 # Node ID 9eb2e7c40765560c3b60218d3875ae01c95499ff # Parent 35468f1dcf38c645ea6ff6692b5e1f0c48b7ed7a /fade/ page can now edit values and :Fade :effectClass values in the graph diff --git a/bin/effectSequencer b/bin/effectSequencer --- a/bin/effectSequencer +++ b/bin/effectSequencer @@ -1,5 +1,5 @@ #!/bin/sh pnpx vite -c light9/effect/sequencer/web/vite.config.ts & -pdm run uvicorn light9.effect.sequencer.service:app --host 0.0.0.0 --port 8213 --no-access-log +pdm run uvicorn light9.effect.sequencer.service:app --host 0.0.0.0 --port 8213 --no-access-log --reload wait diff --git a/light9/fade/web/Light9FadeUi.ts b/light9/fade/web/Light9FadeUi.ts --- a/light9/fade/web/Light9FadeUi.ts +++ b/light9/fade/web/Light9FadeUi.ts @@ -4,7 +4,7 @@ import { customElement, property } from import { NamedNode } from "n3"; import { getTopGraph } from "../../web/RdfdbSyncedGraph"; import { SyncedGraph } from "../../web/SyncedGraph"; - +export { EditChoice } from "../../web/EditChoice"; import { provideFASTDesignSystem, fastSlider, fastSliderLabel } from "@microsoft/fast-components"; provideFASTDesignSystem().register(fastSlider(), fastSliderLabel()); @@ -26,17 +26,28 @@ export class Light9FadeUi extends LitEle

Fade [metrics]

- - + ${this.faders.map((fd) => html` `)} `; } graph!: SyncedGraph; + @property() faders: NamedNode[] = []; + constructor() { super(); getTopGraph().then((g) => { this.graph = g; + this.faders = [ + g.Uri(":show/dance2019/fadePage1f0"), + g.Uri(":show/dance2019/fadePage1f1"), + g.Uri(":show/dance2019/fadePage1f2"), + g.Uri(":show/dance2019/fadePage1f3"), + g.Uri(":show/dance2019/fadePage1f4"), + g.Uri(":show/dance2019/fadePage1f5"), + g.Uri(":show/dance2019/fadePage1f6"), + g.Uri(":show/dance2019/fadePage1f7"), + ]; }); } } @@ -62,27 +73,50 @@ export class Light9Fader extends LitElem ]; render() { return html` - +
${this.value.toPrecision(3)}
-
curtain
-
Slider 1
+
eff:
+
attr:
+
<=> Slider ${this.column}
`; } graph!: SyncedGraph; + ctx: NamedNode = new NamedNode("http://light9.bigasterisk.com/show/dance2019/fade"); + @property() uri!: NamedNode; + @property() column!: string; + @property() effect: NamedNode | null = null; + @property() effectAttr: NamedNode | null = null; + @property() value: number = 0.111; constructor() { super(); getTopGraph().then((g) => { this.graph = g; + this.graph.runHandler(this.configure.bind(this), `config ${this.uri.value}`); + this.graph.runHandler(this.valueSync.bind(this), `valueSync ${this.uri.value}`); + }); } + configure() { + const U = this.graph.U(); + this.column = this.graph.stringValue(this.uri, U(":column")); + this.effect = this.graph.uriValue(this.uri, U(":effectClass")); + this.effectAttr = this.graph.uriValue(this.uri, U(":effectAttr")); + } +valueSync() { + this.value = this.graph.floatValue(this.uri, this.graph.Uri(":value")); +} onSliderInput(ev: CustomEvent) { this.value = (ev.target as any).valueAsNumber; - + this.graph.patchObject(this.uri, this.graph.Uri(":value"), this.graph.LiteralRoundedFloat(this.value), this.ctx); + } + onEffectChange(ev: CustomEvent) { + const { newValue } = ev.detail; + this.graph.patchObject(this.uri, this.graph.Uri(":effectClass"), newValue, this.ctx); } }