【机器视觉】 import算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數
- 06. 結果
- 07. 附錄
01. 概述
import - 導入一個或多個外部程序。
02. 簽名
import( : : ProcedureSource : )
03. 描述
import語句可用于從HDevelop程序中導入其他外部程序。 導入的程序僅適用于包含導入語句的程序,但不作用于其他程序。
import語句可以出現在程序的任何一行中。 導入的程序只能在導入語句下方使用,并可能被后面的(相同名稱)導入程序取代。
proc()* unresolved procedure callimport ./the_one_dirproc()* resolves to ./the_one_dir/proc.hdvpimport ./the_other_dirproc()* resolves to ./the_other_dir/proc.hdvp參數ProcedureSource指向外部程序的來源。 它可以是包含要使用的程序(和/或)程序庫的目錄的路徑或者程序庫的文件名。 在這兩種情況下,路徑可能是絕對的或相對的。 在后一種情況下,HDevelop把相對路徑解析為包含import語句的程序的文件位置。 如果路徑包含一個或多個空格,則路徑必須用引號括住,否則程序行將變為無效。
與系統相反,用戶定義和會話目錄HDevelop(ser-defined, and session directories HDevelop)僅在外部程序的import語句指定的目錄中查找,但不在其子目錄中遞歸查找。
請注意,import語句永遠不會執行,因此必須在該程序加載時已經對ProcedureSource進行了評估。 因此,ProcedureSource必須是一個常量表達式,特別是不能將一個字符串變量傳遞給ProcedureSource。
但是,ProcedureSource也可能包含環境變量,HDevelop會相應地進行解析。 無論實際使用的平臺如何,環境變量都必須以Windows語法表示,即%VARIABLE%。
import既不檢驗路徑ProcedureSource是否存在,也不檢驗它是否指向程序庫或包含程序的目錄。 因此,在任何情況下,具有不存在或無意義路徑的import語句仍然保持有效的程序行。
導入路徑在HDevelop的程序設置中分別列出。 當然,這些路徑不能在程序設置中修改或停用。 此外,僅通過import語句提供的程序標有特殊的圖標。
在程序清單中,顯示的import語句輸入必須沒有帶括號,以強調該行是聲明而不是可執行的算子。
原文描述:
The import statement can be used to import additional external procedures from within a HDevelop program. The imported procedures become only available for the procedure that contains the import statement but not for other procedures.
import statements may occur in any line of a procedure. The imported procedures become only available below the import statement and may be overruled by later import statements.
proc()* unresolved procedure callimport ./the_one_dirproc()* resolves to ./the_one_dir/proc.hdvpimport ./the_other_dirproc()* resolves to ./the_other_dir/proc.hdvpThe parameter ProcedureSource points to the source of the external procedures. It can either be the path of a directory that contains the procedures and/or the procedure libraries to be used or directly the file name of a procedure library. In both cases, the path may either be absolute or relative. In the latter case, HDevelop interprets the path as being relative to the file location of the procedure that contains the import statement. The path has to be in quotes if it contains one or more spaces, otherwise the program line will become invalid.
Contrary to system, user-defined, and session directories HDevelop looks only in the directory specified by an import statement for external procedures but not recursively in its subdirectories.
Note, that an import statement is never executed and, therefore, ProcedureSource has to be evaluated already at the procedure’s loading time. Therefore, ProcedureSource has to be a constant expression, and, in particular, it is not possible to pass a string variable to ProcedureSource.
However, ProcedureSource may also contain environment variables, which HDevelop resolves accordingly. Environment variables, regardless of the platform actually used, must always be denoted in Windows syntax, i.e., %VARIABLE%.
import neither tests whether the path ProcedureSource exists nor whether it points to a procedure library or a directory that contains procedures at all. Therefore, import statements with nonexistent or pointless paths nonetheless stay valid program lines, in any case.
Import paths are listed separately in HDevelop’s procedure settings. Of course, these paths can’t be modified or deactivated from within the procedure settings. Furthermore, procedures that are available only via an import statement are marked with a special icon.
In the program listing, import statements are displayed and must be entered without parenthesis in order to emphasize that the line is a declaration and not an executable operator.
04. 注意
略
05. 參數
ProcedureSource (input_control) string → (string)
File location of the external procedures to be loaded: either a directory or a procedure library
要加載的外部程序的文件位置:目錄或程序庫
06. 結果
import從不執行。
HDevelop例程
variable_types.hdev Define variable types in HDevelop
07. 附錄
7.1 機器視覺博客匯總
網址:https://dengjin.blog.csdn.net/article/details/116837497
總結
以上是生活随笔為你收集整理的【机器视觉】 import算子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 global算子
- 下一篇: 【机器视觉】 par_join算子