App

Module 'SHM_Module'

Domain model

Entities

Name Generalization Documentation
acc_gyro SHM_Module.Data Holds acc_gyro data coming from the Arduino Uno Wifi Rev 2 microcontroller.
Asset An asset is considered as the physical asset which is to be monitored in the system.
Characteristic The entity represents a Bluetooth characteristic. It holds information about the name and UUID of the characteristic.
ClientData The ClientData entity holds a data string of unlimited length for sending sensor data from the devices to the server.
Data The data Entity is the super entity for other data types that the database supports. It is possible for other data types to generalize (inherit) from this object and be connected with an Event. This object should have no data of any kind and should always be inherited.
DataType The DataType entity is used to store the names of the data kinds that are present in the system. The key-sensitive name attribute refers to a specific entity in the domain model for triggering certain functionalities at runtime. This is a required component for the system and must be utilized correctly for the system to be deployed effectively. DataTypes can only be created by the administrator through the admin page. For further insight, see the Javascript or Java code.
Device The Device entity represents a Bluetooth device, such as an Arduino microcontroller. It holds information about the name of the device.
Event One Event entity is created for each logged characteristic.
EventBatch One EventBatch entity is created for keeping track of the logged Events. The EventBatch can be associated with multiple Events.
EventSettings The EventSettings is used to enter custom settings for the user. Currently, it holds the value of the biker's mass in order to use it as a part of the inverse method.
float32 SHM_Module.Data Holds 4 byte float data coming from the Arduino Uno Wifi Rev 2 microcontroller.
grav_gyro SHM_Module.Data Holds acc_gyro data coming from the Arduino Uno Wifi Rev 2 microcontroller.
inverse_data Holds the inverse data which is associated to a specific acc_gyro.
Login The Login Entity is used for storing user credentials when the user attemps to login.
Service The Service entity represents a Bluetooth service. It holds information about the bluetooth service name and UUID.
strain_gauge SHM_Module.Data Holds strain gauge data coming from the Arduino Uno Wifi Rev 2 microcontroller.
uint SHM_Module.Data Holds 2 byte uint data coming from the Arduino Uno Wifi Rev 2 microcontroller.

Entity 'acc_gyro'

Holds acc_gyro data coming from the Arduino Uno Wifi Rev 2 microcontroller.

Generalization

SHM_Module.Data

Attributes
Name Type Default value Documentation
Timer Decimal 0 The timestamp of when the sensor is read.
acc_x Decimal 0 Acceleration read from IMU in x direction.
acc_z Decimal 0 Acceleration read from IMU in z direction.
gyro_y Decimal 0 Pitch rate read from IMU in y direction.
Associations
Name Connected to Multiplicity Documentation
inverse_data_acc_gyro SHM_Module.inverse_data One-to-one The association keeps track of the inverse data that corresponds with a given acc_gyro entity. One inverse_data should refer to a single acc_gyro entity.

Entity 'Asset'

An asset is considered as the physical asset which is to be monitored in the system.

Attributes
Name Type Default value Documentation
Name String (100) The name of the asset.
Associations
Name Connected to Multiplicity Documentation
Asset_User System.User One-to-many This association is put in so that the user can only retrieve assets that themselves created. A user can be associated with multiple assets.

Entity 'Characteristic'

The entity represents a Bluetooth characteristic. It holds information about the name and UUID of the characteristic.

Attributes
Name Type Default value Documentation
Name String (32) The name of the bluetooth characteristic.
UUID String (36) The unique identifier for the characteristic.
Associations
Name Connected to Multiplicity Documentation
Characteristic_DataType SHM_Module.DataType One-to-many The association keeps track of a characteristic's data type.
Characteristic_Service SHM_Module.Service One-to-many A characteristic can only be linked to one Service.

A Service can have many Characteristics.

Entity 'ClientData'

The ClientData entity holds a data string of unlimited length for sending sensor data from the devices to the server.

