日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【机器视觉】 dev_get_exception_data算子

發布時間:2024/4/24 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【机器视觉】 dev_get_exception_data算子 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

00. 目錄

文章目錄

    • 00. 目錄
    • 01. 概述
    • 02. 簽名
    • 03. 描述
    • 04. 注意
    • 05. 參數
    • 06. 結果
    • 07. 附錄

01. 概述

dev_get_exception_data - 訪問exception元組的元素。

02. 簽名

dev_get_exception_data( : : Exception, Name : Value)

03. 描述

算子dev_get_exception_data允許訪問由算子catch捕獲的exception元組的特定項目。 除了從來都是作為exception元組的第一個元素傳遞的錯誤代碼外,exception元組的所有其他數據都必須通過算子dev_get_exception_data專門訪問。 這是因為提供的數據的順序和范圍在將來的版本中可能會改變,并且可能會因不同的導出代碼類型而有所不同。

如果一個算子在HDevelop或HDevEngine中發生錯誤,則捕獲的exception元組包含下面列出的數據項。 這個元組必須傳遞給參數Exception。 請求的數據位置(slot)的名稱必須傳遞給參數Name。 請求的數據在參數Value中返回。 通過將slot名稱的元組傳遞給Name,可以在dev_get_exception_data的單個調用中請求多個異常數據項。 在這種情況下,相應的數據元組被返回到Value中。 對于不可用的請求項目,算子返回空字符串(’’)。

支持的data slots:

‘error_code’:

HALCON或用戶定義的錯誤代碼。 HALCON錯誤代碼列表(代碼<10000)可以在“Extension Package Programmer’s Manua”的附錄中找到。

‘error_message’:

HALCON錯誤信息。

‘add_error_code’:

附加的HDevelop特定的錯誤代碼。 這些錯誤代碼指定在HALCON算子(代碼= 21000)內還是在算子外部(例如在判斷和分配參數表達式期間)是否捕獲到錯誤。 在后一種情況下,錯誤代碼更精確地指定錯誤類型。 相關的錯誤代碼列在“HDevelop User’s Guide”中。

‘add_error_message’:

更精確地描述HDevelop特定錯誤的附加錯誤消息。

‘program_line’:

程序發生錯誤行的編號。

‘operator’:

拋出異常的算子的名稱(如果異常在受保護的程序中拋出,則返回“ - protected - ”而不是算子名稱)。

‘call_stack_depth’:

調用堆棧的深度(如果‘main’發生錯誤則返回深度1)。

‘procedure’:

發生錯誤的程序的名稱。

‘user_data’:

用戶定義的exception元組。 如果算子異常被捕獲并重新拋出,則這是在throw調用中被追加到捕獲的異常元組中的元組。 如果是完全由用戶定義的異常,則返回除包含錯誤代碼(> = 30000)的第一個元素之外的所有元組項。 如果沒有通過異常元組傳遞用戶數據,則返回一個空元組。 請注意,在同一個dev_get_exception_data調用中,用戶數據元組(user data tuple)不能和任何其他異常數據一起請求。

原文描述

The operator dev_get_exception_data enables to access specific items of an exception tuple that was caught by the operator catch. Except the error code that is always passed as the first element of the exception tuple all other data of the exception tuple has to be accessed exclusively via the operator dev_get_exception_data. This is due to the fact that the order and the extent of the provided data may change in future versions and may vary for the different code exports.

If an operator error occurred within HDevelop or HDevEngine, the caught exception tuple contains the data items listed below. This tuple has to be passed to the parameter Exception. The name of the requested data slot has to be passed to the parameter Name. The requested data is returned in the parameter Value. By passing a tuple of slot names to Name it is possible to request several exception data items in a single call of dev_get_exception_data. In that case a corresponding data tuple is returned in Value. For requested items that are not available an empty string (’’) is returned.

Note that the operator dev_get_exception_data is meant to be used within HDevelop or HDevEngine. Some information is not available when the operator is exported.

Supported data slots:

‘error_code’:
HALCON or user defined error code. A list of HALCON error codes (codes < 10000) can be found in the appendix of the “Extension Package Programmer’s Manual”.

‘add_error_code’:
Additional HDevelop specific error code. These error codes specify whether an error was caught within the HALCON operator (code = 21000) or outside the operator, e.g., during the evaluation and assignment of the parameter expressions. In the latter case the error code specifies the error type more precisely. The relevant error codes are listed in the “HDevelop User’s Guide”.

‘error_message’:
HALCON error message.

‘add_error_message’:
Additional error message that describes the HDevelop specific error more precisely.

‘program_line’:
Number of the program line, where the error occurred.

‘operator’:
Name of the operator that threw the exception (if the exception was thrown in a protected procedure, ‘–protected–’ is returned instead of the operator name).

‘call_stack_depth’:
Depth of the call stack (if the error occurred in ‘main’ a depth of 1 is returned).

‘procedure’:
Name of the procedure where the error occurred.

‘user_data’:
User defined exception tuple. If an operator exception was caught and rethrown, this is the tuple that was appended to the caught exception tuple in the call of throw. In case of a completely user defined exception all tuple items except the first element containing the error code (>= 30000) are returned. If no user data was passed with the exception tuple, an empty tuple is returned. Note, that the user data tuple cannot be requested together with any other exception data in one dev_get_exception_data call.

04. 注意

05. 參數

Exception (input_control)     exception-array → (integer / string)
  包含exception數據或用戶定義的錯誤代碼的元組。

Name (input_control)      attribute.name(-array) → (string)

請求的exception數據的名稱。
  Default value: ‘error_code’
  List of values: ‘add_error_code’, ‘add_error_message’, ‘call_stack_depth’, ‘error_code’, ‘error_message’, ‘operator’, ‘procedure’, ‘program_line’, ‘user_data’

Value (output_control) attribute.value-array → (integer / string)
  請求的exception數據。

06. 結果

如果指定參數的值正確,則dev_get_exception_data(作為算子)返回2(H_MSG_TRUE)。 否則會引發異常并返回錯誤代碼。

HDevelop例程

try_catch.hdev Demonstrate the usage of the exception handling in HDevelop
set_shape_model_timeout.hdev Demonstrate how to use the timeout mechanism for shape-based matching

程序示例

07. 附錄

7.1 機器視覺博客匯總
網址:https://dengjin.blog.csdn.net/article/details/116837497

總結

以上是生活随笔為你收集整理的【机器视觉】 dev_get_exception_data算子的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。