From c94f3ebb6a90675129374c3d23662dd1f74b548c Mon Sep 17 00:00:00 2001 From: Richard Bunt Date: Mon, 24 Feb 2014 18:20:41 +0000 Subject: [PATCH] the identifiers of web socket return data now include the argument list --- Telemachus/src/KSPWebSocketService.cs | 6 +++--- WebPages/WebPagesTest/src/websockets-telemachus.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Telemachus/src/KSPWebSocketService.cs b/Telemachus/src/KSPWebSocketService.cs index 99e92b8..1a48f5f 100644 --- a/Telemachus/src/KSPWebSocketService.cs +++ b/Telemachus/src/KSPWebSocketService.cs @@ -73,15 +73,15 @@ private void streamData(object sender, ElapsedEventArgs e) foreach (string s in toRun) { - string refArg = s.Trim().Substring(1, s.Length - 2); + string trimedQuotes = s.Trim().Substring(1, s.Length - 2); + string refArg = trimedQuotes; kspAPI.parseParams(ref refArg, ref dataSources); kspAPI.process(refArg, out entry); if (entry != null) { - entry.formatter.setVarName(entry.APIString); - + entry.formatter.setVarName(trimedQuotes); entries.Add(entry.formatter.format(entry.function(dataSources))); } } diff --git a/WebPages/WebPagesTest/src/websockets-telemachus.html b/WebPages/WebPagesTest/src/websockets-telemachus.html index 2aca75f..803e2e9 100644 --- a/WebPages/WebPagesTest/src/websockets-telemachus.html +++ b/WebPages/WebPagesTest/src/websockets-telemachus.html @@ -71,7 +71,7 @@ } function doStringifyTest() { - doSend(JSON.stringify({ "+":["v.altitude","n.roll","b.name[1]", "f.throttle"], "rate":100 })); + doSend(JSON.stringify({ "+": ["v.altitude", "n.roll", "b.name[1]", "r.resource[LiquidFuel]", "f.throttle"], "rate": 100 })); } function doComplexTest()