Attributes
Name Type Default value Documentation
data String (unlimited) Keeps hold of the data string which is being sent to the server. The data string holds the sensor values read by the microcontroller.
Associations
Entity 'ClientData' does not own any associations.

Entity 'Data'

The data Entity is the super entity for other data types that the database supports. It is possible for other data types to generalize (inherit) from this object and be connected with an Event. This object should have no data of any kind and should always be inherited.

Attributes
Entity 'Data' has no attributes.
Associations
Name Connected to Multiplicity Documentation
Data_Event SHM_Module.Event One-to-many The association is used to retrieve different data types from an Event. The association is inherited by the Data child entities, which results in a cleaner database.

Entity 'DataType'

The DataType entity is used to store the names of the data kinds that are present in the system. The key-sensitive name attribute refers to a specific entity in the domain model for triggering certain functionalities at runtime. This is a required component for the system and must be utilized correctly for the system to be deployed effectively. DataTypes can only be created by the administrator through the admin page. For further insight, see the Javascript or Java code.

Attributes
Name Type Default value Documentation
Name String (50)
Associations
Entity 'DataType' does not own any associations.

Entity 'Device'

The Device entity represents a Bluetooth device, such as an Arduino microcontroller. It holds information about the name of the device.

Attributes
Name Type Default value Documentation
Name String (100) The name of the device.
Associations
Name Connected to Multiplicity Documentation
Device_Asset SHM_Module.Asset One-to-many A device can only be linked to one asset.

An Asset can have many devices.

Entity 'Event'

One Event entity is created for each logged characteristic.

Attributes
Name Type Default value Documentation
Name String (20) The name of the event.
Associations
Name Connected to Multiplicity Documentation
Event_Asset SHM_Module.Asset One-to-many An arbitrary amount of Assets can be logged in an event.
Event_Characteristic SHM_Module.Characteristic One-to-many
Event_Device SHM_Module.Device One-to-many An arbitrary amount of devices can be logged in an event.
Event_EventBatch SHM_Module.EventBatch One-to-many
Event_Service SHM_Module.Service One-to-many An arbitrary amount of Services can be logged in an event.

Entity 'EventBatch'

One EventBatch entity is created for keeping track of the logged Events. The EventBatch can be associated with multiple Events.

Attributes
Name Type Default value Documentation
Name String (200) EventName The name of the event
IsLogging Boolean false Value to keep track of when the event is logged by the rider. When this is true, there is an ongoing event where the rider is logging sensor values from the bike.
IsDeviceConnected Boolean false
Associations
Name Connected to Multiplicity Documentation
EventSettings_EventBatch SHM_Module.EventSettings One-to-one Settings for the eventbatch.

Entity 'EventSettings'

The EventSettings is used to enter custom settings for the user. Currently, it holds the value of the biker's mass in order to use it as a part of the inverse method.

Attributes
Name Type Default value Documentation
Mass Decimal 0 The mass of the bicycle rider
Associations
Name Connected to Multiplicity Documentation
EventSettings_EventBatch SHM_Module.EventBatch One-to-one Settings for the eventbatch.

Entity 'float32'

Holds 4 byte float data coming from the Arduino Uno Wifi Rev 2 microcontroller.

Generalization

SHM_Module.Data

Attributes
Name Type Default value Documentation
Value Decimal 0 Holds the value of the float 32.
Associations
Entity 'float32' does not own any associations.

Entity 'grav_gyro'

Holds acc_gyro data coming from the Arduino Uno Wifi Rev 2 microcontroller.

Generalization

SHM_Module.Data

Attributes
Name Type Default value Documentation
Timer Decimal 0 The timestamp of when the sensor is read.
grav_x Decimal 0 Gravitational acceleration in x direction read from IMU.
grav_z Decimal 0 Gravitational acceleration in z direction read from IMU.
gyro_y Decimal 0 Pitch rate read from IMU in y direction.
Associations
Entity 'grav_gyro' does not own any associations.

