Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generating formula for RX and Tx exchange between two different equipment not speaking same language #75

Open
yboujraf opened this issue Jan 1, 2020 · 0 comments

Comments

@yboujraf
Copy link

yboujraf commented Jan 1, 2020

Dear @psq , @hmalphettes , @miguelvps , @joaojeronimo , @Y--

I hope you are well and my best wishes for 2020,

I have an issue #josdejong/mathjs#1699

And maybe you could help me with your library.

Topic translate from different protocols formula .

One of the properties is "Formulas".

Formulas ( Rx / Tx)

• Formulas provide a way to project values received from an equipment to another value range or representation.
• For example, an equipment might send gain values as INTEGERs ranging from 0 to 65535, while the actual gain range in is -64db to 12db. Obviously, the user of a front-end application prefers to deal with the gain values in db instead of the technical INTEGER range.
• To accommodate for this need, I am looking to provides the concept of formulas.

• This will create a basic formula which does not alter the input value – meaning it returns the identity of the input value:

image

Picture from ww.lawo.de

• The input value of the formula is denoted with the symbol $. You can use this symbol in an arithmetic expression which yields the desired output range.
• The line “$ =“ defines the input value (as sent by the device) of the formula.
• The following line “RX($) =“ defines the expression used to convert values that have been received from the device.
• The following line “TX($) =” defines the expression used to convert values that are about to get sent to the device. This expression has to reverse the projection made in the RX expression.

• To follow the ifSpeed example, let’s display the speed of the interface in megabytes per second instead of bits per second:
o Enter a test input value in the “$ =” field, e.g. “10000000” (10 megabit)
o Enter the expression $ / 8000000.0 into the “RX” field. 8000000 is the factor used to turn unit bits into unit megabyte.
o To reverse the RX expression, enter the expression $ * 8000000.0 into the “TX” field.
o You will now see the following:

image

Picture from www.lawo.de

o You can see that the result of the RX expression is 1.25 (megabytes) and the result of the TX expression, which uses 1.25 as input value, is 10000000 (bits per second, which is equal to the input value of the RX expression).

INPUT RANGE

• I have an Analog to Digital convert 12 bits (4096 positions)
• The manufacturer of the A/D converter infor you for 0 = -128dB and for 4095 = +15 dB

I am looking to create as above "Formula" with possibility to select linear or log the Rx and Tx formula.

Data model of my paramater

{
                    "identifier": "ParameTypeStream",
                    "description": "Stream PPM MAIN",
                    "value": 0,
                    "minimum": -4096,
                    "maximum": 480,
                    "access": "read",
                    "format": "%8.2f°",
                    "enumeration": "",
                    "factor": 32,
                    "isOnline": true,
                    "default": -1024,
                    "type": "integer",
                     "formula": "1000*\n1000/"
                }

The properties : formula

The Minimum & Maximum are :

"minimum": -4096,
"maximum": 480,

Then I need to generate the correct formula for Rx & Tx.

Regarding formula "1000\n1000/"*

That means when the client receives this properties the "/n" is the separation from RX formula then TX formula then no needs two properties

Here :

RX = value *1000
TX = value /1000

Use case - write the formula - RX

  1. the client introduces the formula in an editbox. Just the '$' indicates the value I need to passing into the math expression and get the result.

Use case - write the formula - TX

If the RX formula is already written in the editbox , I need and expect with Mathjs library to generate the invert formula for TX and vice-versa if Tx is filled, then I got RX.

If RX = $/1000
then I need to get for TX = $*1000

The formula could be complex (log, square, ^, (expression)*log) I attached a document from my friend written for F# (Microsoft) long time ago and now we are using nodejs and javascript.

Ember+ Formulas.pdf

I hope you could make a simple example of code how to use it and then I will try it ;-)

Best Wishes for 2020
Youssef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant