To download the examples for Module 5, click Module_5_Examples.zip.
In this topic:
This topic addresses the following key concepts:
In this topic, you will learn the following:
In this topic, you will add a basic parameter-editing dialog to the parameterized RC filter schematic component symbol. Consider the following dialog configured to edit the three parameters used in the parameterized RC filter subcircuit:
To define each parameter-editing control, three data elements are required: Descriptive Label, Type, and Range. The following table describes these elements in detail.
Data Element | Example Data Value | Description | ||||||||||||||||||
Descriptive Label | Cutoff Frequency (Hz) | Any text string which does
not
contain the colon or comma characters. The descriptive
label is compliant with basic HTML markup, which means that you can do the
following:
|
||||||||||||||||||
Type | REAL | Five types of
parameter-editing controls are allowed with NewValueDialog function. The
most common types are the Real and Integer spinner controls, followed by the
List and Boolean types. The String entry type can be used to prompt the user
for general string information and is used infrequently. The five types are
described in the table below:
|
||||||||||||||||||
Range | 1p|100G |
|
In SIMetrix/SIMPLIS, the three data fields for each control are concatenated into a string using the colon character as a delimiter. For example, the three data elements for the Cutoff Frequency parameter control are concatenated into the following string with the colons in red:
Cutoff Frequency (Hz):REAL:1p|100G
This string is a complete parameter-editing control definition for a single parameter. Multiple parameter-editing control definitions are further concatenated to create a single string to define the set of parameter-editing controls for a dialog.
Each parameter-editing control definition is then concatenated into a single string using the comma character as a delimiter. In this example, there are three parameter-editing controls, and the concatenated string of parameter-editing control definitions is shown below with the commas in red:
Cutoff Frequency (Hz):REAL:1p|100G,Resistor Value (ohms):INT:1|100k,Filter Gain (V/V):LIST:1|2|5|10
The actual parameter-editing functionality is provided by a script. In topic 4.0 What is a Symbol?, you learned that the VALUESCRIPT symbol property holds the script name which is executed when you double click on the symbol. SIMetrix/SIMPLIS includes parameter-editing valuescripts that are specialized for the combination of each dialog definition (NewValueDialog or TabValueDialog) with each parameterization method (Single-Property or Multi-Property).
All valuescripts read the symbol or subcircuit definition for the dialog definition and then present the user with the dialog for editing. In this section, you will store the dialog definition on three Reserved Symbol Properties.
All parameter-editing dialogs use the LABELS symbol property to store the parameter-editing control information. The following string defines the LABELS property for the parameter-editing dialog shown below:
Cutoff Frequency (Hz):REAL:1p|100G,Resistor Value (ohms):INT:1|100k,Filter Gain (V/V):LIST:1|2|5|10
The PARAMETERS symbol property holds the parameter names and their default values in a parameter string. In this example, the PARAMETERS property is:
FC=10k R_VAR=1k GAIN=1
The VALUESCRIPT symbol property holds the script name to execute when a user double clicks on the symbol. This example uses the Multi-Property Method, which requires the multi-property valuescript:
edit_parameterised_multi_prop_device
Although the amount of data required to define a parameter-editing dialog is reasonable, the syntax is exacting. For this reason, a spreadsheet tool has been created to help define dialog parameter-editing controls. This spreadsheet, 5.3_new_value_dialog_definition_worksheet.xlsx, is included with the Module 5, in the Module_5_Examples.zip file.
In the next exercise, you will add the dialog definition described in this topic to the multi-property parameterized RC filter symbol using the spreadsheet.
Instead of adding individual symbol properties in this exercise, you will copy a set of script commands from the spreadsheet and execute the commands in SIMetrix/SIMPLIS.
In the previous exercise you added the parameter-editing definition saved in the spreadsheet. This definition used three control types as a demonstration; however, the parameters being edited should be REAL types. In this exercise you will modify the dialog definition to use the REAL type control for all parameters.
As you modify the spreadsheet, the script commands will automatically reflect your changes. When you go to modify the existing dialog definition, you will still use the AddSymbolProperty command.