Entity 'inverse_data'

Holds the inverse data which is associated to a specific acc_gyro.

Attributes
Name Type Default value Documentation
gauge1 Decimal 0
gauge2 Decimal 0
gauge3 Decimal 0
gauge4 Decimal 0
gauge5 Decimal 0
gauge8 Decimal 0
Associations
Name Connected to Multiplicity Documentation
inverse_data_acc_gyro SHM_Module.acc_gyro One-to-one The association keeps track of the inverse data that corresponds with a given acc_gyro entity. One inverse_data should refer to a single acc_gyro entity.

Entity 'Login'

The Login Entity is used for storing user credentials when the user attemps to login.

Attributes
Name Type Default value Documentation
Username String (200) Holds the username of the user who is attempting to login.
Password String (200) Holds the password of the user who is attempting to login.
ValidationMessage String (unlimited) Validation message to inform the user of login errors.
Associations
Entity 'Login' does not own any associations.

Entity 'Service'

The Service entity represents a Bluetooth service. It holds information about the bluetooth service name and UUID.

Attributes
Name Type Default value Documentation
Name String (100) The name of the service.
UUID String (200) The unique identifier for the bluetooth service.
Associations
Name Connected to Multiplicity Documentation
Service_Device SHM_Module.Device One-to-many A service can only be linked to one device.

A device can have many services.

Entity 'strain_gauge'

Holds strain gauge data coming from the Arduino Uno Wifi Rev 2 microcontroller.

Generalization

SHM_Module.Data

Attributes
Name Type Default value Documentation
Timer Decimal 0 The timestamp of when the sensor is read.
gauge1 Integer 0 Value of strain gauge 1 mounted on the Hardrocx bicycle.
gauge2 Integer 0 Value of strain gauge 2 mounted on the Hardrocx bicycle.
gauge3 Integer 0 Value of strain gauge 3 mounted on the Hardrocx bicycle.
gauge4 Integer 0 Value of strain gauge 4 mounted on the Hardrocx bicycle.
gauge5 Integer 0 Value of strain gauge 5 mounted on the Hardrocx bicycle.
gauge8 Integer 0 Value of strain gauge 8 mounted on the Hardrocx bicycle.
Associations
Entity 'strain_gauge' does not own any associations.

Entity 'uint'

Holds 2 byte uint data coming from the Arduino Uno Wifi Rev 2 microcontroller.

Generalization

SHM_Module.Data

Attributes
Name Type Default value Documentation
Value Integer 0 Holds the value of the uint.
Associations
Entity 'uint' does not own any associations.

Enumerations

The module has no enumerations.

Microflows

Name Return type Documentation
AddDevice Creates a new device and associates it to the input asset. The device is commited and refreshed for the client.
AddEvent Creates a new Event and associates it to the input EventBatch. The new Event is commited and refreshed for the client.
AddService Creates a new Service and associates it to the input Device. The new Service is commited and refreshed for the client.
CalculateInverseData Each time an acc gyro object is committed to the database, the microflow is executed. It performs the inverse method on the gathered data every four seconds.
CreateAsset Creates an Asset, commits the Asset and updates the client.
CreateCharacteristic Creates and returns a Characteristic Entity.
CreateEventBatch Creates an EventBatch, an Event and returns the EventBatch.
ExitSetupEvent Exits the event setup page by opening the home page and deleting the Event Batch.
GetAccGyroData Returns a list of acc_gyro data.
GetAccGyroDataSorted Returns a list of sorted acc_gyro data.
GetEvent Gets the head of the events associated to an EventBatch.
GetEventSetting Gets or creates the EventSettings from an EventBatch.
GetEventsReversed Returns a list of events sorted by createdDate in descending order.
GetGravGyroDataSorted Returns a list of sorted acc_gyro data.
GetInverseDataSorted Returns a list of sorted inverse data in ascending order of the timer..
GetStrainGaugeData Returns a list of strain gauge data.
GetStrainGaugeDataSorted Returns a list of sorted strain gauge data.
GetUserAssets Retrieves a list of the Assets associated to the current user.
OpenEventStartPage Opens the event start page.
OpenHomepage This is the first microflow which is run as the client enters the web site. It executes a deep link and opens the sign in page whether the deeplink is executed or not.
RegisterUser_m Registers a user.
SelectableCharacteristics Retrieves a list of selectable characteristics given an event.
SelectableDevices Retrieves a list of selectable devices given an event.
SelectableServices Retrieves a list of selectable services given an event.
SendDataToServer Sends a datastring to the server, parses, commits, and deletes the data.
SetAssetOwner Sets the current user as the owner of the given Asset.

