Mercurial > code > home > repos > light9
annotate web/live/Light9AttrControl.ts @ 2398:87de3fada483
dead code
author | drewp@bigasterisk.com |
---|---|
date | Thu, 16 May 2024 16:13:18 -0700 |
parents | 4556eebe5d73 |
children |
rev | line source |
---|---|
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
1 import debug from "debug"; |
2238 | 2 import { css, html, LitElement, PropertyValues } from "lit"; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
3 import { customElement, property, state } from "lit/decorators.js"; |
2238 | 4 import { Literal, NamedNode } from "n3"; |
2242 | 5 import { SubEvent } from "sub-events"; |
2372
06bf6dae8e64
reorg tools into light9/web/ and a single vite instance
drewp@bigasterisk.com
parents:
2273
diff
changeset
|
6 import { getTopGraph } from "../RdfdbSyncedGraph"; |
06bf6dae8e64
reorg tools into light9/web/ and a single vite instance
drewp@bigasterisk.com
parents:
2273
diff
changeset
|
7 import { SyncedGraph } from "../SyncedGraph"; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
8 import { ControlValue, Effect } from "./Effect"; |
2087 | 9 import { DeviceAttrRow } from "./Light9DeviceControl"; |
2242 | 10 export { Slider } from "@material/mwc-slider"; |
2372
06bf6dae8e64
reorg tools into light9/web/ and a single vite instance
drewp@bigasterisk.com
parents:
2273
diff
changeset
|
11 export { Light9ColorPicker } from "../light9-color-picker"; |
2248 | 12 export { Light9Listbox } from "./Light9Listbox"; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
13 const log = debug("settings.dev.attr"); |
2238 | 14 |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
15 type DataTypeNames = "scalar" | "color" | "choice"; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
16 const makeType = (d: DataTypeNames) => new NamedNode(`http://light9.bigasterisk.com/${d}`); |
2242 | 17 |
2238 | 18 // UI for one device attr (of any type). |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
19 @customElement("light9-attr-control") |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
20 export class Light9AttrControl extends LitElement { |
2087 | 21 graph!: SyncedGraph; |
2084
c4eab47d3c83
WIP half-ported live/ page to working TS
drewp@bigasterisk.com
parents:
2083
diff
changeset
|
22 |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
23 static styles = [ |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
24 css` |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
25 #colorControls { |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
26 display: flex; |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
27 align-items: center; |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
28 } |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
29 #colorControls > * { |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
30 margin: 0 3px; |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
31 } |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
32 :host { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
33 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
34 mwc-slider { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
35 width: 250px; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
36 } |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
37 `, |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
38 ]; |
2081
c57cf4049004
dice up the live/ elements and code into ts files (no conversion yet except auto coffee->ts)
drewp@bigasterisk.com
parents:
diff
changeset
|
39 |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
40 @property() deviceAttrRow: DeviceAttrRow | null = null; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
41 @state() dataType: DataTypeNames = "scalar"; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
42 @property() effect: Effect | null = null; |
2087 | 43 @property() enableChange: boolean = false; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
44 @property() value: ControlValue | null = null; // e.g. color string |
2087 | 45 |
46 constructor() { | |
47 super(); | |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
48 getTopGraph().then((g) => { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
49 this.graph = g; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
50 if (this.deviceAttrRow === null) throw new Error(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
51 }); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
52 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
53 |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
54 connectedCallback(): void { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
55 super.connectedCallback(); |
2248 | 56 setTimeout(() => { |
57 // only needed once per page layout | |
58 this.shadowRoot?.querySelector("mwc-slider")?.layout(/*skipUpdateUI=*/ false); | |
59 }, 1); | |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
60 } |
2081
c57cf4049004
dice up the live/ elements and code into ts files (no conversion yet except auto coffee->ts)
drewp@bigasterisk.com
parents:
diff
changeset
|
61 |
2242 | 62 render() { |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
63 if (this.deviceAttrRow === null) throw new Error(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
64 if (this.dataType == "scalar") { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
65 const v = this.value || 0; |
2248 | 66 return html`<mwc-slider .value=${v} step=${1 / 255} min="0" max="1" @input=${this.onValueInput}></mwc-slider> `; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
67 } else if ((this.dataType = "color")) { |
2248 | 68 const v = this.value || "#000"; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
69 return html` |
2242 | 70 <div id="colorControls"> |
2248 | 71 <button @click=${this.goBlack}>0.0</button> |
72 <light9-color-picker .color=${v} @input=${this.onValueInput}></light9-color-picker> | |
2242 | 73 </div> |
74 `; | |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
75 } else if (this.dataType == "choice") { |
2248 | 76 return html`<light9-listbox .choices=${this.deviceAttrRow.choices} .value=${this.value}> </light9-listbox> `; |
2242 | 77 } |
78 } | |
79 | |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
80 updated(changedProperties: PropertyValues<this>) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
81 super.updated(changedProperties); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
82 |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
83 if (changedProperties.has("deviceAttrRow")) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
84 this.onDeviceAttrRowProperty(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
85 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
86 if (changedProperties.has("effect")) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
87 this.onEffectProperty(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
88 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
89 if (changedProperties.has("value")) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
90 this.onValueProperty(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
91 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
92 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
93 |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
94 private onValueProperty() { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
95 if (this.deviceAttrRow === null) throw new Error(); |
2273 | 96 if (!this.graph) { |
97 log('ignoring value change- no graph yet') | |
98 return; | |
99 } | |
100 if (this.effect === null) { | |
101 this.value = null; | |
102 } else { | |
103 const p = this.effect.edit( | |
104 // | |
105 this.deviceAttrRow.device, | |
106 this.deviceAttrRow.uri, | |
107 this.value | |
108 ); | |
109 if (!p.isEmpty()) { | |
110 log("Effect told us to graph.patch this:\n", p.dump()); | |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
111 this.graph.applyAndSendPatch(p); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
112 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
113 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
114 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
115 |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
116 private onEffectProperty() { |
2273 | 117 if (this.effect === null) { |
118 log('no effect obj yet') | |
119 return; | |
120 } | |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
121 // effect will read graph changes on its own, but emit an event when it does |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
122 this.effect.settingsChanged.subscribe(() => { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
123 this.effectSettingsChanged(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
124 }); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
125 this.effectSettingsChanged(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
126 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
127 |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
128 private effectSettingsChanged() { |
2248 | 129 // something in the settings graph is new |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
130 if (this.deviceAttrRow === null) throw new Error(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
131 if (this.effect === null) throw new Error(); |
2248 | 132 // log("graph->ui on ", this.deviceAttrRow.device, this.deviceAttrRow.uri); |
133 const v = this.effect.currentValue(this.deviceAttrRow.device, this.deviceAttrRow.uri); | |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
134 this.onGraphValueChanged(v); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
135 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
136 |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
137 private onDeviceAttrRowProperty() { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
138 if (this.deviceAttrRow === null) throw new Error(); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
139 const d = this.deviceAttrRow.dataType; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
140 if (d.equals(makeType("scalar"))) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
141 this.dataType = "scalar"; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
142 } else if (d.equals(makeType("color"))) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
143 this.dataType = "color"; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
144 } else if (d.equals(makeType("choice"))) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
145 this.dataType = "choice"; |
2087 | 146 } |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
147 } |
2087 | 148 |
2248 | 149 onValueInput(ev: CustomEvent) { |
2087 | 150 if (ev.detail === undefined) { |
151 // not sure what this is, but it seems to be followed by good events | |
152 return; | |
153 } | |
2252 | 154 // log(ev.type, ev.detail.value); |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
155 this.value = ev.detail.value; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
156 // this.graphToControls.controlChanged(this.device, this.deviceAttrRow.uri, ev.detail.value); |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
157 } |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
158 |
2087 | 159 onGraphValueChanged(v: ControlValue | null) { |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
160 if (this.deviceAttrRow === null) throw new Error(); |
2248 | 161 // log("change: control must display", v, "for", this.deviceAttrRow.device.value, this.deviceAttrRow.uri.value); |
2087 | 162 // this.enableChange = false; |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
163 if (this.dataType == "scalar") { |
2087 | 164 if (v !== null) { |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
165 this.value = v; |
2087 | 166 } else { |
2248 | 167 this.value = 0; |
2087 | 168 } |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
169 } else if (this.dataType == "color") { |
2248 | 170 this.value = v; |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
171 } |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
172 } |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
173 |
2087 | 174 goBlack() { |
175 this.value = "#000000"; | |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
176 } |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
177 |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
178 onChoice(value: any) { |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
179 // if (value != null) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
180 // value = this.graph.Uri(value); |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
181 // } else { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
182 // value = null; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
183 // } |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
184 } |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
185 |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
186 onChange(value: any) { |
2246
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
187 // if (typeof value === "number" && isNaN(value)) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
188 // return; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
189 // } // let onChoice do it |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
190 // //log('change: control tells graph', @deviceAttrRow.uri.value, value) |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
191 // if (value === undefined) { |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
192 // value = null; |
5c269c03863d
WIP device settings page can now load and save ok. Omitted GraphToControls for now
drewp@bigasterisk.com
parents:
2242
diff
changeset
|
193 // } |
2083
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
194 } |
ad7ab7027907
clean up non-elements; get the lit elements at least to work with autoformat
drewp@bigasterisk.com
parents:
2081
diff
changeset
|
195 } |