ABOUT, PROJECTSBLOG COMMUNITY TERMS of Use BARON 58 SimVimPanel Status, plans SimVimCockpit HOME

<<<      Mode Switches, Conditions

One of the features of ArdSimX were switchable encoder modes. Sometimes they required tricky logic to set up all the required functionality. For example, a common goal was configuring a single encoder for radio, which would switch between different COM/NAV (1 and 2) modes with a press of one button, and between MHz/KHz with a press of another, built-in button. This required setting up 8 different encoder modes and two buttons that used different logic to switch the encoder's mode.

In addition to this, later versions of ArdSimX included an experimental feature with switchable output modes - for example, to output different data to a 7-segment display.

Needless to say, there can be a lot of cases where the specific functions of inputs and outputs need to be influenced by outside conditions. Variations include switching modes using buttons or encoders, switching modes or disabling outputs based on dataref value, such as insufficient power, and so on.


In SimVimCockpit Interface, the whole logic for these functions was reworked to make them all unified and allow greater control over various conditions.

Imagine a configuration file with all the input and output config lines, as it looked in ArdSimX. The main idea now is that each config line can by dynamically enabled or disabled. Unlike ArdSimX, now any line can have separate parameters indicating what mode number and what mode switch it corresponds to. A line can even have several mode switches configured to it, making things like the encoder example described earlier more easy to implement.

Such condition, for example, can be used to disable a 7-segment radio display when the power failure has occured in the simulator, along with any encoders and buttons associated with it.

All this functionality is currently at an early stage in development. We will be working out the specifics along the way.


Conditions

Conditions are a new feature in SimVimCockpit Interface. They are placed in the configuration file under the [Conditions] category, and can be used to enable and disable inputs or outputs based on the value of a specified dataref. The dataref conditions can be used intermittently with mode buttons for determining the working state of a particular config line.

Any config line can have any combination of conditions the determine if this line is "Active". For example, if an output has the option "c=B6:2,C1>10", that means that this output will only work when the mode button B6 is in mode state 2, and the value of the dataref specified in Condition 1 is greater than 10.


SimVim special functions

Mode_Switch

Switches between 2 different modes according to pin state.

Mode_Button

Switches between several modes in a cycle. Each button click activates the next mode in a row.

Mode_Group

A group of buttons assigned to several Arduino (or extension) pins in a row. Each button activates its corresponding mode number.

Analog_State

Used for a condition to check the current position of an analog input, in the range of 0-1024.

Mode_LED

A LED (or digital output) that is always ON when specified conditions are met.

Mode_LED_Group

A group of LEDs assigned to several Arduino (or extension) pins in a row. References the corresponding set of modes (Mode_Button, Mode_Group). Only one LED is ON, based on the current mode number.



MODE Switch options

"Mode_Button" and "Mode_Switch" parameters now work with SimVimCockpit v0.9.14. Add them via the configurator, then edit your data.cfg file to link other parameters to them (this will be added to the configurator later).

Example: You have a mode button on pin 5 and mode switch on pin 6:

B5 Mode_Button
S6 Mode_Switch

Mode switch has 2 states. Mode button can have more than 2 states, and cycles through them with each click. Default is 2. To increase the number of states the button has, add the "n" option to it with the desired number. For example:

B5 Mode_Button n=4

Use the "c" option in the controlled I/O config lines to link them to the mode button/switch state. For example:

E10 XPDR_1_Set c=B5:1
E10 XPDR_2_Set c=B5:2
E10 XPDR_3_Set c=B5:3
E10 XPDR_4_Set c=B5:4


E12 Com1_k25_Set c=S6:1
E12 Com1_Mhz_Set c=S6:2

For the Mode_Switch, state 1 is OFF, and state 2 is ON. Some other, more convenient ways of linking the mode buttons with the controlled parameters may also be added later.










© Copyright 2012-2018 - SimVim Design