Changeset - ffa2f340ffdf
[Not reviewed]
default
1 1 1
drewp@bigasterisk.com - 8 months ago 2024-05-14 00:21:31
drewp@bigasterisk.com
revive effectSequencer
2 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
bin/effectSequencer
Show inline comments
 
file renamed from bin/attic/effectSequencer to bin/effectSequencer
 
#!/bin/zsh
 
pnpm exec 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 
 
wait
 
exec pdm run uvicorn light9.effect.sequencer.service:app --port 8213 --no-access-log 
 

	
 

	
web/collector/Light9CollectorUi.ts
Show inline comments
 
@@ -13,49 +13,49 @@ export { Light9CollectorDevice };
 

	
 
debug.enable("*");
 
const log = debug("collector");
 

	
 
@customElement("light9-collector-ui")
 
export class Light9CollectorUi extends LitElement {
 
  graph!: SyncedGraph;
 
  render() {
 
    return html`<rdfdb-synced-graph></rdfdb-synced-graph>
 
      <h1>Collector</h1>
 

	
 
      <h2>Devices</h2>
 
      <div style="column-width: 11em">${this.devices.map((d) => html`<light9-collector-device .uri=${d}></light9-collector-device>`)}</div> `;
 
  }
 

	
 
  @property() devices: NamedNode[] = [];
 

	
 
  constructor() {
 
    super();
 
    getTopGraph().then((g) => {
 
      this.graph = g;
 
      this.graph.runHandler(this.findDevices.bind(this), "findDevices");
 
    });
 

	
 
    const ws = new ReconnectingWebSocket(location.href.replace("http", "ws") + "../service/collector/updates");
 
    const ws = new ReconnectingWebSocket("ws://localhost:8200/service/collector/updates");
 
    ws.addEventListener("message", (ev: any) => {
 
      const outputAttrsSet = JSON.parse(ev.data).outputAttrsSet;
 
      if (outputAttrsSet) {
 
        this.updateDev(outputAttrsSet.dev, outputAttrsSet.attrs);
 
      }
 
    });
 
  }
 

	
 
  findDevices(patch?: Patch) {
 
    const U = this.graph.U();
 

	
 
    this.devices = [];
 
    this.clearDeviceChildElementCache();
 
    let classes = this.graph.subjects(U("rdf:type"), U(":DeviceClass"));
 
    uniq(sortBy(classes, "value"), true).forEach((dc) => {
 
      sortBy(this.graph.subjects(U("rdf:type"), dc), "value").forEach((dev) => {
 
        this.devices.push(dev as NamedNode);
 
      });
 
    });
 
  }
 

	
 
  deviceElements: Map<string, Light9CollectorDevice> = new Map();
 

	
 
  clearDeviceChildElementCache() {
0 comments (0 inline, 0 general)