Adjust field to be drawn at new 0,0.
Draw the position the camera thinks it is as well.
Change-Id: I2cb346e095bc6887c702e96a42752c57d55f1603
diff --git a/aos/network/web_proxy_main.cc b/aos/network/web_proxy_main.cc
index 0e49760..c674520 100644
--- a/aos/network/web_proxy_main.cc
+++ b/aos/network/web_proxy_main.cc
@@ -24,7 +24,6 @@
LOG(INFO) << "My node is " << aos::FlatbufferToJson(self);
- // TODO(alex): skip fetchers on the wrong node.
for (uint i = 0; i < config.message().channels()->size(); ++i) {
auto channel = config.message().channels()->Get(i);
if (aos::configuration::ChannelIsReadableOnNode(channel, self)) {
diff --git a/aos/network/www/config_handler.ts b/aos/network/www/config_handler.ts
index 3d20f0d..6615f39 100644
--- a/aos/network/www/config_handler.ts
+++ b/aos/network/www/config_handler.ts
@@ -3,13 +3,14 @@
import {Connection} from './proxy';
export class ConfigHandler {
- private readonly root_div = document.getElementById('config');
+ private readonly root_div = document.createElement('div');
private readonly tree_div;
private config: Configuration|null = null
constructor(private readonly connection: Connection) {
this.connection.addConfigHandler((config) => this.handleConfig(config));
+ document.body.appendChild(this.root_div);
const show_button = document.createElement('button');
show_button.addEventListener('click', () => this.toggleConfig());
const show_text = document.createTextNode('Show/Hide Config');
diff --git a/aos/network/www/proxy.ts b/aos/network/www/proxy.ts
index a675340..7bcf575 100644
--- a/aos/network/www/proxy.ts
+++ b/aos/network/www/proxy.ts
@@ -66,6 +66,11 @@
this.configHandlers.add(handler);
}
+ /**
+ * Add a handler for a specific message type. Until we need to handle
+ * different channel names with the same type differently, this is good
+ * enough.
+ */
addHandler(id: string, handler: (data: Uint8Array) => void): void {
this.handlerFuncs.set(id, handler);
}
@@ -183,7 +188,8 @@
}
/**
- * Subscribes to messages.
+ * Subscribes to messages. Only the most recent connect message is in use. Any
+ * channels not specified in the message are implicitely unsubscribed.
* @param a Finished flatbuffer.Builder containing a Connect message to send.
*/
sendConnectMessage(builder: any) {