Microflow 'AddDevice'

Creates a new device and associates it to the input asset. The device is commited and refreshed for the client.

Parameters
Name Type Documentation
Asset SHM_Module.Asset The asset which will be associated with the new device.
Return type

Nothing

Microflow 'AddEvent'

Creates a new Event and associates it to the input EventBatch. The new Event is commited and refreshed for the client.

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch The EventBatch which will be associated with the new Event.
Return type

Nothing

Microflow 'AddService'

Creates a new Service and associates it to the input Device. The new Service is commited and refreshed for the client.

Parameters
Name Type Documentation
Device SHM_Module.Device The Device which will be associated with the new Service.
Return type

Nothing

Microflow 'CalculateInverseData'

Each time an acc gyro object is committed to the database, the microflow is executed. It performs the inverse method on the gathered data every four seconds.

Parameters
Name Type Documentation
acc_gyro SHM_Module.acc_gyro The acc_gyro entity which holds the timer value to check whether 4 seconds of data is accumulated.
Return type

Nothing

Microflow 'CreateAsset'

Creates an Asset, commits the Asset and updates the client.

Parameters
This microflow has no parameters.
Return type

Nothing

Microflow 'CreateCharacteristic'

Creates and returns a Characteristic Entity.

Parameters
Name Type Documentation
Service SHM_Module.Service The Service which will be associated with the new Characteristic.
Return type

SHM_Module.Characteristic

Microflow 'CreateEventBatch'

Creates an EventBatch, an Event and returns the EventBatch.

Parameters
This microflow has no parameters.
Return type

SHM_Module.EventBatch

Microflow 'ExitSetupEvent'

Exits the event setup page by opening the home page and deleting the Event Batch.

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch EventBatch to be deleted.
Return type

Nothing

Microflow 'GetAccGyroData'

Returns a list of acc_gyro data.

Parameters
Name Type Documentation
Event SHM_Module.Event Event used to get all associated acc_gyro entities.
Return type

List of SHM_Module.acc_gyro

Microflow 'GetAccGyroDataSorted'

Returns a list of sorted acc_gyro data.

Parameters
Name Type Documentation
Event SHM_Module.Event Event used to get all associated acc_gyro entities.
Return type

List of SHM_Module.acc_gyro

Microflow 'GetEvent'

Gets the head of the events associated to an EventBatch.

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch EventBatch used to get the assciated events.
Return type

SHM_Module.Event

Microflow 'GetEventSetting'

Gets or creates the EventSettings from an EventBatch.

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch EventBatch used to get the associated EventSetting
Return type

SHM_Module.EventSettings

Microflow 'GetEventsReversed'

Returns a list of events sorted by createdDate in descending order.

Parameters
This microflow has no parameters.
Return type

List of SHM_Module.EventBatch

Microflow 'GetGravGyroDataSorted'

Returns a list of sorted acc_gyro data.

Parameters
Name Type Documentation
Event SHM_Module.Event Used to get all associated grav_gyro entities.
Return type

