Cable Number Formatting

<< Click to Display Table of Contents >>

Navigation:  WireCAD PRO Manual > Advanced Topics >

Cable Number Formatting

Previous pageReturn to chapter overviewNext page

Menu: Project Explorer>Project Databases>Project Cable Number Format

Default command line shortcut: fcab

Related Settings:

 None


Allows control of the Cable numbering scheme. Using the Cable Number Format dialog you can select any field that is associated with the Cable Number and concatenate it into your own numbering scheme. Each of the fields selected can be formatted and the numbers can be set to sequence off of another field.

 

How it Works

The Cable Number format tool is used to generate regular expressions that are then used to parse Cable Number info as well as provide formatting information to masked text boxes.

A note on regular expressions: WireCAD 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 Cables database and in text boxes, 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 cable number format:

 

 \w{1,6}-\d{1,5}-\w*

 

 (?<SIGNALTYPEPREFIX>\w{1,6})-(?<NUMERICSEQUENCE>\d{1,5})-(?<MULTICOREDATA>\w*)

 

warning

NOTE: 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 Cables 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 Cables table in order to keep your sequence.

 

Controls

Selected Format - Selected the current Cable Number format. Allows addition and deletion of formats as well.

fcab1

Variable List - Displays the sequence of variables in grid view that will be concatenated into the final Cable Number.

fcab2

SeqOn - This variable should sequence on another variable's value.

Order - The order in the list of the variable.

Test Sequence - Performs a basic syntax test on the regular expressions.

 

Available Variables -

Variable

Description

Can Sequence On

Default Format (Regex)

SIGNALTYPE

The signal type associated with the cable

X

\w{1,4}

SIGNALTYPEPREFIX

the signal type prefix associated with the signal type of the cable

X

\w{1,4}

SOURCESYSTEM

The source SysName

X

\w{1,6}

SOURCEPIN

The source port or pin name

X

\w{1,6}

SOURCEALIAS

The source Alias

X

\w{1,6}

SOURCELOCATION

The source location

X

\w{1,6}

DESTSYSTEM

The destination SysName

 

\w{1,6}

DESTPIN

The destination port or pin name

 

\w{1,6}

DESTALIAS

The destination alias

 

\w{1,6}

DESTLOCATION

The destination alias

 

\w{1,6}

SOURCE_OR_DEST_PIN_IF_JACKFIELD

Not Yet Implemented

 

\w{1,6}

MULTICOREDATA

Core data as defined in the associated cable type if any

 

\w*

STRING

any string (usually used for delimiters like dashes (-))


-

NUMERICSEQUENCE

a numeric sequence that starts with the project starting number


\d{1,5}

ALPHASEQUENCE

an alpha sequence that starts at the letter 'a'


\w{4}

USER1

the global equipment library device definition user1 field

 

\w{1,6}

USER2

"


\w{1,6}

USER3

"


\w{1,6}

USER4

"


\w{1,6}

 

More About Regex

The Format field uses regular expressions. The following are some simple examples:

\w{1,6}                        Any non number, non punctuation string from 1 to 6 characters

\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 dash except when in [] or {} then a range.

[a-zA-Z0-9_\-\,]{1,4}        Lower / Upper case, 0-9, underscore, dash, and comma.