Use Eve dashboard broker
This commit is contained in:
parent
35afc22092
commit
ffb53fe456
3 changed files with 28 additions and 10 deletions
14
README.md
14
README.md
|
|
@ -81,9 +81,11 @@ Start the dashboard authority on Starfire:
|
||||||
dotnet run --project E:\Projects\Mimir\src\Mimir.EveDashboard\Mimir.EveDashboard.csproj -- --port 8795
|
dotnet run --project E:\Projects\Mimir\src\Mimir.EveDashboard\Mimir.EveDashboard.csproj -- --port 8795
|
||||||
```
|
```
|
||||||
|
|
||||||
EveCanvas connects to `ws://192.168.1.66:8795/eve/dashboard`. Mimir sends
|
EveCanvas connects first to `ws://192.168.1.66:8795/eve/deck`, with
|
||||||
`dashboard-state` snapshots containing scene nodes, selection, visibility,
|
`/eve/dashboard` kept as a compatibility fallback. The Starfire broker sends
|
||||||
transform, size, and health. EveCanvas sends compact commands back:
|
native retained `dashboard-state` snapshots containing provider id, title,
|
||||||
|
scene nodes, selection, visibility, transform, size, and health. EveCanvas sends
|
||||||
|
compact commands back:
|
||||||
|
|
||||||
- `select`
|
- `select`
|
||||||
- `move`
|
- `move`
|
||||||
|
|
@ -91,9 +93,11 @@ transform, size, and health. EveCanvas sends compact commands back:
|
||||||
- `rotate`
|
- `rotate`
|
||||||
- `toggle-visibility`
|
- `toggle-visibility`
|
||||||
- `reset-transform`
|
- `reset-transform`
|
||||||
|
- `open-provider`
|
||||||
|
|
||||||
Eve renders and edits the dashboard; Mimir owns the accepted state. Eve is the
|
Eve renders and edits dashboard trees natively; each provider owns accepted
|
||||||
operator's hand on the scene graph, not a second compositor.
|
state and command handling. Eve is the operator's hand on the scene graph, not a
|
||||||
|
second compositor and not a remote WebKit runtime.
|
||||||
|
|
||||||
## Build Shape
|
## Build Shape
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@
|
||||||
if ([state isKindOfClass:NSDictionary.class]) {
|
if ([state isKindOfClass:NSDictionary.class]) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self.delegate dashboardClient:self didReceiveState:state];
|
[self.delegate dashboardClient:self didReceiveState:state];
|
||||||
[self.delegate dashboardClient:self didChangeStatus:@"dashboard live"];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,8 @@ static int64_t EVEHostTimeNowNs(void) {
|
||||||
[self.streamClient connect];
|
[self.streamClient connect];
|
||||||
|
|
||||||
NSArray<NSURL *> *dashboardURLs = @[
|
NSArray<NSURL *> *dashboardURLs = @[
|
||||||
|
[NSURL URLWithString:@"ws://127.0.0.1:8795/eve/deck"],
|
||||||
|
[NSURL URLWithString:@"ws://192.168.1.66:8795/eve/deck"],
|
||||||
[NSURL URLWithString:@"ws://127.0.0.1:8795/eve/dashboard"],
|
[NSURL URLWithString:@"ws://127.0.0.1:8795/eve/dashboard"],
|
||||||
[NSURL URLWithString:@"ws://192.168.1.66:8795/eve/dashboard"],
|
[NSURL URLWithString:@"ws://192.168.1.66:8795/eve/dashboard"],
|
||||||
];
|
];
|
||||||
|
|
@ -515,7 +517,9 @@ static int64_t EVEHostTimeNowNs(void) {
|
||||||
|
|
||||||
- (void)dashboardClient:(EVEDashboardClient *)client didReceiveState:(NSDictionary *)state {
|
- (void)dashboardClient:(EVEDashboardClient *)client didReceiveState:(NSDictionary *)state {
|
||||||
(void)client;
|
(void)client;
|
||||||
self.dashboardStatus = [NSString stringWithFormat:@"v%@", state[@"version"] ?: @"?"];
|
NSString *title = [state[@"title"] isKindOfClass:NSString.class] ? state[@"title"] : @"dashboard";
|
||||||
|
self.dashboardStatus = [NSString stringWithFormat:@"%@ v%@", title, state[@"version"] ?: @"?"];
|
||||||
|
self.dashboardStatusLabel.text = self.dashboardStatus;
|
||||||
NSString *selected = state[@"selectedNodeId"];
|
NSString *selected = state[@"selectedNodeId"];
|
||||||
if ([selected isKindOfClass:NSString.class]) {
|
if ([selected isKindOfClass:NSString.class]) {
|
||||||
self.selectedNodeId = selected;
|
self.selectedNodeId = selected;
|
||||||
|
|
@ -630,7 +634,7 @@ static int64_t EVEHostTimeNowNs(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
UILabel *title = [[UILabel alloc] initWithFrame:CGRectZero];
|
UILabel *title = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||||
title.text = @"Scene Graph";
|
title.text = @"Dashboards";
|
||||||
title.textColor = UIColor.whiteColor;
|
title.textColor = UIColor.whiteColor;
|
||||||
title.font = [UIFont systemFontOfSize:16.0 weight:UIFontWeightBold];
|
title.font = [UIFont systemFontOfSize:16.0 weight:UIFontWeightBold];
|
||||||
[self.hierarchyStackView addArrangedSubview:title];
|
[self.hierarchyStackView addArrangedSubview:title];
|
||||||
|
|
@ -659,8 +663,7 @@ static int64_t EVEHostTimeNowNs(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.selectedNodeId = nodeId;
|
[self selectOrOpenDashboardNode:nodeId];
|
||||||
[self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)nodePanned:(UIPanGestureRecognizer *)recognizer {
|
- (void)nodePanned:(UIPanGestureRecognizer *)recognizer {
|
||||||
|
|
@ -722,7 +725,19 @@ static int64_t EVEHostTimeNowNs(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self selectOrOpenDashboardNode:nodeId];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)selectOrOpenDashboardNode:(NSString *)nodeId {
|
||||||
self.selectedNodeId = nodeId;
|
self.selectedNodeId = nodeId;
|
||||||
|
NSDictionary *node = self.dashboardNodes[nodeId];
|
||||||
|
NSString *command = [node[@"command"] isKindOfClass:NSString.class] ? node[@"command"] : nil;
|
||||||
|
NSString *providerId = [node[@"providerId"] isKindOfClass:NSString.class] ? node[@"providerId"] : nil;
|
||||||
|
if ([command isEqualToString:@"open-provider"] && providerId) {
|
||||||
|
[self.dashboardClient sendCommand:@{@"type": @"open-provider", @"nodeId": nodeId, @"providerId": providerId}];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}];
|
[self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue