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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

【机器视觉】 catch算子

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

00. 目錄

文章目錄

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

01. 概述

catch - 捕獲在前面的try塊中拋出的異常。

02. 簽名

catch( : : : Exception)

03. 描述

使用算子try,catch,endtry和throw可以在HDevelop中實現動態的異常處理,這相當于C ++和C#中的異常處理。 HDevelop中異常處理的基本概念在算子try,throw和dev_set_check以及“HDevelop用戶指南”中進行了描述。

算子catch在錯誤情況時結束一個監控的程序行塊,并跳轉至另一個程序行塊。 如果try-catch塊執行沒有出現異常,則catch-endtry塊將被忽略,程序將在相應的endtry算子后繼續執行。 相反,在錯誤情況下,程序執行從發生錯誤的算子(或從throw算子)直接跳轉到try-catch塊附近的catch算子。 輸出控制參數Exception返回一個元組,包含一組預定義的數據,用于描述發生算子錯誤時的錯誤。 如果throw運算符拋出異常,則可以返回任意的用戶定義的元組。

Exception元組中最重要的數據是錯誤代碼。 因此,它作為Exception元組的第一項,可以通過’Exception’[0]直接訪問。 但是,所有其他數據都必須通過算子dev_get_exception_data進行訪問,因為提供的數據的順序和范圍在將來的版本中可能會更改,并且可能因不同的編程語言導出而有所不同。 尤其是,必須考慮到,在導出的代碼中有一些錯誤元組的詳情是不可用的,有些詳情在請求之前可能無法確定(如錯誤消息)。

如果由算子錯誤引發異常,HALCON錯誤代碼<10000。如果從擴展庫算子引發的異常,則會返回用戶定義的錯誤代碼(> 10000)作為錯誤代碼。 所有HALCON錯誤代碼的列表可以在’Extension Package Programmer’s Manual’的附錄中找到。 算子throw的用戶定義的Exception元組的第一個元素應該是一個錯誤代碼> = 30000,可以加入其他的元組元素,沒有任何限制。

如果在算子在HDevelop或HDevEngine中發生錯誤,Exception元組將提供以下關于錯誤的附加信息:

HALCON錯誤消息。

附加的HDevelop特定錯誤代碼,用于指定在HALCON算子(代碼= 21000)內還是在算子外部(例如,在評估和分配參數表達式期間)捕獲到錯誤。 在后一種情況下,錯誤代碼更精確地指定了錯誤的類型。

一個確切的特定HDevelop錯誤消息。

發生錯誤的程序行號。

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

調用堆棧的深度(如果錯誤發生在“main”,則返回深度1)。

在大多數情況下,對于自動異常處理,使用HALCON錯誤代碼就足夠了。 其他數據主要是為了向HDevelop程序的開發者提供一些關于錯誤情況的信息,以便于調試。 注意:在一般情況下,在導出的代碼中有關錯誤位置的信息將不可用。

原文描述

With the help of the operators try, catch, endtry, and throw it is possible to implement a dynamic exception handling in HDevelop, which is comparable to the exception handling in C++ and C#. The basic concepts of the exception handling in HDevelop are described at the operators try, throw, and dev_set_check as well as in the “HDevelop User’s Guide”.

The operator catch ends a block of watched program lines and starts a block of program lines that have to be executed in an error case. If the try-catch block is executed without an exception, the catch-endtry block is ignored and program execution continues after the corresponding endtry operator. In contrast, in an error case the program execution jumps directly from the operator where the error occurred (or from the throw operator) to the catch operator of the surrounding try-catch block. The output control parameter Exception returns a tuple that contains a predefined set of data describing the error in case an operator error occurred. If the exception was thrown by the throw operator, an arbitrary user-defined tuple can be returned.

The most important data within the Exception tuple is the error code. Therefore, this is passed as the first item of the Exception tuple and can be accessed directly with ‘Exception’[0]. However, all other data has to be accessed through the operator dev_get_exception_data, because the order and the extent of the provided data may change in future versions and may vary for different programming language exports. Especially, it has to be taken into account that in the exported code there are some items of the error tuple that are not available and others that might not be determined until they are requested (like error messages).

If the exception was thrown by an operator error, a HALCON error code (< 10000) or if the aborted operator belongs to an extension package, a user-defined error code (> 10000) is returned as the error code. A list of all HALCON error codes can be found in the appendix of the “Extension Package Programmer’s Manual”. The first element of a user-defined Exception tuple thrown by the operator throw should be an error code >= 30000. Additional tuple elements can be chosen without any restrictions.

