/* * ***************************************************************** * * * * * Copyright (c) Fast Corporation, 1998 * * * * * * All Rights Reserved. Unpublished rights reserved under * * * the copyright laws of the Japan. * * * * * * The software contained on this media is proprietary to * * * and embodies the confidential technology of Fast * * * Corporation. Possession, use, duplication or * * * dissemination of the software and media is authorized only * * * pursuant to a valid written license from Fast Corporation. * * * * * ***************************************************************** */ /* CSC90X 東芝製IK−542ランダムトリガ(フルフレーム)ビデオ入力 IK542.C */ /* ----使用可能な組み合わせ---- CSC901NT + IK-542 CSC902(CATS) + IK-542 CSC902(RICE) + IK-542 FV904 + IK-542 */ /*[作成者]H.Yagi */ /* 目的: 関数: 履歴: Ver 1.0 97/08/26 初版 Ver 2.0 98/08/12 CSC902で使用することを考慮してコメントを追加(E.Ishiyama) Ver 2.1 99/10/28 FV904で使用することを考慮してコメントを追加(A.Sekimori) 注記:m_menu.hをインクルードして下さい。 m_menu.c及びm_note.cをリンクして下さい。 */ /* * Include compiler runtime library */ #include #include /* * Include CSC90X library */ #include "f_stdlib.h" #include "f_time.h" #include "f_gui.h" #include "f_stdio.h" #include "f_graph.h" #include "f_image.h" #include "f_pinf.h" #include "f_video.h" #include "f_system.h" /* * Include CSC90X common local */ #include "m_menu.h" /* * プロトタイプ宣言 */ void main( void ); void main_menu_disp( void ); void disp_help( void ); void input( void ); extern int message_note( void ); /* * メニュー項目 */ #define LANG_N 2 #define MAIN_MENU_N 4 static const char *str_main_menu[MAIN_MENU_N][LANG_N] = { { " INPUT ", " 入 力 " }, { " PROC2 ", " 処理2 " }, { " PROC3 ", " 処理3 " }, { " PROC4 ", " 処理4 " } }; #define INIT_CUR_POS_X 255 #define INIT_CUR_POS_Y 239 /* * メイン */ void main( void ) { int sts; int xpos; int ypos; int s_xpos; int s_ypos; /* 初期メッセージ表示 */ if( NORMAL_RETURN != message_note() ) return; /* パラメタ初期化 */ xpos = INIT_CUR_POS_X; ypos = INIT_CUR_POS_Y; s_xpos = INIT_CUR_POS_X; s_ypos = INIT_CUR_POS_Y; /* 入力ビデオ制御 */ Lib_input_video_control( GRAY_PLANE ); /* ビデオ出力表示項目制御 */ Lib_display_control( GRAY_PLANE | LINE_PLANE | CHAR_PLANE ); /* ビデオ表示項目クリア */ Lib_memory_clear( GRAY_PLANE | LINE_PLANE | CHAR_PLANE ); /* カーソル初期化 */ Lib_init_cursor(); Lib_freerun(); /* メインメニューの表示 */ main_menu_disp(); /* マウスカーソルの表示 */ Lib_draw_cursor( INIT_CUR_POS_X, INIT_CUR_POS_Y ); Lib_chrdisp( 1, 30, "ノーマル入力 " ); /* メニュー制御 */ for (;;) { sts = 0; /* マウス位置読みとり */ Lib_look_current_position( &xpos, &ypos ); sts = Lib_see_current_position( &xpos, &ypos ); if ( s_xpos != xpos || s_ypos != ypos ) { /* マウス表示位置移動 */ Lib_move_cursor( xpos, ypos ); s_xpos = xpos; s_ypos = ypos; } /* 処理振り分け */ if( CURSOR_EXECUTE == sts ) { if ( xpos > MENU_1_XS && xpos < MENU_1_XE && ypos > MENU_1_YS && ypos < MENU_1_YE ) { Lib_memory_clear( LINE_PLANE | CHAR_PLANE ); input(); /*入力*/ main_menu_disp(); } else if ( xpos > MENU_H_XS && xpos < MENU_H_XE && ypos > MENU_H_YS && ypos < MENU_H_YE ) { Lib_memory_clear( LINE_PLANE | CHAR_PLANE ); disp_help(); /* ヘルプ */ main_menu_disp(); } else if ( xpos > MENU_E_XS && xpos < MENU_E_XE && ypos > MENU_E_YS && ypos < MENU_E_YE ) { break; /* 終了 */ } } } } /* * メインメニュー表示 */ static void main_menu_disp( void ) { int iLanguage; /* 日本語/英語表示文字列切替情報取得 */ iLanguage = Lib_get_disp_language(); /* 整列キー表示 -> ( m_menu.c ) */ SUB_menu_disp4he( (char *)str_main_menu[0][iLanguage], (char *)NULL, (char *)NULL, (char *)NULL ); } /* * ヘルプ表示 */ static void disp_help( void ) { int fx_size, fy_size; fx_size = Lib_get_fx_size(); fy_size = Lib_get_fy_size(); Lib_view( 0, 0, fx_size-1, fy_size-1, GRAPH_ERAS ); Lib_chrdisp( 10, 8, "【機能\概要】 IK542" ); Lib_chrdisp( 11, 10, "東芝製IK-542ランダムトリガ(フルフレーム)ビデオ入力" ); Lib_chrdisp( 11, 12, "使用可能\な組み合わせ" ); Lib_chrdisp( 11, 13, "CSC901NT + IK-542 ( SYNC ノンリセット )" ); Lib_chrdisp( 11, 14, "902(CATS) + IK-542 ( SYNC ノンリセット )" ); Lib_chrdisp( 11, 15, "902(RICE) + IK-542 ( SYNC ノンリセット or リセット )" ); Lib_chrdisp( 11, 16, "FV904 + IK-542 ( SYNC ノンリセット )" ); Lib_display_keyinput( 400, 300, "確 認" ); Lib_memory_clear( CHAR_PLANE ); Lib_view( 0, 0, fx_size-1, fy_size-1, GRAPH_DRAW ); Lib_chrdisp( 1, 30, "ノーマル入力 " ); } /* * 入力 */ static void input( void ) { Lib_chrdisp( 1, 30, "ランダムトリガ" ); /* ビデオ入力モード設定 */ /* 実際にカメラを接続しているチャネルとLib_set_video_input_modeで */ /* 指定するチャネルが異なるとハングアップするので注意!! */ if ( NORMAL_RETURN == Lib_set_video_input_mode( RANDOM_FULLFRAME_VIDEO_MODE2, 0 ) ) { Lib_random_video_channel( 0 ); /* ランダムトリガビデオ入力に設定 (CSC901時のみ) */ /* CSC902時にコールしても害は無し(ソース互換を保つため)*/ Lib_freerun(); /* !!ランダムトリガビデオ入力時はフリーラン時に映像は映らない!! */ Lib_strtclk_count(); Lib_freeze( TRANSMIT ); /* 画像入力 */ /* 901NTの場合TRANSMITを指定すると120ms前後かかります。 */ /* NOT_TRANSMITを指定すると50ms前後です。 */ Lib_time_disp( 0, 0 ); } else Lib_chrdisp( 1, 1, "Lib_set_video_input_mode ERR!" ); Lib_display_keyinput( 430, 0, " 確認 " ); Lib_cls( CHAR_PLANE, BLACK_COLOR ); Lib_set_video_input_mode( NORMAL_VIDEO_MODE, 0 ); /*通常入力モードに戻す*/ Lib_chrdisp( 1, 30, "ノーマル入力 " ); Lib_freerun(); }