List of SHM_Module.grav_gyro

Microflow 'GetInverseDataSorted'

Returns a list of sorted inverse data in ascending order of the timer..

Parameters
Name Type Documentation
Event SHM_Module.Event Used to get all associated acc_gyro entities.
Return type

List of SHM_Module.inverse_data

Microflow 'GetStrainGaugeData'

Returns a list of strain gauge data.

Parameters
Name Type Documentation
Event SHM_Module.Event Used to get all associated strain_gauge entities.
Return type

List of SHM_Module.strain_gauge

Microflow 'GetStrainGaugeDataSorted'

Returns a list of sorted strain gauge data.

Parameters
Name Type Documentation
Event SHM_Module.Event Used to get all associated strain_gauge entities.
Return type

List of SHM_Module.strain_gauge

Microflow 'GetUserAssets'

Retrieves a list of the Assets associated to the current user.

Parameters
This microflow has no parameters.
Return type

List of SHM_Module.Asset

Microflow 'OpenEventStartPage'

Opens the event start page.

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch Used to get the associated events.
Return type

Nothing

Microflow 'OpenHomepage'

This is the first microflow which is run as the client enters the web site. It executes a deep link and opens the sign in page whether the deeplink is executed or not.

Parameters
This microflow has no parameters.
Return type

Nothing

Microflow 'RegisterUser_m'

Registers a user.

Parameters
Name Type Documentation
Login SHM_Module.Login The login object with the login information.
Return type

Nothing

Microflow 'SelectableCharacteristics'

Retrieves a list of selectable characteristics given an event.

Parameters
Name Type Documentation
Event SHM_Module.Event The event that will be associated to the selected characteristic.
EventBatch SHM_Module.EventBatch Used to retrieve the associated Events.
Return type

List of SHM_Module.Characteristic

Microflow 'SelectableDevices'

Retrieves a list of selectable devices given an event.

Parameters
Name Type Documentation
Event SHM_Module.Event The Event used to get the associated (selectable) devices.
Return type

List of SHM_Module.Device

Microflow 'SelectableServices'

Retrieves a list of selectable services given an event.

Parameters
Name Type Documentation
Event SHM_Module.Event The Event used to get the associated (selectable) services.
Return type

List of SHM_Module.Service

Microflow 'SendDataToServer'

Sends a datastring to the server, parses, commits, and deletes the data.

Parameters
Name Type Documentation
data SHM_Module.ClientData The data containing the datastring which will be stored at the server.
Return type

Nothing

Microflow 'SetAssetOwner'

Sets the current user as the owner of the given Asset.

Parameters
Name Type Documentation
Asset SHM_Module.Asset The targeted asset which will have the current user as the owner.
Return type

Nothing

Nanoflows

Name Return type Documentation
ACT_SignInUser
ConnectToCharacteristic Connects to all devices associated with an event.
ConnectToDevice Either connects or disconnects to all services associated with a given event depending on whether the event IsLogging attribute is true or false. If false, the event starts logging, otherwise, the device is disconnected, and the event stops.
DSS_CreateLoginContext
DSS_CreateLoginContext_web
DSS_CreateRegisterContext
DSS_CreateRegisterContext_web
GetDeviceServices
GetEventAssets
GetEventCharacteristic
GetEventDevice
GetEventsByBatch
GetEventService
GetServiceCharacteristics
nfGetEventsReversed
RegisterUser
RegisterUser_web

Nanoflow 'ACT_SignInUser'

Parameters
Name Type Documentation
Login SHM_Module.Login
Return type

Nothing

Nanoflow 'ConnectToCharacteristic'

Connects to all devices associated with an event.

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch Context
Return type

Nothing

Nanoflow 'ConnectToDevice'

Either connects or disconnects to all services associated with a given event depending on whether the event IsLogging attribute is true or false. If false, the event starts logging, otherwise, the device is disconnected, and the event stops.

Parameters
Name Type Documentation
eventBatch SHM_Module.EventBatch
Return type

Nothing

Nanoflow 'DSS_CreateLoginContext'

Parameters
This nanoflow has no parameters.
Return type

SHM_Module.Login

Nanoflow 'DSS_CreateLoginContext_web'

Parameters
This nanoflow has no parameters.
Return type

SHM_Module.Login

Nanoflow 'DSS_CreateRegisterContext'

Parameters
This nanoflow has no parameters.
Return type

SHM_Module.Login

Nanoflow 'DSS_CreateRegisterContext_web'

Parameters
This nanoflow has no parameters.
Return type

SHM_Module.Login

Nanoflow 'GetDeviceServices'

Parameters
Name Type Documentation
Device SHM_Module.Device
Return type

List of SHM_Module.Service

Nanoflow 'GetEventAssets'

Parameters
Name Type Documentation
Event SHM_Module.Event
Return type

List of SHM_Module.Asset

Nanoflow 'GetEventCharacteristic'

Parameters
Name Type Documentation
Event SHM_Module.Event
Return type

List of SHM_Module.Characteristic

Nanoflow 'GetEventDevice'

Parameters
Name Type Documentation
Event SHM_Module.Event
Return type

List of SHM_Module.Device

Nanoflow 'GetEventsByBatch'

Parameters
Name Type Documentation
EventBatch SHM_Module.EventBatch
Return type

List of SHM_Module.Event

Nanoflow 'GetEventService'

Parameters
Name Type Documentation
Event SHM_Module.Event
Return type

List of SHM_Module.Service

Nanoflow 'GetServiceCharacteristics'

Parameters
Name Type Documentation
Service SHM_Module.Service
Return type

List of SHM_Module.Characteristic

Nanoflow 'nfGetEventsReversed'

Parameters
This nanoflow has no parameters.
Return type

List of SHM_Module.EventBatch

Nanoflow 'RegisterUser'

Parameters
Name Type Documentation
Login SHM_Module.Login
Return type

String

Nanoflow 'RegisterUser_web'

Parameters
Name Type Documentation
Login SHM_Module.Login
Return type

String

Java actions

Name Return type Documentation
computeInverseData
dataParseCommit

Java action 'computeInverseData'

Type parameters
This Java action has no type parameters.
Parameters
Name Type Documentation
acc_gyro_list List of SHM_Module.acc_gyro
mass Decimal
Return type

Nothing

Java action 'dataParseCommit'

Type parameters
This Java action has no type parameters.
Parameters
Name Type Documentation
dataString String
Return type

Nothing

JavaScript actions

Name Return type Documentation
BLECharacteristicSubscribe Subscribes to a characteristic given a UUID and commits data to the server on every notification retrieved from the peripheral device.
BLEDeviceConnect Pairs with a Bluetooth device with a given UUID.
BLEDeviceDisconnect Disconnect from all Bluetooth devices.

JavaScript action 'BLECharacteristicSubscribe'

Subscribes to a characteristic given a UUID and commits data to the server on every notification retrieved from the peripheral device.

Type parameters
This JavaScript action has no type parameters.
Parameters
Name Type Documentation
characteristicUUID String
dataType String
eventBatch SHM_Module.EventBatch
eventReference SHM_Module.Event
serviceUUID String
Return type

String

JavaScript action 'BLEDeviceConnect'

Pairs with a Bluetooth device with a given UUID.

Type parameters
This JavaScript action has no type parameters.
Parameters
Name Type Documentation
eventBatch SHM_Module.EventBatch
primaryServiceUUID String
Return type

Nothing

JavaScript action 'BLEDeviceDisconnect'

Disconnect from all Bluetooth devices.

Type parameters
This JavaScript action has no type parameters.
Parameters
Name Type Documentation
characteristicUUID String
eventBatch SHM_Module.EventBatch
serviceUUID String