Class: assetsparametershelper

assetsparametershelper()

Class for handling of assets parameters for assets groups and their tabs and orders

Constructor

new assetsparametershelper()

Source:

Methods

doesParameterExistInStore(assetsId, assetsParametersId, callback)

checks weather a value for the given assetsparameter exists in assets_parameters_store
Parameters:
Name Type Description
assetsId integer id of asset the check shall be run for
assetsParametersId integer id of asset parameter the check shall be run for
callback function id of asstets_parameter_store if found, or false if not found
Source:

getAssetParameterValuesForAssetId(assetId, callback)

Function loads values for asset parameters for given asset with assetId
Parameters:
Name Type Description
assetId integer
callback function rows or null
Source:

getAssetsParametersForAssetGroup(assetGroup, callback)

returns list of assets parameters for given assetGroup id
Parameters:
Name Type Description
assetGroup integer id of assets group, parameters shall be returned for
callback function rows or null
Source:

getAssetsParametersFormHTMLForAssetGroup(req, res, assetGroup, callback)

builds HTML-form for assets parameters organized in tabs
Parameters:
Name Type Description
req *
res *
assetGroup *
callback *
Source:

getAssetsParametersFormHTMLForAssetGroupAndAsset(req, res, assetGroup, assetId, isGear, gearname, callback)

builds HTML-form for assets parameters organized in tabs for editing mode
Parameters:
Name Type Description
req object Request object
res object Response object
assetGroup integer if of asset group of asset
assetId integer if of asset in core database
isGear integer 1 if its an alarmable asset, 0 if not
gearname string name of gear in alarmings
callback function string if HTML form
Source:

getAssetsParametersTabs(assetGroup, callback)

reads defined tabs for assets parameters from database
Parameters:
Name Type Description
assetGroup integer id of asset group, asset parameter tabs shall be returned for
callback function rows or null
Source:

persistParameterValueInDatabase(assetId, parameterId, parameterType, value, callback)

writes parameter value to database table assets_parameters_store
Parameters:
Name Type Description
assetId * ID of asset this value has to be stored for
parameterId * ID of parameter, this value is for
parameterType * type of parameter (string, select, integer)
value * value to be stored
callback * callback function (false in case of error, true if successfully written)
Source:

persistParameterValuesInDatabase(newAssetId, formData, parameters, callback)

writes parameter value to database table assets_parameters_store
Parameters:
Name Type Description
newAssetId integer
formData object
parameters object
callback function success (true or false)
Source:

renderTabsForAssetGroups(assetGroups, callback)

Renders HTML Code for Tab navigation for given assetGroup id
Parameters:
Name Type Description
assetGroups *
callback *
Source:

updateParameterInStore(storeId, newValue, interpretAs, callback)

updates Value in parameters Store
Parameters:
Name Type Description
storeId integer id of object in table assets_parameters_store
newValue string new value as string
interpretAs string type of value as string
callback function callback function, success (true or false)
Source:

updateParameterValueInDatabase(req, res, parameterId, parameterType, value, callback)

writes parameter value to database table assets_parameters_store
Parameters:
Name Type Description
req *
res *
parameterId * ID of parameter, this value is for
parameterType * type of parameter (string, select, integer)
value * value to be stored
callback * callback function (false in case of error, true if successfully written)
Source:

updateParameterValuesInDatabase(assetId, parameterId, parameterType, value, callback)

update parameter value to database table assets_parameters_store
Parameters:
Name Type Description
assetId integer ID of asset this value has to be stored for
parameterId integer ID of parameter, this value is for
parameterType string type of parameter (string, select, integer)
value string value to be stored
callback function callback function (false in case of error, true if successfully written)
Source: