arrow-left

All pages
gitbookPowered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

injectMarker

This method is to create an "instance" marker to the current record of a session. Then you can call updateMarker to turn this marker into an "interval" marker.

circle-info

You must call createRecord before you call this method.

hashtag
Parameters

hashtag
Result

The result is an object containing these fields:

hashtag
Examples

updateMarker

This method is to update a marker that was previously created by injectMarker.

This method set the end date time of a marker, turning an "instance" marker into an "interval" marker. You can also update the extras object.

The marker must belong to a record that is still in progress. You cannot update the marker if the record is already stopped.

hashtag
Parameters

hashtag
Result

The result is an object containing these fields:

hashtag
Examples

Marker object

A marker object includes these fields:

Name

Type

Description

uuid

string

The id of the marker.

type

string

Can be "interval" or "instance".

value

hashtag
Examples

An instance marker:

An interval marker:

Markers

A marker is to mark a point in time, or a period of time, inside a .

Markers are always linked to a record, so you must start a record before you add a marker. You can't add nor update a marker after the record is stopped. You can associate some data to each marker, like a value and a label.

There are two types of markers:

  • An instance marker is to mark a point in time. You call to create the marker at a specific timestamp.

An interval marker is to mark a period of time, with a beginning and an end. First you create an instance marker with injectMarker. This sets the beginning of the interval. Then you call updateMarker to set the end of the interval, turning the instance marker into an interval marker.

record
injectMarker

yes

The start timestamp of the marker. It is the number of milliseconds that have elapsed since 00:00:00 Thursday, 1 January 1970 UTC.I

value

string or number

yes

The value of the marker. It can be a string or an integer.

If it is an integer then it must be positive or zero.

label

string

yes

The label of the marker.

port

string

no

The port of the marker, or where the marker comes from. Examples: "USB", "Serial", etc... The default value is "Software"

extras

object

no

Any extra information you want to associate with the marker.

Name

Type

Required

Description

cortexToken

string

yes

A token returned by authorize.

session

string

yes

A session id returned by createSession.

The marker will be added to the current record of this session.

time

Name

Type

Description

recordId

string

The id of the record this marker was added to.

sessionId

string

The id of the session associated to the record.

marker

object

A marker object that represents the marker that was created.

number

The id of the marker you want to update. This marker must belong to the current record of the session.

time

number

yes

The end timestamp of the marker. It is the number of milliseconds that have elapsed since 00:00:00 Thursday, 1 January 1970 UTC.

extras

object

no

Any extra information you want to associate with the marker.

Name

Type

Required

Description

cortexToken

string

yes

A token returned by authorize.

session

string

yes

A session id returned by createSession.

markerId

string

Name

Type

Description

recordId

string

The id of the record this marker belongs to.

sessionId

string

The id of the session associated to the record.

marker

object

A marker object that represents the marker that was updated.

yes

string or number

The value you set in injectMarker.

label

string

The label of the marker.

port

string

The port of the marker, ie where the marker comes from. Examples: "Software", "Serial", etc...

startDatetime

string (ISO date time)

The timestamp you set in injectMarker.

endDatetime

string (ISO date time)

The timestamp you set in updateMarker.

If you didn't call this method, then endDatetime is equal to startDatetime.

extras

object

Can be any extra information you want to associate with this marker.

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "injectMarker",
    "params": {
        "cortexToken": "xxx",
        "label": "test2",
        "port": "Cortex Example",
        "session": "4cbf7554-31bd-4659-ac58-400b823503f0",
        "time": 1559811461532,
        "value": 42
    }
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "marker": {
            "endDatetime": "2019-06-06T15:57:41.529661+07:00",
            "extras": {},
            "label": "test2",
            "port": "Cortex Example",
            "startDatetime": "2019-06-06T15:57:41.529661+07:00",
            "type": "instance",
            "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
            "value": 42
        },
        "recordId": "db01c15e-d916-4a7b-9f1d-16295fd1c643",
        "sessionId": "4cbf7554-31bd-4659-ac58-400b823503f0"
    }
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "updateMarker",
    "params": {
        "cortexToken": "xxx",
        "session": "4cbf7554-31bd-4659-ac58-400b823503f0",
        "markerId": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
        "time": 1559811469531
    }
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "marker": {
            "endDatetime": "2019-06-06T15:57:49.530743+07:00",
            "extras": {},
            "label": "test2",
            "port": "Cortex Example",
            "startDatetime": "2019-06-06T15:57:41.529661+07:00",
            "type": "interval",
            "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
            "value": 42
        },
        "recordId": "db01c15e-d916-4a7b-9f1d-16295fd1c643",
        "sessionId": "4cbf7554-31bd-4659-ac58-400b823503f0"
    }
}
{
    "extras": {},
    "label": "test2",
    "port": "Cortex Example",
    "startDatetime": "2019-06-06T15:57:41.529661+07:00",
    "endDatetime":   "2019-06-06T15:57:41.529661+07:00",
    "type": "instance",
    "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
    "value": 42
}
{
    "extras": {},
    "label": "test2",
    "port": "Cortex Example",
    "startDatetime": "2019-06-06T15:57:41.529661+07:00",
    "endDatetime":   "2019-06-06T15:57:49.530743+07:00",
    "type": "interval",
    "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
    "value": 42
}