WorkbenchDataEditor
allows for manipulation of the subscriber data (for example, pricing)
via a caplin.services.messaging.Subscription. Generally for workbenches,
this is achieved via a caplin.services.testing.SubscriptionStub, for example:
var oDataSubscriber = new caplin.services.testing.SubscriptionStub("GBPUSD"); var oMessageService = { createSubscriber: function(sSubject) { return oDataSubscriber; } }; caplin.core.ServiceRegistry.registerService("caplin.message-service", oMessageService); var oPriceDataEditor = new caplin.workbench.ui.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.
Attributes | Name and Description |
---|---|
|
caplin.workbench.ui.WorkbenchDataEditor(caplin.services.messaging.Subscription oDataSubscriber, int nAutoGenerateIntervalMillis)
|
Attributes | Name and Description |
---|---|
|
void
addDataGenerator(caplin.workbench.model.DataGenerator oDataGenerator)
Adds a data generator that will be used to generate updates for this class. |
►
caplin.workbench.ui.WorkbenchDataEditor(caplin.services.messaging.Subscription oDataSubscriber, int nAutoGenerateIntervalMillis)
caplin.services.messaging.Subscription | oDataSubscriber | The data subscriber to add. |
int | nAutoGenerateIntervalMillis | The interval which will be used to generate data updates. |
►
void
addDataGenerator(caplin.workbench.model.DataGenerator oDataGenerator)
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).
caplin.workbench.model.DataGenerator | oDataGenerator | The generator to add. |