diff --git a/src/client/spark/core/FontsAndColors/BTSColors.cs b/src/client/spark/core/FontsAndColors/BTSColors.cs
index 6f3c11fca..19eea3600 100644
--- a/src/client/spark/core/FontsAndColors/BTSColors.cs
+++ b/src/client/spark/core/FontsAndColors/BTSColors.cs
@@ -309,6 +309,8 @@ namespace mbts.ui
public static BTSColor input_invalid_border { get { return new BTSColor(0x7E, 0xB4, 0xEA); } }
public static BTSColor input_invalid_background { get { return new BTSColor(0xAB, 0xAD, 0xB3); } }
+ public static BTSColor input_dirty_border => warning;
+
public static class ComboBox
{
// Normal
@@ -407,6 +409,7 @@ namespace mbts.ui
public static BTSColor uneditable_button_border { get { return UI.transparent; } }
public static BTSColor uneditable_button_background { get { return UI.transparent; } }
+ //public static BTSColor uncommitted_edit_background => new BTSColor
}
public static class Button
diff --git a/src/client/spark/view/Colors.xaml b/src/client/spark/view/Colors.xaml
index ef3587fa2..073ca2704 100644
--- a/src/client/spark/view/Colors.xaml
+++ b/src/client/spark/view/Colors.xaml
@@ -1,10 +1,9 @@
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mbts="clr-namespace:mbts.ui"
+ xmlns:ui="clr-namespace:mbts.ui"
+>
#FF999999
@@ -22,10 +21,16 @@
-
+
+ #FFFFFFFF
+ #FFABADB3
+
+
+
+
diff --git a/src/client/spark/view/Controls/Order/OrderDetailsPopupControl.xaml b/src/client/spark/view/Controls/Order/OrderDetailsPopupControl.xaml
index 2df915cd1..81258e385 100644
--- a/src/client/spark/view/Controls/Order/OrderDetailsPopupControl.xaml
+++ b/src/client/spark/view/Controls/Order/OrderDetailsPopupControl.xaml
@@ -19,16 +19,29 @@
\ No newline at end of file
diff --git a/src/client/spark/view/Controls/TickUpDown/TickUpDown.xaml b/src/client/spark/view/Controls/TickUpDown/TickUpDown.xaml
index e9065ca5e..f45b0fe6d 100644
--- a/src/client/spark/view/Controls/TickUpDown/TickUpDown.xaml
+++ b/src/client/spark/view/Controls/TickUpDown/TickUpDown.xaml
@@ -3,152 +3,160 @@
xmlns:u="clr-namespace:mbts.ui"
xmlns:c="clr-namespace:mbts.ui.controls">
-
+
+
\ No newline at end of file
diff --git a/src/client/spark/view/Spark/Ladder/LadderVM.cs b/src/client/spark/view/Spark/Ladder/LadderVM.cs
index be6bb885d..94c53f407 100644
--- a/src/client/spark/view/Spark/Ladder/LadderVM.cs
+++ b/src/client/spark/view/Spark/Ladder/LadderVM.cs
@@ -110,10 +110,13 @@ namespace mbts.spark {
}
public async Task send_order((double price, Side? side) args) {
- if (args.side.HasValue && !HasErrors) {
- var sec_order = selected_order_type as ISecurityOrderTypeDefVM;
- if (!size_calculator.value.HasValue || size_calculator.value.Value == 0) {
- await size_calculator.flash_value_error();
+ if (args.side.HasValue) {
+ _validate_selected_account();
+ _validate_selected_time_in_force();
+ _validate_selected_order_type();
+ if (HasErrors) return;
+ else if (!size_calculator.value.HasValue || size_calculator.value.Value == 0) {
+ size_calculator.flash_error();
} else {
var order = create(args.side.Value);
uint size = (uint)Math.Abs(size_calculator.value.Value);
diff --git a/src/client/spark/view/Spark/Orders/ExistingOrderTicketVM.cs b/src/client/spark/view/Spark/Orders/ExistingOrderTicketVM.cs
index 5bb8c93c9..76bcac146 100644
--- a/src/client/spark/view/Spark/Orders/ExistingOrderTicketVM.cs
+++ b/src/client/spark/view/Spark/Orders/ExistingOrderTicketVM.cs
@@ -1,30 +1,45 @@
using bts.api.orderman;
using mbts.ui;
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Windows.Input;
namespace mbts.spark {
- class ExistingOrderTicketVM : OrderPropertiesEditorVM {
+ class ExistingOrderTicketVM : OrderPropertiesEditorVM, IRequestViewClose {
readonly Property _current_price;
readonly Property _current_size;
+ readonly Property _current_account;
+ readonly Property _current_time_in_force;
+ readonly Property _current_order_type;
+ readonly DelegateProperty _price_dirty, _size_dirty, _account_dirty, _time_in_force_dirty, _order_type_dirty;
public ExistingOrderTicketVM(OrdersModel model, IObservable order_source, IObservable calculator_buttons)
: base(model, order_source.Where(ot => ot.security_md.HasValue).Select(ot => ot.security_md.Value.security),
- order_source.Select(ot => new InlineOrderProperties(
- new InlineUserProperty(ot.order.State.Price),
- new InlineUserProperty(ot.order.State.Quantity),
- new InlineUserProperty(ot.order.Def.Account),
- new InlineUserProperty(ot.order.Def.TimeInForce),
- new InlineUserProperty(ot.order.Def.CustomDef.CloneToMutable())
+ order_source.Take(1).Select(ot => new InlineOrderProperties(
+ new InlineUserProperty(ot.order.State.Price, true),
+ new InlineUserProperty(ot.order.State.Quantity, true),
+ new InlineUserProperty(ot.order.Def.Account, true),
+ new InlineUserProperty(ot.order.Def.TimeInForce, true),
+ new InlineUserProperty(ot.order.Def.CustomDef.CloneToMutable(), true)
)), calculator_buttons) {
uint? key = null;
_current_price = backing(nameof(current_price), order_source.Select(ort => ort.order.State.Price));
_current_size = backing(nameof(current_size), order_source.Select(ort => ort.order.State.Quantity));
+ _current_account = backing(nameof(current_account), order_source.Select(ort => ort.order.Def.Account));
+ _current_time_in_force = backing(nameof(current_time_in_force), order_source.Select(ort => ort.order.Def.TimeInForce));
+ _current_order_type = backing(nameof(current_order_type), order_source.Select(ort => ort.order.Def.CustomDef.CustomCase));
+ _price_dirty = backing(nameof(price_dirty), () => !double.IsNaN(price) && price != current_price);
+ _size_dirty = backing(nameof(size_dirty), () => size_calculator.value.HasValue && size_calculator.value.Value != current_size);
+ _account_dirty = backing(nameof(account_dirty), () => selected_account != current_account);
+ _time_in_force_dirty = backing(nameof(time_in_force_dirty), () => selected_time_in_force != current_time_in_force);
+ _order_type_dirty = backing(nameof(order_type_dirty), () => selected_order_type == null || selected_order_type.order_type != current_order_type);
_dispose = Disposable.Create(
order_source.Select(ort => ort.order.Key).ObserveOnDispatcher().Subscribe(k => key = k),
- bbo = new BBOVM(order_source.Where(ort => ort.security_md.HasValue).Select(ort => ort.security_md.Value))
+ bbo = new BBOVM(order_source.Where(ort => ort.security_md.HasValue).Select(ort => ort.security_md.Value)),
+ Observable.Merge(_price_dirty, _size_dirty, _account_dirty, _time_in_force_dirty, _order_type_dirty)
+ .ObserveOnDispatcher().Subscribe(_ => RaisePropertyChanged(nameof(dirty_items_text)))
);
modify_order = new DelegateCommand(() => {
if (key.HasValue) {
@@ -37,23 +52,54 @@ namespace mbts.spark {
}
} else if (size_valid) {
model.update_order_size(key.Value, size_calculator.value.Value).ignore();
- } else return;
+ } else {
+ size_calculator.flash_error();
+ flash_error(nameof(price)).ignore();
+ return;
+ }
+ RequestClose?.Invoke(this, new EventArgs());
+ }
+ });
+ cancel_order = new DelegateCommand(() => {
+ if (key.HasValue) {
+ model.cancel_order(key.Value).ignore();
+ RequestClose?.Invoke(this, new EventArgs());
}
});
}
- public double current_price => _current_price.Value;
- public uint current_size => _current_size.Value;
+ public event EventHandler RequestClose;
+
+ public override double? current_price => _current_price.Value;
+ public override uint? current_size => _current_size.Value;
+ public string current_account => _current_account.Value;
+ public TimeInForce current_time_in_force => _current_time_in_force.Value;
+ public CustomOrderDefinition.CustomOneofCase current_order_type => _current_order_type.Value;
+ public override bool? price_dirty => _price_dirty.Value;
+ public override bool? size_dirty => _size_dirty.Value;
+ public override bool? account_dirty => _account_dirty.Value;
+ public override bool? time_in_force_dirty => _time_in_force_dirty.Value;
+ public override bool? order_type_dirty => _order_type_dirty.Value;
+ public string dirty_items_text => string.Join(", ", _dirty_items());
public BBOVM bbo { get; }
public ICommand modify_order { get; }
public ICommand cancel_order { get; }
- (bool price_valid, bool size_valid) _validate_input() {
- bool pv = _price_valid(), sv = _size_valid();
- if (!pv) flash_error(nameof(price)).ignore();
- if (!sv) size_calculator.flash_value_error().ignore();
- return (pv, sv);
+ IEnumerable _dirty_items() {
+ if (_price_dirty.Value) yield return "price";
+ if (_size_dirty.Value) yield return "size";
+ if (_account_dirty.Value) yield return "account";
+ if (_time_in_force_dirty.Value) yield return "tif";
+ if (_order_type_dirty.Value) yield return "type";
}
+ protected override void _on_price_changed(double value) => _price_dirty.refresh();
+ protected override void _on_size_changed(uint? value) => _size_dirty.refresh();
+ protected override void _on_selected_account_changed(string value) => _account_dirty.refresh();
+ protected override void _on_selected_time_in_force_changed(TimeInForce value) => _time_in_force_dirty.refresh();
+ protected override void _on_selected_order_type_changed(IOrderTypeDefVM value) => _order_type_dirty.refresh();
+
+ (bool price_valid, bool size_valid) _validate_input() =>
+ (_price_valid(), _size_valid());
bool _price_valid() =>
!double.IsNaN(price) && price != 0;
@@ -61,4 +107,4 @@ namespace mbts.spark {
bool _size_valid() =>
size_calculator.value.HasValue && size_calculator.value.Value != 0;
}
-}
+}
\ No newline at end of file
diff --git a/src/client/spark/view/Spark/Orders/NewOrderTicketVM.cs b/src/client/spark/view/Spark/Orders/NewOrderTicketVM.cs
index ec27bee0e..91cb40fd4 100644
--- a/src/client/spark/view/Spark/Orders/NewOrderTicketVM.cs
+++ b/src/client/spark/view/Spark/Orders/NewOrderTicketVM.cs
@@ -5,17 +5,31 @@ using System.Reactive.Linq;
using System.Windows.Input;
namespace mbts.spark {
- class NewOrderTicketVM : OrderPropertiesEditorVM {
+ class NewOrderTicketVM : OrderPropertiesEditorVM, IRequestViewClose {
public NewOrderTicketVM(OrdersModel model, SecurityMD security_md, IObservable settings)
: base(model, Observable.Return(security_md.security), settings) {
bbo = new BBOVM(Observable.Return(security_md));
send_order = new DelegateCommand(side => {
- if (DoubleHelper.IsNaNOrInfinityOr(price, 0)) flash_error(nameof(price)).ignore();
- else if (!HasErrors) model.send_order(create(side), price, size_calculator.value.Value).ignore();
+ _validate_selected_account();
+ _validate_selected_time_in_force();
+ _validate_selected_order_type();
+ _validate_price();
+ size_calculator.validate();
+ if (!HasErrors && !size_calculator.HasErrors) {
+ model.send_order(create(side), price, size_calculator.value.Value).ignore();
+ RequestClose?.Invoke(this, new EventArgs());
+ }
});
}
+ public event EventHandler RequestClose;
+
public BBOVM bbo { get; }
public ICommand send_order { get; }
+
+ void _validate_price() {
+ using (validation(nameof(price)))
+ validation_assert(!DoubleHelper.IsNaNOrInfinityOr(price, 0), string.Empty, nameof(price));
+ }
}
}
\ No newline at end of file
diff --git a/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml b/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml
index 1a1aed736..54f3b0a63 100644
--- a/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml
+++ b/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml
@@ -1,7 +1,7 @@
-
+
+
+
@@ -58,9 +77,15 @@
-
+
-
+
@@ -69,13 +94,13 @@
-
@@ -105,7 +138,10 @@
-
+
@@ -118,9 +154,27 @@
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml.cs b/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml.cs
index 5d74f45c4..936d18b0b 100644
--- a/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml.cs
+++ b/src/client/spark/view/Spark/Orders/OrderModificationControl.xaml.cs
@@ -1,22 +1,21 @@
-using bts.spark;
-using mbts.spark;
+using mbts.spark;
using System.Windows;
using System.Windows.Controls;
-namespace mbts.ui.spark
-{
+namespace mbts.ui.spark {
///
/// Interaction logic for OrderModificationControl.xaml
///
- public partial class OrderModificationControl : UserControl
- {
- public OrderModificationControl() {
+ public partial class OrderModificationControl : UserControl {
+ public static readonly DependencyProperty IsDirtyProperty = DependencyProperty.RegisterAttached("IsDirty", typeof(bool?), typeof(OrderModificationControl), new PropertyMetadata(null));
+ public static bool? GetIsDirty(DependencyObject d) => d.GetValue(IsDirtyProperty) as bool?;
+ public static void SetIsDirty(DependencyObject d, bool? value) => d.SetValue(IsDirtyProperty, value);
+
+ public OrderModificationControl() =>
InitializeComponent();
- }
}
- internal class OrderModificationTemplateSelector : DataTemplateSelector
- {
+ class OrderModificationTemplateSelector : DataTemplateSelector {
public DataTemplate StopLimitOrderTemplate { get; set; }
public DataTemplate StopMarketOrderTemplate { get; set; }
public DataTemplate IcebergOrderTemplate { get; set; }
@@ -36,4 +35,4 @@ namespace mbts.ui.spark
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/client/spark/view/Spark/Orders/OrderModificationDialog.xaml b/src/client/spark/view/Spark/Orders/OrderModificationDialog.xaml
index dafe68503..8eb38d319 100644
--- a/src/client/spark/view/Spark/Orders/OrderModificationDialog.xaml
+++ b/src/client/spark/view/Spark/Orders/OrderModificationDialog.xaml
@@ -1,9 +1,10 @@
8.0
4.0
22.0
+
+
+
@@ -29,11 +33,30 @@
-
-
+
+
Cancel Order
- Modify
+
+
+
+
+
+
+ Modify
+
+
+
diff --git a/src/client/spark/view/Spark/Orders/OrderPropertiesEditorVM.cs b/src/client/spark/view/Spark/Orders/OrderPropertiesEditorVM.cs
index cb0389750..b54610cee 100644
--- a/src/client/spark/view/Spark/Orders/OrderPropertiesEditorVM.cs
+++ b/src/client/spark/view/Spark/Orders/OrderPropertiesEditorVM.cs
@@ -32,19 +32,21 @@ namespace mbts.spark {
readonly OrdersModel _model;
readonly ObservableCollection _order_types_model =
new ObservableCollection(EnumHelper.get_values_except(CustomOrderDefinition.CustomOneofCase.None));
+ double _price = double.NaN;
+ string _selected_account;
+ TimeInForce _selected_time_in_force = TimeInForce.Undefined;
IOrderTypeDefVM _selected_order_type;
- TimeInForce _selected_time_in_force;
protected OrderPropertiesEditorVM(OrdersModel model, IObservable security_source, IObservable settings)
: this(model, security_source, settings.Select(s => new InlineOrderProperties(
time_in_force:new InlineUserProperty(s.default_time_in_force, true),
- order_type_def:new InlineUserProperty(model.factory.custom_order(s.default_order_type), true))
- ), settings.Select(s => s.calculator_buttons)) { }
+ order_type_def:new InlineUserProperty(model.factory.custom_order(s.default_order_type), true),
+ account:new InlineUserProperty(model.factory.default_account)
+ )), settings.Select(s => s.calculator_buttons)) { }
protected OrderPropertiesEditorVM(OrdersModel model, IObservable security_source, IObservable order_properties, IObservable calcuator_buttons) {
_model = model;
accounts = model.factory.accounts;
- selected_account = accounts[0];
order_types = OrderTypeDefVMFactory.get_collection(model, _order_types_model, _on_order_type_is_ready_changed);
set_price_command = new DelegateCommand(p => {
price = p;
@@ -53,6 +55,7 @@ namespace mbts.spark {
InlineOrderProperties props = new InlineOrderProperties();
_dispose = Disposable.Create(
size_calculator = new CalculatorLogic(0, calcuator_buttons),
+ size_calculator.value_observable.ObserveOnDispatcher().Subscribe(_on_size_changed),
security_source.ObserveOnDispatcher().Subscribe(s => {
using (detect_property_changes()) {
security = s;
@@ -116,23 +119,32 @@ namespace mbts.spark {
public event Action security_changed;
public SecurityImmutable security { get; private set; } = SecurityDataHelper.Defaults.SecurityImmutable;
- public double price { get; set; } = double.NaN;
+ public double price { get => _price; set { _on_price_changed(_price = value); } }
public CalculatorLogic size_calculator { get; }
public string[] accounts { get; }
- public string selected_account { get; set; }
+ public string selected_account { get => _selected_account; set => _on_selected_account_changed(_selected_account = value); }
public ObservableCollection time_in_forces { get; } = new ObservableCollection();
- public TimeInForce selected_time_in_force { get => _selected_time_in_force; set { _selected_time_in_force = value; _validate_selected_time_in_force(); } }
+ public TimeInForce selected_time_in_force { get => _selected_time_in_force; set { _on_selected_time_in_force_changed(_selected_time_in_force = value); _validate_selected_time_in_force(); } }
public ObservableAutoWrapper order_types { get; }
public IOrderTypeDefVM selected_order_type {
get => _selected_order_type;
set {
if ((value is ILazyOrderTypeDefVM lvm) && !lvm.is_initialized)
lvm.initialize();
- _selected_order_type = value;
+ _on_selected_order_type_changed(_selected_order_type = value);
_validate_selected_order_type();
}
}
public ICommand set_price_command { get; }
+ // these virtual properties avoid binding errors for properties that only apply to the modify ticket.
+ // writing different templates for each ticket, while a better solution in theory, would be way more code/work than it's worth.
+ public virtual double? current_price => null;
+ public virtual uint? current_size => null;
+ public virtual bool? price_dirty => null;
+ public virtual bool? size_dirty => null;
+ public virtual bool? account_dirty => null;
+ public virtual bool? time_in_force_dirty => null;
+ public virtual bool? order_type_dirty => null;
protected OrderDefinition create(Side side) {
if (HasErrors) throw new InvalidOperationException("Cannot create order when errors are present.");
@@ -144,12 +156,23 @@ namespace mbts.spark {
return order;
}
- void _validate_selected_time_in_force() {
+ protected virtual void _on_price_changed(double value) { }
+ protected virtual void _on_size_changed(uint? value) { }
+ protected virtual void _on_selected_account_changed(string value) { }
+ protected virtual void _on_selected_time_in_force_changed(TimeInForce value) { }
+ protected virtual void _on_selected_order_type_changed(IOrderTypeDefVM value) { }
+
+ protected void _validate_selected_account() {
+ using (validation(nameof(selected_account)))
+ validation_assert(selected_account != null && accounts.Contains(selected_account), string.Empty, nameof(selected_account));
+ }
+
+ protected void _validate_selected_time_in_force() {
using (validation(nameof(selected_time_in_force)))
validation_assert(time_in_forces.Contains(selected_time_in_force), string.Empty, nameof(selected_time_in_force));
}
- void _validate_selected_order_type() {
+ protected void _validate_selected_order_type() {
using (validation(nameof(selected_order_type))) {
var svm = _selected_order_type as ISecurityOrderTypeDefVM;
validation_assert(
@@ -163,5 +186,5 @@ namespace mbts.spark {
if (sender == _selected_order_type)
_validate_selected_order_type();
}
- }
+ }
}
\ No newline at end of file
diff --git a/src/client/spark/view/Spark/Shell/CalculatorLogic.cs b/src/client/spark/view/Spark/Shell/CalculatorLogic.cs
index eeb9191c6..3494ec5f0 100644
--- a/src/client/spark/view/Spark/Shell/CalculatorLogic.cs
+++ b/src/client/spark/view/Spark/Shell/CalculatorLogic.cs
@@ -1,45 +1,52 @@
using mbts.ui;
using mbts.ui.shell;
using System;
-using System.Threading.Tasks;
+using System.Reactive.Linq;
using System.Windows.Input;
namespace mbts.spark {
public class CalculatorLogic : DisposableViewModelBase {
+ readonly Property _value;
+ readonly Property _buttons;
+
public CalculatorLogic(uint? initial_size, IObservable buttons_source) {
- _size = backing(nameof(value), initial_size);
+ _value = backing(nameof(value), initial_size);
_buttons = backing(nameof(buttons), buttons_source);
}
- Property _size;
- public uint? value { get => _size.Value; set => _size.set(value); }
- Property _buttons;
+ public uint? value { get => _value.Value; set => _value.set(value); }
+ public IObservable value_observable => _value.Select(vals => vals.newval);
public int[] buttons { get => _buttons.Value; set => _buttons.set(value); }
public ICommand click => new DelegateCommand(handle_calculator_click);
- public ICommand set_value_command => new DelegateCommand(v => _size.Value = v);
- public ICommand clear => new DelegateCommand(() => _size.Value = null);
+ public ICommand set_value_command => new DelegateCommand(v => _value.Value = v);
+ public ICommand clear => new DelegateCommand(() => _value.Value = null);
- public async Task flash_value_error() =>
- await flash_error(nameof(value));
+ public void validate() {
+ using (validation(nameof(value)))
+ validation_assert(value.HasValue && value.Value != 0, string.Empty, nameof(value));
+ }
- private void handle_calculator_click(uint value) {
+ public void flash_error() =>
+ flash_error(nameof(value)).ignore();
+
+ void handle_calculator_click(uint value) {
if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift) || value == 0) {
- _size.Value = value;
+ _value.Value = value;
} else if (KeyboardExtensions.IsCtrlDown()) {
- if (!_size.Value.HasValue)
- _size.Value = 0;
+ if (!_value.Value.HasValue)
+ _value.Value = 0;
else {
- if (value > _size.Value)
- _size.Value = 0;
+ if (value > _value.Value)
+ _value.Value = 0;
else
- _size.Value -= value;
+ _value.Value -= value;
}
}
else {
- if (!_size.Value.HasValue)
- _size.Value = value;
+ if (!_value.Value.HasValue)
+ _value.Value = value;
else
- _size.Value += value;
+ _value.Value += value;
}
}
}
diff --git a/src/client/spark/view/Spark/Utilities/OrderDataHelper.cs b/src/client/spark/view/Spark/Utilities/OrderDataHelper.cs
index 20671376d..43677214a 100644
--- a/src/client/spark/view/Spark/Utilities/OrderDataHelper.cs
+++ b/src/client/spark/view/Spark/Utilities/OrderDataHelper.cs
@@ -36,10 +36,11 @@ namespace mbts.spark.utilities {
users = new HashSet(accounts) { _login }.Ordered().ToLArray();
}
+ #region Defaults
+ public string default_account => accounts[0];
public string[] accounts { get; } = new[] { "BTS1", "BTS2", "BTS3", "BTS4" };
public string[] users { get; }
- #region Defaults
public CustomOrderDefinition.CustomOneofCase default_order_type() =>
CustomOrderDefinition.CustomOneofCase.Limit;