Skip to content

getDatasource

Alexius Wadell edited this page Jan 10, 2017 · 1 revision

Syntax

datasource = dm.getDatasource()

datasource = dm.getDatasource(Name, Value)

datasource = dm.getDatasource(Name, Value, Name2, Value2, ...)

Description

datasource = dm.getDatasource() Returns an array of all datasource objects stored in the datastore


datasource = dm.getDatasource(Name, Value) Returns an array of all datasource objects stored in the datastore that meet the search criteria


datasource = dm.getDatasource(Name, Value, Name2, Value2, ...) Multiple search criteria can be specified by passing multiple Name-Value pairs one after another

Examples

Search By Details

Filter Datasource to only include ones where a given detail field was recorded with the given value. Note: At present only String (Not Numeric) details are supported.

To Return all datasource where the Venue Field was set to Groton use the following Code:

dm = Datamaster;
ds = dm.getDatasource('Venue', 'Groton')

To see a list of Details Fields that can be searched for use:

dm = Datamaster;
dm.allLogged('detail')

Search By Channel

To Return only datasource where a given channel was logged use:

dm = Datamaster;
ds = dm.getDatamsource('channel', 'Engine_RPM')

Multiple Channels can be searched for by passing a cell array of channel names instead

dm = Datamaster;
ds = dm.getDatasource('channel', {'Engine_RPM', 'Engine_Torque'})

To see a list of all channels that can be searched for use:

dm = Datamaster;
dm.allLogged;

Search by Date

Use StartDate to search for datasource occurring after the specified datetime.

dm = Datamaster;
ds = dm.getDatasource('StartDate', '2015-01-01')

Use EndDate to search for datasource occurring before the specified datetime.

dm = Datamaster;
ds = dm.getDatasource('EndDate', '2016-01-01')

Both StartDate and EndDate can be specified to search for datasource occurring after StartDate and before EndDate, exclusively.

dm = Datamaster;
ds = dm.getDatasource('StartDate', '2015-01-01', 'EndDate', '2016-01-01')

Datetime Format

The StartDate and EndDate can be specified using any of the following formats:

  • YYYY-MM-DD
  • YYYY-MM-DD HH:MM
  • YYYY-MM-DD HH:MM:SS