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 @@ -109,28 +109,27 @@ export class Light9Fader extends LitElem 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}`); + this.graph.runHandler(this.compile.bind(this), `config ${this.uri.value}`); + this.graph.runHandler(this.compileValue.bind(this), `valueSync ${this.uri.value}`); }); } - configure() { - // console.time(`fader configure ${this.uri.value}`) + private compile() { const U = this.graph.U(); if (!this.graph.contains(this.uri, U("rdf:type"), U(":Fader"))) { - // not loaded yet - // console.timeEnd(`fader configure ${this.uri.value}`) - + // not loaded yet, perhaps + this.column = "unset"; + this.effect = null; + this.effectAttr = null; return; } 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")); - // console.timeEnd(`fader configure ${this.uri.value}`) + this.effect = this.graph.uriValue(this.uri, U(":effect")); + const s = this.graph.uriValue(this.uri, U(":setting")); + this.effectAttr = this.graph.uriValue(s, U(":effectAttr")); } - valueSync() { - // console.time(`valueSync ${this.uri.value}`) + private compileValue() { const U = this.graph.U(); if (!this.graph.contains(this.uri, U("rdf:type"), U(":Fader"))) { // not loaded yet @@ -139,7 +138,6 @@ export class Light9Fader extends LitElem } this.value = this.graph.floatValue(this.uri, this.graph.Uri(":value")); - // console.timeEnd(`valueSync ${this.uri.value}`) } onSliderInput(ev: CustomEvent) { @@ -149,13 +147,12 @@ export class Light9Fader extends LitElem if (this.value == prev) { return; } - log(`new value ${this.value}`); meter.tick(); 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); + this.graph.patchObject(this.uri, this.graph.Uri(":effect"), newValue, this.ctx); } } diff --git a/light9/typedgraph.py b/light9/typedgraph.py --- a/light9/typedgraph.py +++ b/light9/typedgraph.py @@ -33,9 +33,6 @@ def _typeIncludes(t1: Type, t2: Type) -> ts = _expandUnion(t1) if len(ts) > 1: return any(_typeIncludes(t, t2) for t in ts) - # if t1 is float: - # return float in get_args(t2) - print(f'down to {t1} {t2}') return False