From 02d1badf0d4900abed41abe9c817cc73581b902d Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Tue, 30 Oct 2018 16:17:08 -0500 Subject: [PATCH 1/3] Adding vertical fudge factor so that no scrollbar is initally present on the SparkCommands; nice catch Eric --- src/client/spark/view/Spark/SparkWindow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/spark/view/Spark/SparkWindow.cs b/src/client/spark/view/Spark/SparkWindow.cs index a65b7d983..07774e7c7 100644 --- a/src/client/spark/view/Spark/SparkWindow.cs +++ b/src/client/spark/view/Spark/SparkWindow.cs @@ -19,6 +19,7 @@ namespace bts.spark { TITLE_PANEL_HEIGHT = 30, COLUMN_HEADER_HEIGHT = 27, SPARK_MENU_ITEM_HEIGHT = 45, + GRID_FOOTER_HEIGHT = 30, ABSOLUTE_MIN_HEIGHT = 230; protected static readonly TimeSpan CONTENT_MEASURE_WAIT_PERIOD = TimeSpan.FromSeconds(0.3); @@ -60,7 +61,7 @@ namespace bts.spark { public abstract UIElement Content { get; } public virtual IEnumerable Commands => Enumerable.Empty(); public virtual double MinWidth => 400; - public virtual double MinHeight => Math.Max(ABSOLUTE_MIN_HEIGHT, TITLE_PANEL_HEIGHT + COLUMN_HEADER_HEIGHT + Commands.Count() * SPARK_MENU_ITEM_HEIGHT); + public virtual double MinHeight => Math.Max(ABSOLUTE_MIN_HEIGHT, TITLE_PANEL_HEIGHT + COLUMN_HEADER_HEIGHT + GRID_FOOTER_HEIGHT + Commands.Count() * SPARK_MENU_ITEM_HEIGHT); public ShellWindowUI GetContent() => new ShellWindowUI(new SparkWindowView(_bus, Commands, Content)); From 246f9240e7c9c933ee3dc80ca49469fee2ecd606 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Thu, 1 Nov 2018 11:53:47 -0400 Subject: [PATCH 2/3] Tweak md dump tool for easier human consumption --- src/lib/md/Diag/ShmDumper.cpp | 67 ++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/src/lib/md/Diag/ShmDumper.cpp b/src/lib/md/Diag/ShmDumper.cpp index 914f58897..f41da63aa 100644 --- a/src/lib/md/Diag/ShmDumper.cpp +++ b/src/lib/md/Diag/ShmDumper.cpp @@ -33,8 +33,11 @@ string dump(IntPrice price) { string dump(PriceSize ps) { stringstream res; res << "{"; - res << "'price': " << std::setprecision(11) << ps.price() << ", "; - res << "'size': " << ps.size() << " "; + res << "'price': " << std::setprecision(11) << ps.price(); + if (!ps.is_nan()) { + res << " (^" << (int)ps.exponent() << ")"; + } + res << ", 'size': " << ps.size() << " "; // res << "'mant': " << ps.mantissa() << ", "; // res << "'exp': " << (int)ps.exponent() << " "; res << "}"; @@ -162,34 +165,42 @@ string dump_entry(const HotDepthEntry& entry) { res << "{ "; res << "'timestamp': " << dump(entry.time()) << ", "; res << "'key': " << entry.key << ", "; - - res << "\n'bid': ["; - for (const auto& level : entry.direct) { - res << dump(level.bid()) << ", "; - } - res << "], "; - - res << "\n'ask': ["; - for (const auto& level : entry.direct) { - res << dump(level.ask()) << ", "; - } - res << "], "; - - res << "'\nimplied_bid': ["; - for (const auto& level : entry.implied) { - res << dump(level.bid()) << ", "; - } - res << "], "; - - res << "'\nimplied_ask': ["; - for (const auto& level : entry.implied) { - res << dump(level.ask()) << ", "; - } - res << "], "; - - res << "\n'settlement': '" << dump(entry.settlement) << "', "; + res << "'settlement': '" << dump(entry.settlement) << "', "; res << "'status': '" << CoconutSecurityStatus_Name((CoconutSecurityStatus)entry.status) << "', "; res << "'sequence': '" << entry.sequence << "', "; + + res << "\n 'bid': ["; + for (const auto& level : entry.direct) { + if (!level.bid().is_nan()) { + res << dump(level.bid()) << ", "; + } + } + res << "], "; + + res << "\n 'ask': ["; + for (const auto& level : entry.direct) { + if (!level.ask().is_nan()) { + res << dump(level.ask()) << ", "; + } + } + res << "], "; + + res << "\n 'implied_bid': ["; + for (const auto& level : entry.implied) { + if (!level.bid().is_nan()) { + res << dump(level.bid()) << ", "; + } + } + res << "], "; + + res << "\n 'implied_ask': ["; + for (const auto& level : entry.implied) { + if (!level.ask().is_nan()) { + res << dump(level.ask()) << ", "; + } + } + res << "]"; + res << " }"; return res.str(); } From d70bd63659c25a1d7e7c1a988170bc1797e06e0e Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Thu, 1 Nov 2018 13:26:29 -0400 Subject: [PATCH 3/3] sparkd md dumpsecurity should dump synthetic metadata --- src/server/sparkd/md/run_md.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/server/sparkd/md/run_md.cpp b/src/server/sparkd/md/run_md.cpp index b4d5a4f78..de31a5280 100644 --- a/src/server/sparkd/md/run_md.cpp +++ b/src/server/sparkd/md/run_md.cpp @@ -195,6 +195,15 @@ void dump_db(const vector args) { md::db::load_securities(symbols, [&](const api::Security& security) { if (all || keys.find(security.id()) != keys.end()) { security.PrintDebugString(); + if (md::securitytype_of(security) == api::SECURITYTYPE_SYNTHETIC) { + auto metadata = md::db::load_metadata(); + for (const auto &m : metadata) { + if(m.security_key() == security.id()) { + m.PrintDebugString(); + break; + } + } + } } }); }