csen

Často kladené otázky

Entering advanced functions (equations)

To create complex and feature-rich components, you need to enter complex formulas instead of simple variables. You can use functions anywhere you like: inside animations, instead of constants, or as a text replacement in the text fields.

Formulas are evaluated with JavaScript, so you can enter any formula that is a valid JavaScript expression. You can also include any of the Component Variables that you have defined.

To show the functionality, we will extend our example by implementing the scale along the slide bar we have just created.

  • Open the slide bar created in the previous chapter and adjust as follows:

7.7.1

  • Delete the Min and Max fields and stretch the blue rectangle, including the frame. After that, insert additional lines with the Drawing-Line tool to divide the rectangle into thirds. With Transforms -> Order -> Lower to background send both lines and the frame into the background

7.7.2

  • Now insert additional text fields.

7.7.3

For each text field we need to specify the Text in the Replacement in the Rep. tab:

  • Left text field: (min).toFixed(1)
  • Second text field (from left): ((min+max)/3+min).toFixed(1)
  • Second text field (from right): (2*(min+max)/3+min).toFixed(1)
  • Right text field: (max).toFixed(1)

The left text field will show the value of the variable min.toFixed(x), which is a function that rounds the result to x decimal places. In our case, the value will be formatted to show one decimal place.

The second text field from the left should show 1/3 of the scale; therefore, we have used the formula min+(min+max)/3 to get 1/3 of the scale. We will use the toFixed(1) function to round the result.

The other two text fields are similar to those two; we can add units and a label to our component to finish:

7.7.4

To use the Label and Units text fields, we need to create two new variables. Both will be of the type ‘string’. The first variable will be named label, and the second will be named unit. For the text field label, add Text Replacement equal to the variable label. For Units text field, add Text Replacement equal to variable units. Finally, click on the Save button to see the changes.

7.7.5

Nenašli jste co jste hledali?

Kontaktujte nás.
ZAVOLEJTE
  • +420 541 217 220
Nebo nám napište a my se ozveme.
  • Obchodní oddělení
  • Technická podpora
  • Servis/Reklamace
  • Webmaster

AMiT Automation s.r.o.

  • info@amit-automation.cz
  • +420 541 217 220
    +420 549 210 403
    +420 549 210 276

Vídeňská 186/118


619 00 Brno


Česká republika

IČO: 276 52 203


DIČ: CZ27652203

Česká rada pro šetrné budovy

MODERNÍ ELEKTRONIKA PRO PRŮMYSLOVOU AUTOMATIZACI A AUTOMATIZACI BUDOV

Copyright © — AMiT Automation
Přihlášení a registrace
Registrací souhlasíte s našimi obchodními podmínkami a se zpracováním osobních údajů.

We often send out our newsletter with news and great offers. We will never disclose your data to third parties and you can unsubscribe from the newsletter at any time.

Unfortunately, we’re unable to offer free samples. As a retailer, we buy all magazines from their publishers at the regular trade price. However, you could contact the magazine’s publisher directly to ask if they can send you a free copy.

You can create a new account at the end of the order process or on the following page. You can view all of your orders and subscriptions in your customer account. You can also change your addresses and your password.

No, you don’t have to create an account. But there are a few advantages if you create an account.

  • You never have to enter your billing and shipping address again

  • Find all of your orders, subscriptions and addresses in your account

  • Download invoices of your orders

No, we don’t have a physical store location at the moment. We accept only orders through our online shop and we’re shipping all orders with the Swiss Post Service. Please visit our shipping section for more details.

From time to time you will find us at design fairs and popup markets in Switzerland. Subscribe to our newsletter and you’ll receive the latest news.

Tab Content

This is a basic text element.
Smazat účet?
Určitě si přejete smazat účet?

Tuto akci nelze vrátit zpět.
Fakturační a doručovací údaje

Pro zobrazení tohoto formuláře se musíte přihlásit.

Zapomenuté heslo

Zadejte svůj e-mail, na který vám zašleme odkaz pro obnovení hesla.

Přihlášení a registrace
Registrací souhlasíte s našimi obchodními podmínkami a se zpracováním osobních údajů.

We often send out our newsletter with news and great offers. We will never disclose your data to third parties and you can unsubscribe from the newsletter at any time.

Unfortunately, we’re unable to offer free samples. As a retailer, we buy all magazines from their publishers at the regular trade price. However, you could contact the magazine’s publisher directly to ask if they can send you a free copy.

You can create a new account at the end of the order process or on the following page. You can view all of your orders and subscriptions in your customer account. You can also change your addresses and your password.

No, you don’t have to create an account. But there are a few advantages if you create an account.

  • You never have to enter your billing and shipping address again

  • Find all of your orders, subscriptions and addresses in your account

  • Download invoices of your orders

No, we don’t have a physical store location at the moment. We accept only orders through our online shop and we’re shipping all orders with the Swiss Post Service. Please visit our shipping section for more details.

From time to time you will find us at design fairs and popup markets in Switzerland. Subscribe to our newsletter and you’ll receive the latest news.

Tab Content

This is a basic text element.
Přidat do seznamu
+ Přidat nový seznam