If an operator error occurred within HDevelop or HDevEngine, the following information about the error is provided by the Exception tuple:

The HALCON error code.

An additional HDevelop specific error code that specifies 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 kind of error more precisely.

The HALCON error message.

An appropriate HDevelop-specific error message.

The number of the program line, where the error occurred.

The 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).

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

The name of the procedure, where the error occurred.

In most cases, for an automatic exception handling it is sufficient to use the HALCON error code. Additional data is primarily passed in order to provide some information about the error condition to the developer of the HDevelop program for debugging reasons. Attention: in the exported code, in general, information about the error location will not be available.

04. 注意

算子try,catch,endtry和throw不支持C語言導出,支持語言C ++,C#和VisualBasic / .NET。 只有后者支持跨程序拋出異常。

05. 參數

Exception (output_control)   exception-array → (integer / string)
返回異常數據的元組。

06. 結果

catch總是返回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
cancel_draw_result.hdev Enable user-defined actions when a draw operation is canceled

程序示例

07. 附錄

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

總結

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

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

主站蜘蛛池模板: 99自拍视频 | 极品久久久久 | 国产寡妇亲子伦一区二区三区四区 | 日韩成人在线观看视频 | 欧美r级在线观看 | 久久久久久久国产视频 | 久久久久久无码午夜精品直播 | 91麻豆网| 中出一区| 综合久久一区 | 国产1区二区 | 免费观看已满十八岁 | 激情小说视频在线 | 人人插插| 九九在线观看高清免费 | 免费看一级片 | 日本理论片在线 | 国产玖玖| 久久精品无码一区二区三区免费 | 朝桐光一区二区三区 | 久久久久久久久久久综合 | 91最新在线视频 | 亚洲在线国产 | mm131国产精品 | 久久9精品区-无套内射无码 | japanese24hdxxxx日韩 | 国产成人无码精品久久二区三 | 在线不欧美 | 成人高清视频在线观看 | 欧美xxxx非洲 | 欧美日韩在线观看成人 | 久久精品国产亚洲av香蕉 | 欧美日韩免费在线 | 青青国产在线视频 | 国产精品自拍一区 | 亚州av在线播放 | 青青草在线免费视频 | 六月丁香综合 | 欧美怡春院 | 国产不卡一| 日韩播放 | 色吧av色av | 黑森林福利视频导航 | 懂色av一区二区三区四区 | jizz日本在线播放 | 91九色蝌蚪porny| 91精品网 | 国产精品主播一区二区 | 国产精品久久在线 | 欧美精品一区二区性色a+v | 一区二区三区在线观看免费 | 青青草福利视频 | 国产精品伦理 | 成人乱人乱一区二区三区一级视频 | av色区| 免费国产一区 | 一区二区三区在线观看视频 | 精品人妻一区二区三区在线视频 | 天堂中文在线视频 | 国产精品一区二区三区四 | av网址在线播放 | 亚洲一区二区日本 | 日日麻批免费视频播放 | 一级片免费观看视频 | 一区二区乱子伦在线播放 | 亚洲av无码一区二区三区性色 | 色老汉av一区二区三区 | 国产又粗又硬又黄的视频 | 精品人妻一区二区三区四区不卡 | 成人精品视频在线观看 | 欧美日韩激情在线观看 | 夜夜躁很很躁日日躁麻豆 | 国产一区二区三区网站 | 九九色视频 | 欧美123 | 里番acg★同人里番本子大全 | 中国在线观看片免费 | 亚洲av无码专区在线 | 国产乱码精品一区二区三区五月婷 | 日本道在线观看 | 亚洲在线中文字幕 | 素人fc2av清纯18岁 | 精品嫩模一区二区三区 | 91免费视 | 在线日韩一区二区 | 欧美日韩亚洲不卡 | 欧美激情视频一区二区三区不卡 | 女人喂男人奶水做爰视频 | 国产乱子伦视频一区二区三区 | 日韩成人高清在线 | 黄色毛毛片| 亚洲无码精品一区二区三区 | 亚洲成a人v欧美综合天堂麻豆 | 国产精品视频自拍 | 狠狠的日 | 视频一区在线观看 | 国产成人精品久久 | 超碰在线观看av | 韩国久久久|