1056 lines
45 KiB
C#
1056 lines
45 KiB
C#
using bts.api.orderman;
|
|
using bts.collections;
|
|
using bts.persist.algo;
|
|
using bts.proto;
|
|
using bts.utils;
|
|
|
|
using mbts.ui;
|
|
using mbts.ui.settings;
|
|
using mbts.ui.spark;
|
|
using mbts.ui.utility.text;
|
|
|
|
using ProtoBuf;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Immutable;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows.Media;
|
|
|
|
namespace mbts.spark {
|
|
// IMPORTANT: BE SURE TO ADD ANY NEW PROPERTIES TO THE EQUALS FUNCTION!
|
|
// 1 important reason at this time:
|
|
// From the settings dialog, default settings will only be persisted when they are NOT EQUAL to the current default settings.
|
|
// Settings are liable to change in the near future, so an internal IEqualityComparer simply won't do as it risks becoming out of date.
|
|
//
|
|
// NOTE: "column width" is enigmatic to this new settings structure
|
|
// since they are adjusted in the actual Ladder window, and not the settings editor.
|
|
// A group of Ladders that are all using the default settings may each have different column widths.
|
|
// TODO: somehow allow windows that are using the default settings to still have individual column widths.
|
|
[ProtoContract]
|
|
class LadderColumnSettings : IEquatable<LadderColumnSettings> {
|
|
// this class is 100% mutable (there are literally 0 readonly members),
|
|
// so GetHashCode must return the same hash for every instance.
|
|
static readonly int _type_hash = typeof(LadderColumnSettings).GetHashCode();
|
|
|
|
public static LadderColumnSettings Default => new LadderColumnSettings {
|
|
show = true,
|
|
width = 50,
|
|
font_family = "Segoe UI",
|
|
font_size = 10,
|
|
font_weight = FontWeights.SemiBold.ToOpenTypeWeight(),
|
|
background = BTSColors.Ladder.default_column_background,
|
|
};
|
|
|
|
public static LadderColumnSettings default_bid =>
|
|
Default.with(
|
|
foreground: BTSColors.Ladder.bid_column_foreground,
|
|
background: BTSColors.Ladder.bid_column_background);
|
|
|
|
public static LadderColumnSettings default_orders =>
|
|
Default.with(
|
|
width: 70,
|
|
foreground: BTSColors.Ladder.orders_column_foreground,
|
|
background: BTSColors.Ladder.orders_column_background);
|
|
|
|
public static LadderColumnSettings default_last =>
|
|
Default.with(
|
|
foreground: BTSColors.Ladder.last_column_foreground,
|
|
background: BTSColors.Ladder.last_column_background);
|
|
|
|
public static LadderColumnSettings default_volume =>
|
|
Default.with(
|
|
foreground: BTSColors.Ladder.volume_column_foreground,
|
|
background: BTSColors.Ladder.volume_column_background);
|
|
|
|
public static LadderColumnSettings default_ask =>
|
|
Default.with(
|
|
foreground: BTSColors.Ladder.ask_column_foreground,
|
|
background: BTSColors.Ladder.ask_column_background);
|
|
|
|
public static LadderColumnSettings default_price =>
|
|
Default.with(
|
|
foreground: BTSColors.Ladder.price_column_foreground,
|
|
background: BTSColors.Ladder.price_column_background);
|
|
|
|
public static LadderColumnSettings default_piq =>
|
|
Default.with(show: false);
|
|
|
|
[ProtoMember(1)]
|
|
public bool show { get; set; }
|
|
[ProtoMember(2)]
|
|
public uint width { get; set; }
|
|
[ProtoMember(3)]
|
|
public uint background { get; set; }
|
|
[ProtoMember(4)]
|
|
public uint foreground { get; set; }
|
|
|
|
[ProtoMember(5)]
|
|
public string font_family { get; set; }
|
|
[ProtoMember(6)]
|
|
public double font_size { get; set; }
|
|
[ProtoMember(7)]
|
|
public int font_weight { get; set; }
|
|
|
|
public LadderColumnSettings with(
|
|
bool? show = null,
|
|
uint? width = null,
|
|
uint? background = null,
|
|
uint? foreground = null,
|
|
string font_family = null,
|
|
double? font_size = null,
|
|
int? font_weight = null) =>
|
|
new() {
|
|
show = show ?? this.show,
|
|
width = width ?? this.width,
|
|
background = background ?? this.background,
|
|
foreground = foreground ?? this.foreground,
|
|
font_family = font_family ?? this.font_family,
|
|
font_size = font_size ?? this.font_size,
|
|
font_weight = font_weight ?? this.font_weight
|
|
};
|
|
|
|
public bool Equals(LadderColumnSettings other) =>
|
|
other != null &&
|
|
other.width == width &&
|
|
other.background == background &&
|
|
other.foreground == foreground &&
|
|
other.font_family == font_family &&
|
|
other.font_size == font_size &&
|
|
other.font_weight == font_weight &&
|
|
other.show == show;
|
|
|
|
public override bool Equals(object obj) => Equals(obj as LadderColumnSettings);
|
|
public override int GetHashCode() => _type_hash;
|
|
|
|
public static bool operator ==(LadderColumnSettings x, LadderColumnSettings y) => x.safe_equals(y);
|
|
public static bool operator !=(LadderColumnSettings x, LadderColumnSettings y) => !(x == y);
|
|
}
|
|
|
|
[ProtoContract]
|
|
class LadderOrderLimits : IEquatable<LadderOrderLimits> {
|
|
[ProtoMember(1)]
|
|
public ToggleInt32Proto max_settlement_cross_ticks { get; set; }
|
|
|
|
public bool Equals(LadderOrderLimits other) =>
|
|
other != null && max_settlement_cross_ticks == other.max_settlement_cross_ticks;
|
|
}
|
|
|
|
[ProtoContract]
|
|
class HistogramBarAnimation : IEquatable<HistogramBarAnimation> {
|
|
// this class is 100% mutable (there are literally 0 readonly members),
|
|
// so GetHashCode must return the same hash for every instance.
|
|
static readonly int _type_hash = typeof(HistogramBarAnimation).GetHashCode();
|
|
[ProtoMember(1)]
|
|
public ColorShowProto bars { get; set; }
|
|
[ProtoMember(2)]
|
|
public bool show_numbers { get; set; }
|
|
|
|
public bool active => bars.show || show_numbers;
|
|
|
|
public bool Equals(HistogramBarAnimation other) =>
|
|
other != null &&
|
|
bars == other.bars &&
|
|
show_numbers == other.show_numbers;
|
|
|
|
public override bool Equals(object obj) => Equals(obj as HistogramBarAnimation);
|
|
public override int GetHashCode() => _type_hash;
|
|
}
|
|
|
|
[ProtoContract]
|
|
class VolumeColumnSettings : IEquatable<VolumeColumnSettings> {
|
|
// this class is 100% mutable (there are literally 0 readonly members),
|
|
// so GetHashCode must return the same hash for every instance.
|
|
static readonly int _type_hash = typeof(VolumeColumnSettings).GetHashCode();
|
|
public static VolumeColumnSettings Default {
|
|
get {
|
|
var gen = LadderColumnSettings.Default;
|
|
gen.show = false;
|
|
gen.background = BTSColors.Ladder.volume_column_background;
|
|
return new VolumeColumnSettings {
|
|
general = gen,
|
|
buy = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.MarketData.bid, false) },
|
|
sell = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.MarketData.ask, false) },
|
|
passive = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.Ladder.passive_volume_bar, false) },
|
|
total = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.Ladder.total_volume_bar), show_numbers = true },
|
|
show_ltq = false
|
|
};
|
|
}
|
|
}
|
|
|
|
[ProtoMember(1)]
|
|
public LadderColumnSettings general { get; set; }
|
|
[ProtoMember(2)]
|
|
public HistogramBarAnimation buy { get; set; }
|
|
[ProtoMember(3)]
|
|
public HistogramBarAnimation sell { get; set; }
|
|
[ProtoMember(4)]
|
|
public HistogramBarAnimation passive { get; set; }
|
|
[ProtoMember(5)]
|
|
public HistogramBarAnimation total { get; set; }
|
|
[ProtoMember(6)]
|
|
public bool show_ltq { get; set; }
|
|
|
|
public bool Equals(VolumeColumnSettings other) =>
|
|
other != null &&
|
|
general.Equals(other.general) &&
|
|
buy.safe_equals(other.buy) &&
|
|
sell.safe_equals(other.sell) &&
|
|
passive.safe_equals(other.passive) &&
|
|
total.safe_equals(other.total) &&
|
|
show_ltq.Equals(other.show_ltq);
|
|
|
|
public override bool Equals(object obj) => Equals(obj as VolumeColumnSettings);
|
|
public override int GetHashCode() => _type_hash;
|
|
}
|
|
|
|
[ProtoContract]
|
|
class LadderMarketBreakLine : IEquatable<LadderMarketBreakLine> {
|
|
public enum RefreshMode {
|
|
Auto,
|
|
Manual
|
|
}
|
|
// this class is 100% mutable (there are literally 0 readonly members),
|
|
// so GetHashCode must return the same hash for every instance.
|
|
static readonly int _type_hash = typeof(LadderMarketBreakLine).GetHashCode();
|
|
[ProtoMember(1)]
|
|
public bool show { get; set; }
|
|
[ProtoMember(2)]
|
|
public uint color { get; set; }
|
|
[ProtoMember(3)]
|
|
public RefreshMode refresh_mode { get; set; }
|
|
|
|
public uint? color_nullable {
|
|
get {
|
|
if (show) {
|
|
return color;
|
|
} else return null;
|
|
}
|
|
}
|
|
|
|
public bool Equals(LadderMarketBreakLine other) =>
|
|
other != null &&
|
|
other.show == show &&
|
|
other.color == color &&
|
|
other.refresh_mode == refresh_mode;
|
|
|
|
public override bool Equals(object obj) =>
|
|
Equals(obj as LadderMarketBreakLine);
|
|
|
|
public override int GetHashCode() =>
|
|
_type_hash;
|
|
}
|
|
|
|
[ProtoContract]
|
|
class FairValueLine : IEquatable<FairValueLine> {
|
|
public enum PriceType {
|
|
Bid,
|
|
Ask,
|
|
Mid,
|
|
Theo
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents the security from which the 'fair value price' comes (null represents the
|
|
/// 'Ladder's own security')
|
|
/// </summary>
|
|
[ProtoMember(1)]
|
|
public uint? security_key { get; set; }
|
|
|
|
[ProtoMember(2)]
|
|
public PriceType price_type { get; set; }
|
|
[ProtoMember(3)]
|
|
public LadderMarketBreakLine display { get; set; }
|
|
|
|
public bool Equals(FairValueLine other) {
|
|
return other != null &&
|
|
security_key == other.security_key &&
|
|
price_type == other.price_type &&
|
|
display.safe_equals(other.display);
|
|
}
|
|
|
|
public override bool Equals(object obj) {
|
|
return Equals(obj as FairValueLine);
|
|
}
|
|
|
|
public override int GetHashCode() =>
|
|
// don't include mutable props in hash
|
|
typeof(LadderSettings).GetHashCode();
|
|
}
|
|
|
|
[Flags]
|
|
enum LadderFavoriteAlgoFlags {
|
|
Sticky = 1,
|
|
AutoRevert = 2,
|
|
}
|
|
|
|
/// <summary>
|
|
/// This struct contains properties for a single algo favorite item.
|
|
/// The various <see cref="AlgoPersistedKey"/> arrays in <see cref="LadderFavoriteAlgosSettings"/>,
|
|
/// can be used to create a collection of <see cref="LadderFavoriteAlgoMetadata"/>s.
|
|
/// In fact, the method <see cref="LadderFavoriteAlgosSettings.to_algo_items"/> does just that.
|
|
/// </summary>
|
|
readonly struct LadderFavoriteAlgoMetadata : IEquatable<LadderFavoriteAlgoMetadata> {
|
|
public readonly AlgoKey key;
|
|
public readonly int sort_index;
|
|
public readonly LadderFavoriteAlgoFlags flags;
|
|
|
|
public LadderFavoriteAlgoMetadata(AlgoKey key, int sort_index, LadderFavoriteAlgoFlags flags) {
|
|
this.key = key;
|
|
this.sort_index = sort_index;
|
|
this.flags = flags;
|
|
}
|
|
|
|
public bool Equals(LadderFavoriteAlgoMetadata other) =>
|
|
key == other.key &&
|
|
flags == other.flags;
|
|
|
|
public override bool Equals(object obj) =>
|
|
obj is LadderFavoriteAlgoMetadata other && Equals(other);
|
|
|
|
public override int GetHashCode() =>
|
|
key.GetHashCode();
|
|
}
|
|
|
|
[ProtoContract]
|
|
struct LadderFavoriteAlgosSettings : IEquatable<LadderFavoriteAlgosSettings> {
|
|
[ProtoMember(1)]
|
|
readonly AlgoPersistedKey[] _favorite_algos;
|
|
[ProtoMember(2)]
|
|
public readonly int column_count;
|
|
[ProtoMember(3)]
|
|
readonly AlgoPersistedKey[] _stickied_algos;
|
|
[ProtoMember(4)]
|
|
readonly AlgoPersistedKey[] _auto_revert_algos;
|
|
|
|
public LadderFavoriteAlgosSettings(AlgoKey[] favorite_algos, int column_count, AlgoKey[] stickied_algos, AlgoKey[] auto_revert_algos)
|
|
: this(ArrayHelper.safe_convert(favorite_algos, k => new AlgoPersistedKey(k.persisted)),
|
|
ArrayHelper.safe_convert(stickied_algos, k => new AlgoPersistedKey(k.persisted)),
|
|
ArrayHelper.safe_convert(auto_revert_algos, k => new AlgoPersistedKey(k.persisted)),
|
|
column_count) { }
|
|
|
|
LadderFavoriteAlgosSettings(AlgoPersistedKey[] favorite_algos, AlgoPersistedKey[] stickied_algos, AlgoPersistedKey[] auto_revert_algos, int column_count) {
|
|
_favorite_algos = favorite_algos;
|
|
_stickied_algos = stickied_algos;
|
|
_auto_revert_algos = auto_revert_algos;
|
|
this.column_count = column_count;
|
|
}
|
|
|
|
public IReadOnlyList<AlgoKey> favorite_algos => _favorite_algos?.WrapSelectorRO(pk => pk.to_algo_key()) ?? Array.Empty<AlgoKey>();
|
|
public IReadOnlyList<AlgoKey> stickied_algos => _stickied_algos?.WrapSelectorRO(pk => pk.to_algo_key()) ?? Array.Empty<AlgoKey>();
|
|
public IReadOnlyList<AlgoKey> auto_revert_algos => _auto_revert_algos?.WrapSelectorRO(pk => pk.to_algo_key()) ?? Array.Empty<AlgoKey>();
|
|
|
|
/// <summary>
|
|
/// A more sane representation of the data contained in this proto,
|
|
/// so callers don't need to join the various key lists together to determine which algos are sticky, auto revert, etc.
|
|
/// </summary>
|
|
/// <returns>An immutable dictionary of favorite algo data.</returns>
|
|
public ImmutableDictionary<AlgoKey, LadderFavoriteAlgoMetadata> build_map() {
|
|
var map = ImmutableDictionary.CreateBuilder<AlgoKey, LadderFavoriteAlgoMetadata>();
|
|
if (_favorite_algos != null) {
|
|
var stickied_algo_set = new HashSet<AlgoKey>(stickied_algos);
|
|
var auto_revert_algo_set = new HashSet<AlgoKey>(auto_revert_algos);
|
|
for (int i = 0; i < _favorite_algos.Length; i++) {
|
|
var pk = _favorite_algos[i];
|
|
var k = pk.to_algo_key();
|
|
var flags = (LadderFavoriteAlgoFlags)0;
|
|
if (stickied_algo_set.Contains(k))
|
|
flags |= LadderFavoriteAlgoFlags.Sticky;
|
|
if (auto_revert_algo_set.Contains(k))
|
|
flags |= LadderFavoriteAlgoFlags.AutoRevert;
|
|
map[k] = new LadderFavoriteAlgoMetadata(k, i, flags);
|
|
}
|
|
}
|
|
return map.ToImmutable();
|
|
}
|
|
|
|
public bool Equals(LadderFavoriteAlgosSettings other) =>
|
|
column_count == other.column_count &&
|
|
favorite_algos.SequenceEqual(other.favorite_algos) &&
|
|
stickied_algos.SequenceEqual(other.stickied_algos) &&
|
|
auto_revert_algos.SequenceEqual(other.auto_revert_algos);
|
|
|
|
public override bool Equals(object obj) =>
|
|
EqualityComparer.equals_obj(this, obj);
|
|
|
|
public override int GetHashCode() =>
|
|
EqualityComparer.aggregate_hash(
|
|
column_count,
|
|
EqualityComparer.aggregate_hash_limited(favorite_algos),
|
|
EqualityComparer.aggregate_hash_limited(stickied_algos),
|
|
EqualityComparer.aggregate_hash_limited(auto_revert_algos));
|
|
|
|
public static bool operator ==(LadderFavoriteAlgosSettings a, LadderFavoriteAlgosSettings b) => a.Equals(b);
|
|
public static bool operator !=(LadderFavoriteAlgosSettings a, LadderFavoriteAlgosSettings b) => !a.Equals(b);
|
|
}
|
|
|
|
[ProtoContract]
|
|
readonly struct LadderMiniOrderBookSettings : IEquatable<LadderMiniOrderBookSettings> {
|
|
// this is the only member now, but more may be added later (that is why a GridSettings member wasn't added directly to LadderSettings).
|
|
[ProtoMember(1)]
|
|
public readonly GridSettings value;
|
|
|
|
public LadderMiniOrderBookSettings(GridSettings value) =>
|
|
this.value = value;
|
|
|
|
public bool Equals(LadderMiniOrderBookSettings other) => value == null ? other.value == null : value.Equals(other.value);
|
|
public override bool Equals(object obj) => obj is LadderMiniOrderBookSettings other && Equals(other);
|
|
public override int GetHashCode() => value.GetHashCode();
|
|
|
|
public static bool operator ==(LadderMiniOrderBookSettings a, LadderMiniOrderBookSettings b) => a.Equals(b);
|
|
public static bool operator !=(LadderMiniOrderBookSettings a, LadderMiniOrderBookSettings b) => !a.Equals(b);
|
|
}
|
|
|
|
[ProtoContract]
|
|
class LadderPanelPricePointSettings : IEquatable<LadderPanelPricePointSettings> {
|
|
public static LadderPanelPricePointSettings historic_default =>
|
|
new LadderPanelPricePointSettings {
|
|
day_change = new DaySettings {
|
|
// (neutral)
|
|
font = _default_font,
|
|
background_color = Colors.Transparent.to_uint(),
|
|
// negative
|
|
negative_font_color = Colors.White.to_uint(),
|
|
negative_background_color = Colors.Red.to_uint(),
|
|
// positive
|
|
positive_font_color = Colors.White.to_uint(),
|
|
positive_background_color = Colors.Green.to_uint()
|
|
},
|
|
session_low = _default_item,
|
|
session_high = _default_item,
|
|
open = _default_item,
|
|
settlement = _default_item,
|
|
theo = _default_item,
|
|
delta = _default_item,
|
|
vega = _default_item,
|
|
volume = _default_item
|
|
};
|
|
|
|
public static LadderPanelPricePointSettings tt_default {
|
|
get {
|
|
var rv = historic_default;
|
|
rv.day_change.background_color = Color.FromRgb(113, 201, 69).to_uint();
|
|
rv.day_change.font.font_color = Colors.Black.to_uint();
|
|
return rv;
|
|
}
|
|
}
|
|
|
|
public static LadderPanelPricePointSettings Default => LadderSettings.mimic_tt ?
|
|
tt_default : historic_default;
|
|
|
|
[ProtoMember(1)]
|
|
public DaySettings day_change { get; set; }
|
|
[ProtoMember(2)]
|
|
public ItemSettings session_low { get; set; }
|
|
[ProtoMember(3)]
|
|
public ItemSettings session_high { get; set; }
|
|
[ProtoMember(4)]
|
|
public ItemSettings open { get; set; }
|
|
[ProtoMember(5)]
|
|
public ItemSettings settlement { get; set; }
|
|
[ProtoMember(6)]
|
|
public ItemSettings volume { get; set; }
|
|
|
|
[ProtoMember(7)]
|
|
public ItemSettings theo { get; set; }
|
|
|
|
[ProtoMember(8)]
|
|
public ItemSettings delta { get; set; }
|
|
|
|
[ProtoMember(9)]
|
|
public ItemSettings vega { get; set; }
|
|
|
|
public bool Equals(LadderPanelPricePointSettings other) =>
|
|
other != null &&
|
|
day_change.safe_equals(other.day_change) &&
|
|
session_high.safe_equals(other.session_high) &&
|
|
session_high.safe_equals(other.session_high) &&
|
|
open.safe_equals(other.open) &&
|
|
settlement.safe_equals(other.settlement) &&
|
|
theo.safe_equals(other.theo) &&
|
|
delta.safe_equals(other.delta) &&
|
|
vega.safe_equals(other.vega) &&
|
|
volume.safe_equals(other.volume);
|
|
|
|
static FontParamsProto _default_font =>
|
|
new FontParamsProto {
|
|
font_color = BTSColors.UI.default_text,
|
|
font_size = FontSizes.Regular,
|
|
typeface = new TypefaceProto(TextUtils.StandardFontFamilyName, FontWeights.Bold.ToOpenTypeWeight())
|
|
};
|
|
|
|
static ItemSettings _default_item =>
|
|
new ItemSettings {
|
|
font = _default_font,
|
|
background_color = Colors.Transparent.to_uint()
|
|
};
|
|
|
|
[ProtoContract]
|
|
readonly struct SignedColorPair : IEquatable<SignedColorPair> {
|
|
[ProtoMember(1)]
|
|
public uint positive_color { get; }
|
|
[ProtoMember(2)]
|
|
public uint negative_color { get; }
|
|
|
|
public bool Equals(SignedColorPair other) =>
|
|
positive_color == other.positive_color &&
|
|
negative_color == other.negative_color;
|
|
}
|
|
|
|
[ProtoContract]
|
|
public class ItemSettings : IEquatable<ItemSettings> {
|
|
[ProtoMember(1)]
|
|
public FontParamsProto font { get; set; }
|
|
[ProtoMember(2)]
|
|
public uint background_color { get; set; }
|
|
[ProtoMember(3)]
|
|
public bool show_label { get; set; }
|
|
|
|
public bool Equals(ItemSettings other) =>
|
|
other != null &&
|
|
font.safe_equals(other.font) &&
|
|
background_color == other.background_color &&
|
|
show_label == other.show_label;
|
|
}
|
|
|
|
[ProtoContract]
|
|
public class DaySettings : IEquatable<DaySettings> {
|
|
[ProtoMember(1)]
|
|
public FontParamsProto font { get; set; }
|
|
// [neutral] background
|
|
[ProtoMember(2)]
|
|
public uint background_color { get; set; }
|
|
[ProtoMember(3)]
|
|
public bool show_label { get; set; }
|
|
|
|
// negative
|
|
[ProtoMember(4)]
|
|
public uint negative_font_color { get; set; }
|
|
[ProtoMember(5)]
|
|
public uint negative_background_color { get; set; }
|
|
|
|
// positive
|
|
[ProtoMember(6)]
|
|
public uint positive_font_color { get; set; }
|
|
[ProtoMember(7)]
|
|
public uint positive_background_color { get; set; }
|
|
|
|
public uint neutral_foreground => font?.font_color ?? 0;
|
|
|
|
public bool Equals(DaySettings other) =>
|
|
other != null &&
|
|
font.safe_equals(other.font) &&
|
|
background_color == other.background_color &&
|
|
show_label == other.show_label &&
|
|
negative_font_color == other.negative_font_color &&
|
|
negative_background_color == other.negative_background_color &&
|
|
positive_font_color == other.positive_font_color &&
|
|
positive_background_color == other.positive_background_color;
|
|
}
|
|
}
|
|
|
|
// IMPORTANT: BE SURE TO ADD ANY NEW PROPERTIES TO THE EQUALS FUNCTION!
|
|
// 1 important reason at this time:
|
|
// From the settings dialog, default settings will only be persisted when they are NOT EQUAL to the current default settings.
|
|
// Settings are liable to change in the near future, so an internal IEqualityComparer simply won't do as it risks becoming out of date.
|
|
[ProtoContract]
|
|
class LadderSettings : IEquatable<LadderSettings> {
|
|
// RESERVED ProtoMember indices
|
|
// 900-999: dj settings
|
|
const double _default_order_entry_panel_width = 110.0;
|
|
const double _default_zoom_factor = 1.0;
|
|
const bool _default_show_warn_on_cross = true;
|
|
const bool _default_enforce_max_clip = false;
|
|
public static readonly IEqualityComparer<LadderSettings> profile_equality_comparer =
|
|
EqualityComparer.Create<LadderSettings>(profile_equals);
|
|
// this class is 100% mutable (there are literally 0 readonly members),
|
|
// so GetHashCode must return the same hash for every instance.
|
|
static readonly int _type_hash = typeof(LadderSettings).GetHashCode();
|
|
uint _ticks_per_row;
|
|
List<FairValueLine> _fair_value_lines;
|
|
|
|
static LadderSettings() {
|
|
var knobs = config.Configuration.get<bts.config.LadderKnobs>();
|
|
mimic_tt = knobs.mimic_tt;
|
|
}
|
|
|
|
// Default proto constructor
|
|
// Added this so that when clients upgrade to a version with new settings,
|
|
// the default values are applied correctly; thx to John for this tip
|
|
/// TODO: all default values should be consts, because they must be referenced in two places (in the default constructor, and the <see cref="DefaultValueAttribute"/>)
|
|
public LadderSettings() {
|
|
day_visible = true;
|
|
high_visible = true;
|
|
low_visible = true;
|
|
open_visible = true;
|
|
settle_visible = true;
|
|
volume_visible = true;
|
|
account_visible = true;
|
|
tif_visible = true;
|
|
order_type_visible = true;
|
|
account_position_visible = true;
|
|
day_position_visible = true;
|
|
size_presets_visible = true;
|
|
cancel_buys_visible = true;
|
|
cancel_sells_visible = true;
|
|
cancel_all_visible = true;
|
|
auto_clear_visible = true;
|
|
clear_visible = true;
|
|
order_entry_panel_initial_width = _default_order_entry_panel_width;
|
|
zoom_factor = _default_zoom_factor;
|
|
use_defaults = true;
|
|
favorite_algos = new LadderFavoriteAlgosSettings(null, 2, null, null);
|
|
show_warn_on_cross = _default_show_warn_on_cross;
|
|
enforce_max_clip = _default_enforce_max_clip;
|
|
status_message_visible = true;
|
|
}
|
|
|
|
public static bool mimic_tt { get; }
|
|
|
|
public static LadderSettings historic_default {
|
|
get {
|
|
LadderColumnSettings
|
|
orders_column = LadderColumnSettings.default_orders,
|
|
bid_column = LadderColumnSettings.default_bid,
|
|
ask_column = LadderColumnSettings.default_ask,
|
|
price_column = LadderColumnSettings.default_price,
|
|
last_column = LadderColumnSettings.default_last,
|
|
piq_column = LadderColumnSettings.default_piq;
|
|
var rv = new LadderSettings {
|
|
row_height = 22,
|
|
grid_line_color = 0x535353,
|
|
orders_column = orders_column,
|
|
bid_column = bid_column,
|
|
ask_column = ask_column,
|
|
price_column = price_column,
|
|
last_column = last_column,
|
|
piq_column = piq_column,
|
|
volume_column = VolumeColumnSettings.Default,
|
|
calculator_buttons = new double[] { 1, 5, 10, 25, 50, 100 },
|
|
scroll_bar_visible = false,
|
|
default_time_in_force = TimeInForce.Day,
|
|
default_algo = new AlgoID(CustomOrderDefinition.CustomOneofCase.Limit),
|
|
animate_recenter = true,
|
|
badge_style = BadgeStyle.Normal,
|
|
bid_break_line = new LadderMarketBreakLine { color = BTSColors.Ladder.bid_line, show = true },
|
|
ask_break_line = new LadderMarketBreakLine { color = BTSColors.Ladder.ask_line, show = false },
|
|
mid_break_line = new LadderMarketBreakLine { color = BTSColors.Ladder.mid_line, show = false },
|
|
session_low_line = new LadderMarketBreakLine { color = BTSColors.MarketData.session_low, show = true },
|
|
session_high_line = new LadderMarketBreakLine { color = BTSColors.MarketData.session_high, show = true },
|
|
session_range_fill = new LadderMarketBreakLine { color = BTSColors.MarketData.session_range_fill, show = true },
|
|
alternate_order_size = 0,
|
|
size_display = MarketSizeDisplay.get_default(),
|
|
day_visible = true,
|
|
high_visible = true,
|
|
low_visible = true,
|
|
open_visible = true,
|
|
settle_visible = true,
|
|
volume_visible = true,
|
|
account_visible = true,
|
|
tif_visible = true,
|
|
order_type_visible = true,
|
|
account_position_visible = true,
|
|
day_position_visible = true,
|
|
size_presets_visible = true,
|
|
cancel_buys_visible = true,
|
|
cancel_sells_visible = true,
|
|
cancel_all_visible = true,
|
|
auto_clear_visible = true,
|
|
clear_visible = true,
|
|
order_entry_panel_initial_width = _default_order_entry_panel_width,
|
|
panel_price_point_settings = LadderPanelPricePointSettings.Default,
|
|
zoom_slider_visible = false,
|
|
zoom_factor = _default_zoom_factor,
|
|
net_change = NetChangeTerms.None,
|
|
mini_ob = new LadderMiniOrderBookSettings(bts.shell.orderbook.OrderBookStartupData.default_mini_grid.general),
|
|
max_clip = 0,
|
|
price_display_format = PriceDisplayFormat.Default,
|
|
status_message_visible = true,
|
|
};
|
|
rv.row_height = LadderRender.measure_row_height(rv);
|
|
return rv;
|
|
}
|
|
}
|
|
|
|
public static LadderSettings tt_default => historic_default;
|
|
|
|
public static LadderSettings Default => mimic_tt ?
|
|
tt_default : historic_default;
|
|
|
|
public enum BadgeStyle { Normal, Alternate }
|
|
|
|
// TODO: rename to PriceDisplayFormat (today is merge monday, since this isn't a functional change, it is not worth the potential merge headaches right now)
|
|
public enum NetChangeTerms {
|
|
[Description("Standard Ticks")]
|
|
None,
|
|
[Description("Net Change Dollars")]
|
|
Dollars,
|
|
[Description("Net Change Ticks")]
|
|
Ticks
|
|
}
|
|
|
|
public enum PriceDisplayFormat {
|
|
[Description("Default")]
|
|
Default,
|
|
[Description("Integer")]
|
|
Integer
|
|
}
|
|
|
|
[ProtoMember(1)]
|
|
public double row_height { get; set; }
|
|
[ProtoMember(2)]
|
|
public uint grid_line_color { get; set; }
|
|
//[ProtoMember(3)]
|
|
//public MarketBreakType market_break_type { get; set; }
|
|
|
|
// Column settings
|
|
[ProtoMember(4)]
|
|
public LadderColumnSettings orders_column { get; set; }
|
|
[ProtoMember(5)]
|
|
public LadderColumnSettings bid_column { get; set; }
|
|
[ProtoMember(6)]
|
|
public LadderColumnSettings ask_column { get; set; }
|
|
[ProtoMember(7)]
|
|
public LadderColumnSettings price_column { get; set; }
|
|
[ProtoMember(8)]
|
|
public LadderColumnSettings last_column { get; set; }
|
|
|
|
[ProtoMember(9)]
|
|
public double[] calculator_buttons { get; set; }
|
|
[ProtoMember(10)]
|
|
public bool scroll_bar_visible { get; set; }
|
|
// USED [ProtoMember(11)]
|
|
// USED [ProtoMember(12)]
|
|
[ProtoMember(51)]
|
|
public uint default_account { get; set; }
|
|
[ProtoMember(52)]
|
|
public AlgoID default_algo { get; set; }
|
|
[ProtoMember(13)]
|
|
public CustomOrderDefinition.CustomOneofCase default_order_type { get; set; }
|
|
[ProtoMember(14)]
|
|
public TimeInForce default_time_in_force { get; set; }
|
|
[ProtoMember(15)]
|
|
public uint size { get; set; }
|
|
[ProtoMember(16)]
|
|
public bool animate_recenter { get; set; } = true;
|
|
[ProtoMember(17)]
|
|
public BadgeStyle badge_style { get; set; }
|
|
[ProtoMember(53)]
|
|
public bool auto_clear { get; set; }
|
|
|
|
[ProtoMember(18)]
|
|
public LadderMarketBreakLine bid_break_line { get; set; }
|
|
[ProtoMember(19)]
|
|
public LadderMarketBreakLine ask_break_line { get; set; }
|
|
[ProtoMember(20)]
|
|
public LadderMarketBreakLine mid_break_line { get; set; }
|
|
[ProtoMember(21)]
|
|
public uint alternate_order_size { get; set; }
|
|
[ProtoMember(22)]
|
|
public LadderMarketBreakLine session_low_line { get; set; }
|
|
[ProtoMember(23)]
|
|
public LadderMarketBreakLine session_high_line { get; set; }
|
|
[ProtoMember(24)]
|
|
public LadderMarketBreakLine session_range_fill { get; set; }
|
|
[ProtoMember(25)]
|
|
public VolumeColumnSettings volume_column { get; set; }
|
|
[ProtoMember(26)]
|
|
public MarketSizeDisplay size_display { get; set; }
|
|
|
|
// order entry panel items show/hide
|
|
[ProtoMember(27), DefaultValue(true)]
|
|
public bool day_visible { get; set; }
|
|
[ProtoMember(28), DefaultValue(true)]
|
|
public bool high_visible { get; set; }
|
|
[ProtoMember(29), DefaultValue(true)]
|
|
public bool low_visible { get; set; }
|
|
[ProtoMember(30), DefaultValue(true)]
|
|
public bool open_visible { get; set; }
|
|
[ProtoMember(31), DefaultValue(true)]
|
|
public bool settle_visible { get; set; }
|
|
|
|
[ProtoMember(63)]
|
|
public bool theo_visible { get; set; }
|
|
|
|
[ProtoMember(64)]
|
|
public bool delta_visible { get; set; }
|
|
|
|
[ProtoMember(65)]
|
|
public bool vega_visible { get; set; }
|
|
|
|
[ProtoMember(32), DefaultValue(true)]
|
|
public bool volume_visible { get; set; }
|
|
[ProtoMember(33), DefaultValue(true)]
|
|
public bool account_visible { get; set; }
|
|
[ProtoMember(34), DefaultValue(true)]
|
|
public bool tif_visible { get; set; }
|
|
[ProtoMember(35), DefaultValue(true)]
|
|
public bool order_type_visible { get; set; }
|
|
[ProtoMember(36), DefaultValue(true)]
|
|
public bool account_position_visible { get; set; }
|
|
[ProtoMember(50), DefaultValue(true)]
|
|
public bool day_position_visible { get; set; }
|
|
[ProtoMember(56)]
|
|
public bool raw_day_position_visible { get; set; }
|
|
[ProtoMember(37), DefaultValue(true)]
|
|
public bool size_presets_visible { get; set; }
|
|
[ProtoMember(38), DefaultValue(true)]
|
|
public bool cancel_buys_visible { get; set; }
|
|
[ProtoMember(39), DefaultValue(true)]
|
|
public bool cancel_sells_visible { get; set; }
|
|
[ProtoMember(40), DefaultValue(true)]
|
|
public bool cancel_all_visible { get; set; }
|
|
[ProtoMember(41), DefaultValue(true)]
|
|
public bool auto_clear_visible { get; set; }
|
|
[ProtoMember(42), DefaultValue(true)]
|
|
public bool clear_visible { get; set; }
|
|
//
|
|
[ProtoMember(43), DefaultValue(_default_order_entry_panel_width)]
|
|
public double order_entry_panel_initial_width { get; set; }
|
|
|
|
[ProtoMember(44), DefaultValue(true)]
|
|
public bool use_defaults { get; set; }
|
|
|
|
// the zoom slider is the first new widget on the panel
|
|
// since our initial general release, so its enablement
|
|
// will be opt-in (default not visible)
|
|
[ProtoMember(45)]
|
|
public bool zoom_slider_visible { get; set; }
|
|
[ProtoMember(46), DefaultValue(_default_zoom_factor)]
|
|
public double zoom_factor { get; set; }
|
|
|
|
[ProtoMember(47)]
|
|
public LadderFavoriteAlgosSettings favorite_algos { get; set; }
|
|
|
|
[ProtoMember(48)]
|
|
public NetChangeTerms net_change { get; set; }
|
|
|
|
[ProtoMember(49)]
|
|
LadderColumnSettings _piq_column;
|
|
public LadderColumnSettings piq_column {
|
|
get => _piq_column ?? (_piq_column = LadderSettings.Default.piq_column);
|
|
set => _piq_column = value;
|
|
}
|
|
[ProtoMember(54), DefaultValue(_default_show_warn_on_cross)]
|
|
public bool show_warn_on_cross { get; set; }
|
|
|
|
[ProtoMember(55)]
|
|
public LadderMiniOrderBookSettings mini_ob { get; set; }
|
|
|
|
[ProtoMember(57)]
|
|
public double left_panel_scroll_position { get; set; }
|
|
|
|
[ProtoMember(58), DefaultValue(_default_enforce_max_clip)]
|
|
public bool enforce_max_clip { get; set; }
|
|
|
|
[ProtoMember(59)]
|
|
public double max_clip { get; set; }
|
|
|
|
[ProtoMember(60)]
|
|
public PriceDisplayFormat price_display_format { get; set; }
|
|
|
|
[ProtoMember(61), DefaultValue(true)]
|
|
public bool status_message_visible { get; set; }
|
|
|
|
[ProtoMember(62)]
|
|
public uint ticks_per_row {
|
|
get => Math.Max(_ticks_per_row, 1);
|
|
set => _ticks_per_row = value;
|
|
}
|
|
|
|
[ProtoMember(900)]
|
|
public LadderOrderLimits ladder_order_limits { get; set; }
|
|
[ProtoMember(901)]
|
|
public LadderPanelPricePointSettings panel_price_point_settings { get; set; }
|
|
[ProtoMember(902)]
|
|
public List<FairValueLine> fair_value_lines {
|
|
get => _fair_value_lines ?? (_fair_value_lines = new List<FairValueLine>());
|
|
set => _fair_value_lines = value;
|
|
}
|
|
|
|
public void sanitize() =>
|
|
sanitize(this);
|
|
|
|
// if there are new props, make sure they are not null, invalid, etc.
|
|
public static LadderSettings sanitize(LadderSettings s) {
|
|
if (s == null)
|
|
return null;
|
|
// these MarketBreakLines are new settings props, ensure they are not null
|
|
if (s.bid_break_line == null)
|
|
s.bid_break_line = Default.bid_break_line;
|
|
if (s.ask_break_line == null)
|
|
s.ask_break_line = Default.ask_break_line;
|
|
if (s.mid_break_line == null)
|
|
s.mid_break_line = Default.mid_break_line;
|
|
if (s.session_low_line == null)
|
|
s.session_low_line = Default.session_low_line;
|
|
if (s.session_high_line == null)
|
|
s.session_high_line = Default.session_high_line;
|
|
if (s.session_range_fill == null)
|
|
s.session_range_fill = Default.session_range_fill;
|
|
if (s.volume_column == null)
|
|
s.volume_column = Default.volume_column;
|
|
if (s.size_display == null)
|
|
s.size_display = MarketSizeDisplay.get_default();
|
|
if (s.size_display.normal == null)
|
|
s.size_display = s.size_display.with(MarketSizeDisplay.get_default().normal);
|
|
if (s.mini_ob.value == null)
|
|
s.mini_ob = new LadderMiniOrderBookSettings(bts.shell.orderbook.OrderBookStartupData.default_mini_grid.general);
|
|
#pragma warning disable CS0612 // Type or member is obsolete
|
|
if (s.mini_ob.value.sorting_criteria.Count == 0)
|
|
s.mini_ob = new LadderMiniOrderBookSettings(s.mini_ob.value.with(sorting_criteria: bts.shell.orderbook.OrderBookStartupData.default_mini_grid.general.sorting_criteria));
|
|
#pragma warning restore CS0612 // Type or member is obsolete
|
|
s.row_height = LadderRender.measure_row_height(s);
|
|
if (s.panel_price_point_settings is null)
|
|
s.panel_price_point_settings = LadderPanelPricePointSettings.Default;
|
|
if (s.fair_value_lines is null) {
|
|
s.fair_value_lines = new List<FairValueLine>(0);
|
|
}
|
|
return s;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines whether or not the specified LadderSettings are 'profile equivalent.'
|
|
/// This means that 2 ladders, each with a different one of the specified settings, could share the same profile.
|
|
/// </summary>
|
|
///
|
|
/// Note: the impetus for this version of equality is to avoid disconnecting a ladder from its profile due to 'trivial' settings changes.
|
|
/// Consider the '<see cref="default_algo"/>' property:
|
|
/// If a ladder is using a settings profile with Limit as the default algo, and the user decides to send a 'Market' order,
|
|
/// the ladder would suddenly be disconnected from the profile, because it's settings state would no longer be equal to the profile's settings,
|
|
/// since they changed the selected algo type to 'Market.'
|
|
/// To avoid such travesties, a separate equals logic is needed: this is called 'profile-equivalent' and is implemented in <see cref="profile_equals)"/>.
|
|
/// Devs: be sure to account for properties that are excluded in the 'profile-equals' logic in the [regular]'equals' logic.
|
|
public static bool profile_equals(LadderSettings a, LadderSettings b) =>
|
|
a == null ? b == null :
|
|
b != null &&
|
|
a.row_height == b.row_height &&
|
|
a.grid_line_color == b.grid_line_color &&
|
|
a.orders_column.safe_equals(b.orders_column) &&
|
|
a.bid_column.safe_equals(b.bid_column) &&
|
|
a.ask_column.safe_equals(b.ask_column) &&
|
|
a.price_column.safe_equals(b.price_column) &&
|
|
a.last_column.safe_equals(b.last_column) &&
|
|
a.piq_column.safe_equals(b.piq_column) &&
|
|
a.calculator_buttons.safe_equals(b.calculator_buttons, Enumerable.SequenceEqual) &&
|
|
a.scroll_bar_visible == b.scroll_bar_visible &&
|
|
a.default_account == b.default_account &&
|
|
a.default_time_in_force == b.default_time_in_force &&
|
|
a.size == b.size &&
|
|
a.animate_recenter == b.animate_recenter &&
|
|
a.badge_style == b.badge_style &&
|
|
a.auto_clear == b.auto_clear &&
|
|
a.bid_break_line.safe_equals(b.bid_break_line) &&
|
|
a.ask_break_line.safe_equals(b.ask_break_line) &&
|
|
a.mid_break_line.safe_equals(b.mid_break_line) &&
|
|
a.alternate_order_size == b.alternate_order_size &&
|
|
a.session_low_line.safe_equals(b.session_low_line) &&
|
|
a.session_high_line.safe_equals(b.session_high_line) &&
|
|
a.session_range_fill.safe_equals(b.session_range_fill) &&
|
|
a.volume_column.safe_equals(b.volume_column) &&
|
|
a.size_display.safe_equals(b.size_display) &&
|
|
a.day_visible == b.day_visible &&
|
|
a.high_visible == b.high_visible &&
|
|
a.low_visible == b.low_visible &&
|
|
a.open_visible == b.open_visible &&
|
|
a.settle_visible == b.settle_visible &&
|
|
a.theo_visible == b.theo_visible &&
|
|
a.delta_visible == b.delta_visible &&
|
|
a.vega_visible == b.vega_visible &&
|
|
a.volume_visible == b.volume_visible &&
|
|
a.account_visible == b.account_visible &&
|
|
a.tif_visible == b.tif_visible &&
|
|
a.order_type_visible == b.order_type_visible &&
|
|
a.account_position_visible == b.account_position_visible &&
|
|
a.day_position_visible == b.day_position_visible &&
|
|
a.raw_day_position_visible == b.raw_day_position_visible &&
|
|
a.size_presets_visible == b.size_presets_visible &&
|
|
a.cancel_buys_visible == b.cancel_buys_visible &&
|
|
a.cancel_sells_visible == b.cancel_sells_visible &&
|
|
a.cancel_all_visible == b.cancel_all_visible &&
|
|
a.auto_clear_visible == b.auto_clear_visible &&
|
|
a.clear_visible == b.clear_visible &&
|
|
a.order_entry_panel_initial_width == b.order_entry_panel_initial_width &&
|
|
a.zoom_slider_visible == b.zoom_slider_visible &&
|
|
a.zoom_factor == b.zoom_factor &&
|
|
a.use_defaults == b.use_defaults &&
|
|
a.favorite_algos == b.favorite_algos &&
|
|
a.net_change == b.net_change &&
|
|
a.show_warn_on_cross == b.show_warn_on_cross &&
|
|
a.mini_ob == b.mini_ob &&
|
|
a.enforce_max_clip == b.enforce_max_clip &&
|
|
a.max_clip == b.max_clip &&
|
|
a.price_display_format == b.price_display_format &&
|
|
a.status_message_visible == b.status_message_visible &&
|
|
a.ladder_order_limits.safe_equals(b.ladder_order_limits) &&
|
|
a._ticks_per_row == b._ticks_per_row &&
|
|
a.panel_price_point_settings.safe_equals(b.panel_price_point_settings) &&
|
|
a._ticks_per_row == b._ticks_per_row &&
|
|
EqualityComparer.safe_sequence_equals(a.fair_value_lines, b.fair_value_lines);
|
|
|
|
public bool Equals(LadderSettings other) =>
|
|
profile_equals(this, other) &&
|
|
default_algo == other.default_algo &&
|
|
left_panel_scroll_position == other.left_panel_scroll_position;
|
|
|
|
public override bool Equals(object obj) => Equals(obj as LadderSettings);
|
|
|
|
public override int GetHashCode() => _type_hash;
|
|
|
|
public struct WindowSpecifics {
|
|
public readonly double order_entry_panel_width, zoom_factor;
|
|
public readonly uint orders_column_width, bid_column_width, price_column_width, ask_column_width, last_column_width, volume_column_width, piq_column_width;
|
|
|
|
public WindowSpecifics(LadderSettings s)
|
|
: this(s.order_entry_panel_initial_width, s.orders_column.width, s.bid_column.width, s.price_column.width, s.ask_column.width, s.last_column.width, s.volume_column.general.width, s.zoom_factor, s.piq_column.width) { }
|
|
|
|
public WindowSpecifics(double order_entry_panel_width, uint orders_column_width, uint bid_column_width, uint price_column_width, uint ask_column_width, uint last_column_width, uint volume_column_width, double zoom_factor, uint piq_column_width) {
|
|
this.order_entry_panel_width = order_entry_panel_width;
|
|
this.orders_column_width = orders_column_width;
|
|
this.bid_column_width = bid_column_width;
|
|
this.price_column_width = price_column_width;
|
|
this.ask_column_width = ask_column_width;
|
|
this.last_column_width = last_column_width;
|
|
this.volume_column_width = volume_column_width;
|
|
this.zoom_factor = zoom_factor;
|
|
this.piq_column_width = piq_column_width;
|
|
}
|
|
}
|
|
}
|
|
|
|
static class LadderSettingsExtensions {
|
|
public static IEnumerable<LadderColumnSettings> all_columns(this LadderSettings settings) {
|
|
yield return settings.orders_column;
|
|
yield return settings.bid_column;
|
|
yield return settings.price_column;
|
|
yield return settings.ask_column;
|
|
yield return settings.volume_column.general;
|
|
yield return settings.last_column;
|
|
yield return settings.piq_column;
|
|
}
|
|
|
|
public static IEnumerable<LadderColumnSettings> visible_columns(this LadderSettings settings) =>
|
|
settings.all_columns().Where(c => c.show);
|
|
|
|
public static LadderSettings.WindowSpecifics get_window_specifics(this LadderSettings settings) =>
|
|
new LadderSettings.WindowSpecifics(settings);
|
|
|
|
public static LadderSettings with_window_specifics(this LadderSettings source, LadderSettings.WindowSpecifics specifics) {
|
|
// must use clone bc we are applying settings that are specific to each individual LadderWindow, and should not be shared among all ladders (even if it is default settings).
|
|
source = SparkUtils.clone_proto(source);
|
|
source.order_entry_panel_initial_width = specifics.order_entry_panel_width;
|
|
source.orders_column.width = specifics.orders_column_width;
|
|
source.bid_column.width = specifics.bid_column_width;
|
|
source.price_column.width = specifics.price_column_width;
|
|
source.ask_column.width = specifics.ask_column_width;
|
|
source.last_column.width = specifics.last_column_width;
|
|
source.piq_column.width = specifics.piq_column_width;
|
|
source.volume_column.general.width = specifics.volume_column_width;
|
|
source.zoom_factor = specifics.zoom_factor;
|
|
return source;
|
|
}
|
|
}
|
|
}
|