Difference between revisions of "V2/CMS Tutorial/User Tools/Creating Content/Measurement/Computed Measurement/Script"

From Senfi Docs
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:
  
 
===Add Script===
 
===Add Script===
 +
[[File:Add_script_steps.png|thumb|center|600px|Steps to add Script for Computed Measurement|link=]]
 
# Select '''source measurements'''.
 
# Select '''source measurements'''.
# Fill in the '''init''' and '''compute''' functions.  
+
# Fill in the '''compute''' function.  
 
#* Programming Language Used: Javascript
 
#* Programming Language Used: Javascript
 
# [[#Test Script|Test Script]].
 
# [[#Test Script|Test Script]].
# Revise code as necessary.
+
# Repeat Steps 2 and 3 as required.
# Choose to [[File:enable.png|80px]] '''enable''' or [[File:disable.png|80px]] disable''' the script.
+
# Choose to [[File:enable.png|80px|link=]] '''enable''' or [[File:disable.png|80px|link=]] disable''' the script.
  
 
===Test Script===
 
===Test Script===
 
# Input data into the '''Testing Data Set'''.
 
# Input data into the '''Testing Data Set'''.
 
#* New data sets can be created by selecting the [[File:add_data_set.png|30px]] '''Add''' button.  
 
#* New data sets can be created by selecting the [[File:add_data_set.png|30px]] '''Add''' button.  
# Select the '''START TESTING''' button.
+
#* The format of the data set should match that of the selected '''source measurement'''. [[File:sample_data_set_updated.png|thumb|600px|center|<u>'''Sample data set'''</u><br> '''Source Measurement:''' aerialdynamics<br> '''Tags:''' sensor_id<br> '''Metrics:''' altitude, longtitude, latitude|link=]]
 +
# Select the "START TESTING" button.
 
#* Log data will be shown in the '''Testing Console''' panel.
 
#* Log data will be shown in the '''Testing Console''' panel.
# Select the '''SEND DATA''' button.  
+
# Select the "SEND DATA" button.  
 
#* Computed values will be shown in the '''Output (Measurement)''' and/or '''Output (Command)''' panel.
 
#* Computed values will be shown in the '''Output (Measurement)''' and/or '''Output (Command)''' panel.

Latest revision as of 18:03, 6 August 2021

Add Script

This section covers the following topics:

Add Script

Steps to add Script for Computed Measurement
  1. Select source measurements.
  2. Fill in the compute function.
    • Programming Language Used: Javascript
  3. Test Script.
  4. Repeat Steps 2 and 3 as required.
  5. Choose to Enable.pngenable or Disable.png disable the script.

Test Script

  1. Input data into the Testing Data Set.
    • New data sets can be created by selecting the Add data set.png Add button.
    • The format of the data set should match that of the selected source measurement.
      Sample data set
      Source Measurement: aerialdynamics
      Tags: sensor_id
      Metrics: altitude, longtitude, latitude
  2. Select the "START TESTING" button.
    • Log data will be shown in the Testing Console panel.
  3. Select the "SEND DATA" button.
    • Computed values will be shown in the Output (Measurement) and/or Output (Command) panel.