NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Data Formatting and Transformation

From Texas Instruments Wiki
Jump to: navigation, search

Processing Data going to widget (incoming) and leaving the widget (outgoing)[edit]

Pre processing functions may be used to transform data that is going to be displayed in the widget or leaving the widget before it is sent to the target. The most common use of pre processing functions is to control the format of displayed data. These functions need to be created in JavaScript and can be added to app.js file as it is automatically loaded by GUI Composer application. A good resource for syntax and available functions in javascript is at www.w3schools.com/js/default.asp


PrePostDiagram.png



1. Create an application, add a widget and specify a variable in its value binding. Then click on "..." button beside a binding that you specified. This opens a new dialog allowing you to format the value of a variable before it is displayed in the widget. It also contains edit boxes to specify javascript functions that will be called. PreProcessingFunction will be called when data is sent from the target to the widget allowing you to control how data is displayed. PostProcessing function will be called in reverse direction, when a user modifies widgets value and it is being sent to the target. 

2. The easiest way to enter the logic of pre/post processing functions is to click on Edit button in the dialog where pre/post processing function name is specified. GUI Composer designer will then open app.js file and create a prototype function where you need to fill in the processing logic. 

E.g. data formatting
function ToQ24_RoundTo2Decimals(oldValue) {
   var toQ24 = oldValue/(Math.pow(2,24));
   var result = new Number(Math.round(toQ24 * 100)/100);
   var s = result.toString();
   return (s)
};


function FromQ24(oldValue) {
   var result = Math.round(oldValue*(Math.pow(2,24)));
   return ( result )
};



This modem_m3_gc_app.zip contains a sample application that is based on example that is part of GUI Composer Runtime which includes an example of preprocessing functions.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Data Formatting and Transformation here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Data Formatting and Transformation here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Data Formatting and Transformation here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Data Formatting and Transformation here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Data Formatting and Transformation here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Data Formatting and Transformation here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Data Formatting and Transformation here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Data Formatting and Transformation here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Data Formatting and Transformation here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity