Difference between revisions of "WireCAD Online Help:SysName Format"
Wirecadadmin (Talk | contribs) |
Wirecadadmin (Talk | contribs) |
||
(11 intermediate revisions by the same user not shown) | |||
Line 22: | Line 22: | ||
− | {{ | + | {{warning|WireCAD supports multiple formats in the same database. In order to accomplish this we use the simplified Regex as a mask. If you have any data in the Project Systems table and you change ANYTHING in ANY Format field you will change the mask and therefore the sequence. You must decide if the change is such that it warrants copying the new simplified Regex to all records in the Project Systems table in order to keep your sequence.}} |
Line 34: | Line 34: | ||
| '''Selected Format'''|| Selects the current SysName format. Clicking the + or - button allows you to add and remove custom SysName Formats[[File:Sysfmt1.png|thumb|Select SysName Format]] | | '''Selected Format'''|| Selects the current SysName format. Clicking the + or - button allows you to add and remove custom SysName Formats[[File:Sysfmt1.png|thumb|Select SysName Format]] | ||
|- | |- | ||
− | |'''Input String/Looks Like'''|| WireCAD uses a fixed set of constants to test your custom format. All of the constants are upper case. The Input String provides a string to which the selected format is applied. The '''Looks Like''' label shows the input string with the formatting applied. | + | |'''Input String/Looks Like'''|| WireCAD uses a fixed set of constants to test your custom format. All of the constants are upper case. The Input String provides a string to which the selected format is applied. The '''Looks Like''' label shows the input string with the formatting applied.[[File:Sysfmt3.png|thumb|Select SysName Format]] |
|- | |- | ||
− | |'''Advanced Regular Expression Info(geek stuff)'''|| This collapsible panel displays the complex and simplified REGEX. The simplified REGEX is associated with every SysName that is created under this format. This allows us to have multiple sequences working in the same table. As noted above: even minor changes in the simplified REGEX will change the sequence. | + | |'''Advanced Regular Expression Info(geek stuff)'''|| This collapsible panel displays the complex and simplified REGEX. The simplified REGEX is associated with every SysName that is created under this format. This allows us to have multiple sequences working in the same table. As noted above: even minor changes in the simplified REGEX will change the sequence.[[File:Sysfmt4.png|thumb|SysName Format]] |
|- | |- | ||
| '''Regex Examples'''||Some examples that you can cut/paste into the format field. | | '''Regex Examples'''||Some examples that you can cut/paste into the format field. | ||
Line 42: | Line 42: | ||
| '''Variable List'''|| Displays the sequence of variables in grid view that will be concatenated into the final SysName.[[File:Sysfmt2.png|thumb|Select SysName Format]] | | '''Variable List'''|| Displays the sequence of variables in grid view that will be concatenated into the final SysName.[[File:Sysfmt2.png|thumb|Select SysName Format]] | ||
|- | |- | ||
− | | '''Field''' || The variable to concatenate into the output string. | + | | '''Field''' || The variable to concatenate into the output string.[[File:Sysfmt6.png|thumb|SysName Format]] |
|- | |- | ||
− | | '''Sequence On'''|| Applies to Numeric/Alpha Sequences. Sets the variable that the sequences is associated to. | + | | '''Sequence On'''|| Applies to Numeric/Alpha Sequences. Sets the variable that the sequences is associated to.[[File:Sysfmt4.png|thumb|Select SysName Format]] |
|- | |- | ||
− | |''' Format''' || The REGEX for all fields except the STRING variable. The STRING variable uses the literal string value of the format field. | + | |''' Format''' || The REGEX for all fields except the STRING variable. The STRING variable uses the literal string value of the format field.[[File:Sysfmt5.png|thumb|SysName Format]] |
|- | |- | ||
| '''Order''' || the variable's order in the list. | | '''Order''' || the variable's order in the list. | ||
Line 60: | Line 60: | ||
{| class="wikitable" style=" background-color:#ffffcc;" cellpadding="10" cellspacing="0"; border="1"; width="100%" | {| class="wikitable" style=" background-color:#ffffcc;" cellpadding="10" cellspacing="0"; border="1"; width="100%" | ||
|- | |- | ||
− | ! Variable !! Description !! Sequencable !! Default REGEX | + | ! Variable !! Description !! Sequencable !! Default Format REGEX |
|- | |- | ||
− | | ''' | + | | '''MANUFACTURER'''|| The Manufacturer Name from the global Manufacturers database||X||\w{1,6} |
+ | |- | ||
+ | | '''EQUIPMENTNAME'''|| Equipment Name/PN/Model Number||X||\w{1,6} | ||
+ | |- | ||
+ | | '''DESCRIPTION'''|| The device description as contained in the global equipment library||X||\w{1,6} | ||
+ | |- | ||
+ | | '''EQUIPMENTTYPE'''|| The Equipment Type as contained in the global equipment library||X||\w{1,6} | ||
+ | |- | ||
+ | | '''LOCATION'''|| The location typed in the SysName edit dialog.||X||\w{1,6} | ||
+ | |- | ||
+ | | '''ELEVATION'''|| The elevation typed in the SysName edit dialog||X||\w{1,5} | ||
+ | |- | ||
+ | | '''STRING'''|| any string (usually used for delimiters like dashes (-))||||any string (usually used for delimiters like dashes (-)) | ||
+ | |- | ||
+ | | '''ALPHASEQUENCE'''|| an alpha sequence that starts at the letter 'a'||X||\w{4} | ||
+ | |- | ||
+ | | '''NUMERICSEQUENCE'''|| a numeric sequence that starts with the project starting number||X||\d{1,5} | ||
+ | |- | ||
+ | | '''USER1'''|| the global equipment library device definition user1 field||X||\w{1,6} | ||
+ | |- | ||
+ | | '''USER2'''|| the global equipment library device definition user2 field||X||\w{1,6} | ||
+ | |- | ||
+ | | '''USER3'''|| the global equipment library device definition user3 field||X||\w{1,6} | ||
+ | |- | ||
+ | | '''USER4'''|| the global equipment library device definition user4 field||X||\w{1,6} | ||
+ | |||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== More About Regex == | == More About Regex == | ||
− | |||
− | |||
The Format field uses regular expressions. The following are some simple examples: | The Format field uses regular expressions. The following are some simple examples: | ||
− | \w{1,6} | + | {| class="wikitable" style=" background-color:#ffffcc;" cellpadding="10" cellspacing="0"; border="1"; width="100%" |
− | \w* | + | |- |
− | [a-zA-Z0-9]{5} | + | ! Expression!! Description |
− | \d{1,5} | + | |-\w{1,6} ||Any non number, non punctuation string from 1 to 6 characters |
− | \d* | + | |- |
− | \\ a slash "\". The \ is the escape character so you need two | + | |\w* ||Any non number, non punctuation string any length |
− | - | + | |- |
− | [a-zA-Z0-9_\-\,]{1,4} | + | |[a-zA-Z0-9]{5} ||Lower / Upper case and 0 thru 9 exactly 5 characters |
+ | |- | ||
+ | |\d{1,5} ||Digits 1 to 5 digits in length | ||
+ | |- | ||
+ | |\d*||Digits any length | ||
+ | |- | ||
+ | |\\|| a slash "\". The \ is the escape character so you need two | ||
+ | |- | ||
+ | |-"-" || a dash except when in [] or {} then a range. | ||
+ | |- | ||
+ | |[a-zA-Z0-9_\-\,]{1,4} || Lower / Upper case, 0-9, underscore, dash, and comma. | ||
+ | |} |
Latest revision as of 18:57, 2 January 2011
Command Line Shortcut: fsys User Permissions Level: sysNameFormatMasterCollection - AllowAddNew/AllowEdit/AllowDelete |
How it Works
The SysName format tool is used to generate regular expressions that are then used to parse SysName info as well as provide formatting information to masked text boxes.
A note on regular expressions: WireCAD v6 makes extensive use of regular expressions (Regex). Regular expressions are a well documented string parsing tool. Much has been written on them. It is not within the scope of this quick start guide to fully explain regular expressions; however, a google search will tell you more than you ever wanted to know.
Two forms of regular expression are generated: a simplified form that is used as a mask in both the Systems database and in textboxes, and a complex form that aids in the generation of queries to determine the next number in a sequence. The following are both the simplified and complex regex for the default format:
\w{1,6}-\d{1,5} (?<EQUIPMENTTYPE>\w{1,6})-(?<NUMERICSEQUENCE>\d{1,5})
Controls Explanation
Setting/Control | Explanation/Description |
---|---|
Selected Format | Selects the current SysName format. Clicking the + or - button allows you to add and remove custom SysName Formats |
Input String/Looks Like | WireCAD uses a fixed set of constants to test your custom format. All of the constants are upper case. The Input String provides a string to which the selected format is applied. The Looks Like label shows the input string with the formatting applied. |
Advanced Regular Expression Info(geek stuff) | This collapsible panel displays the complex and simplified REGEX. The simplified REGEX is associated with every SysName that is created under this format. This allows us to have multiple sequences working in the same table. As noted above: even minor changes in the simplified REGEX will change the sequence. |
Regex Examples | Some examples that you can cut/paste into the format field. |
Variable List | Displays the sequence of variables in grid view that will be concatenated into the final SysName. |
Field | The variable to concatenate into the output string. |
Sequence On | Applies to Numeric/Alpha Sequences. Sets the variable that the sequences is associated to. |
Format | The REGEX for all fields except the STRING variable. The STRING variable uses the literal string value of the format field. |
Order | the variable's order in the list. |
[UP]/[DN] | Move the selected record up or down in the list. |
Test Syntax | Tests the syntax. This tool has so many possibilities that it is possible that the [Test Syntax] function may not find all errors. |
Available Variables
Variable | Description | Sequencable | Default Format REGEX |
---|---|---|---|
MANUFACTURER | The Manufacturer Name from the global Manufacturers database | X | \w{1,6} |
EQUIPMENTNAME | Equipment Name/PN/Model Number | X | \w{1,6} |
DESCRIPTION | The device description as contained in the global equipment library | X | \w{1,6} |
EQUIPMENTTYPE | The Equipment Type as contained in the global equipment library | X | \w{1,6} |
LOCATION | The location typed in the SysName edit dialog. | X | \w{1,6} |
ELEVATION | The elevation typed in the SysName edit dialog | X | \w{1,5} |
STRING | any string (usually used for delimiters like dashes (-)) | any string (usually used for delimiters like dashes (-)) | |
ALPHASEQUENCE | an alpha sequence that starts at the letter 'a' | X | \w{4} |
NUMERICSEQUENCE | a numeric sequence that starts with the project starting number | X | \d{1,5} |
USER1 | the global equipment library device definition user1 field | X | \w{1,6} |
USER2 | the global equipment library device definition user2 field | X | \w{1,6} |
USER3 | the global equipment library device definition user3 field | X | \w{1,6} |
USER4 | the global equipment library device definition user4 field | X | \w{1,6} |
More About Regex
The Format field uses regular expressions. The following are some simple examples:
Expression | Description |
---|---|
\w* | Any non number, non punctuation string any length |
[a-zA-Z0-9]{5} | Lower / Upper case and 0 thru 9 exactly 5 characters |
\d{1,5} | Digits 1 to 5 digits in length |
\d* | Digits any length |
\\ | a slash "\". The \ is the escape character so you need two |
[a-zA-Z0-9_\-\,]{1,4} | Lower / Upper case, 0-9, underscore, dash, and comma. |