Compare commits

...
19 Commits
Author SHA1 Message Date
John Colvin abf44b5b8d fix build: Fix a few path errors in publish target 2023-05-31 22:03:17 -04:00
Taha fd2ba70031 Culling the logs 2023-05-29 11:35:49 -04:00
Taha ab410c339f Order Tickets from the sheets are defaulted correctly now 2023-05-29 10:32:29 -04:00
John Colvin 9e3f16d8bc fix build: Update externals so prod builds in new docker 2023-04-05 11:45:24 -04:00
John Colvin a3f194d708 build (web): Upgrade web build to net7.0 2023-04-05 11:39:37 -04:00
John Colvin bf87c46fcd fix build: Remove inappropriate ThreadStatic attr
This has likely been incorrect for a while. The problem surfaced after
upgrading to net7.0, as the new framework emits a warning (CA2259) when the
attribute is associated with a non-static field.
2023-03-07 16:30:59 -05:00
John Colvin 222d4b266e build: Disable warning cs8981
This is a new warning, introduced in net7.0, that disallows lowercase
class names. Our spark_crypto.prod branch currently uses protoc v3.19.1,
which is incompatible with this new warning, as it generates
classes with lowercase names. We can re-enable the warning when we
upgrade protoc to 3.21.12 (this has been done in the api server branch).
2023-03-07 16:25:21 -05:00
John Colvin d593eaf058 build: Upgrade TargetFramework to net7.0
We've been using several net7.0 preview features for a while now. Now that a
stable net7.0 release is available, it is time upgrade officially. This also
aids the effort to build csharp on Linux, where these preview features didn't
work out of the box. Lastly, trying to make these preview features work would
be a waste of time, as namespaces/interfaces in the official release have
changed in a way that isn't backwards compatible w/ the preview features.
2023-03-07 16:17:39 -05:00
John Colvin 55d021ccb1 fix build (publish): Copy libspark.dll to publish dir
Bugs (fixed):
  * Spark.exe generated by the installer crashes immediately on launch because
    it cannot find the libspark.dll.

  Cause: Sure enough, libspark.dll isn't in the install folder
  (AppData\Roaming\bts\Spark)

* Build libspark explicitly
* Fix libspark.dll copy src path
2023-02-07 16:41:11 -05:00
John Colvin b02f814c65 fix (ui): Remove context menu items that do nothing
They were accidentally brought over from Edge. Their functionality
hasn't been implemented in Spark.
2023-01-23 01:34:55 -05:00
John Colvin 8c42aa93a2 chore: Remove unused code 2023-01-23 01:34:55 -05:00
John Colvin 357bc5ad44 fix (ui): Format perp futs 'Perp' suffix (not bogus exp) 2023-01-23 01:34:55 -05:00
John Colvin 07fb9e8eb7 ui (pnl): Use 'default_text' foreground in popup titles
Previously, the foreground for some popups was a hardcoded dark gray,
which became hard-to-read following the Dark Theme changes.
2023-01-23 01:34:55 -05:00
John Colvin 9f9fc4c8ab fix (analytics-exps): Wait for sym list before loading selection
Bugs (fixed):
   * The selected symbols aren't restored with the workspace

   Cause: The selected symbols were getting loaded once, in the ctr, before the
   list of symbols had been properly initialized. The view automatically
   deselects items that aren't in the ItemsSource.
2023-01-22 12:23:03 -05:00
John Colvin 2aef052398 ui (pnl): Use gray font color when pnl is zero 2023-01-22 12:23:03 -05:00
John Colvin 1c2027506a refactor: Clean up NullableColor/FontWeightProto 2023-01-22 12:23:03 -05:00
John Colvin c3274b2008 refactor: Rename argb_color -> to_uint
This is a more appropriate name
2023-01-22 00:11:28 -05:00
John Colvin 99aef9e86e refactor: Get rid of redundant prop 'NullableColorProto.argb'
It was a relic of the past. Although different fns are called in the props'
getters ('rgb_color' vs 'argb_color'), both ultimately return the same value.
2023-01-22 00:09:38 -05:00
John Colvin 8e9233022e fix (mini-ob): Return root element in CancelColumn.view_factory
Bugs (fixed):
  * Mini Orderbook crashes immediately when opened

  Cause: The (cell) view_factory fn wasn't returning the cell's root
  element, and was instead returning the root's child element.
  As a result, when the row attempted to add this element to its visual
  tree, the following exception was thrown:

    System.ArgumentException: Specified Visual is already a child of
    another Visual or the root of a CompositionTarget.
2023-01-21 13:41:04 -05:00
99 changed files with 6843 additions and 6015 deletions

No files matched your search

