五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Halcon10-C語言打印消息

2023-07-02 11:39 作者:Halcom中國  | 我要投稿

#include "HalconC.h"

#include <stdio.h>




/* ignore automatic error handling */

void no_exit()

{

? (void)set_check("~give_error");

}



/* activate automatic error handling (default) */

void do_exit()

{

? (void)set_check("give_error");

}



/*?

?* handling of errors:

?*? ?a: user defined error handling

?*? ?b: exit on error

?*/

void test_errors()

{

? Herror? ? err;? ? ? ? ? ? ? ? ? ?/* message number */

? char? ? ? message[MAX_STRING];? ?/* error text */

? long? ? ? WrongWindowHandle = 0; /* no window available */

??

? (void)printf("Ignore automatic exit on error:\n");

? no_exit();

? (void)printf("- Trying to display a circle ... But because there's\n");

? (void)printf("? no valid graphics window, an error will occur!\n");

? err = disp_circle(WrongWindowHandle,100.0,100.0,100.0);

? if (err != H_MSG_TRUE)

? {

? ? (void)get_error_text(err,(char*)message);

? ? (void)printf("My error message: (%d) \n%s\n",err,message);

? ? (void)printf("... we should have opened a window!\n\n");

? }


? (void)printf("Switch on automatic exit on error:\n");

? do_exit();

? (void)printf("- Trying to display a circle ... But because there's\n");

? (void)printf("? no valid graphics window, the program will terminate!\n");

? (void)disp_circle(WrongWindowHandle,100.0,100.0,100.0);

}




/*

?* Types of messages:

?* Attention: Messages are no error and do not cause runtime errors!

?*? ? ? ? ? ? They are always returned.

?*

?*? ?H_MSG_TRUE:? everything is perfect

?*? ?H_MSG_FAIL:? something failed (try again)

?*? ?H_MSG_VOID:? you can't continue with this result

?*/

void test_messages()

{

? ?Herror? ? err;

? ?Hobject? ?Image,Circle,Empty,Result;

? ?long? ? ? WindowHandle;

? ?Htuple? ? task, value;

? ?

? ?(void)printf("Provoking a success message (H_MSG_TRUE):\n");

? ?err = open_window(1,1,100,100,0,"visible","",&WindowHandle);

? ?if (err == H_MSG_TRUE)

? ? ?(void)printf("- open_window:? H_MSG_TRUE (%d)\n",err);

? ?(void)printf("We wait until the mouse is inside the graphics window ...\n\n");

? ?do

? ?{

? ? ?err = get_mposition(WindowHandle,_,_,_);

? ?} while (err == H_MSG_FAIL);

? ?(void)close_window(WindowHandle);

? ?

? ?(void)printf("Now provoking a failure message (H_MSG_FAIL):\n");

? ?err = read_image(&Image,"this_image_does_not_exist");

? ?if (err == H_MSG_FAIL)

? ? ?(void)printf("- read_image (file not found): H_MSG_FAIL (%d)\n\n",err);

? ?else

? ? ?(void)printf("This is really funny! (%d)\n\n", err);

? ?

? ?(void)printf("Now provoking a void message (H_MSG_VOID):\n");

? ?/* create circle with radius 1.0 */

? ?(void)gen_circle(&Circle,100.0,100.0,1.0);? ? ?

? ?/* select large segments */

? ?(void)select_shape(Circle,&Empty,"area","and",1000.0,1000000.0);

? ?/* now we have an empty list! */

? ?create_tuple(&task,1);

? ?set_s(task,"empty_region_result",0);

? ?create_tuple(&value,1);

? ?set_d(value,H_MSG_FAIL,0);

? ?set_system("no_object_result","void");

? ?destroy_tuple(task);

? ?destroy_tuple(value);

? ?/* contour of nothing -> VOID message */

? ?err = boundary(Empty,&Result,"inner");

? ?if (err == H_MSG_VOID)

? ? ?(void)printf("- contour1 (no objects):? H_MSG_VOID (%d)\n\n",err);

? ?else

? ? ?(void)printf("That is really funny! (%d)\n\n", err);

}




main()

{

? (void)printf("-----------------------------\n");

? (void)printf("Example program for HALCON/C:\n");

? (void)printf("-----------------------------\n");

? (void)printf("- error handling\n");

? (void)printf("- H_MSG_TRUE, H_MSG_FAIL, and H_MSG_VOID\n\n");


? test_messages();

? test_errors();


? return(0);

}


Halcon10-C語言打印消息的評論 (共 條)

分享到微博請遵守國家法律
嘉善县| 高清| 嘉义县| 罗定市| 密云县| 中西区| 郧西县| 天镇县| 湟中县| 绥中县| 共和县| 伊宁县| 灵寿县| 葵青区| 肇州县| 宁波市| 乐昌市| 会昌县| 辽宁省| 司法| 房山区| 通海县| 汉沽区| 宁城县| 隆回县| 鲜城| 宜宾市| 郯城县| 德阳市| 额敏县| 稷山县| 鹤庆县| 濮阳县| 康定县| 铜山县| 江油市| 会昌县| 博罗县| 门源| 芦溪县| 翼城县|