Account
BdsApi 4.0.1 This is the Blacknest BDS API. |
This is the DataAdd Access API interface. More...
#include <BdsC.h>

Public Member Functions | |
DataAddAccess (BString name="") | |
BDS RPC access class. | |
BError | connect (BString user, BString password) |
Provides user/password information. | |
BError | validateUser (BString user, BString email) |
Checks the user given name or email. | |
BError | setUser (BString user, BString email) |
Sets user to given name or email. | |
BError | setUserReal () |
Sets user back to real user. | |
BError | getVersion (BString &version, BString &name) |
Gets the software version and server name. | |
BError | userGetFromId (BUInt32 id, User &user) |
Get user info given user ID. | |
BError | userGet (User &user) |
Get user info of the currently loogged in user. | |
BError | userSet (User user) |
Set user info of the currently loogged in user. | |
BError | userGetGroups (BList< BString > &groups) |
Get list of groups the user belongs to. | |
BError | userGetOptions (BDict< BString > &items) |
Get users options. | |
BError | userSetOptions (BDict< BString > &items) |
Set users options. | |
BError | groupGetList (BList< Group > &groups) |
Get list of Groups. | |
BError | networkGetList (BList< Network > &networks) |
Get list of Networks. | |
BError | stationGetList (Selection sel, BList< Station > &stations) |
Get list of Stations. | |
BError | channelGetList (Selection sel, BList< Channel > &channels) |
Get list of Channels. | |
BError | sourceGetList (BList< Source > &sources) |
Get list of Sources. | |
BError | sourcePriorityGetList (BList< SourcePriority > &sourcePrioritys) |
Get list of SourcePriorities. | |
BError | dataFileGetList (Selection sel, BList< DataFileInfo > &dataFile) |
Get list of DataFiles. | |
BError | dataChannelGetList (Selection sel, BList< DataChannel > &dataChannel) |
Get list of DataChannels. | |
BError | channelInstrumentGetList (Selection sel, BList< ChannelInstrument > &channelInstruments) |
Get list of Instruments. | |
BError | digitiserGetList (Selection sel, BList< Digitiser > &digitisers) |
Get list of Channels. | |
BError | digitiserGet (BUInt32 id, Digitiser &digitiser) |
Get a Digitiser object given its ID. | |
BError | sensorGetList (Selection sel, BList< Sensor > &sensors) |
Get list of Sensors. | |
BError | sensorGet (BUInt32 id, Sensor &sensor) |
Get a Sensor object given its ID. | |
BError | calibrationGetList (Selection sel, BList< Calibration > &calibrations) |
Get list of Calibrations. | |
BError | responseGetList (Selection sel, BList< Response > &responses) |
Get list of Responses. | |
BError | locationGetList (Selection sel, BList< Location > &locations) |
Get list of Station, Channel or both Locations depending on the sel.locationSelect parameter. | |
BError | eventGetList (Selection sel, BList< Event > &events) |
Get list of Events. | |
BError | eventUpdate (BInt32 append, Event event, BUInt32 &id) |
Add or update a Event entry. | |
BError | eventDelete (BUInt32 id) |
Delete a Event entry. | |
BError | specialChannelGetList (Selection sel, BList< SpecialChannel > &specialChannels) |
Get list of Special Channels. | |
BError | metadataGetChannelInfo (Selection sel, MetadataOption options, ChannelInfos &channelInfos) |
Return the channel MetaData in structured form. Normally returns an error if incomplete metadata. If option AllowIncomplete is set will return partial Metadata with ErrorWarning. | |
BError | metadataGetFormatted (Selection sel, MetadataOption options, BString format, BArray< BUInt8 > &data) |
Return the channel MetaData in a particular format. Normally returns an error if incomplete metadata. If option AllowIncomplete is set will return partial Metadata with ErrorWarning. | |
BError | getSelectionInfo (SelectionGroup group, Selection selectionIn, SelectionInfo &selectionInfo) |
Get information on possible selections. Use in GUI programs to list options available. | |
BError | getSelections (SelectionGroup group, Selection selectionIn, Selection &selectionOut) |
Get selection list. | |
BError | dataAvailability (Selection selection, BUInt32 num, BArray< DataAvailChan > &dataAvailChans) |
Return availability for data matching the given selection parameters. If num > 0 segment ito this number of fixed time segments. | |
BError | dataSearch (Selection selection, DataInfo &dataInfo) |
Search for data matching the given selection parameters. | |
BError | dataGetChannelInfo (DataInfo dataInfo, ChannelInfos &channelInfos) |
Return the channel MetaData in structured form. | |
BError | dataOpen (DataInfo dataInfo, BString mode, BString format, BUInt32 flags, DataHandle &dataHandle) |
Open a data file. | |
BError | dataGetInfo (DataHandle dataHandle, BUInt32 infoExtra, DataInfo &dataInfo) |
Get information on the data file. | |
BError | dataGetNotes (DataHandle dataHandle, BList< Note > ¬es) |
Get notes on the data file. | |
BError | dataGetWarnings (DataHandle dataHandle, BList< BString > &warnings) |
Get information on the data file. | |
BError | dataSeekBlock (DataHandle dataHandle, BUInt32 channel, BUInt32 segment, BTimeStamp time, BUInt32 &blockNumber) |
Searches for a data block matching the time given. | |
BError | dataGetBlock (DataHandle dataHandle, BUInt32 channel, BUInt32 segment, BUInt32 blockNumber, DataBlock &data) |
Return a block of data. | |
BError | dataSetInfo (DataHandle dataHandle, DataInfo dataInfo) |
Set the info when writing to a file. | |
BError | dataPutBlock (DataHandle dataHandle, DataBlock data) |
Send a block of data. | |
BError | dataClose (DataHandle dataHandle, BError error, BInt32 del) |
Close a file. | |
BError | dataFormattedRead (DataHandle dataHandle, BUInt32 number, BArray< BUInt8 > &data) |
Read the raw data from the stream. | |
BError | dataFormattedGetLength (DataHandle dataHandle, BUInt64 &length) |
The total length in bytes of the formated data. | |
BError | dataRealtimeConfig (BInt32 enable, Selection sel) |
Configures the sending of real-time data blocks. | |
BError | dataRealtimeGet (BUInt32 numBlocks, BUInt32 &numBlocksAvailable, BList< DataBlockChannel > &dataBlocks) |
Returns the number of data blocks available and up to numBlocks of these. | |
BError | noteGetList (Selection sel, BList< Note > ¬es) |
Return a list of Notes. | |
BError | noteUpdate (BInt32 append, Note note, BUInt32 &id) |
Add or update a Note. | |
BError | noteWriteDocument (BUInt32 id, BString format, BArray< BUInt8 > data) |
Given a Note write a document associated with it. | |
BError | noteReadDocument (BUInt32 id, BString &format, BArray< BUInt8 > &data) |
Read a document associated with a Note. | |
BError | noticesAdd (BString notice) |
Add a notice line. | |
BError | noticesGetList (BList< BString > ¬ices) |
Get notices list. | |
BError | noticesClear () |
Clear notices list. | |
BError | logUpdate (BInt32 append, Log log, BUInt32 &id) |
Append a log item ///< Add or update a Log item. | |
BError | logAppend (BString type, BUInt32 priority, BString subSystem, BString title, BString description) |
Append a log item. | |
BError | modeSet (Mode mode, Mode &previousMode) |
Changes the system mode from Master to slave. | |
BError | modeSnapshotPause (BInt32 on) |
Enables/disables backup synchronisation pause. | |
BError | clean (CleanOptions cleanOptions) |
Cleans the system logs and Changes information. | |
BError | databaseBackup (BString &ref) |
Backup the database. | |
BError | statisticsGet (BDict< BString > &info) |
Get a list of system statistics. | |
BError | serverConfigurationGet (BDict< BString > &items) |
Get server configuration parameters. | |
BError | dataFormatGetList (BList< DataFormat > &formats) |
Get list of data formats. | |
![]() | |
BoapClientObject (BString name="") | |
virtual | ~BoapClientObject () |
BUInt32 | apiVersion () |
BError | connectService (BString name) |
BError | disconnectService () |
BString | getServiceName () |
BError | ping (BUInt32 &apiVersion) |
BError | setConnectionPriority (BoapPriority priority) |
void | setMaxLength (BUInt32 maxLength) |
void | setTimeout (int timeout) |
BoapClientObject (BString name) | |
BError | connectService (BString name) |
![]() | |
BSocket () | |
BSocket (int fd) | |
BSocket (NType type) | |
BSocket (int domain, int type, int protocol) | |
~BSocket () | |
BError | init (int domain, int type, int protocol) |
BError | init (NType type) |
void | setFd (int fd) |
int | getFd () |
BError | bind (const BSocketAddress &add) |
BError | connect (const BSocketAddress &add) |
BError | shutdown (int how) |
BError | close () |
BError | listen (int backlog=5) |
BError | accept (int &fd) |
BError | accept (int &fd, BSocketAddress &address) |
BError | send (const void *buf, BSize nbytes, BSize &nbytesSent, int flags=0) |
BError | sendTo (const BSocketAddress &address, const void *buf, BSize nbytes, BSize &nbytesSent, int flags=0) |
BError | sendChunks (const BDataChunk *chunks, BSize nChunks, BSize &nbytesSent, int flags=0) |
BError | recv (void *buf, BSize maxbytes, BSize &nbytesRecv, int flags=0) |
BError | recvFrom (BSocketAddress &address, void *buf, BSize maxbytes, BSize &nbytesRecv, int flags=0) |
BError | recvWithTimeout (void *buf, BSize maxbytes, BSize &nbytesRecv, int timeout, int flags=0) |
BError | recvFromWithTimeout (BSocketAddress &address, void *buf, BSize maxbytes, BSize &nbytesRecv, int timeout, int flags=0) |
BUInt | recvAvailable () |
BError | setSockOpt (int level, int optname, void *optval, unsigned int optlen) |
BError | getSockOpt (int level, int optname, void *optval, unsigned int *optlen) |
BError | setReuseAddress (int on) |
BError | setBroadCast (int on) |
BError | setPriority (Priority priority) |
BError | getMTU (uint32_t &mtu) |
BError | getAddress (BSocketAddress &address) |
Additional Inherited Members | |
![]() | |
enum | NType |
enum | Priority |
![]() | |
STREAM | |
DGRAM | |
PriorityLow | |
PriorityNormal | |
PriorityHigh | |
![]() | |
BError | pingLocked (BUInt32 &apiVersion) |
BError | checkApiVersion () |
BError | performCall (BoapPacket &tx, BoapPacket &rx) |
BError | performSend (BoapPacket &tx) |
BError | performRecv (BoapPacket &rx) |
virtual BError | handleReconnect (BError err) |
BError | performSend (BoapPacket &tx) |
BError | performRecv (BoapPacket &rx) |
BError | performCall (BoapPacket &tx, BoapPacket &rx) |
![]() | |
BString | oname |
BUInt32 | oapiVersion |
BoapPriority | opriority |
BoapService | oservice |
int | oconnected |
BUInt32 | omaxLength |
BoapPacket | otx |
BoapPacket | orx |
BMutex | olock |
int | otimeout |
int | oreconnect |
Detailed Description
This is the DataAdd Access API interface.
This object provides the set of API functions that make RPC network calls to a BdsServer. It provides the basic and restricted user orientated read only, data access API along with the ability to import data. It will normally be used by data import client programs.
To use this BdsServer access object you would create one like "DataAccess bds;". Then you would connect it to a particular BdsServer running on a particular host using the connectService(in String) function. Once connected you need to login to the BdsServer as a particular user using the connect(in String user, in String password). After your have successfully logged in you can use the various objects methods. These result in a remote procedure call (RPC) to the BdsServer which Will imlement the function and return any data and normally an errors status (BError).
Constructor & Destructor Documentation
◆ DataAddAccess()
Bds::DataAddAccess::DataAddAccess | ( | BString | name = "" | ) |
BDS RPC access class.
- Parameters
-
name The URL of the remote BOAP object name to connect to.
This object constructor takes the name of the remote object to connect to. However this is normally passed as "" as the connectService() function is normally used to perform the actual remote connection.
Member Function Documentation
◆ connect()
Provides user/password information.
Python: (BError err) = connect(PythonStr user, PythonStr password);
◆ validateUser()
Checks the user given name or email.
Python: (BError err) = validateUser(PythonStr user, PythonStr email);
- Parameters
-
user The user's name email The users email address
Checks to see if the user as named exsists or if just the email address is provided, if any user with that email address exists.
◆ setUser()
Sets user to given name or email.
Python: (BError err) = setUser(PythonStr user, PythonStr email);
- Parameters
-
user The user's name email The users email address
Changes the connection to be logged in as the given user by their user name or email address. This function will only be allowed if the current user is in the userSet group. The bdsAutodrm user normally has this set so it can change the BdsServer's connection to be that of the BdsAutodrm user for example.
◆ setUserReal()
DataAddAccess::setUserReal | ( | ) |
Sets user back to real user.
Python: (BError err) = setUserReal();
◆ getVersion()
Gets the software version and server name.
Python: (BError err, PythonStr version, PythonStr name) = getVersion();
◆ userGetFromId()
◆ userGet()
DataAddAccess::userGet | ( | User & | user | ) |
◆ userSet()
DataAddAccess::userSet | ( | User | user | ) |
Set user info of the currently loogged in user.
Python: (BError err) = userSet(User user);
◆ userGetGroups()
Get list of groups the user belongs to.
Python: (BError err, BList<BString > groups) = userGetGroups();
◆ userGetOptions()
Get users options.
Python: (BError err, BDict<BString > items) = userGetOptions();
◆ userSetOptions()
Set users options.
Python: (BError err, BDict<BString > items) = userSetOptions();
◆ groupGetList()
Get list of Groups.
Python: (BError err, BList<Group > groups) = groupGetList();
◆ networkGetList()
Get list of Networks.
Python: (BError err, BList<Network > networks) = networkGetList();
◆ stationGetList()
◆ channelGetList()
Get list of Channels.
Python: (BError err, BList<Channel > channels) = channelGetList(Selection sel);
If the selection.channelId is set to a value other than 0, this will return a list of one Channel which matches that id. Otherwise it will return a list of Channels matchin the Network:Station:Channel regular expression fields of the selection.
◆ sourceGetList()
Get list of Sources.
Python: (BError err, BList<Source > sources) = sourceGetList();
◆ sourcePriorityGetList()
DataAddAccess::sourcePriorityGetList | ( | BList< SourcePriority > & | sourcePrioritys | ) |
Get list of SourcePriorities.
Python: (BError err, BList<SourcePriority > sourcePrioritys) = sourcePriorityGetList();
◆ dataFileGetList()
BError Bds::DataAddAccess::dataFileGetList | ( | Selection | sel, |
BList< DataFileInfo > & | dataFile | ||
) |
Get list of DataFiles.
Python: (BError err, BList<DataFileInfo > dataFile) = dataFileGetList(Selection sel);
- Parameters
-
sel Channels selection dataFiles The returned DataFiles
If sel.id is set, then returns the single DataFile matching this id. Otherwise uses the Selection's Network:Station:Channel:Source fields to select a list of DataFiles.
◆ dataChannelGetList()
BError Bds::DataAddAccess::dataChannelGetList | ( | Selection | sel, |
BList< DataChannel > & | dataChannel | ||
) |
Get list of DataChannels.
Python: (BError err, BList<DataChannel > dataChannel) = dataChannelGetList(Selection sel);
- Parameters
-
sel Channels selection dataChannels The returned DataChannel
Uses the Selection's Network:Station:Channel:Source fields to select a list of DataChannels.
◆ channelInstrumentGetList()
BError Bds::DataAddAccess::channelInstrumentGetList | ( | Selection | sel, |
BList< ChannelInstrument > & | channelInstruments | ||
) |
Get list of Instruments.
Python: (BError err, BList<ChannelInstrument > channelInstruments) = channelInstrumentGetList(Selection sel);
- Parameters
-
sel The Selection channelInstruments The list of ChannelInstruments matching the Selection.
This uses the Network:Station:Channel:Source fields of the Selection to return a list of matching Channel Instruments.
◆ digitiserGetList()
◆ digitiserGet()
◆ sensorGetList()
◆ sensorGet()
◆ calibrationGetList()
DataAddAccess::calibrationGetList | ( | Selection | sel, |
BList< Calibration > & | calibrations | ||
) |
Get list of Calibrations.
Python: (BError err, BList<Calibration > calibrations) = calibrationGetList(Selection sel);
◆ responseGetList()
◆ locationGetList()
Get list of Station, Channel or both Locations depending on the sel.locationSelect parameter.
Python: (BError err, BList<Location > locations) = locationGetList(Selection sel);
This uses the Network:Station and optionaly the Channel parts of the Selection object to return a list of matching Stations. The Selection.locationSelect parameter can be set to LocationSelectAll, LocationSelectStation or LocationSelectChannel. If set to LocationSelectStation will return the locations of the Stations matched. If set to LocationSelectChannel will return the locations of the Channels matched. If set to LocationSelectAll (The default) will return the locations of the Channels matched if they have Locations or otherwise that of the Stations.
◆ eventGetList()
Get list of Events.
Python: (BError err, BList<Event > events) = eventGetList(Selection sel);
If sel.id or sel.eventId is set then return the Event with this ID. Otherwise if sel.name is set return an Event with a title matching this regular expression between sel.startTime and sel.endTime.. Otherwise match any events between sel.startTime and sel.endTime.
◆ eventUpdate()
◆ eventDelete()
DataAddAccess::eventDelete | ( | BUInt32 | id | ) |
◆ specialChannelGetList()
BError Bds::DataAddAccess::specialChannelGetList | ( | Selection | sel, |
BList< SpecialChannel > & | specialChannels | ||
) |
◆ metadataGetChannelInfo()
BError Bds::DataAddAccess::metadataGetChannelInfo | ( | Selection | sel, |
MetadataOption | options, | ||
ChannelInfos & | channelInfos | ||
) |
Return the channel MetaData in structured form. Normally returns an error if incomplete metadata. If option AllowIncomplete is set will return partial Metadata with ErrorWarning.
Python: (BError err, ChannelInfos channelInfos) = metadataGetChannelInfo(Selection sel, MetadataOption options);
- Parameters
-
sel Channels selection channelInfos Metadata information for the channels
This function is designed to help when exporting data from the BDS. It will attempt to gather all of the Metadata present for the Channels selected. Depending on the dataType of the selected Channels it will check that the expected Metadata is present and if not return an Error. For Channels of dataType "seismic" it will check that the following Metadata information exists: Station, Channel, Location. Calibration, Response, ChannelInstrument. For each of the selected Channels there will be an array of ChannelInfo objects. The BdsServer will segment the Metadata in time periods at each point an of this Metadata is changed. This each ChannelInfo object will return a set of Metadata over a time period that has no change in Metadata. When exporting data it can be time segmented to match this.
◆ metadataGetFormatted()
BError Bds::DataAddAccess::metadataGetFormatted | ( | Selection | sel, |
MetadataOption | options, | ||
BString | format, | ||
BArray< BUInt8 > & | data | ||
) |
Return the channel MetaData in a particular format. Normally returns an error if incomplete metadata. If option AllowIncomplete is set will return partial Metadata with ErrorWarning.
Python: (BError err, BArray<BUInt8 > data) = metadataGetFormatted(Selection sel, MetadataOption options, PythonStr format);
- Parameters
-
sel Channels selection format The requested Metadata output format. This should match a format specified by any of the BDS data convertors. data The raw file data for the format given in bytes.
This function gathers all of the Metadata for the channels matching the Selection and then finds a suitable BDS data format conertor to export this Metadata in the chosen format. The resultion array of Byte data can be written to a suitable file.
◆ getSelectionInfo()
BError Bds::DataAddAccess::getSelectionInfo | ( | SelectionGroup | group, |
Selection | selectionIn, | ||
SelectionInfo & | selectionInfo | ||
) |
Get information on possible selections. Use in GUI programs to list options available.
Python: (BError err, SelectionInfo selectionInfo) = getSelectionInfo(SelectionGroup group, Selection selectionIn);
- Parameters
-
group The type of selection info requested. Can be SelectionGroupData to get selections for Sensor data, SelectionGroupMetaData for Metadata selectrions and SelectionGroupDataWithCount as for SelectionGroupData but alos returns the total number of DataChannels. selectionIn The current selection selectionInfo The returned selection information
Used for selection systems such as that within a Gui to restrict the options available given partial selection parameters. Given a basic Selection returns all of the Selection options available based on the Sensor data or Metadata in the BDS. For example if the selectionIn defines one particular Network and one particular Station, the getSelectionInfo function will return a list of Channels and Sources for that base selection.
◆ getSelections()
BError Bds::DataAddAccess::getSelections | ( | SelectionGroup | group, |
Selection | selectionIn, | ||
Selection & | selectionOut | ||
) |
Get selection list.
Python: (BError err, Selection selectionOut) = getSelections(SelectionGroup group, Selection selectionIn);
- Parameters
-
group The type of selection info requested. Currently ignored. selectionIn The selection which may include regular expressions and Station arrays. selectionOut The full Sensor data selection after regular expressions have been expanded and any Array's exapanded into a list of Stations.
This is used to expand a Sensor data Selection to a full Selection list.
◆ dataAvailability()
BError Bds::DataAddAccess::dataAvailability | ( | Selection | selection, |
BUInt32 | num, | ||
BArray< DataAvailChan > & | dataAvailChans | ||
) |
Return availability for data matching the given selection parameters. If num > 0 segment ito this number of fixed time segments.
Python: (BError err, BArray<DataAvailChan > dataAvailChans) = dataAvailability(Selection selection, PythonInt num);
- Parameters
-
sel The selection information num The number of availability time segments to return. dataAvailChans Information on the availablility of sensor data for the selected channel
This function will return a list of Sensor data availability information for the selected Channels. If num > 0 then it will restrict the number of time segments to that number. The time segments will be linearly spaced in time. If num ==0 then the system will return a data availabliliy segment for each DataChannel continuous segment. This can be slow and return a very large number of segments.
◆ dataSearch()
Search for data matching the given selection parameters.
Python: (BError err, DataInfo dataInfo) = dataSearch(Selection selection);
- Parameters
-
selection Channel Selection information dataInfo Sensor data selection information with data segmented by actual data file segments with extra information if available
This will perform a search for Sensor data matching the Selection. Be careful with the selction as their could be a lot of data matching that will then hit resource limits. There are restrictions on the maximum time range allowed (MaxTimePeriod) and the maximum DataChannel segments returned (MaxNumChannels). The return DataInfo object can be interidated for information on the data, such as sampleRates and/or used in the dataOpen() function for actual access to the Sensor data.
◆ dataGetChannelInfo()
BError Bds::DataAddAccess::dataGetChannelInfo | ( | DataInfo | dataInfo, |
ChannelInfos & | channelInfos | ||
) |
Return the channel MetaData in structured form.
Python: (BError err, ChannelInfos channelInfos) = dataGetChannelInfo(DataInfo dataInfo);
- Parameters
-
dataInfo Data selection channelInfos Metadata information for the channels
This function returns all of the Metadata for the given Channels specified in the dataInfo selection. It uses the metadataGetChannelInfo() function converting the DataInfo selection to a more general Selection first.
◆ dataOpen()
BError Bds::DataAddAccess::dataOpen | ( | DataInfo | dataInfo, |
BString | mode, | ||
BString | format, | ||
BUInt32 | flags, | ||
DataHandle & | dataHandle | ||
) |
Open a data file.
- Parameters
-
[in] dataInfo The sensor data to open selection [in] mode The open format. The mode should be set to "w" for writing data, "a" when appending data and "r" for reading data. [in] format What format to open the data stream as. This can be API for raw BDS API access or one of the supported formats that the BDS is able to convert to. [in] flags A bitset of flags as defined by Bds::DataFlags. [out] dataHandle The handle for the open data set
Python: (BError err, DataHandle dataHandle) = dataOpen(DataInfo dataInfo, PythonStr mode, PythonStr format, PythonInt flags);
- Parameters
-
dataInfo Data selection defining the Sensor data Channels mode The open mode. This can be "r" for read access, "w" for write access and "aday" to append to a day file. format This is the format to use. It can be "API-SM" for multiplexed by sample or "API-CM" for multiplexed by channel. For reads it can also be one of the BDS data convertors supported formats. flags Bit set of DataFlags. Can include: DataFlagClipDataToTime, DataFlagClipDataToChannels, DataFlagMergeSegments and DataFlagNoMetadata dataHandle The returned data handle to access this data set
This function opens a set of Sensor data files in the BdsServer for read, write or append access. When the format is "API-SM" or "API-CM" then the raw data blocks can be accessed using the dataSeekBlock() and dataGetBlock() functions. Note that the "API-SM" format requires the Channels selected to be synchonously sampled and so can only be used for certain import/export data formats where this is the case. The flags are used when reading data. Normaly whole contigous DataBlocks are returned. The actual starttime and endtime of the overall data may thus be before and after the selection. The DataFlagClipDataToTime "clips" the first and last blocks, removing samples, so the time match the actual selection. The DataFlagClipDataToChannels "clips" the blocks so that all of the Channels contain data over the selection period as some Channels otherwise could be missing data for a portion of the Selection. DataFlagMergeSegments mergese data segments that have matching end and start times into one continuous segment. DataFlagNoMetadata ignores Metadata when exporting data.
◆ dataGetInfo()
BError Bds::DataAddAccess::dataGetInfo | ( | DataHandle | dataHandle, |
BUInt32 | infoExtra, | ||
DataInfo & | dataInfo | ||
) |
Get information on the data file.
Python: (BError err, DataInfo dataInfo) = dataGetInfo(DataHandle dataHandle, PythonInt infoExtra);
- Parameters
-
dataHandle The opened data set's handle infoExtra A boolean flag to say to include the extra Metadata containwed within the files dataInfo The resulting fully filled out DataInfo describing the data.
This functions returns fuller, more detailed, information on the Sensor data using Metadata stored within the data files themselves. The BDS data format files can store an extensive amount of Metadata from the various import formats supported. A fair amount of this Metadata is freeform and this is for general information purposes only. The returned sampleRate is the samplerate calculated on the actual data samples taking into account start and end times as well as actual numbers of continuous samples. The DataInfo returned has a set of time segmented information per Channel. Each of the DataInfo segments defines a cotigous set of data with no time discontinuities.
◆ dataGetNotes()
BError Bds::DataAddAccess::dataGetNotes | ( | DataHandle | dataHandle, |
BList< Note > & | notes | ||
) |
Get notes on the data file.
Python: (BError err, BList<Note > notes) = dataGetNotes(DataHandle dataHandle);
- Parameters
-
dataHandle The opened data set's handle notes A list of Notes on the data
Returns a list of system and user added notes for the data from the database.
◆ dataGetWarnings()
BError Bds::DataAddAccess::dataGetWarnings | ( | DataHandle | dataHandle, |
BList< BString > & | warnings | ||
) |
Get information on the data file.
Python: (BError err, BList<BString > warnings) = dataGetWarnings(DataHandle dataHandle);
- Parameters
-
dataHandle The opened data set's handle warnings A list of warning strings from the datafiles
Returns a list of warning strings contained within the data files, typically from the data file import convertors.
◆ dataSeekBlock()
BError Bds::DataAddAccess::dataSeekBlock | ( | DataHandle | dataHandle, |
BUInt32 | channel, | ||
BUInt32 | segment, | ||
BTimeStamp | time, | ||
BUInt32 & | blockNumber | ||
) |
Searches for a data block matching the time given.
Python: (BError err, PythonInt blockNumber) = dataSeekBlock(DataHandle dataHandle, PythonInt channel, PythonInt segment, BTimeStamp time);
- Parameters
-
dataHandle The opened data set's handle channel The channel number. 0 for all channels. segment The segment number. 0 for all segments time The time of a sample to search for blockNumber The returned block number
This seeks for the a DataBlock in the set of files that contains a smaple for the time provided. If channel is other than 0 then it seeks for a DataBlock for the given channel. If the data is sample multiplexed a Channel number of 0 can be given which will return the location of a dataBlock containing all of the Channels. If Segment is 0 then the block number returned is referenced to the start of the set of files. If a particular segment number is given then the seek and the returned block number is within that segment.
◆ dataGetBlock()
BError Bds::DataAddAccess::dataGetBlock | ( | DataHandle | dataHandle, |
BUInt32 | channel, | ||
BUInt32 | segment, | ||
BUInt32 | blockNumber, | ||
DataBlock & | data | ||
) |
Return a block of data.
Python: (BError err, DataBlock data) = dataGetBlock(DataHandle dataHandle, PythonInt channel, PythonInt segment, PythonInt blockNumber);
- Parameters
-
dataHandle The opened data set's handle channel The channel number. 0 for all channels. segment The segment number. 0 for all segments blockNumber The block number to fetch dataBlock The returned data block
This returns the given block number from the set of opened data files. If channel is other than 0 then it will return the data for the given channel number. If the data is sample multiplexed a Channel number of 0 can be given which will return a DataBlock with Sensor data for all of the channels. If Segment is 0 then the block number is referenced to the start of the set of files. If a particular segment number is given then the returned block number is from within that segment.
◆ dataSetInfo()
DataAddAccess::dataSetInfo | ( | DataHandle | dataHandle, |
DataInfo | dataInfo | ||
) |
Set the info when writing to a file.
Python: (BError err) = dataSetInfo(DataHandle dataHandle, DataInfo dataInfo);
◆ dataPutBlock()
DataAddAccess::dataPutBlock | ( | DataHandle | dataHandle, |
DataBlock | data | ||
) |
Send a block of data.
Python: (BError err) = dataPutBlock(DataHandle dataHandle, DataBlock data);
◆ dataClose()
DataAddAccess::dataClose | ( | DataHandle | dataHandle, |
BError | error, | ||
BInt32 | del | ||
) |
Close a file.
Python: (BError err) = dataClose(DataHandle dataHandle, BError error, BInt32 del);
◆ dataFormattedRead()
BError Bds::DataAddAccess::dataFormattedRead | ( | DataHandle | dataHandle, |
BUInt32 | number, | ||
BArray< BUInt8 > & | data | ||
) |
Read the raw data from the stream.
Python: (BError err, BArray<BUInt8 > data) = dataFormattedRead(DataHandle dataHandle, PythonInt number);
- Parameters
-
dataHandle The opened data set's handle number The maximum number of Bytes to read data The set of data bytes in the requested format
Given a handle to a set of data files opened for read in an external data format supported by the BDS data converters, read the raw formated data bytes from the converted file.
◆ dataFormattedGetLength()
DataAddAccess::dataFormattedGetLength | ( | DataHandle | dataHandle, |
BUInt64 & | length | ||
) |
The total length in bytes of the formated data.
Python: (BError err, PythonInt length) = dataFormattedGetLength(DataHandle dataHandle);
◆ dataRealtimeConfig()
Configures the sending of real-time data blocks.
Python: (BError err) = dataRealtimeConfig(BInt32 enable, Selection sel);
- Parameters
-
enable Enable/disable the sending of a real-time data stream sel The selection of channels to send
This function has yet to be implemented. It is designed to enable or disable the sening of a stream of data from the BdsServer to a data viewing client.
◆ dataRealtimeGet()
BError Bds::DataAddAccess::dataRealtimeGet | ( | BUInt32 | numBlocks, |
BUInt32 & | numBlocksAvailable, | ||
BList< DataBlockChannel > & | dataBlocks | ||
) |
Returns the number of data blocks available and up to numBlocks of these.
Python: (BError err, PythonInt numBlocksAvailable, BList<DataBlockChannel > dataBlocks) = dataRealtimeGet(PythonInt numBlocks);
- Parameters
-
numBlocks How many blocks to return at a time numBlocksAvailable The number of blocks available in this stream dataBlocks A list of the DataBlocks
This function has yet to be implemented. It is designed to return a set of real-time DataBlocks from the BdsServer to a data viewing client.
◆ noteGetList()
◆ noteUpdate()
◆ noteWriteDocument()
◆ noteReadDocument()
◆ noticesAdd()
DataAddAccess::noticesAdd | ( | BString | notice | ) |
Add a notice line.
Python: (BError err) = noticesAdd(PythonStr notice);
◆ noticesGetList()
Get notices list.
Python: (BError err, BList<BString > notices) = noticesGetList();
◆ noticesClear()
DataAddAccess::noticesClear | ( | ) |
Clear notices list.
Python: (BError err) = noticesClear();
◆ logUpdate()
◆ logAppend()
BError Bds::DataAddAccess::logAppend | ( | BString | type, |
BUInt32 | priority, | ||
BString | subSystem, | ||
BString | title, | ||
BString | description | ||
) |
Append a log item.
Python: (BError err) = logAppend(PythonStr type, PythonInt priority, PythonStr subSystem, PythonStr title, PythonStr description);
- Parameters
-
type The log entries type: error, warning, notice, debug or all. priority The log events priority from 0 to 5 with 5 being the highest priority subSystem The subsystem the log entry is from title A title for the log entry description A more detailed description of the log entry
This allows BDS xclients, perhaps data import clients, to add BDS system log entries.
◆ modeSet()
Changes the system mode from Master to slave.
Python: (BError err, Mode previousMode) = modeSet(Mode mode);
- Parameters
-
mode The new server mode previousMode The current server mode returned
Changes the mode of a BdsServer's operation. A BdsServer can be in ModeMaster or ModeSlave modes. In ModeSlave it will act as a read only BdsServer which can be used for resiliance, data protection or for peerformance purposes.
◆ modeSnapshotPause()
Enables/disables backup synchronisation pause.
Python: (BError err) = modeSnapshotPause(BInt32 on);
- Parameters
-
on Enabvle/disable pause
Preforms a snapshot pause. When in this mode all changes to the database and data files will be blocked untill the end of the pause. This allows a backup to be performed with consistant files.
◆ clean()
BError Bds::DataAddAccess::clean | ( | CleanOptions | cleanOptions | ) |
Cleans the system logs and Changes information.
Python: (BError err) = clean(CleanOptions cleanOptions);
- Parameters
-
cleanOptions Clean options. This has the options logs, changes and deletedFiles
This function can be used to clean up old data. It should be called once in a while to perform this work. It will clean the given items that are over a year old.
◆ databaseBackup()
Backup the database.
Python: (BError err, PythonStr ref) = databaseBackup();
- Parameters
-
ref Reference and file name component
This will perform a complede BDS database backup into a file with the given reference name.
◆ statisticsGet()
Get a list of system statistics.
Python: (BError err, BDict<BString > info) = statisticsGet();
- Parameters
-
info A dictionary of BdsServer statistics
This returns runtime statistics from the BdsServer
◆ serverConfigurationGet()
Get server configuration parameters.
Python: (BError err, BDict<BString > items) = serverConfigurationGet();
- Parameters
-
info A dictionary of BdsServer configuration entries
This returns the list of server configuration parameters.
◆ dataFormatGetList()
BError Bds::DataAddAccess::dataFormatGetList | ( | BList< DataFormat > & | formats | ) |
Get list of data formats.
Python: (BError err, BList<DataFormat > formats) = dataFormatGetList();
- Parameters
-
formats A list of all data file formats
This returns the list of all of the data file formats supported by the BdsServer's data convertors.
The documentation for this class was generated from the following files:
- BdsC.h
- BdsC.cc
- BdsLib.dox
- /src/blacknest/bds/bds/doc/BdsPython.dox
- /src/blacknest/bds/bds/doc/bdsApi-extra.dox
Generated by