zpywz 发表于 2014-9-12 20:41:59

Altium Designer 的高级查询,有没有中文的教程?

这个查询系统,一直稀里糊涂的用着。一直想搞明白它。今天找到了对应的帮助文件,用词典试着翻译了几段,还是很不好懂。
那位高手手上有中文的吗?

What is a Query?
Underlying Altium Designer is a powerful data filtering and editing system
它是强大的数据编辑和过滤系统
that lets you instruct the software to return you a specified set of objects.
让你指导软件返回相同对象的集合
This instruction is entered in the form of a Query.
这个指令的形式是输入一个查询。
A query is a string you enter using specific keywords and syntax, which will return the targeted objects. There are many keywords available, allowing you to target objects by their type, their properties, or both.
您输入一个使用特定的关键字和语法查询是一个字符串,这将返回目标对象。有很多关键字,让你的目标对象类型,它们的属性,或两者兼而有之。

For help on a specific query keyword, press F1 when the cursor is in the keyword. Use the links below for more information on the query system, operators, and tips on writing queries.
帮助在一个特定的查询关键字,按F1当光标在关键字。使用下面的链接获取更多信息查询系统,操作符和建议编写查询。

Use the Query Helper dialog for a list of keywords. To easily re-use popular queries add them to your Favorites (copy them from the History list). Favorites can be accessed from the Favorites dialog, or by pressing the Y shortcut in the schematic or PCB editors.
使用关键字的查询助手对话框列表。很容易地重用热门查询将它们添加到你的收藏(从历史列表中复制)。最爱最爱的可以访问对话框中,按Y快捷方式的示意图或PCB编辑。


Links:链接:
Introduction to the Query Language
查询语言介绍
An Insider’s Guide to the Query Language
内部查询语言向导
Query Language Reference
查询语言参考


The following is a list of the operator buttons available in the dialog:
下面列出可用的操作按钮在对话框中:

Arithmetic Operators
算术运算
Addition Operator +
加运算
Example:
例子:
NetPinCount + NetViaCount

Subtraction Operator, -
减法运算
例如:
ArcStopAngle - ArcStartAngle
弧停止角度 – 弧开始角度

Multiplication operator, *
乘法运算
例如:
PadXSize_BottomLayer * PadYSize_BottomLayer



Division Operator, /
除法运算
例如:
HoleDiameter / ViaDiameter


Integral Division operator, Div
例如:
Color Div 65536

This calculates Color divided by 65536 and the fractional part of the result is discarded.
这种计算彩色除法65536和小数部分被丢弃
Mod This is used to obtain the remainder from an integral division operation, equivalent to determining a mathematical modulus.

Example:

Color Mod 256

This calculates the remainder when Color is divided by 256 without determining the fractional part of the result.



Logic Operators

Logical AND operator, And

Logical AND operator, && This is also used to implement Logical AND, but has a lower order of precedence.

Examples:

IsPad And OnMultiLayer

IsPad && OnMultiLayer



Logical Or operator, Or

|| This is also used to implement Logical OR, but has a lower order of precedence.

Example:

IsPad Or IsVia

IsPad || IsVia



EXCLUSIVE OR operator, Xor This is used to implement Logical EXCLUSIVE OR.

Example:

OnMultiLayer Xor (HoleDiameter <> 0)

To be returned, an object has to either be on the Multi-Layer layer and have a Hole Diameter that is zero, or not be on the Multi-Layer layer and have a Hole Diameter that is not zero.



Not This is used to implement Logical NOT.

Example:

Not OnMultiLayer

To be returned, an object has to not be on the Multi-Layer layer.



Comparison Operators

< This means Less Than.

Example:

HoleDiameter < 40



<= This means Less Than Or Equal To.

Example:

HoleDiameter <= 40



>= This means Greater Than Or Equal To.

Example:

HoleDiameter >= 40



> This means Greater Than.

Example:

HoleDiameter > 40



<> This means Not Equal To.

Example:

HoleDiameter <> 40

To be returned, an object has to have a Hole Diameter which is not equal to 40.



= This means Equal To.

Example:

HoleDiameter = 40

To be returned, an object has to have a Hole Diameter which is equal to 40.



Between ... And ... This means Greater Than Or Equal To the first number, and Less Than Or Equal To the second number.

Example:

HoleDiameter Between 30 And 50

To be returned, an object has to have a Hole Diameter that is greater than or equal to 30, and less than or equal to 50.



Like Keywords that are used in conjunction with user-specified strings require that these strings be exactly specified whenever these strings are being compared by the = operator. The use of the Like operator permits the provision of strings which contain one or more Wild Card characters, thus supporting the comparison of strings which are not exactly specified. (See the immediately following Section for a description of Wild Card Characters.)

Example:

Name Like 'ADDR?*'

This returns objects having a Name property whose associated (text) string begins with 'ADDR' and which contains at least one more character; the string property required has thus not been exactly specified, but has been partially specified.



Wild Card Characters

Wild Card characters permit the provision of strings which are not exactly specified. These characters are typically used in conjunction with other characters, resulting in the provision of strings which are partially specified. A few exceptional keywords can accept string parameters that are not exactly specified, but for the most part, strings can only contain Wild Card characters when these are being compared by the Like operator.



? This can be replaced by a single character of any type.

Example:

Footprint Like 'DIP1?'

This returns objects which have a Footprint property of 'DIP10', or 'DIP12', or 'DIP14', etc.



* This can be replaced by any number of characters, each of which can be of any type.

Example:

Footprint Like 'SIP*'

This returns objects which have a Footprint property of 'SIP1', or 'SIP12', or 'SIP216', etc. (Any objects having a Footprint property of 'SIP' are also returned, because * can also be replaced by no characters.)



Boolean Strings

True This affirms the meaning of a Keyword.

Example:

IsPad = True

To be returned, an object has to be a pad.



False This negates the meaning of a Keyword.

Example:

IsVia = False

To be returned, an object has to not be a via.



Brackets and Order of Precedence

It is highly advisable to use brackets within a query whenever there is any possibility whatsoever that the query might not be correctly interpreted.

The following two queries provide a demonstration of how brackets are used in order to eliminate ambiguity:



((IsPad And OnMultiLayer) Or IsVia) And (HoleDiameter < 16)



(IsPad And OnMultiLayer) Or (IsVia And (HoleDiameter < 16))



Both of those queries return all vias whose hole diameter is less than 16mil, but each of them differs in which pads are also returned. The first query returns pads on the Multi-Layer layer whose hole diameter is less than 16mil, but the second query returns all pads on the Multi-Layer layer, regardless of their hole diameters.

Brackets have the highest precedence within an order of precedence that has been defined for the various operators provided, and which determines how queries are interpreted by the software (whenever the user has not provided brackets). The sequence of this order is as follows:



Brackets

Not

^, *, /, Div, Mod, And

+, -, Or, Xor

=, <>, <, >, <=, >=

&&, ||



Ambiguities are resolved by working from left to right. Parentheses are evaluated from inside to outside and equal levels are done left to right.

Examples:

A And B Or C becomes (A And B) Or C

A * B + C becomes (A * B) + C



This order of precedence is similar to that used in Pascal type languages. However, generous usage of brackets removes doubt, and makes the resulting queries easier to read by others.

LQS1200 发表于 2017-12-13 01:31:06

页: [1]
查看完整版本: Altium Designer 的高级查询,有没有中文的教程?