+18
View File
@@ -7,6 +7,24 @@
"commands": [
"dotnet-format"
]
},
"fable": {
"version": "4.0.0-theta-018",
"commands": [
"fable"
]
},
"fantomas": {
"version": "5.2.2",
"commands": [
"fantomas"
]
},
"fake-cli": {
"version": "6.0.0",
"commands": [
"fake"
]
}
}
}
+55 -53
View File
@@ -1,53 +1,55 @@
<Project>
<PropertyGroup>
<ComputerSpecificConfig>..\..\tools\override\$(computername).props</ComputerSpecificConfig>
<SparkRoot>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\..))</SparkRoot>
<SourceRoot>$([System.IO.Path]::GetFullPath($(SparkRoot)\src))</SourceRoot>
<Externals>$(SparkRoot)\externals\windows</Externals>
<DepotName>$([System.IO.Path]::GetFileName($([System.IO.Path]::GetFullPath($(SparkRoot)))))</DepotName>
<ErrorReport>None</ErrorReport>
<Prefer32Bit>False</Prefer32Bit>
<Deterministic>true</Deterministic>
<EnableDefaultContentItems>False</EnableDefaultContentItems>
<ShowMissingItemTypes>false</ShowMissingItemTypes>
<Configuration Condition="'$(configuration)'==''">Debug</Configuration>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
</PropertyGroup>
<PropertyGroup Label="Output">
<BaseOutputPath>$(SparkRoot)\build\$(Configuration)</BaseOutputPath>
<OutputPath>$(BaseOutputPath)\bin</OutputPath>
<BaseIntermediateOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</IntermediateOutputPath>
<GenDir>$(BaseOutputPath)\gen\$(MSBuildProjectName)</GenDir>
</PropertyGroup>
<Import
Project="$(ComputerSpecificConfig)"
Condition="Exists($(ComputerSpecificConfig))" />
<PropertyGroup Label="ProtoBuf">
<ProtocPluginBase>$(SparkRoot)\src\lib\api\service_compiler</ProtocPluginBase>
<protoc>$(Externals)\bin\protoc.exe</protoc>
<protogen>$(Externals)\bin\protogen.exe</protogen>
</PropertyGroup>
<ItemDefinitionGroup>
<Proto2></Proto2>
<Proto3>
<OutBase>$(IntermediateOutputPath)\gen\%(relativedir)</OutBase>
<OutCS>%(OutBase)%(FileName).cs</OutCS>
<OutCSClient>%(OutBase)%(FileName).client.pb.cs</OutCSClient>
<OutCSServer>%(OutBase)%(FileName).server.pb.cs</OutCSServer>
<OutCSImmutable>%(OutBase)%(FileName).immutable.pb.cs</OutCSImmutable>
<CompileOptions></CompileOptions>
</Proto3>
<Proto3Excel>
<OutBase>$(IntermediateOutputPath)\gen\%(relativedir)</OutBase>
<OutCSExcel>%(OutBase)%(FileName).excel.pb.cs</OutCSExcel>
<CompileOptions></CompileOptions>
</Proto3Excel>
</ItemDefinitionGroup>
</Project>
<Project>
<PropertyGroup>
<ComputerSpecificConfig>..\..\tools\override\$(computername).props</ComputerSpecificConfig>
<SparkRoot>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\..))</SparkRoot>
<SourceRoot>$([System.IO.Path]::GetFullPath($(SparkRoot)\src))</SourceRoot>
<Externals>$(SparkRoot)\externals\windows</Externals>
<DepotName>$([System.IO.Path]::GetFileName($([System.IO.Path]::GetFullPath($(SparkRoot)))))</DepotName>
<ErrorReport>None</ErrorReport>
<Prefer32Bit>False</Prefer32Bit>
<Deterministic>true</Deterministic>
<EnableDefaultContentItems>False</EnableDefaultContentItems>
<ShowMissingItemTypes>false</ShowMissingItemTypes>
<Configuration Condition="'$(configuration)'==''">Debug</Configuration>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<LangVersion>11</LangVersion>
</PropertyGroup>
<PropertyGroup Label="Output">
<BaseOutputPath>$(SparkRoot)\build\$(Configuration)</BaseOutputPath>
<OutputPath>$(BaseOutputPath)\bin</OutputPath>
<BaseIntermediateOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</IntermediateOutputPath>
<ProtoOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</ProtoOutputPath>
<GenDir>$(BaseOutputPath)\gen\$(MSBuildProjectName)</GenDir>
</PropertyGroup>
<Import
Project="$(ComputerSpecificConfig)"
Condition="Exists($(ComputerSpecificConfig))" />
<PropertyGroup Label="ProtoBuf">
<ProtocPluginBase>$(SparkRoot)\src\lib\api\service_compiler</ProtocPluginBase>
<protoc>$(Externals)\bin\protoc.exe</protoc>
<protogen>$(Externals)\bin\protogen.exe</protogen>
</PropertyGroup>
<ItemDefinitionGroup>
<Proto2></Proto2>
<Proto3>
<OutBase>$(IntermediateOutputPath)\gen\%(relativedir)</OutBase>
<OutCS>%(OutBase)%(FileName).cs</OutCS>
<OutCSClient>%(OutBase)%(FileName).client.pb.cs</OutCSClient>
<OutCSServer>%(OutBase)%(FileName).server.pb.cs</OutCSServer>
<OutCSImmutable>%(OutBase)%(FileName).immutable.pb.cs</OutCSImmutable>
<CompileOptions></CompileOptions>
</Proto3>
<Proto3Excel>
<OutBase>$(IntermediateOutputPath)\gen\%(relativedir)</OutBase>
<OutCSExcel>%(OutBase)%(FileName).excel.pb.cs</OutCSExcel>
<CompileOptions></CompileOptions>
</Proto3Excel>
</ItemDefinitionGroup>
</Project>
@@ -43,6 +43,7 @@ namespace mbts.spark {
readonly ObservableHashSet<AnalyticsExpirationParametersRowVM> _selected_rows = new();
readonly DeferrableAction _raise_selected_rows_changed;
readonly IRaiseCanExecuteChangedCommand _set_driver_to_nearest_exp_cmd;
IList<string>? _pending_selected_symbols;
AnalyticsExpirationParametersMap? _parameter_map;
(ICommand cmd, IDisposable can_exe_sub)? _smart_copy_roll_target_to_selection_cmd;
@@ -65,9 +66,7 @@ namespace mbts.spark {
_is_dirty = backing(nameof(is_dirty), () => rows.Any(r => r.is_dirty));
if (startup_data is not null) {
if (!startup_data.selected_symbols.is_null_or_empty()) {
selected_symbols.AddRange(startup_data.selected_symbols);
}
_pending_selected_symbols = startup_data.selected_symbols;
auto_copy_rolls_is_checked = startup_data.auto_copy_rolls_is_checked;
auto_copy_rates_is_checked = startup_data.auto_copy_rates_is_checked;
}
@@ -297,8 +296,8 @@ namespace mbts.spark {
symbols.sync_with(_parameters.Select(p => p.security.symbol).Distinct().Ordered());
using var _ = _sync_visible_rows.defer();
if (is_first_update) {
// select all symbols on first update
selected_symbols.sync_with(symbols);
selected_symbols.sync_with(_pending_selected_symbols?.Intersect(symbols) ?? symbols);
_pending_selected_symbols = null;
}
}
@@ -63,9 +63,9 @@ namespace mbts.spark {
vs_input, vs_nonvol_data.contracts, aux_data_map);
_timer.stop();
var tag_str = tag == null ? "Null" : tag.ToString();
bts.Log.Gen.info($"SingleVolSurfaceCommittedOutputRetriever._recompute_and_publish " +
$"vs_id: {_vs_id} time:{_timer.lastIntervalTime} ms tag:{tag_str} " +
$"tid:{_tid()}"); //output: {vs_output.log_string()}*/");
// bts.Log.Gen.info($"SingleVolSurfaceCommittedOutputRetriever._recompute_and_publish " +
// $"vs_id: {_vs_id} time:{_timer.lastIntervalTime} ms tag:{tag_str} " +
// $"tid:{_tid()}"); //output: {vs_output.log_string()}*/");
_logger.log(_log_id, _log_id, _timer.lastIntervalTime);
_bb.post(_out_bb_computed_vol_tag, vs_output);
}
@@ -75,7 +75,7 @@ namespace mbts.spark {
var exp_price_map = OptionDriverPriceMap.get_vs_price_map(
all_sym_price_map, (s) => _option_symbols.Contains(s));
if (sc_data != null && vs_nonvol_input != null && exp_price_map != null) {
bts.Log.Gen.info($"SingleVolSurfaceNonVolDataSource vs_id:{_vs_id} " +
bts.Log.Gen.diag($"SingleVolSurfaceNonVolDataSource vs_id:{_vs_id} " +
"publishing VolSurfaceNonVolData");
_bb.post(_out_bb_vs_nonvol_data_tag,
new VolSurfaceNonVolData(
@@ -81,7 +81,7 @@ namespace mbts.analytics {
output.Add(symbol, symbol_data);
}
IReadOnlyDictionary<string, TData> ro_output = output;
bts.Log.Gen.info($"SymbolAggregationPublisher._on_timer publishing " +
bts.Log.Gen.diag($"SymbolAggregationPublisher._on_timer publishing " +
$"tag: {_out_tag} sz: {ro_output.Count}");
_bb.post(_out_tag, ro_output);
}
@@ -28,9 +28,10 @@ namespace mbts.spark {
_candidate_value.Changed += on_candidate_changed;
_is_dirty.Changed += (o, n) => {
Log.assert(o != n);
Log.Ui.info(
$"VolSurface '{expiration}.{column}' is_dirty changed to {n}. " +
$"commited: {committed_value}; candidate: {candidate_value}");
// TODO: John, this was logged too many times
// Log.Ui.info(
// $"VolSurface '{expiration}.{column}' is_dirty changed to {n}. " +
// $"commited: {committed_value}; candidate: {candidate_value}");
};
void on_committed_changed(object? oldval, object? newval) =>
@@ -96,7 +96,7 @@ namespace mbts.spark {
get => _core_settings.font_weight_override;
set {
using var _ = detect_property_change();
_core_settings.with(font_weight_override: value.HasValue ? new NullableFontWeightProto(value) : null);
_core_settings.with(font_weight_override: value.HasValue ? new(value) : null);
}
}
@@ -145,7 +145,7 @@ namespace mbts {
!(x == y);
public override string ToString() =>
$"{security_tuple} {expiration.ToShortDateString()}";
$"{security_tuple} {SecurityFormatter.format_expiration(expiration)}";
}
[ProtoContract]
@@ -88,8 +88,8 @@ namespace mbts.analytics {
public void set_driver_price(
IDictionary<VolSurfaceExpiration, double> driver_price_map) {
Log.Gen.info($"VolSurfaceInterpGreeksProducer.set_driver_price " +
$"vs_id: {_vs_id} exp_count: {driver_price_map.Count}");
// Log.Gen.info($"VolSurfaceInterpGreeksProducer.set_driver_price " +
// $"vs_id: {_vs_id} exp_count: {driver_price_map.Count}");
_driver_price_map = new Dictionary<VolSurfaceExpiration, double>(driver_price_map);
_compute_and_fire(InputType.DriverPrice);
}
+1 -1
View File
@@ -62,7 +62,7 @@ namespace bts {
}
private void _on_server_sec_map(IReadOnlyDictionary<uint, SecurityMD> sec_map) {
_log_options(sec_map);
//_log_options(sec_map);
bts.Log.Gen.info(String.Format("MergedMDDaemon._on_server_sec_map sz: {0}", sec_map.Count()));
_server_sec_map = new Dictionary<uint, SecurityMD>(sec_map);
_merge_and_post();
@@ -79,10 +79,12 @@ namespace bts.shell.market_view {
var ask_col_index = columns.FindIndex(x => x.id == MarketViewWindowFactory.col_id(Columns.Ask));
if (bid_col_index > -1 && ask_col_index > -1) {
if (!columns[bid_col_index].background_color_override.HasValue) {
columns[bid_col_index] = columns[bid_col_index].with(background_color_override: new NullableColorProto(BTSColors.MarketData.bid.value));
columns[bid_col_index] = columns[bid_col_index].with(
background_color_override: new(BTSColors.MarketData.bid));
}
if (!columns[ask_col_index].background_color_override.HasValue) {
columns[ask_col_index] = columns[ask_col_index].with(background_color_override: new NullableColorProto(BTSColors.MarketData.ask.value));
columns[ask_col_index] = columns[ask_col_index].with(
background_color_override: new(BTSColors.MarketData.ask));
}
}
// and enable background color upgrade
@@ -70,11 +70,13 @@ namespace bts.shell {
bool applied = false;
if (bid_col_index > -1 && ask_col_index > -1) {
if (!columns[bid_col_index].background_color_override.HasValue) {
columns[bid_col_index] = columns[bid_col_index].with(background_color_override: new NullableColorProto(BTSColors.MarketData.bid.value));
columns[bid_col_index] = columns[bid_col_index].with(
background_color_override: new(BTSColors.MarketData.bid));
applied = true;
}
if (!columns[ask_col_index].background_color_override.HasValue) {
columns[ask_col_index] = columns[ask_col_index].with(background_color_override: new NullableColorProto(BTSColors.MarketData.ask.value));
columns[ask_col_index] = columns[ask_col_index].with(
background_color_override: new(BTSColors.MarketData.ask));
applied = true;
}
}
@@ -410,13 +410,13 @@ namespace mbts.spark {
day_change = new DaySettings {
// (neutral)
font = _default_font,
background_color = Colors.Transparent.rgb_color(),
background_color = Colors.Transparent.to_uint(),
// negative
negative_font_color = Colors.White.rgb_color(),
negative_background_color = Colors.Red.rgb_color(),
negative_font_color = Colors.White.to_uint(),
negative_background_color = Colors.Red.to_uint(),
// positive
positive_font_color = Colors.White.rgb_color(),
positive_background_color = Colors.Green.rgb_color()
positive_font_color = Colors.White.to_uint(),
positive_background_color = Colors.Green.to_uint()
},
session_low = _default_item,
session_high = _default_item,
@@ -431,8 +431,8 @@ namespace mbts.spark {
public static LadderPanelPricePointSettings tt_default {
get {
var rv = historic_default;
rv.day_change.background_color = Color.FromRgb(113, 201, 69).rgb_color();
rv.day_change.font.font_color = Colors.Black.rgb_color();
rv.day_change.background_color = Color.FromRgb(113, 201, 69).to_uint();
rv.day_change.font.font_color = Colors.Black.to_uint();
return rv;
}
}
@@ -484,7 +484,7 @@ namespace mbts.spark {
static ItemSettings _default_item =>
new ItemSettings {
font = _default_font,
background_color = Colors.Transparent.rgb_color()
background_color = Colors.Transparent.to_uint()
};
[ProtoContract]
@@ -97,7 +97,7 @@ namespace mbts.spark {
security_key = use_self_security ? null : selected_security_key,
price_type = _selected_price_type,
display = new LadderMarketBreakLine {
color = color.rgb_color(),
color = color.to_uint(),
show = show,
refresh_mode = refresh_mode
}
@@ -27,7 +27,7 @@ namespace mbts.spark {
class LadderOrderVM : DisposableViewModelBase {
static readonly Color _colorbg = Colors.White;
static readonly Color _darkbg = Color.FromRgb(0xbf, 0xbf, 0xbf);
static readonly Brush _color_bg_brush = _colorbg.rgb_color().rgb_brush();
static readonly Brush _color_bg_brush = _colorbg.to_uint().rgb_brush();
readonly LadderVM _owner;
readonly double _real_price;
@@ -228,7 +228,7 @@ namespace mbts.spark {
if (_orders.TryGetValue(order.Key, out var opm)) {
algo_studio_abbreviation = (opm.meta?.abbreviation).is_null_or_empty() ?
_abbreviate_algo(opm.algo) : opm.meta?.abbreviation ?? string.Empty;
border = opm.meta?.badge_color?.rgb_color().rgb_brush() ?? border;
border = opm.meta?.badge_color?.to_uint().rgb_brush() ?? border;
}
algo_type = order.order_type().is_bts_algo_type() ?
order.order_type() : CustomOrderDefinition.CustomOneofCase.None;
@@ -42,13 +42,13 @@ namespace mbts.spark {
public LadderPanelPricePointSettings.ItemSettings create() =>
new LadderPanelPricePointSettings.ItemSettings {
font = new FontParamsProto {
font_color = font_color.rgb_color(),
font_color = font_color.to_uint(),
font_size = font_size,
typeface = new(
font_family.name() ?? TextUtils.StandardFontFamilyName,
font_weight.ToOpenTypeWeight())
},
background_color = background_color.rgb_color(),
background_color = background_color.to_uint(),
show_label = show_label
};
@@ -111,11 +111,11 @@ namespace mbts.spark {
show_label = base_settings.show_label,
background_color = base_settings.background_color,
// negative
negative_font_color = negative_font_color.rgb_color(),
negative_background_color = negative_background_color.rgb_color(),
negative_font_color = negative_font_color.to_uint(),
negative_background_color = negative_background_color.to_uint(),
// positive
positive_font_color = positive_font_color.rgb_color(),
positive_background_color = positive_background_color.rgb_color()
positive_font_color = positive_font_color.to_uint(),
positive_background_color = positive_background_color.to_uint()
};
}
}
@@ -700,8 +700,8 @@ namespace mbts.spark {
font_weight = font_weight.ToOpenTypeWeight(),
width = width,
show = show,
foreground = foreground.rgb_color(),
background = background.rgb_color()
foreground = foreground.to_uint(),
background = background.to_uint()
};
}
}
@@ -891,7 +891,7 @@ namespace mbts.spark {
};
root_bd.SetBinding(
Border.BackgroundProperty, new Binding(nameof(background_brush)) { Source = this });
return button;
return root_bd;
}
}
@@ -231,7 +231,7 @@ namespace bts.shell {
sorting_criteria,
_vm.anchors,
filters,
state.grid.with(columns: cols, background: _vm.grid_background_color.rgb_color()),
state.grid.with(columns: cols, background: _vm.grid_background_color.to_uint()),
calc_type,
_vm.header_row_display,
menu_display: _menu_display_vm?.create());
@@ -68,10 +68,10 @@ namespace bts.shell.pnl {
typeface = new TypefaceProto(
cell_appearance.font_family?.name(),
(cell_appearance.font_weight ?? FontWeights.Normal).ToOpenTypeWeight()),
font_color = cell_appearance.foreground?.rgb_color() ?? 0,
font_color = cell_appearance.foreground?.to_uint() ?? 0,
font_size = cell_appearance.font_size,
},
background = cell_appearance.background?.rgb_color()
background = cell_appearance.background?.to_uint()
};
public PNLCellAppearance to_appearance() {
File diff suppressed because it is too large. Load diff
@@ -103,14 +103,14 @@ namespace bts.shell.pnl {
public PNLAnimation to_animation(PNLView.Columns key) =>
new PNLAnimation {
column = key,
foreground = is_font_color_overridden ? font_color_override.color.rgb_color() : (uint?)null,
background = is_background_overridden ? background_override.color.rgb_color() : (uint?)null,
foreground = is_font_color_overridden ? font_color_override.color.to_uint() : (uint?)null,
background = is_background_overridden ? background_override.color.to_uint() : (uint?)null,
font_weight = is_font_weight_overridden ? font_weight_override.ToOpenTypeWeight() : (int?)null
};
public PNLCellAppearanceProto to_appearance_proto() =>
new PNLCellAppearanceProto {
background = is_background_overridden ? background_override.color.rgb_color() : (uint?)null,
background = is_background_overridden ? background_override.color.to_uint() : (uint?)null,
font_params = to_font_params()
};
@@ -119,7 +119,7 @@ namespace bts.shell.pnl {
typeface = new TypefaceProto(
font_family_override?.name(),
is_font_weight_overridden ? font_weight_override.ToOpenTypeWeight() : 0),
font_color = is_font_color_overridden ? font_color_override.color.rgb_color() : 0,
font_color = is_font_color_overridden ? font_color_override.color.to_uint() : 0,
font_size = font_size_override
};
}
@@ -132,7 +132,7 @@ namespace bts.shell.pnl {
// group
var (group_cell_appearance, group_row_background_colors) = group_row_defaults.create();
s.group_cell_appearance = PNLCellAppearanceProto.from_appearance(group_cell_appearance);
s.group_background_colors.SetItems(group_row_background_colors.Select(c => c.rgb_color()));
s.group_background_colors.SetItems(group_row_background_colors.Select(c => c.to_uint()));
//
return s;
}
@@ -329,20 +329,19 @@ namespace bts.shell.pnl {
}
static (string desc, Color fg) _fills_title(Columns key) {
const uint net_fg = 0x333333u;
switch (key) {
case Columns.SODLongPos: return ("Open Buy Fills", BTSColors.MarketData.bid);
case Columns.SODShortPos: return ("Open Sell Fills", BTSColors.MarketData.ask);
case Columns.SODNetPos: return ("Open Fills", net_fg.rgb_color());
case Columns.SODNetPos: return ("Open Fills", BTSColors.UI.default_text);
case Columns.DayLongPos: return ("Day Buy Fills", BTSColors.MarketData.bid);
case Columns.DayShortPos: return ("Day Sell Fills", BTSColors.MarketData.ask);
case Columns.DayNetPos: return ("Day Fills", net_fg.rgb_color());
case Columns.DayNetPos: return ("Day Fills", BTSColors.UI.default_text);
case Columns.RawDayLongPos: return ("Raw Day Buy Fills", BTSColors.MarketData.bid);
case Columns.RawDayShortPos: return ("Raw Day Sell Fills", BTSColors.MarketData.ask);
case Columns.RawDayNetPos: return ("Raw Day Fills", net_fg.rgb_color());
case Columns.RawDayNetPos: return ("Raw Day Fills", BTSColors.UI.default_text);
case Columns.TotalLongPos: return ("All Buy Fills", BTSColors.MarketData.bid);
case Columns.TotalShortPos: return ("All Sell Fills", BTSColors.MarketData.ask);
case Columns.TotalNetPos: return ("All Fills", net_fg.rgb_color());
case Columns.TotalNetPos: return ("All Fills", BTSColors.UI.default_text);
default: throw ExceptionBuilder.Argument.unexpected_case(key, nameof(key));
}
}
@@ -368,7 +367,7 @@ namespace bts.shell.pnl {
switch (key) {
case Columns.WorkingLongPos: return ("Working Buy Orders", BTSColors.MarketData.bid);
case Columns.WorkingShortPos: return ("Working Sell Orders", BTSColors.MarketData.ask);
case Columns.WorkingNetPos: return ("Working Orders", 0x333333u.rgb_color());
case Columns.WorkingNetPos: return ("Working Orders", BTSColors.UI.default_text);
default: throw ExceptionBuilder.Argument.unexpected_case(key, nameof(key));
}
}
@@ -58,5 +58,10 @@ namespace BCG {
public static UInt32 get_ask_size(BBOPacket md) {
return md != null ? md._ask_size : (UInt32)0;
}
public static Tuple<double, UInt32> get_md(BBOPacket md, bool is_bid) {
double price = is_bid ? BBOPacket.get_bid_price(md) : BBOPacket.get_ask_price(md);
UInt32 sz = is_bid ? BBOPacket.get_bid_size(md) : BBOPacket.get_ask_size(md);
return Tuple.Create(price, sz);
}
}
}
@@ -123,6 +123,15 @@ namespace BCG {
#endregion
#region Orders
[System.ComponentModel.Category("Orders / Algo")]
[System.ComponentModel.DisplayName("Default Account")]
public string Account { get; set; }
[System.ComponentModel.Category("Orders / Algo")]
[System.ComponentModel.DisplayName("Default Qty")]
public Nullable<double> DefaultQty { get; set; }
#endregion
public NMSheetSettingLayout() {
show_settings_header = false;
show_exp_navigator = false;
@@ -18,6 +18,7 @@ using mbts.spark.filters;
using System.Collections;
using System.Reactive.Linq;
using System.Threading;
using bts.api.orderman;
namespace BCG {
public partial class NMSheetControl : UserControl {
@@ -555,6 +556,17 @@ namespace BCG {
}
private void _launch_order_entry_window(NMSheetTheoGrid.GridCell cell,
OrderEntryWindow window_type) {
Func<string, bts.AccountTuple> get_account = (string default_acc) => {
string account = _settings.setting_layout.Account;
if (String.IsNullOrEmpty(account)) {
account = default_acc;
}
Nullable<uint> id = _get_account_id(account);
if (!id.HasValue) {
id = 0;
}
return new bts.AccountTuple(id.Value, account);
};
uint key;
var found = _sheet_data.get_security_key(cell.expiration,
cell.strike, cell.call_selected, out key);
@@ -566,7 +578,20 @@ namespace BCG {
if (sc_data.sec_md_map.TryGetValue(key, out var smd)) {
switch (window_type) {
case OrderEntryWindow.Ticket:
_threaded_bb.post(SparkTags.ShowOrderTicketFromSecurityTag, smd);
bool is_bid = NMSheetSettingColumnOrganization.get_column_info(cell.col).is_bid;
bts.AccountTuple acc_tup = get_account("SMALL");
Nullable<double> qty = _settings.setting_layout.DefaultQty;
OrderDefinition od = new OrderDefinition() {
SecurityKey = smd.id,
TimeInForce = TimeInForce.Gtc,
Account = acc_tup.name,
AccountId = acc_tup.id
};
BBOPacket bbo = _sheet_data.get_bbo(smd.id);
Tuple<double, UInt32> pr_sz = BBOPacket.get_md(bbo, is_bid);
UInt32 effective_qty = qty.HasValue ? Convert.ToUInt32(Math.Abs(qty.Value)) : pr_sz.Item2;
_threaded_bb.post(SparkTags.ShowOrderTicketTag,
(new OrderDefinitionImmutable(od), pr_sz.Item1, effective_qty));
break;
case OrderEntryWindow.Ladder:
_threaded_bb.post(SparkTags.ShowLadderTag, smd);
@@ -29,7 +29,7 @@ namespace mbts.spark {
get {
var m = new OrderMetadata { KeyBinding = string.Empty, NoProps = false };
if (_studio_meta.HasValue && _studio_meta.Value.badge_color.HasValue)
m.Color = _studio_meta.Value.badge_color.Value.rgb_color();
m.Color = _studio_meta.Value.badge_color.Value.to_uint();
return m;
}
}
@@ -136,7 +136,7 @@ namespace mbts.analytics {
IEnumerable<VolSurfaceExpiration> all_exps) {
var exps = all_exps.Where(vse => vse.symbol.is_null_or_empty()).ToArray();
var exp_header_cells = exps
.Select(vse => DateFormatter.Format(vse.expiration, DateFormat.DayMonthAbvDiff2000))
.Select(vse => SecurityFormatter.format_expiration(vse.expiration))
.ToArray();
return (exps, exp_header_cells);
}
@@ -145,7 +145,7 @@ namespace mbts.analytics {
IEnumerable<VolSurfaceExpiration> all_exps) {
var exps = all_exps.ToArray();
var exp_header_cells = exps.Select(vse => string.IsNullOrEmpty(vse.symbol) ?
DateFormatter.Format(vse.expiration, DateFormat.DayMonthAbvDiff2000) : vse.symbol)
SecurityFormatter.format_expiration(vse.expiration) : vse.symbol)
.ToArray();
return (exps, exp_header_cells);
}
@@ -57,8 +57,6 @@
<analytics:ComboFutureDataColumn x:Key="FutureSymDataColumn" HeaderTemplate="{StaticResource SymHeaderTemplate}" ElementStyle="{StaticResource FutureSymDataElementStyle}" MinWidth="60" x:Shared="False" />
<analytics:ComboOptionDataColumn x:Key="OptionExpDataColumn" HeaderTemplate="{StaticResource ExpHeaderTemplate}" ElementStyle="{StaticResource OptionExpDataElementStyle}" MinWidth="60" x:Shared="False" />
<analytics:ComboOptionDataColumn x:Key="OptionSymDataColumn" HeaderTemplate="{StaticResource SymHeaderTemplate}" ElementStyle="{StaticResource OptionSymDataElementStyle}" MinWidth="60" x:Shared="False" />
<MenuItem x:Key="LaunchConfigurationEditorMenuItem" x:Shared="False" Header="Report Configuration..." Command="{Binding DataContext.launch_configuration_editor, Source={x:Reference ComboWindow}}" />
<MenuItem x:Key="ExportToCSVMenuItem" Header="Export To CSV..." Command="{Binding export_to_csv_command}" CommandParameter="{Binding DataContext.show_call_put, Source={x:Reference ComboWindow}}" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
@@ -99,14 +97,7 @@
VerticalGridLinesBrush="LightGray"
CanUserResizeColumns="False"
CanUserReorderColumns="False"
IsReadOnly="True"
>
<DataGrid.ContextMenu>
<ContextMenu>
<StaticResourceExtension ResourceKey="LaunchConfigurationEditorMenuItem" />
</ContextMenu>
</DataGrid.ContextMenu>
</c:DataGridEx>
IsReadOnly="True" />
</AdornerDecorator>
<GridSplitter Grid.Row="2" Height="3" Background="Black" HorizontalAlignment="Stretch" />
@@ -144,12 +135,6 @@
<TextBlock Text="{Binding Item.strike, RelativeSource={RelativeSource AncestorType=DataGridRow}}" />
</DataTemplate>
</DataGrid.RowHeaderTemplate>
<DataGrid.ContextMenu>
<ContextMenu>
<StaticResourceExtension ResourceKey="LaunchConfigurationEditorMenuItem" />
<StaticResourceExtension ResourceKey="ExportToCSVMenuItem" />
</ContextMenu>
</DataGrid.ContextMenu>
</c:DataGridEx>
</AdornerDecorator>
@@ -121,7 +121,7 @@ namespace mbts.analytics {
timer.stop();
Log.Ui.info($"PNLReportCalculator n_pos: {output.position_data.Count()} " +
$"n_day_trades: {output.day_trades.Count()} time(msecs): {timer.lastIntervalTime}");
_log_before_posting(output.position_data);
//_log_before_posting(output.position_data);
_bus.post(SparkTags.ReportBlackboardTags.PNL.PNLData, output);
});
}
@@ -1,5 +1,7 @@
#nullable enable
namespace mbts.analytics {
using bts.api;
using System;
using System.Diagnostics.Contracts;
@@ -17,13 +19,9 @@ namespace mbts.analytics {
symbol = null;
}
private static string _format_exp(DateTime exp) {
return mbts.ui.utility.ExpirationFormatter.DateFormatter.format_day_month_year(exp);
}
SlideGreekUnitKey(DateTime exp_date) {
exp = exp_date;
_unique_name = _format_exp(exp_date);
_unique_name = SecurityFormatter.format_expiration(exp_date);
type = GroupType.Exp;
symbol = null;
}
@@ -31,7 +29,7 @@ namespace mbts.analytics {
SlideGreekUnitKey(DateTime exp_date, string symbol) {
exp = exp_date;
this.symbol = symbol;
_unique_name = $"{_format_exp(exp_date)}:{symbol}";
_unique_name = $"{SecurityFormatter.format_expiration(exp_date)}:{symbol}";
type = GroupType.SymExp;
}
@@ -115,21 +115,21 @@ namespace mbts.analytics {
}
private void _handle_nonvol_data(VolSurfaceNonVolData vs_nonvol_data) {
bts.Log.Gen.info(String.Format("SlideReportCalculator._handle_nonvol_data report {0}",
_report.ReportName));
// bts.Log.Gen.info(String.Format("SlideReportCalculator._handle_nonvol_data report {0}",
// _report.ReportName));
_vs_nonvol_data = vs_nonvol_data;
}
private void _handle_future_prices(
IReadOnlyDictionary<SecurityExpiration, FutureTheoStructure> future_prices_map) {
bts.Log.Gen.info(String.Format("SlideReportCalculator._handle_future_prices report {0}",
_report.ReportName));
// bts.Log.Gen.Diag(String.Format("SlideReportCalculator._handle_future_prices report {0}",
// _report.ReportName));
_future_prices_map = future_prices_map.ToDictionary(kv => kv.Key, kv => kv.Value.theo);
}
private void _handle_trades(IEnumerable<ITradeLogRow> trades) {
bts.Log.Gen.info(String.Format("SlideReportCalculator._handle_trades report {0}",
_report.ReportName));
// bts.Log.Gen.info(String.Format("SlideReportCalculator._handle_trades report {0}",
// _report.ReportName));
_all_trades = trades.Where(t => t.is_active);
if (_report.CalcMode == Report.Types.ReportCalculationMode.PositionOrTheoChange) {
_compute_dirty = true;
+1 -2
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<Authors>Blue Trading Systems</Authors>
<Company>Blue Trading Systems</Company>
@@ -34,7 +34,6 @@
<PackageReference Include="System.Reactive.Interfaces" Version="5.0.0" />
<PackageReference Include="System.Reactive.Linq" Version="5.0.0" />
<PackageReference Include="System.Reactive.PlatformServices" Version="5.0.0" />
<PackageReference Include="System.Runtime.Experimental" Version="6.0.2" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<ProjectReference Include="../spark_api/spark_api.csproj" />
<ProjectReference Include="../spark_core/spark_core.csproj" />
@@ -71,7 +71,8 @@ namespace BCG {
foreach (string sym in temp.Keys) {
SortedList<DateTime, string> temp2 = temp[sym];
foreach (KeyValuePair<DateTime, string> kvp in temp2) {
string datecode = bts.api.DateFormatter.Format(kvp.Key, bts.api.DateFormat.MonthCodeLastDigitYear);
string datecode = bts.api.SecurityFormatter.format_expiration(
kvp.Key, date_format: bts.api.DateFormat.MonthCodeLastDigitYear);
string explegs = (temp.Keys.Count > 1) ? string.Concat(sym, datecode, "_", kvp.Value) :
string.Concat(datecode, "_", kvp.Value);
@@ -61,7 +61,7 @@ namespace BCG {
string rv = String.Empty;
foreach (SingleSpreadLeg l in legs)
rv += (rv == String.Empty ? "" : "/") + l.symbol + //BCG.Utilities.Dates.DateCode.getMonthSymbol(l.exp) + (l.exp.Year - 2000);
bts.api.DateFormatter.Format(l.exp, bts.api.DateFormat.DayMonthAbvDiff2000);
SecurityFormatter.format_expiration(l.exp);
return rv;
}
+2 -2
View File
@@ -35,7 +35,7 @@ namespace bts.core {
// TODO: for debugging purposes, remove it later
if (tag != mbts.spark.SparkTags.SparkTimer) {
var tid = System.Threading.Thread.CurrentThread.ManagedThreadId;
bts.Log.Ui.diag($"SimpleBus.post tag:{tag} tid:{tid}");
//bts.Log.Ui.diag($"SimpleBus.post tag:{tag} tid:{tid}");
return;
}
} catch (Exception e) {
@@ -45,7 +45,7 @@ namespace bts.core {
public IObservable<T> subscribe<T>(ITag<T> tag) {
var tid = System.Threading.Thread.CurrentThread.ManagedThreadId;
bts.Log.Ui.info($"SimpleBus.post tag:{tag} tid:{tid}");
//bts.Log.Ui.info($"SimpleBus.subscribe tag:{tag} tid:{tid}");
return subject<T>(tag);
}
}
@@ -253,6 +253,7 @@ namespace mbts.ui {
public static BTSColor foreground => UI.default_foreground;
public static BTSColor anchor => Colors.Gold;
public static BTSColor profit => Colors.Green;
public static BTSColor net_zero => BTSCoreColors.gray;
public static BTSColor loss => BTSCoreColors.venetian_red;
public static BTSColor header_row_background => 0xffaaaaaa;
// group background colors
@@ -17,7 +17,7 @@ namespace bts.proto {
readonly double _opacity;
public ColorOpacityProto(Color color = default, double opacity = 1.0)
: this(color.rgb_color(), opacity) { }
: this(color.to_uint(), opacity) { }
public ColorOpacityProto(uint color = 0u, double opacity = 1.0) {
_color = color;
@@ -16,7 +16,7 @@ namespace bts.proto {
readonly bool _show;
public ColorShowProto(Color value, bool show = true)
: this(value.rgb_color(), show) { }
: this(value.to_uint(), show) { }
public ColorShowProto(uint value, bool show = true) {
_value = value;
@@ -1,51 +0,0 @@
using bts.api;
using bts.utils;
using mbts.utils;
using ProtoBuf;
using System;
namespace bts.proto {
[ProtoContract]
public struct ExpDate : IEquatable<ExpDate> {
[ProtoMember(1)]
readonly uint _month;
[ProtoMember(2)]
readonly uint _year;
[ProtoMember(3)]
readonly uint _day;
public ExpDate(SecurityImmutable security)
: this(security.earliest_expiration()) { }
public ExpDate(DateTime date) {
_month = (uint)date.Month;
_year = (uint)date.Year;
_day = (uint)date.Day;
}
public uint month => _month;
public uint year => _year;
public uint day => _day;
public bool Equals(ExpDate other) =>
other._month == _month && other._year == year && other._day == day;
public override bool Equals(object obj) => obj is ExpDate ed && Equals(ed);
public static bool operator ==(ExpDate a, ExpDate b) => a.Equals(b);
public static bool operator !=(ExpDate a, ExpDate b) => !a.Equals(b);
public override int GetHashCode() =>
EqualityComparer.aggregate_hash((int)_month, (int)_day, (int)_year);
public override string ToString() =>
DateFormatter.Format((int)_year, (int)_month, (int)_day, DateFormat.MonthCodeLastDigitYear);
}
static class ExpDateExtensions {
public static DateTime to_date_time(this ExpDate exp_date) =>
new DateTime((int)exp_date.year, (int)exp_date.month, (int)exp_date.day);
}
}
@@ -1,36 +1,42 @@
using bts.utils;
using mbts.ui;
using ProtoBuf;
using System;
using System.Windows.Media;
#nullable enable
namespace bts.proto {
using bts.utils;
using mbts.ui;
using ProtoBuf;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Windows.Media;
[ProtoContract]
struct NullableColorProto : IEquatable<NullableColorProto> {
readonly struct NullableColorProto : IEquatable<NullableColorProto> {
[ProtoMember(1)]
readonly uint? _value;
public NullableColorProto(Color? value) =>
_value = value?.rgb_color();
_value = value?.to_uint();
public NullableColorProto(uint value) =>
_value = value;
public static NullableColorProto none => new(null);
public Color? value => _value?.rgb_color();
public Color? argb => _value?.argb_color();
public Color? value => _value?.argb_color();
[MemberNotNullWhen(true, nameof(value))]
public bool has_value => value.HasValue;
public bool Equals(NullableColorProto other) =>
EqualityComparer.nullable_equals(_value, other._value);
public override bool Equals(object obj) =>
public override bool Equals(object? obj) =>
obj is NullableColorProto ncp && Equals(ncp);
public override int GetHashCode() =>
_value.HasValue ? (int)_value.Value : 0;
public override string ToString() =>
_value?.ToString() ?? string.Empty;
public static bool operator ==(NullableColorProto a, NullableColorProto b) => a.Equals(b);
public static bool operator !=(NullableColorProto a, NullableColorProto b) => !a.Equals(b);
}
@@ -1,42 +0,0 @@
using bts.utils;
using mbts.utils;
using ProtoBuf;
using System;
using System.Windows;
namespace mbts.ui.settings {
[ProtoContract]
struct NullableFontWeightProto : IEquatable<NullableFontWeightProto> {
[ProtoMember(1)]
readonly ushort? _value;
public NullableFontWeightProto(FontWeight? value) =>
_value = (ushort?)value?.ToOpenTypeWeight();
public NullableFontWeightProto(ushort value) =>
_value = value;
public FontWeight? value {
get {
if (_value.HasValue)
return FontWeight.FromOpenTypeWeight(_value.Value);
return null;
}
}
public bool Equals(NullableFontWeightProto other) =>
EqualityComparer.nullable_equals(_value, other._value);
public override bool Equals(object obj) =>
obj is NullableFontWeightProto ncp && Equals(ncp);
public override int GetHashCode() =>
_value.HasValue ? _value.Value : 0;
public static bool operator ==(NullableFontWeightProto a, NullableFontWeightProto b) => a.Equals(b);
public static bool operator !=(NullableFontWeightProto a, NullableFontWeightProto b) => !a.Equals(b);
}
}
@@ -0,0 +1,49 @@
#nullable enable
namespace bts.proto {
using bts.utils;
using ProtoBuf;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
[ProtoContract]
readonly struct NullableFontWeightProto : IEquatable<NullableFontWeightProto> {
[ProtoMember(1)]
readonly int? _value;
public NullableFontWeightProto(FontWeight? value) =>
_value = value?.ToOpenTypeWeight();
public NullableFontWeightProto(int value) =>
_value = value;
public static NullableFontWeightProto none =>
new(null);
public FontWeight? value =>
_value.HasValue ? FontWeight.FromOpenTypeWeight(_value.Value) : null;
[MemberNotNullWhen(true, nameof(value))]
public bool has_value => value.HasValue;
public bool Equals(NullableFontWeightProto other) =>
EqualityComparer.nullable_equals(_value, other._value);
public override bool Equals(object? obj) =>
obj is NullableFontWeightProto fw && Equals(fw);
public override int GetHashCode() =>
_value ?? 0;
public override string ToString() =>
_value?.ToString() ?? string.Empty;
public static bool operator ==(NullableFontWeightProto a, NullableFontWeightProto b) =>
a.Equals(b);
public static bool operator !=(NullableFontWeightProto a, NullableFontWeightProto b) =>
!a.Equals(b);
}
}
@@ -103,7 +103,7 @@ namespace mbts.ui.controls {
color = brush.Color;
opacity = brush.Opacity;
}
public ColorOpacityProto to_proto() => new ColorOpacityProto(color.rgb_color(), opacity);
public ColorOpacityProto to_proto() => new ColorOpacityProto(color.to_uint(), opacity);
}
class NamedColorPickerPopupVM : ColorPickerPopupVM {
@@ -104,7 +104,7 @@ namespace mbts.ui.settings {
public bool is_expanded => _is_expanded;
public FontWeight? font_weight_override => _font_weight_override.value;
public Color? font_color_override => _font_color_override.value;
public Color? background_color_override => _background_color_override.argb;
public Color? background_color_override => _background_color_override.value;
public double width => _width;
public HorizontalAlignment horizontal_alignment => _horizontal_alignment;
public double horizontal_offset => _horizontal_offset;
@@ -126,7 +126,7 @@ namespace mbts.ui.settings {
width ?? this.width,
horizontal_alignment ?? this.horizontal_alignment,
horizontal_offset ?? this.horizontal_offset,
(background_color_override ?? _background_color_override).argb);
(background_color_override ?? _background_color_override).value);
public GridColumnSettings Clone() =>
ProtobufSerializationHelper.clone(this);
@@ -23,7 +23,7 @@
public static GridSettings Default =>
new GridSettings(
selection_highlight: Colors.MediumSlateBlue.with(0x63).argb_color(),
selection_highlight: Colors.MediumSlateBlue.with(0x63).to_uint(),
background: BTSColors.Grid.default_column_background,
font_color: BTSColors.Grid.default_column_foreground);
@@ -149,7 +149,7 @@ namespace mbts.ui.settings {
var a = sl.A.within_range((byte)30, (byte)200);
if (sl.A != a) {
sl.A = a;
new_settings = settings.with(selection_highlight: sl.rgb_color());
new_settings = settings.with(selection_highlight: sl.to_uint());
return true;
}
}
@@ -137,9 +137,9 @@ namespace mbts.spark {
foreach (IGrouping<TPredicateData, CellAnimation> g in animations)
animation_map.AddOrUpdate(g.Key, p => animation_tuple(c: g), (p, t) => t.cell_animations.AddRange(g));
}
return _create_settings_obj(new GridSettings(font_family.name(), font_size, font_weight, font_color.color.rgb_color(), selection_highlight.color.rgb_color(), col_settings,
return _create_settings_obj(new GridSettings(font_family.name(), font_size, font_weight, font_color.color.to_uint(), selection_highlight.color.to_uint(), col_settings,
background: background_color.color.with(
(byte)(background_color.opacity.within_range(0, 1) * 255.0)).rgb_color()),
(byte)(background_color.opacity.within_range(0, 1) * 255.0)).to_uint()),
animation_map.Select(kv => PredicateAnimations.create_data<TRowData, TPredicateData>(kv.Key, kv.Value.cell_animations, kv.Value.row_animations, kv.Value.sounds)));
//
(List<RowAnimation> row_animations, List<SoundNotification> sounds, List<CellAnimation> cell_animations) animation_tuple(IEnumerable<RowAnimation> r = null, IEnumerable<SoundNotification> s = null, IGrouping<TPredicateData, CellAnimation> c = null) =>
@@ -120,10 +120,10 @@ namespace mbts.spark {
font_family.name(),
font_size,
font_weight,
font_color.color.rgb_color(),
selection_highlight.color.rgb_color(),
font_color.color.to_uint(),
selection_highlight.color.to_uint(),
columns.Select(c => c.create()),
background: background_color.color.argb_color());
background: background_color.color.to_uint());
public void load_from(GridSettings value) {
if (value == null)
@@ -258,13 +258,13 @@ namespace mbts.spark {
settings.title_font_params = new() {
typeface = new(title_font_family, title_font_weight.ToOpenTypeWeight()),
font_size = title_font_size,
font_color = title_font_color.argb_color(),
font_color = title_font_color.to_uint(),
};
settings.font_params = new() {
typeface = new(font_family, font_weight.ToOpenTypeWeight()),
font_size = font_size,
font_color = font_color.argb_color(),
font_color = font_color.to_uint(),
};
}
@@ -42,6 +42,7 @@
<TextBlock
x:Name="PART_Context"
FontWeight="Bold"
Foreground="{u:BTSBrush UI.default_text}"
HorizontalAlignment="Left"
Margin="4,0,0,0"
Text="{Binding context}"
@@ -5,6 +5,7 @@ namespace mbts.ui.controls {
using System;
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
static class TickUpDownHelper {
public const string
@@ -13,7 +14,7 @@ namespace mbts.ui.controls {
public static string? format<T>(
T? new_value, string curr_text, TickDisplaySettingsImmutable? settings = null)
where T : struct, IFloatingPoint<T> {
where T : struct, IFloatingPointIeee754<T> {
if (T.TryParse(curr_text, null, out var from_text)) {
if (!from_text.Equals(new_value)) {
return format(new_value, settings);
@@ -25,7 +26,7 @@ namespace mbts.ui.controls {
}
public static string format<T>(T? value, TickDisplaySettingsImmutable? settings = null)
where T : struct, IFloatingPoint<T> {
where T : struct, IFloatingPointIeee754<T> {
if (!value.HasValue) {
return string.Empty;
}
@@ -39,7 +40,7 @@ namespace mbts.ui.controls {
string? text,
[NotNullWhen(true)] out T? result,
TickDisplaySettingsImmutable? settings = null
) where T : IFloatingPoint<T> {
) where T : IFloatingPointIeee754<T> {
if (text is null) {
result = default;
return false;
@@ -11,6 +11,7 @@ namespace mbts.ui.controls {
using System;
using System.Linq;
using System.Numerics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -3,13 +3,14 @@ using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Windows.Data;
namespace mbts.ui.converters {
class DictionaryLookupConverter : IMultiValueConverter {
[ThreadStatic]
Dictionary<Type, Lookup> _type_impls_backing;
Dictionary<Type, Lookup> _type_impls => _type_impls_backing ?? (_type_impls_backing = new Dictionary<Type, Lookup>());
Dictionary<Type, Lookup> _type_impls =>
Interlocked.CompareExchange(ref _type_impls_backing, new(), null);
delegate bool Lookup(object source, object key, out object result);
@@ -22,16 +22,11 @@ namespace mbts.ui.converters {
object value, Type target_type, object parameter, CultureInfo culture) =>
throw new NotImplementedException();
public string convert(SecurityExpiration exp) {
var sb = new StringBuilder();
if (ShowType) {
sb.Append($"[{SecurityFormatter.format_security_type(exp.security_type)}] ");
}
if (ShowSymbol) {
sb.Append(exp.symbol);
}
sb.Append(DateFormatter.Format(exp.expiration, DateFormat));
return sb.ToString();
}
public string convert(SecurityExpiration exp) =>
SecurityFormatter.format_expiration(
exp.expiration,
ShowSymbol ? exp.symbol : null,
ShowType ? exp.security_type.contract_case() : null,
DateFormat);
}
}
@@ -114,10 +114,7 @@ namespace mbts.ui {
public static SolidColorBrush rgb_solid_brush(this uint color) =>
new SolidColorBrush(rgb_color(color));
public static UInt32 argb_color(this Color color) =>
(uint)color.A << 24 | (uint)color.R << 16 | (uint)color.G << 8 | (uint)color.B;
public static UInt32 rgb_color(this Color color) =>
public static uint to_uint(this Color color) =>
(uint)color.A << 24 | (uint)color.R << 16 | (uint)color.G << 8 | (uint)color.B;
public static Brush to_brush(this Color color) =>
@@ -9,6 +9,7 @@
using Spark.Core.Disposables;
using System;
using System.Numerics;
using System.Reactive.Linq;
using System.Windows.Input;
@@ -7,6 +7,7 @@ using Spark.Core.Disposables;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Reactive.Linq;
namespace mbts.ui {
@@ -11,6 +11,7 @@ namespace mbts {
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Numerics;
public static class TickExtensions {
static string _nan_text => TickDisplaySettings.Default.nan_text;
@@ -109,20 +110,20 @@ namespace mbts {
public static string format_without_decimal_part(this TickFactors tick, double value) =>
format(tick, value, double.NaN, false, _nan_text, true);
public static string format<T>(this TickFactors tick, T value) where T : IFloatingPoint<T> =>
public static string format<T>(this TickFactors tick, T value) where T : IFloatingPointIeee754<T> =>
format(tick, value, T.NaN, false, _nan_text);
public static string format<T>(this TickFactors tick, T value, bool show_commas)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
format(tick, value, T.NaN, show_commas, _nan_text);
public static string format<T>(this TickDisplaySettings settings, T value)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
format(settings.tick_factors, value, settings);
public static string format<T>(
this bts.api.domain.TickDisplaySettingsImmutable settings, T value)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
settings.to_tick_display_settings().format(value);
public static string format<T>(this TickFactors tick, T value, TickDisplaySettings settings)
@@ -149,7 +150,7 @@ namespace mbts {
bool show_commas,
string nan_text,
bool show_decimal_part = true)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
tick.format(
value,
TickDisplaySettings.Default.with(
@@ -196,7 +197,7 @@ namespace mbts {
parse(display_settings.tick_factors, text, display_settings);
public static T parse<T>(this TickDisplaySettings display_settings, string text)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
parse<T>(display_settings.tick_factors, text, display_settings);
#nullable disable
@@ -204,7 +205,7 @@ namespace mbts {
parse<double>(tick, text, display_settings);
public static T parse<T>(this TickFactors tick, string text, TickDisplaySettings display_settings)
where T : IFloatingPoint<T> {
where T : IFloatingPointIeee754<T> {
if (display_settings is null) {
return parse(tick, text, T.NaN, _nan_text);
}
@@ -213,7 +214,9 @@ namespace mbts {
return parse(tick, text, display_multiplier, nan_text);
}
public static T parse<T>(this TickFactors tick, string text, T display_multiplier, string nan_text) where T : IFloatingPoint<T> =>
public static T parse<T>(
this TickFactors tick, string text, T display_multiplier, string nan_text)
where T : IFloatingPointIeee754<T> =>
tick?.is_valid() ?? false ?
_parse(tick, text, display_multiplier, nan_text) :
_parse_no_tick(text, display_multiplier, nan_text);
@@ -223,37 +226,37 @@ namespace mbts {
string text,
T display_multiplier,
string nan_text
) where T : IFloatingPoint<T> =>
) where T : IFloatingPointIeee754<T> =>
regional_tick.is_valid() ?
_parse(regional_tick, text, display_multiplier, nan_text) :
_parse_no_tick(text, display_multiplier, nan_text);
public static T tick<T>(this TickFactors tick, T value, int count)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
count < 0 ? tick.tickdown(value, (uint)-count) : tick.tickup(value, (uint)count);
public static T tick<T>(this bts.api.domain.TickFactorsImmutable tick, T value, int count)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
tick.to_tick_factors().tick(value, count);
public static T tick<T>(
this bts.api.domain.TickDisplaySettingsImmutable settings, T value, int count)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
settings.HasTickFactors ?
settings.TickFactors.tick(value, count) :
throw new ArgumentException(
"Can't tick because 'settings.HasTickFactors' is false", nameof(settings));
public static T tickup<T>(this TickFactors tick, T input, uint count = 1)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
tickup(tick, input, count, TickUtils.precision_const<T>());
public static T tickup<T>(this TickFactors tick, T input, uint count, T precision)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
tickup<T, NumericCastOutConverter<T>>(tick, input, count, precision);
public static T tickup<T, TFromUInt32>(this TickFactors tick, T input, uint count, T precision)
where T : IFloatingPoint<T>
where T : IFloatingPointIeee754<T>
where TFromUInt32 : IConverter<uint, T> {
if (!precision.is_real_positive()) {
throw new ArgumentException("Must be a real positive number.", nameof(precision));
@@ -262,7 +265,7 @@ namespace mbts {
return input;
}
var tuf = tick.tick_unit_frac<T>();
var ieeer = T.IEEERemainder(input, tuf);
var ieeer = T.Ieee754Remainder(input, tuf);
input -= ieeer;
if (ieeer < -precision) {
count--;
@@ -271,15 +274,18 @@ namespace mbts {
return _round_tick(tuf, result);
}
public static T tickup<T>(this RegionalTickFactors regional_tick, T input) where T : IFloatingPoint<T> =>
public static T tickup<T>(
this RegionalTickFactors regional_tick, T input) where T : IFloatingPointIeee754<T> =>
regional_tick.tickup(input, 1);
public static T tickup<T>(this RegionalTickFactors regional_tick, T input, uint count) where T : IFloatingPoint<T> =>
public static T tickup<T>(
this RegionalTickFactors regional_tick, T input, uint count)
where T : IFloatingPointIeee754<T> =>
regional_tick.tickup(input, count, TickUtils.precision_const<T>());
public static T tickup<T>(
this RegionalTickFactors regional_tick, T input, uint count, T precision)
where T : IFloatingPoint<T> {
where T : IFloatingPointIeee754<T> {
if (!precision.is_real_positive()) {
throw new ArgumentException("Must be a real positive number.", nameof(precision));
}
@@ -292,7 +298,7 @@ namespace mbts {
T ltie = regional_tick.low_tick_inclusive_end.as_type<double, T>();
if (input < ltie) {
tuf = regional_tick.low_tick.tick_unit_frac<T>();
var ieeer = T.IEEERemainder(input, tuf);
var ieeer = T.Ieee754Remainder(input, tuf);
input -= ieeer;
if (ieeer < -precision) count--;
val = input + tuf * count.as_type<uint, T>();
@@ -303,7 +309,7 @@ namespace mbts {
}
} else {
tuf = regional_tick.high_tick.tick_unit_frac<T>();
var ieeer = T.IEEERemainder(input, tuf);
var ieeer = T.Ieee754Remainder(input, tuf);
input -= ieeer;
if (ieeer < -precision) count--;
val = input + tuf * count.as_type<uint, T>();
@@ -312,21 +318,21 @@ namespace mbts {
}
public static T tickdown<T>(this TickFactors tick, T input, uint count = 1)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
tickdown(tick, input, count, TickUtils.precision_const<T>());
public static T tickdown<T>(this TickFactors tick, T input, uint count, T precision)
where T : IFloatingPoint<T> =>
where T : IFloatingPointIeee754<T> =>
tickdown<T, NumericCastOutConverter<T>>(tick, input, count, precision);
public static T tickdown<T, TFromUInt32>(this TickFactors tick, T input, uint count, T precision)
where T : IFloatingPoint<T>
where T : IFloatingPointIeee754<T>
where TFromUInt32 : IConverter<uint, T> {
if (!input.is_real()) {
return input;
}
var tuf = tick.tick_unit_frac<T>();
var ieeer = T.IEEERemainder(input, tuf);
var ieeer = T.Ieee754Remainder(input, tuf);
input -= ieeer;
if (ieeer > precision) {
count--;
@@ -336,21 +342,22 @@ namespace mbts {
}
public static T tickdown<T>(this RegionalTickFactors regional_tick, T input)
where T : IFloatingPoint<T>, IComparisonOperators<T, double> =>
where T : IFloatingPointIeee754<T> =>
regional_tick.tickdown(input, 1);
public static T tickdown<T>(this RegionalTickFactors regional_tick, T input, uint count)
where T : IFloatingPoint<T>, IComparisonOperators<T, double> =>
where T : IFloatingPointIeee754<T> =>
tickdown(regional_tick, input, count, TickUtils.precision_const<T>());
public static T tickdown<T>(
this RegionalTickFactors regional_tick, T input, uint count, T precision) where T : IFloatingPoint<T> =>
this RegionalTickFactors regional_tick, T input, uint count, T precision)
where T : IFloatingPointIeee754<T> =>
tickdown<T, NumericCastOutConverter<T>, NumericCastOutConverter<T>, NumericCastInConverter<T>>(
regional_tick, input, count, precision);
public static T tickdown<T, TFromUInt32, TFromDouble, TToUInt16>(
this RegionalTickFactors regional_tick, T input, uint count, T precision)
where T : IFloatingPoint<T>
where T : IFloatingPointIeee754<T>
where TFromDouble : IConverter<double, T>
where TFromUInt32 : IConverter<uint, T>
where TToUInt16 : IConverter<T, uint> {
@@ -365,7 +372,7 @@ namespace mbts {
T low_tick_inclusive_end = TFromDouble.convert(regional_tick.low_tick_inclusive_end);
if (input > low_tick_inclusive_end) {
tuf = regional_tick.high_tick.tick_unit_frac<T>();
var ieeer = T.IEEERemainder(input, tuf);
var ieeer = T.Ieee754Remainder(input, tuf);
input -= ieeer;
if (ieeer > precision) count--;
val = input - tuf * TFromDouble.convert(count);
@@ -377,7 +384,7 @@ namespace mbts {
}
} else {
tuf = regional_tick.low_tick.tick_unit_frac<T>();
var ieeer = T.IEEERemainder(input, tuf);
var ieeer = T.Ieee754Remainder(input, tuf);
input -= ieeer;
if (ieeer > precision) count--;
val = input - tuf * TFromDouble.convert(count);
@@ -483,7 +490,7 @@ namespace mbts {
return display_digits(tick.tick_base);
}
public static int display_digits<T>(T tick_base) where T : IFloatingPoint<T> {
public static int display_digits<T>(T tick_base) where T : IFloatingPoint<T>, ILogarithmicFunctions<T> {
var log_tick_base = T.Log10(tick_base);
var floor = T.Floor(log_tick_base);
var dec = log_tick_base - floor;
@@ -500,14 +507,14 @@ namespace mbts {
}
static string _format_no_tick<T>(T value, T display_multiplier, bool show_commas)
where T : IFloatingPoint<T> {
where T : INumberBase<T> {
if (!display_multiplier.is_nan()) {
value *= display_multiplier;
}
return value.ToString(show_commas ? "#,0" : "0", null);
}
static T _parse_no_tick<T>(string text, T display_multiplier, string nan_text) where T : IFloatingPoint<T> {
static T _parse_no_tick<T>(string text, T display_multiplier, string nan_text) where T : IFloatingPointIeee754<T> {
if (text == nan_text) {
return T.NaN;
}
@@ -515,7 +522,7 @@ namespace mbts {
result.safe_divide(display_multiplier) : T.NaN;
}
static T _get_integer_part<T>(string integer_text) where T : IFloatingPoint<T> {
static T _get_integer_part<T>(string integer_text) where T : IFloatingPointIeee754<T> {
if (integer_text.is_null_or_white_space()) {
return T.Zero;
}
@@ -524,7 +531,7 @@ namespace mbts {
result : T.NaN;
}
static T _get_numerator_part<T>(string numerator_text, T tick_base) where T : IFloatingPoint<T> {
static T _get_numerator_part<T>(string numerator_text, T tick_base) where T : IFloatingPointIeee754<T> {
if (string.IsNullOrEmpty(numerator_text)) {
return T.Zero;
}
@@ -554,7 +561,7 @@ namespace mbts {
static T _parse<T>(
RegionalTickFactors regional_tick, string text, T display_multiplier, string nan_text)
where T : IFloatingPoint<T> {
where T : IFloatingPointIeee754<T> {
T result = _parse(regional_tick.low_tick, text, display_multiplier, nan_text);
T ltie = regional_tick.low_tick_inclusive_end.as_type<double, T>()
@@ -566,7 +573,7 @@ namespace mbts {
}
static T _parse<T>(TickFactors tick, string text, T display_multiplier, string nan_text)
where T : IFloatingPoint<T> {
where T : IFloatingPointIeee754<T> {
if (text.is_null_or_white_space() || text == nan_text) {
return T.NaN;
}
@@ -584,7 +591,7 @@ namespace mbts {
}
static T _parse<T>(TickFactors tick, T integer_part, string numerator_part_text)
where T : IFloatingPoint<T> {
where T : IFloatingPointIeee754<T> {
T tick_base = tick.tick_base.as_type<double, T>();
T numerator_part = _get_numerator_part(numerator_part_text, tick_base);
return integer_part + numerator_part / tick_base;
@@ -657,7 +664,7 @@ namespace mbts {
}
}
static T _round_tick<T>(T tick_unit_frac, T input) where T : IFloatingPoint<T> =>
input - T.IEEERemainder(input, tick_unit_frac);
static T _round_tick<T>(T tick_unit_frac, T input) where T : IFloatingPointIeee754<T> =>
input - T.Ieee754Remainder(input, tick_unit_frac);
}
}
@@ -9,6 +9,7 @@ using Spark.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace mbts.spark {
static class TickUtils {
@@ -33,13 +33,6 @@
public static string Format(DateTime date, DateFormat format) =>
Format(date.Year, date.Month, date.Day, format);
/// <summary>
/// Returns a concise string representation of a date (using single-letter month codes)
/// appropriate for UIs (e.g. March 22, 2019: 22 Mar 19, or 22 H19).
/// </summary>
public static string Format(uint year, uint month, uint day, DateFormat format) =>
Format((int)year, (int)month, (int)day, format);
/// <summary>
/// Returns a concise string representation of a date (using single-letter month codes)
/// appropriate for UIs (e.g. March 22, 2019: 22 Mar 19, or 22 H19).
@@ -10,6 +10,9 @@ namespace bts.api {
public partial class Security {
public static security_key key(Security s) { return s.Id; }
public static bool is_perpetual_exp(DateTime exp) =>
exp.Year < 2000 || exp.Year > 2999;
public static class Defaults {
public static ContractSpecification ContractSpecification =>
new() {
@@ -21,7 +21,7 @@
format_future(symbol, (uint)exp.Year, (uint)exp.Month, (uint)exp.Day);
public static string format_future(string symbol, uint exp_year, uint exp_month, uint exp_day) =>
$"{symbol}{DateFormatter.Format(exp_year, exp_month, exp_day, DateFormat.DayMonthAbvDiff2000)}";
$"{symbol}{format_expiration(new((int)exp_year, (int)exp_month, (int)exp_day))}";
public static string format_future(string symbol, FutureContractImmutable future) =>
format_future(symbol, future.ExpirationYear, future.ExpirationMonth, future.ExpirationDay);
@@ -108,12 +108,17 @@
string? symbol = null,
Security.ContractOneofCase? type = null,
DateFormat date_format = DateFormat.DayMonthAbvDiff2000) {
var result = DateFormatter.Format(exp_date, date_format);
var result = Security.is_perpetual_exp(exp_date) ?
"Perp" : DateFormatter.Format(exp_date, date_format);
if (symbol is not null) {
result = symbol + " " + result;
}
if (type.HasValue) {
result = format_security_type(type.Value) + " " + result;
if (result.Length == 0) {
result = format_security_type(type.Value);
} else {
result = $"[{format_security_type(type.Value)}] {result}";
}
}
return result;
}
+2 -2
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Authors>Blue Trading Systems</Authors>
<Company>Blue Trading Systems</Company>
<Description />
@@ -11,6 +11,7 @@
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<NoWarn>8981</NoWarn>
<Version>$(major).$(minor).$(patch)</Version>
<Version Condition="'$(version)'=='..'">0.0.0</Version>
</PropertyGroup>
@@ -20,7 +21,6 @@
<PackageReference Include="Google.Protobuf" Version="3.21.4" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="System.Runtime.Experimental" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
@@ -61,9 +61,6 @@ namespace System.Collections.Generic {
public static IDictionary<TKey, TValue> as_idictionary<TKey, TValue>(this Dictionary<TKey, TValue> dictionary) =>
dictionary;
public static IReadOnlyDictionary<TKey, TValue> AsReadOnly<TKey, TValue>(this IDictionary<TKey, TValue> dictionary) =>
new ReadOnlyDictionary<TKey, TValue>(dictionary);
public static void Difference<TKey, TValue>(this IDictionary<TKey, TValue> left,
IDictionary<TKey, TValue> right,
out IEnumerable<KeyValuePair<TKey, TValue>> exclusive_left,
@@ -13,6 +13,7 @@ namespace System.Collections.Generic {
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Numerics;
using System.Reactive.Linq;
using System.Runtime.Versioning;
+1 -2
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
@@ -15,7 +15,6 @@
<PackageReference Include="Google.Protobuf" Version="3.21.4" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="protobuf-net" Version="3.1.17" />
<PackageReference Include="System.Runtime.Experimental" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
namespace mbts.utils {
static class ExceptionAssert {
+7 -6
View File
@@ -5,6 +5,7 @@ namespace bts.utils {
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
public static class MathUtils {
public const double EPSILON = 1E-12;
@@ -14,7 +15,7 @@ namespace bts.utils {
public static readonly IComparer<double> epsilon_comparer = new ErrorMarginComparer<double>(EPSILON);
public static T abs_diff<T>(T x, T y)
where T : ISubtractionOperators<T, T, T>, IComparisonOperators<T, T> =>
where T : ISubtractionOperators<T, T, T>, IComparisonOperators<T, T, bool> =>
x > y ? (x - y) : (y - x);
public static IComparer<double> error_margin_comparer(double error_margin) =>
@@ -36,14 +37,14 @@ namespace bts.utils {
epsilon_equals(x, y, NormalNumericOps<T>.epsilon);
public static bool epsilon_equals<T>(T x, T y, T epsilon)
where T : ISubtractionOperators<T, T, T>, IComparisonOperators<T, T> =>
where T : ISubtractionOperators<T, T, T>, IComparisonOperators<T, T, bool> =>
abs_diff(x, y) < epsilon;
public static bool marginal_equals(double x, double y) =>
marginal_equals(x, y, EPSILON);
public static bool marginal_equals<T>(T x, T y, T margin)
where T : ISubtractionOperators<T, T, T>, IComparisonOperators<T, T> =>
where T : ISubtractionOperators<T, T, T>, IComparisonOperators<T, T, bool> =>
(x > y ? (x - y) : (y - x)) < margin;
public static bool is_nan<T>(T value) where T : INumber<T> =>
@@ -132,7 +133,7 @@ namespace bts.utils {
public static T nan_diff<T>(T a, T b) where T : IFloatingPoint<T> =>
T.IsNaN(a) ? -b : T.IsNaN(b) ? a : a - b;
public static bool is_within_range<T>(T value, T min, T max) where T : IComparisonOperators<T, T> =>
public static bool is_within_range<T>(T value, T min, T max) where T : IComparisonOperators<T, T, bool> =>
value >= min && value <= max;
public static T weighted_average<T>(T x, T x_weight, T y, T y_weight) where T : IFloatingPoint<T> {
@@ -145,7 +146,7 @@ namespace bts.utils {
return x + (y - x) * (x_weight / (x_weight + y_weight));
}
public static T within_range<T>(T value, T min, T max) where T : IComparisonOperators<T, T> {
public static T within_range<T>(T value, T min, T max) where T : IComparisonOperators<T, T, bool> {
if (value < min) {
return min;
}
@@ -156,7 +157,7 @@ namespace bts.utils {
}
public static T within_range<T>(
T value, T? min = null, T? max = null) where T : struct, IComparisonOperators<T, T> {
T value, T? min = null, T? max = null) where T : struct, IComparisonOperators<T, T, bool> {
if (min.HasValue && value < min.Value) {
return min.Value;
}
@@ -2,6 +2,7 @@ namespace Spark.Core {
using bts;
using System;
using System.Numerics;
public class NumericCastConverter :
IConverter<int, int>,
@@ -213,7 +214,7 @@ namespace Spark.Core {
IConverter<T, double>,
IConverter<T, float>,
IConverter<T, decimal>
where T : INumber<T> {
where T : INumberBase<T> {
static readonly Func<T, short> _to_int16;
static readonly Func<T, ushort> _to_uint16;
@@ -342,7 +343,9 @@ namespace Spark.Core {
static decimal IConverter<T, decimal>.convert(T value) => _to_decimal(value);
}
public class NumericCastConverter<TIn, TOut> : IConverter<TIn, TOut> where TIn : INumber<TIn> where TOut : INumber<TOut> {
public class NumericCastConverter<TIn, TOut> : IConverter<TIn, TOut>
where TIn : INumberBase<TIn>
where TOut : INumberBase<TOut> {
static readonly Func<TIn, TOut> _convert;
static NumericCastConverter() {
@@ -3,44 +3,45 @@ namespace bts.utils {
using System;
using System.Collections.Generic;
using System.Numerics;
public static class NumericExtensions {
public static TOut as_type<TOut>(this short value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this short value) where TOut : INumberBase<TOut> =>
as_type<short, TOut>(value);
public static TOut as_type<TOut>(this ushort value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this ushort value) where TOut : INumberBase<TOut> =>
as_type<ushort, TOut>(value);
public static TOut as_type<TOut>(this int value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this int value) where TOut : INumberBase<TOut> =>
as_type<int, TOut>(value);
public static TOut as_type<TOut>(this uint value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this uint value) where TOut : INumberBase<TOut> =>
as_type<uint, TOut>(value);
public static TOut as_type<TOut>(this long value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this long value) where TOut : INumberBase<TOut> =>
as_type<long, TOut>(value);
public static TOut as_type<TOut>(this ulong value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this ulong value) where TOut : INumberBase<TOut> =>
as_type<ulong, TOut>(value);
public static TOut as_type<TOut>(this float value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this float value) where TOut : INumberBase<TOut> =>
as_type<float, TOut>(value);
public static TOut as_type<TOut>(this double value) where TOut : INumber<TOut> =>
public static TOut as_type<TOut>(this double value) where TOut : INumberBase<TOut> =>
as_type<double, TOut>(value);
public static TOut as_type<TIn, TOut>(this TIn value)
where TIn : INumber<TIn>
where TOut : INumber<TOut> =>
where TIn : INumberBase<TIn>
where TOut : INumberBase<TOut> =>
NumericCastConverter<TIn, TOut>.convert(value);
public static T abs<T>(this T value) where T : INumber<T> =>
public static T abs<T>(this T value) where T : INumberBase<T> =>
T.Abs(value);
public static bool is_nan<T>(this T value) where T : IFloatingPoint<T> =>
public static bool is_nan<T>(this T value) where T : INumberBase<T> =>
T.IsNaN(value);
public static T if_nan<T>(this T d, T if_nan) where T : IFloatingPoint<T> =>
public static T if_nan<T>(this T d, T if_nan) where T : INumberBase<T> =>
d.is_nan() ? if_nan : d;
public static bool is_int<T>(this T value) where T : IFloatingPoint<T> =>
@@ -71,15 +72,15 @@ namespace bts.utils {
MathUtils.marginal_equals(x, y, margin);
public static bool is_within_range<T>(
this T value, T min, T max) where T : IComparisonOperators<T, T> =>
this T value, T min, T max) where T : IComparisonOperators<T, T, bool> =>
MathUtils.is_within_range(value, min, max);
public static T within_range<T>(
this T value, T min, T max) where T : IComparisonOperators<T, T> =>
this T value, T min, T max) where T : IComparisonOperators<T, T, bool> =>
MathUtils.within_range(value, min, max);
public static T within_range<T>(
this T value, T? min = null, T? max = null) where T : struct, IComparisonOperators<T, T> =>
this T value, T? min = null, T? max = null) where T : struct, IComparisonOperators<T, T, bool> =>
MathUtils.within_range(value, min, max);
public static bool is_real<T>(this T value) where T : IFloatingPoint<T> =>
@@ -118,7 +119,7 @@ namespace bts.utils {
/// If only <paramref name="b"/> is real, returns <paramref name="b"/>.
/// If neither term is real, returns NaN.
/// </remarks>
public static T add_real<T>(this T a, T b) where T : IFloatingPoint<T> =>
public static T add_real<T>(this T a, T b) where T : IFloatingPointIeee754<T> =>
new[] { a, b }.sum_real(true);
/// <summary>
@@ -129,7 +130,7 @@ namespace bts.utils {
/// If only <paramref name="b"/> is real, returns -<paramref name="b"/>
/// If neither term is real, returns NaN.
/// </remarks>
public static T subtract_real<T>(this T a, T b) where T : IFloatingPoint<T> =>
public static T subtract_real<T>(this T a, T b) where T : IFloatingPointIeee754<T> =>
new[] { a, -b }.sum_real(true);
/// <summary>
@@ -187,7 +188,7 @@ namespace bts.utils {
/// contains no real numbers
/// </param>
public static T sum_real<T>(this IEnumerable<T> values, bool nan_if_none = false)
where T : IFloatingPoint<T> {
where T : IFloatingPointIeee754<T> {
return nan_if_none ? nan_if_none_impl() : normal_impl();
T normal_impl() {
+7 -7
View File
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Exe</OutputType>
<GeneratePackageOnBuild Condition="$(Configuration) == 'Release' or $(Configuration) == 'Release'">true</GeneratePackageOnBuild>
<PackageOutputPath>$(OutputPath)\net6.0</PackageOutputPath>
<PackageOutputPath>$(OutputPath)\net7.0</PackageOutputPath>
<IncludeSource>true</IncludeSource>
<IncludeSymbols>true</IncludeSymbols>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
@@ -40,19 +40,19 @@
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences" Condition=" '$(SparkRoot)' != '' ">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
<BuildOutputInPackage Include="$(OutputPath)..\net6.0\libspark.dll" />
<BuildOutputInPackage Include="$(OutputPath)..\net7.0\libspark.dll" />
</ItemGroup>
</Target>
<!-- deployed sdk build net6.0 -->
<ItemGroup Condition=" '$(SparkRoot)' == '' and '$(TargetFramework)' == 'net6.0'">
<!-- deployed sdk build net7.0 -->
<ItemGroup Condition=" '$(SparkRoot)' == '' and '$(TargetFramework)' == 'net7.0'">
<Reference Include="spark_api">
<HintPath>..\..\lib\net6.0\spark_api.dll</HintPath>
<HintPath>..\..\lib\net7.0\spark_api.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="copy_lib_deployed" AfterTargets="PostBuildEvent" Condition=" '$(SparkRoot)' == '' ">
<Copy SourceFiles="..\..\lib\net6.0\libspark.dll" DestinationFolder="$(OutputPath)\" SkipUnchangedFiles="true" />
<Copy SourceFiles="..\..\lib\net7.0\libspark.dll" DestinationFolder="$(OutputPath)\" SkipUnchangedFiles="true" />
</Target>
</Project>
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<RuntimeIdentifiers>win10-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<Authors>Blue Trading Systems</Authors>
<Company>Blue Trading Systems</Company>
+1 -1
View File
@@ -161,7 +161,7 @@ def to_type_model(field, msg):
elif field.type == types.TYPE_DOUBLE: return TypeModel("double", islist, "double?", jstype='number')
elif field.type == types.TYPE_FLOAT: return TypeModel("float", islist, "float?", jstype='number', fstype='float32')
elif field.type == types.TYPE_STRING: return TypeModel("string", islist, cpptype="std::string")
elif field.type == types.TYPE_BYTES: return TypeModel("ByteString", islist, cpptype="std::string", jstype='Uint8Array', fstype='Fable.Import.JS.Uint8Array')
elif field.type == types.TYPE_BYTES: return TypeModel("ByteString", islist, cpptype="std::string", jstype='Uint8Array', fstype='Fable.Core.JS.Uint8Array')
elif field.type == types.TYPE_BOOL: return TypeModel("bool", islist, "bool?", jstype='boolean', natural_key=True)
elif field.type == types.TYPE_ENUM:
nested_enums = [x.name for x in msg.enum_type]
+2409 -1369
View File
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -1,23 +1,23 @@
{
"dependencies": {
"protobufjs": "^6.11.3",
"tslib": "^2.4.0",
"protobufjs": "^7.2.2",
"tslib": "^2.5.0",
"watch": "^1.0.2"
},
"devDependencies": {
"jest": "^28.1.1",
"ts-jest": "^28.0.4",
"jest": "^29.4.3",
"protobufjs-cli": "^1.1.1",
"ts-jest": "^29.0.5",
"ts2fable": "^0.7.1",
"tsutils": "^3.21.0",
"typescript": "^4.7.3",
"ws": "^8.7.0"
"typescript": "^4.9.5",
"ws": "^8.12.1"
},
"scripts": {
"build": "tsc -p tsconfig.release.json",
"watch": "tsc -w -p tsconfig.release.json",
"protogen": "pbjs -t json-module -w commonjs -o %build%/proto.js ../../lib/api/*.proto ../../lib/api/services/*.proto ../../lib/domain_model/*.proto ../../lib/sparkproto/*.proto ../../lib/md/protos/*.proto",
"test": "jest",
"test:watch": "jest --watch",
"fable": "ts2fable %build%/ServiceContext.d.ts %build%/ServiceContext.fs && ts2fable %build%/HelloService.d.ts %build%/HelloService.fs"
"test:watch": "jest --watch"
}
}
+2833 -3529
View File
File diff suppressed because it is too large. Load diff
+18 -21
View File
@@ -8,37 +8,34 @@
"author": "",
"license": "ISC",
"dependencies": {
"@babel/plugin-transform-runtime": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"@babel/runtime": "^7.18.3",
"babel-loader": "^8.2.5",
"fable-loader": "^2.1.9",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/runtime": "^7.21.0",
"babel-loader": "^9.1.2",
"fable-utils": "^1.2.0",
"node-sass": "^7.0.1",
"protobufjs": "^6.11.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"node-sass": "^8.0.0",
"protobufjs": "^7.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remotedev": "^0.2.9",
"ts2fable": "^0.7.1",
"webpack": "^5.73.0"
"webpack": "^5.75.0"
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/core": "^7.21.0",
"@fortawesome/fontawesome-free": "^5.15.4",
"bulma": "^0.9.4",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.22.8",
"css-loader": "^6.7.1",
"fable-compiler": "^2.13.0",
"file-loader": "^6.2.0",
"core-js": "^3.28.0",
"css-loader": "^6.7.3",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.6.0",
"mini-css-extract-plugin": "^2.7.2",
"npx": "^10.2.2",
"sass": "^1.52.3",
"sass-loader": "^13.0.0",
"sass": "^1.58.3",
"sass-loader": "^13.2.0",
"style-loader": "^3.3.1",
"tslib": "^2.4.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
"tslib": "^2.5.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
}
+2 -2
View File
@@ -170,8 +170,8 @@ let marginSub model dispatch =
let selectSub (tab:Tab option) model =
match tab, model.tab with
| Some PositionManagementTab, _ | None, PositionManagementTab -> Cmd.ofSub (positionSub model)
| Some MarginTab, _ | None, MarginTab -> Cmd.ofMsg GetMarginData //Cmd.ofSub (marginSub model)
| Some PositionManagementTab, _ | None, PositionManagementTab -> Cmd.ofEffect (positionSub model)
| Some MarginTab, _ | None, MarginTab -> Cmd.ofMsg GetMarginData //Cmd.ofEffect (marginSub model)
| _ ->
match model.unsub with
| Some (unsub) -> unsub.Dispose()
+3 -3
View File
@@ -1225,7 +1225,7 @@ let accountSelectionGrid (accountList:BTSAccount list) (currentAccount:BTSAccoun
onClick = None
}
]
div[] [
div [] [
TableControl.createSelectorTable (Some headerRow) rws
]
@@ -1265,7 +1265,7 @@ let menuItem account selectedAccount model dispatch =
]
]
]
else span[][])
else span [] [])
]
let NavRoot (accounts:BTSAccount[]) selectedAccount model dispatch =
@@ -1312,7 +1312,7 @@ let root (model:Model) dispatch =
| "" -> span [] []
| _ -> Modal.showConfirm (fst model.ConfirmModal) (fun () -> (snd model.ConfirmModal) |> dispatch) (fun _ -> OpenConfirmModal ("", Msg.SelectTab model.tab ) |> dispatch)
match model.adminData with
| None -> div[][str "Loading account list..."]
| None -> div [] [str "Loading account list..."]
| Some data ->
div
[ Class "columns is-fullheight"
-4
View File
@@ -7,10 +7,6 @@ open Types
open App.State
open App.Types
open Global
open Fable.Core.JsInterop
open Types
open App.State
open Global
importAll "../sass/main.scss"
+2 -2
View File
@@ -146,8 +146,8 @@ let buttonColumn action header icon misc =
rowIdx = 0;
misc = misc;
}
[ Fable.React.Props.HTMLAttr.Name header
Fable.React.Props.HTMLAttr.Style [ Fable.React.Props.CSSProp.Width 60 ]
[ HTMLAttr.Name header
Style [ Fable.React.Props.CSSProp.Width 60 ]
]
// [ Name header
-1
View File
@@ -6,7 +6,6 @@ open System
open System.Runtime.InteropServices
open Fable.Core
open Fable.Core.JsInterop
open System.Xml
open bts.api.admin
open Global
+5 -5
View File
@@ -119,7 +119,7 @@ let generalTabView (model:Model) (dispatch:Msg->Unit) (readonly: bool)=
Fields.text "Company" model.scratchUser.company [Disabled readonly] (Company >> UpdateField >> dispatch)
Fields.checkbox "Can Login?" "Unchecking this stops the user from logging into Spark" model.scratchUser.isActive [Disabled can_login_disabled] (IsActive >> UpdateField >> dispatch)
Fields.checkbox "Can Create?" "Checking this allows the user to create other users and accounts" model.scratchUser.canCreate [Disabled (readonly || not can_create)] (CanCreate >> UpdateField >> dispatch)
(if (State.isNewUser model.scratchUser) then modal else span[][])
(if (State.isNewUser model.scratchUser) then modal else span [] [])
]
let accountNameLookup (accountsList:BTSAccount list) (id:string) =
@@ -334,7 +334,7 @@ let tabContent (model:Model) (dispatch:Msg->Unit) display_md display_risk =
| Tab.MarketData, true -> MarketDataTabView model dispatch (not display_md)
| Tab.OrderRouting, true -> orderRoutingTabView model dispatch (not display_risk) )
(if (State.userIsSelected model.scratchUser State.defaultScratchUser) then userControls model dispatch else span[][])
(if (State.userIsSelected model.scratchUser State.defaultScratchUser) then userControls model dispatch else span [] [])
]
let usersMenu (usersList:BTSUser list) (currentUser:BTSUser) (dispatch:Msg->Unit) =
@@ -395,7 +395,7 @@ let userSelectionGrid (usersList:BTSUser list) (currentUser:BTSUser) (dispatch:M
onClick = None
}
]
div[][
div [] [
TableControl.createSelectorTable (Some headerRow) rws
]
@@ -444,7 +444,7 @@ let menuItem (user:BTSUser) (selectedUser:BTSUser) model dispatch =
]
]
else
span[][])
span [] [])
]
let NavRoot (usersList:BTSUser list) (currentUser:BTSUser) model (dispatch:Msg->Unit) =
@@ -496,7 +496,7 @@ let root (model:Model) (dispatch:Msg->Unit) =
| "" -> span [] []
| _ -> Modal.showConfirm (fst model.ConfirmModal) (fun () -> (snd model.ConfirmModal) |> dispatch) (fun _ -> OpenConfirmModal ("", Msg.SwitchTab model.currentTab ) |> dispatch)
(match model.adminData with
| None -> div[][str "Loading user list..."]
| None -> div [] [str "Loading user list..."]
| Some data ->
div
[ Class "columns is-fullheight"
@@ -0,0 +1,486 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"ui/1.0.0": {
"dependencies": {
"Elmish": "4.0.1",
"Elmish.Navigation": "1.0.0",
"Fable.Core": "4.0.0-theta-007",
"Fable.Elmish": "4.0.1",
"Fable.Elmish.Browser": "4.0.1",
"Fable.Elmish.Debugger": "4.0.0",
"Fable.Elmish.HMR": "7.0.0",
"Fable.Elmish.React": "4.0.0",
"Fable.Elmish.UrlParser": "1.0.1",
"Fable.Promise": "3.2.0",
"Fable.React": "9.2.0",
"System.Runtime": "4.3.1"
},
"runtime": {
"ui.dll": {}
}
},
"Elmish/4.0.1": {
"runtime": {
"lib/netstandard2.0/Elmish.dll": {
"assemblyVersion": "4.0.1.0",
"fileVersion": "4.0.1.0"
}
}
},
"Elmish.Navigation/1.0.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Elmish": "4.0.1"
},
"runtime": {
"lib/net5.0/Elmish.Navigation.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"Fable.Browser.Blob/1.2.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Browser.Blob.dll": {
"assemblyVersion": "1.2.0.0",
"fileVersion": "1.2.0.0"
}
}
},
"Fable.Browser.Dom/2.10.1": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Browser.Blob": "1.2.0",
"Fable.Browser.Event": "1.5.0",
"Fable.Browser.WebStorage": "1.1.0",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Browser.Dom.dll": {
"assemblyVersion": "2.10.1.0",
"fileVersion": "2.10.1.0"
}
}
},
"Fable.Browser.Event/1.5.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Browser.Gamepad": "1.1.0",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Browser.Event.dll": {
"assemblyVersion": "1.5.0.0",
"fileVersion": "1.5.0.0"
}
}
},
"Fable.Browser.Gamepad/1.1.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Browser.Gamepad.dll": {
"assemblyVersion": "1.1.0.0",
"fileVersion": "1.1.0.0"
}
}
},
"Fable.Browser.WebStorage/1.1.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Browser.Event": "1.5.0",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Browser.WebStorage.dll": {
"assemblyVersion": "1.1.0.0",
"fileVersion": "1.1.0.0"
}
}
},
"Fable.Core/4.0.0-theta-007": {
"runtime": {
"lib/netstandard2.0/Fable.Core.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"Fable.Elmish/4.0.1": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Fable.Elmish.dll": {
"assemblyVersion": "4.0.1.0",
"fileVersion": "4.0.1.0"
}
}
},
"Fable.Elmish.Browser/4.0.1": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Browser.Dom": "2.10.1",
"Fable.Elmish": "4.0.1",
"Fable.Elmish.UrlParser": "1.0.1"
},
"runtime": {
"lib/netstandard2.0/Fable.Elmish.Browser.dll": {
"assemblyVersion": "4.0.1.0",
"fileVersion": "4.0.1.0"
}
}
},
"Fable.Elmish.Debugger/4.0.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Elmish": "4.0.1",
"Thoth.Json": "6.0.0"
},
"runtime": {
"lib/netstandard2.0/Fable.Elmish.Debugger.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"Fable.Elmish.HMR/7.0.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Core": "4.0.0-theta-007",
"Fable.Elmish.React": "4.0.0"
},
"runtime": {
"lib/netstandard2.0/Fable.Elmish.HMR.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.0.0"
}
}
},
"Fable.Elmish.React/4.0.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Elmish": "4.0.1",
"Fable.ReactDom.Types": "18.2.0"
},
"runtime": {
"lib/netstandard2.0/Fable.Elmish.React.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"Fable.Elmish.UrlParser/1.0.1": {
"dependencies": {
"FSharp.Core": "6.0.7"
},
"runtime": {
"lib/netstandard2.0/Fable.Elmish.UrlParser.dll": {
"assemblyVersion": "1.0.1.0",
"fileVersion": "1.0.1.0"
}
}
},
"Fable.Promise/3.2.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Fable.Promise.dll": {
"assemblyVersion": "3.2.0.0",
"fileVersion": "3.2.0.0"
}
}
},
"Fable.React/9.2.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.React.Types": "18.3.0",
"Fable.ReactDom.Types": "18.2.0"
},
"runtime": {
"lib/netstandard2.0/Fable.React.dll": {
"assemblyVersion": "9.2.0.0",
"fileVersion": "9.2.0.0"
}
}
},
"Fable.React.Types/18.3.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Browser.Dom": "2.10.1",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Fable.React.Types.dll": {
"assemblyVersion": "18.3.0.0",
"fileVersion": "18.3.0.0"
}
}
},
"Fable.ReactDom.Types/18.2.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.React.Types": "18.3.0"
},
"runtime": {
"lib/netstandard2.0/Fable.ReactDom.Types.dll": {
"assemblyVersion": "18.2.0.0",
"fileVersion": "18.2.0.0"
}
}
},
"FSharp.Core/6.0.7": {
"runtime": {
"lib/netstandard2.1/FSharp.Core.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.722.51308"
}
},
"resources": {
"lib/netstandard2.1/cs/FSharp.Core.resources.dll": {
"locale": "cs"
},
"lib/netstandard2.1/de/FSharp.Core.resources.dll": {
"locale": "de"
},
"lib/netstandard2.1/es/FSharp.Core.resources.dll": {
"locale": "es"
},
"lib/netstandard2.1/fr/FSharp.Core.resources.dll": {
"locale": "fr"
},
"lib/netstandard2.1/it/FSharp.Core.resources.dll": {
"locale": "it"
},
"lib/netstandard2.1/ja/FSharp.Core.resources.dll": {
"locale": "ja"
},
"lib/netstandard2.1/ko/FSharp.Core.resources.dll": {
"locale": "ko"
},
"lib/netstandard2.1/pl/FSharp.Core.resources.dll": {
"locale": "pl"
},
"lib/netstandard2.1/pt-BR/FSharp.Core.resources.dll": {
"locale": "pt-BR"
},
"lib/netstandard2.1/ru/FSharp.Core.resources.dll": {
"locale": "ru"
},
"lib/netstandard2.1/tr/FSharp.Core.resources.dll": {
"locale": "tr"
},
"lib/netstandard2.1/zh-Hans/FSharp.Core.resources.dll": {
"locale": "zh-Hans"
},
"lib/netstandard2.1/zh-Hant/FSharp.Core.resources.dll": {
"locale": "zh-Hant"
}
}
},
"Microsoft.NETCore.Platforms/1.1.1": {},
"Microsoft.NETCore.Targets/1.1.3": {},
"System.Runtime/4.3.1": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.1",
"Microsoft.NETCore.Targets": "1.1.3"
}
},
"Thoth.Json/6.0.0": {
"dependencies": {
"FSharp.Core": "6.0.7",
"Fable.Core": "4.0.0-theta-007"
},
"runtime": {
"lib/netstandard2.0/Thoth.Json.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.0.0"
}
}
}
}
},
"libraries": {
"ui/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Elmish/4.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-6AI++9Ula33yMUG9F83iVrZClurQn5cgriwK7aX9FvlhJFXgRB6IYybD+wx26NNhdPOKQIvfBYZYWwRWWWqJmA==",
"path": "elmish/4.0.1",
"hashPath": "elmish.4.0.1.nupkg.sha512"
},
"Elmish.Navigation/1.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-0+CYaZzb988Oi02KeXPTUf0HTi1NXgFXTZ5/OROU22GKAohZe519QK3Be+jkbT0hvQq5EEiJJjPfp3FAgpqDaA==",
"path": "elmish.navigation/1.0.0",
"hashPath": "elmish.navigation.1.0.0.nupkg.sha512"
},
"Fable.Browser.Blob/1.2.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-bM4zbtIeycTFFCH7o4WuN28W70dTxNTMZiMvR70XUTYrBnbz7GpS5XxzUy5caDB4l7s2l7wiuVDhh52t7NXxDg==",
"path": "fable.browser.blob/1.2.0",
"hashPath": "fable.browser.blob.1.2.0.nupkg.sha512"
},
"Fable.Browser.Dom/2.10.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-G1Ul9D3suwBPUxEw0hwclZzDxDk/hLkwAZytgAoxHmv4uGth9Zpi9Fz4gm6C8v6W87qvhcM8lrCpg1awPeATyg==",
"path": "fable.browser.dom/2.10.1",
"hashPath": "fable.browser.dom.2.10.1.nupkg.sha512"
},
"Fable.Browser.Event/1.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Bx2AOOASIG1Eq1Pe8869H8baMePte6STmKGccGuOYMT2p6nWVS8G6ZBZb5encQ0tAL2/0vhA4KJOl4bYwUaQqg==",
"path": "fable.browser.event/1.5.0",
"hashPath": "fable.browser.event.1.5.0.nupkg.sha512"
},
"Fable.Browser.Gamepad/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-8m/Ae/mrH2Hb2ue435rTPEeVb2FhfWsRJJLpCxMvk+5EUOO2+IIjIkLq4thUfRL98uQVt9V5cQd14h2aBf2XJA==",
"path": "fable.browser.gamepad/1.1.0",
"hashPath": "fable.browser.gamepad.1.1.0.nupkg.sha512"
},
"Fable.Browser.WebStorage/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-tGktTk6QHIOeX7JtG5ISem1p9Rc1iYkgcbpIEzHS2YuvpOa9YomUKABU0Lraz4GMjAGxhhNvAXLRry2w89HdVQ==",
"path": "fable.browser.webstorage/1.1.0",
"hashPath": "fable.browser.webstorage.1.1.0.nupkg.sha512"
},
"Fable.Core/4.0.0-theta-007": {
"type": "package",
"serviceable": true,
"sha512": "sha512-9nDQRQfhz6/NjoXLBMqixCjRYvx8jgHAuGjJow4W0vHoFWNauPhTex+psQsw9FRRuQF2AhIwuhHoh9Tb8JoCfw==",
"path": "fable.core/4.0.0-theta-007",
"hashPath": "fable.core.4.0.0-theta-007.nupkg.sha512"
},
"Fable.Elmish/4.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-BtsXTur95XkWmZaXwIoqfUk8puWpiwgJK8YMTg62C/FYxMl8Z6WM4yuGAjQ6rVpKWw5Ha47VfmOL6k/znK3msw==",
"path": "fable.elmish/4.0.1",
"hashPath": "fable.elmish.4.0.1.nupkg.sha512"
},
"Fable.Elmish.Browser/4.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XqTMh3TzkyuWmKXOoNAHRDjxcnCAiDkUMIZZX6tkxoHPhtruxnOG5zniOm7K/RZD+NGbreKi82pPswcvmjw6/w==",
"path": "fable.elmish.browser/4.0.1",
"hashPath": "fable.elmish.browser.4.0.1.nupkg.sha512"
},
"Fable.Elmish.Debugger/4.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-a1gABGh8L6kkzGDeVJP6VJtcimfSi/l3Xaa1lzuMlnzb3oXgtfmzXfx1DV/dtDVujIujueCOsA+JmiBh/2HB7A==",
"path": "fable.elmish.debugger/4.0.0",
"hashPath": "fable.elmish.debugger.4.0.0.nupkg.sha512"
},
"Fable.Elmish.HMR/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4A3u0H3wdmF00UBFJGJK6jlRxzEgkYOegDj2bgVzYTD1L17+0mCy9+QqAYJMuOGtA2klrKAHcU43tYdm0o2Fnw==",
"path": "fable.elmish.hmr/7.0.0",
"hashPath": "fable.elmish.hmr.7.0.0.nupkg.sha512"
},
"Fable.Elmish.React/4.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-cMuWet7DhxgN2G1caYLwjLvoMkH1u75U36cUyL07yxNt/dmGp8GD/+RTtL9wpkfeThfeJHHouCkR708mJcMRpA==",
"path": "fable.elmish.react/4.0.0",
"hashPath": "fable.elmish.react.4.0.0.nupkg.sha512"
},
"Fable.Elmish.UrlParser/1.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Jpw1TPR3YsEeLHF0HMoeHKMYzTgjH+gslq8kNa3/d68GIK09eDpASNzA1gu9YLJkRYy5iUXvvvYtHUOKh+mzEw==",
"path": "fable.elmish.urlparser/1.0.1",
"hashPath": "fable.elmish.urlparser.1.0.1.nupkg.sha512"
},
"Fable.Promise/3.2.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4A+Iiembrny2h3AE2BIbchfuLmWHNhpkOTvbTtFXHtGzHVMqEVFRXrAfdy83wX2wK5Og3fqRo1y8t/Bqkd7j6g==",
"path": "fable.promise/3.2.0",
"hashPath": "fable.promise.3.2.0.nupkg.sha512"
},
"Fable.React/9.2.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-ZMRkZpBy+6ytUHPk0WjRh15kigncmSGLOAbtf12VaSy48mtgqIW4lC/23X/FEvz8tUGwHvBUen2GzUU1G/L+RQ==",
"path": "fable.react/9.2.0",
"hashPath": "fable.react.9.2.0.nupkg.sha512"
},
"Fable.React.Types/18.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/b8WZ3Bdfhqy9r60ZK9JGZaGNjIMb0ogsrvWIg3k7KfCEvJs5X6+7hCybVkyjVoxwzn9wLyYGRbh5wmuHQT/Vg==",
"path": "fable.react.types/18.3.0",
"hashPath": "fable.react.types.18.3.0.nupkg.sha512"
},
"Fable.ReactDom.Types/18.2.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-2WoBjsLiSgrvR68OJXko0iVaqeMbkPM5Bx813A1WlxOSCJ50M9fwnlwG/MUEZtiOIhQmku/YTJY5a8E8r1+j2Q==",
"path": "fable.reactdom.types/18.2.0",
"hashPath": "fable.reactdom.types.18.2.0.nupkg.sha512"
},
"FSharp.Core/6.0.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-e6wGrq5smV3Yk2fBE/Y0nBG5oFyF59k5Je0a0QDydUpg6liyaafGjD3xvutciKepCP2knspZ/sWViC/F1OyyQQ==",
"path": "fsharp.core/6.0.7",
"hashPath": "fsharp.core.6.0.7.nupkg.sha512"
},
"Microsoft.NETCore.Platforms/1.1.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==",
"path": "microsoft.netcore.platforms/1.1.1",
"hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512"
},
"Microsoft.NETCore.Targets/1.1.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==",
"path": "microsoft.netcore.targets/1.1.3",
"hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512"
},
"System.Runtime/4.3.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-abhfv1dTK6NXOmu4bgHIONxHyEqFjW8HwXPmpY9gmll+ix9UNo4XDcmzJn6oLooftxNssVHdJC1pGT9jkSynQg==",
"path": "system.runtime/4.3.1",
"hashPath": "system.runtime.4.3.1.nupkg.sha512"
},
"Thoth.Json/6.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-fJ9nhZezOyRIsaluEIj5ytCSCbnsvA7ZCa1kY7KkWPqyHtc+SDvjthz5edoFxOAHH44iSmxl6zakapjMSRJbbw==",
"path": "thoth.json/6.0.0",
"hashPath": "thoth.json.6.0.0.nupkg.sha512"
}
}
}
+16 -10
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Version>1.0.0</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
</PropertyGroup>
@@ -17,6 +17,10 @@
</Otherwise>
</Choose>
<ItemGroup>
<!-- Global to the app -->
<Compile Include="Lens.fs" />
<Compile Include="Cmd.fs" />
<Compile Include="$(API)/ServiceContext.fs" />
<Compile Include="$(API)/DynamicService.fs" />
<Compile Include="Imports.fs" />
@@ -37,9 +41,7 @@
<Compile Include="$(API)/fable/co2.fable.fs" />
<Compile Include="$(API)/fable/MarketDataRelay.fable.fs" />
<!-- Global to the app -->
<Compile Include="Lens.fs" />
<Compile Include="Global.fs" />
<Compile Include="Cmd.fs" />
<Compile Include="Controls/nbsp.fs" />
<Compile Include="Controls/Button.fs" />
<Compile Include="Controls/ReactGrid.fs" />
@@ -68,13 +70,17 @@
<Compile Include="App.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Elmish" Version="4.0.1" />
<PackageReference Include="Elmish.Navigation" Version="1.0.0" />
<PackageReference Include="Fable.Core" Version="4.0.0-snake-island-alpha-005" />
<PackageReference Include="Fable.Elmish" Version="4.0.0-beta-3" />
<PackageReference Include="Fable.Elmish.React" Version="4.0.0-beta-2" />
<PackageReference Include="Fable.Elmish.UrlParser" Version="1.0.0-beta-1" />
<PackageReference Include="Fable.Elmish.Debugger" Version="4.0.0-beta-1" />
<PackageReference Include="Fable.Elmish.HMR" Version="6.0.0-beta-002" />
<PackageReference Include="Fable.Fetch" Version="2.4.0" />
<PackageReference Include="Fable.Core" Version="4.0.0-theta-007" />
<PackageReference Include="Fable.Elmish" Version="4.0.1" />
<PackageReference Include="Fable.Elmish.Browser" Version="4.0.1" />
<PackageReference Include="Fable.Elmish.React" Version="4.0.0" />
<PackageReference Include="Fable.Elmish.UrlParser" Version="1.0.1" />
<PackageReference Include="Fable.Elmish.Debugger" Version="4.0.0" />
<PackageReference Include="Fable.Elmish.HMR" Version="7.0.0" />
<PackageReference Include="Fable.Promise" Version="3.2.0" />
<PackageReference Include="Fable.React" Version="9.2.0" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
</Project>
+1 -11
View File
@@ -33,7 +33,7 @@ module.exports = env => {
ignored: "./**/*"
},
devtool: isProduction ? undefined : "source-map",
entry: resolve('src/ui.fsproj'),
entry: resolve(`${output_path}/App.js`),
output: {
filename: 'bundle.js',
path: output_path,
@@ -58,16 +58,6 @@ module.exports = env => {
},
module: {
rules: [
{
test: /\.fs(x|proj)?$/,
use: {
loader: "fable-loader",
options: {
babel: babelOptions,
define: isProduction ? [] : ["DEBUG"]
}
}
},
{
test: /\.js$/,
exclude: /node_modules/,
-16
View File
@@ -1,16 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "ui", "web/ui/src/ui.fsproj", "{E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
+8 -8
View File
@@ -2,44 +2,44 @@
<PropertyGroup>
<BuildRoot>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)))</BuildRoot>
<Net60OutputPath>$(BuildRoot)\$(Configuration)\bin\net6.0\</Net60OutputPath>
<Net60WinOutputPath>$(BuildRoot)\$(Configuration)\bin\net6.0-windows\</Net60WinOutputPath>
<Net70OutputPath>$(BuildRoot)\$(Configuration)\bin\net7.0\</Net70OutputPath>
<Net70WinOutputPath>$(BuildRoot)\$(Configuration)\bin\net7.0-windows\</Net70WinOutputPath>
<ErrorReport>None</ErrorReport>
</PropertyGroup>
<Target
Name="CopyToNet60"
Name="CopyToNet70"
AfterTargets="Link">
<Copy
SourceFiles="$(OutDir)libspark.dll"
Condition="Exists('$(OutDir)libspark.dll')"
DestinationFolder="$(Net60OutputPath)"
DestinationFolder="$(Net70OutputPath)"
Retries="512"
RetryDelayMilliseconds="250"
SkipUnchangedFiles="true" />
<Copy
SourceFiles="$(OutDir)libspark.pdb"
Condition="Exists('$(OutDir)libspark.pdb')"
DestinationFolder="$(Net60OutputPath)"
DestinationFolder="$(Net70OutputPath)"
Retries="512"
RetryDelayMilliseconds="250"
SkipUnchangedFiles="true" />
</Target>
<Target
Name="CopyToNet60Win"
Name="CopyToNet70Win"
AfterTargets="Link">
<Copy
SourceFiles="$(OutDir)libspark.dll"
Condition="Exists('$(OutDir)libspark.dll')"
DestinationFolder="$(Net60WinOutputPath)"
DestinationFolder="$(Net70WinOutputPath)"
Retries="512"
RetryDelayMilliseconds="250"
SkipUnchangedFiles="true" />
<Copy
SourceFiles="$(OutDir)libspark.pdb"
Condition="Exists('$(OutDir)libspark.pdb')"
DestinationFolder="$(Net60WinOutputPath)"
DestinationFolder="$(Net70WinOutputPath)"
Retries="512"
RetryDelayMilliseconds="250"
SkipUnchangedFiles="true" />
+6 -3
View File
@@ -307,10 +307,13 @@ def build(
bins = SparkPaths.client_bins(build_dir, configuration=configuration)
for t in publish_tgts:
build_cmd_steps.append(f'cd {Path(t.path).parent}')
build_cmd_steps.append('dotnet publish -c Release -r win-x64 --sc')
build_cmd_steps.append(f'cmake --build {build_dir} --config {configuration}')
build_cmd_steps.append(f'dotnet publish -c Release -r win-x64 --sc {t.path}')
libspark_path=build_dir.joinpath("src", "lib", configuration, "libspark.dll")
print(f'libspark-src: {libspark_path}')
print(f'libspark-dst: {bins.joinpath("win-x64", "publish")}')
build_cmd_steps.append(
f'copy {bins.joinpath("libspark.dll")} {bins.joinpath("publish")}')
f'copy {libspark_path} {bins.joinpath("win-x64", "publish")}')
build_cmd = ' && '.join(build_cmd_steps)
proc_results.append(subprocess.run(build_cmd))
+8
View File
@@ -154,6 +154,14 @@ def _fable_webpack(src_path, ui_out_path):
copytree(str(src_path.joinpath('ui', 'public')), str(ui_out_path))
os.chdir(src_path.joinpath('ui', 'src'))
_wrapped_run('dotnet restore')
_wrapped_run('dotnet tool restore')
# Note: We used to convert fs -> js via webpack, using the node pkgs
# fable-compiler & fable-loader. However, as of 02/24/2023, they are
# incompatible w/ net7.0. Fortunately the dotnet tool 'fable' IS
# compatible w/ net7.0.
_wrapped_run(f'dotnet fable -o {ui_out_path}')
# Run webpack via 'npm run build'
# (the build cmd is defined in package.json)
_wrapped_run('npm run build')
+1 -1
View File
@@ -42,7 +42,7 @@ class SparkPaths:
@staticmethod
def client_bins(build_root=_default_build(), configuration='Release'):
return build_root.joinpath(configuration, 'bin', 'net6.0-windows', 'win-x64')
return build_root.joinpath(configuration, 'bin', 'net7.0-windows')
@staticmethod
def client_sln():
+1 -1
View File
@@ -38,7 +38,7 @@ def _main():
output_dir = args.output_dir or SparkPaths.default_build()
output_dir = Path(output_dir)
build(
configuration='release',
configuration='Release',
restore=True,
build_dir=output_dir,
targets=['publish'],