new module:ct-workbench /ui /Workbench Data Editor(oData Subscriber, nAuto Generate Interval Millis)
A WorkbenchDataEditor
allows for manipulation of the subscriber data (for example, pricing)
via a module:ct-services/messaging/Subscription
. Generally for workbenches,
this is achieved via a module:ct-services/testing/SubscriptionStub
, for example:
var oDataSubscriber = new caplin.services.testing.SubscriptionStub("GBPUSD"); var oMessageService = { createSubscriber: function(sSubject) { return oDataSubscriber; } }; ServiceRegistry.registerService("caplin.message-service", oMessageService); var oPriceDataEditor = new WorkbenchDataEditor(oDataSubscriber, 2000); oPriceDataEditor.addFieldsByExample({"Bid":"1.1111", "Ask":"1.1112"});
The WorkbenchDataEditor
also supports randomly generated updates
of data, which is useful for testing price updates.
Extends:
Parameters:
Name | Type | Description |
---|---|---|
oDataSubscriber |
module:ct-services |
The data subscriber to add. |
nAutoGenerateIntervalMillis |
int | The interval which will be used to generate data updates. |
Extends
Methods
add Data Generator(oData Generator)
Adds a data generator that will be used to generate updates for this class. Note that the generate method will be called at a rate of nAutoGenerateIntervalMillis (as specified in the constructor).
Parameters:
Name | Type | Description |
---|---|---|
oDataGenerator |
module:ct-workbench |
The generator to add. |
get Element()
- Overrides:
- Implements:
Returns:
the top level element
get Presentation Model()
Returns the presentation model used for the QuckForm
.
- Inherited From:
Returns:
The presentation model for the QuickForm