Skip to content

control_image_sourceControlImageSourceControlImageSourcecontrol_image_sourceT_control_image_source🔗

説明🔗

control_image_sourceControlImageSourceControlImageSourcecontrol_image_sourceT_control_image_source — 画像ソースで利用可能な操作を制御する。

書式🔗

control_image_source( image_source ImageSourceHandle, string Action, attribute.name GenParamName, attribute.value GenParamValue, out string Result )void ControlImageSource( const HTuple& ImageSourceHandle, const HTuple& Action, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Result )static void HOperatorSet.ControlImageSource( HTuple imageSourceHandle, HTuple action, HTuple genParamName, HTuple genParamValue, out HTuple result )def control_image_source( image_source_handle: HHandle, action: str, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]] ) -> Sequence[HTupleElementType]

Herror T_control_image_source( const Htuple ImageSourceHandle, const Htuple Action, const Htuple GenParamName, const Htuple GenParamValue, Htuple* Result )

HTuple HImageSource::ControlImageSource( const HString& Action, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HTuple HImageSource::ControlImageSource( const char* Action, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HTuple HImageSource::ControlImageSource( const wchar_t* Action, const HTuple& GenParamName, const HTuple& GenParamValue ) const (Windows only)

HTuple HImageSource.ControlImageSource( string action, HTuple genParamName, HTuple genParamValue )

説明🔗

control_image_sourceControlImageSource は、ImageSourceHandleimageSourceHandleimage_source_handle で 指定された画像ソースに対して操作を実行します。 操作した結果、値を返す場合はその値が Resultresultresult に返されます。

画像ソースの概念に関する詳細は、Image Source を参照してください。

実行する操作は Actionactionaction により決定されます。 操作はグローバルなもの、または画像ソース内の個別モジュールを対象としたものがあります。 いくつか操作では、画像ソースが接続状態である必要があります。

すべての画像ソースで使用可能な Actionactionaction のオプションは以下のとおりです:

  • 'enumerate_groups'"enumerate_groups" すべてのパラメータグループ名を返します。 'enumerate_groups'"enumerate_groups" を指定する場合、 汎用パラメータ GenParamNamegenParamNamegen_param_name と GenParamValuegenParamValuegen_param_value は空である必要があります。

  • 'enumerate_params'"enumerate_params" GenParamValuegenParamValuegen_param_value に、設定されたグループ内で使用可能なすべてのパラメータを返します。 この操作は画像ソースモジュール固有であるため、汎用パラメータを使用して パラメータグループを指定する必要があります。

    'group'"group" は GenParamNamegenParamNamegen_param_name に使用できる唯一のオプションです。 GenParamValuegenParamValuegen_param_value には以下のいずれかを設定してパラメーターグループを指定します:

    • 'image_source'"image_source"

    • 'plugin'"plugin"

    • 'interface'"interface"

    • 'local_device'"local_device"

    • 'device'"device"

    • 'stream'"stream"

    汎用パラメータが指定されていない場合、デフォルトで GenParamNamegenParamNamegen_param_name = 'group'"group"、 GenParamValuegenParamValuegen_param_value = 'device'"device" が設定されます。

  • 'query_param_tree'"query_param_tree" すべてのパラメータカテゴリ、サブカテゴリ、およびそれらのパラメータを含む、ネストされたHALCONライブラリを返します。 含まれる各パラメータについて、そのパラメータ型もあわせて出力されます。 この操作は画像ソースモジュールに固有のものであるため、汎用パラメータを使用してパラメータグループを指定する必要があります。 GenParamNamegenParamNamegen_param_name に指定できるオプションは 'group'"group" のみです。 以下のいずれかのオプションを設定して、GenParamValuegenParamValuegen_param_value にパラメータグループを指定します:

    • 'image_source'"image_source"

    • 'plugin'"plugin"

    • 'interface'"interface"

    • 'local_device'"local_device"

    • 'device'"device"

    • 'stream'"stream"

    汎用パラメータが指定されていない場合、デフォルトで GenParamNamegenParamNamegen_param_name = 'group'"group"、 GenParamValuegenParamValuegen_param_value = 'device'"device" が設定されます。

  • 'write_state_string'"write_state_string" 特定のグループのすべての持続可能なパラメータの値を復元するために、必要な情報を含む文字列を返します。 パラメータプロパティ 'persistable'"persistable" が 'true'"true" であるパラメータのみが含まれます。 この操作は画像ソースモジュールに固有のものであるため、汎用パラメータを使用してパラメータグループを 指定する必要があります。 GenParamNamegenParamNamegen_param_name に指定できるオプションは 'group'"group" のみです。 以下のいずれかのオプションを設定して、GenParamValuegenParamValuegen_param_value にパラメータグループを指定します:

    • 'plugin'"plugin"

    • 'interface'"interface"

    • 'local_device'"local_device"

    • 'device'"device"

    • 'stream'"stream"

    汎用パラメータが設定されていない場合、GenParamNamegenParamNamegen_param_name は 'group'"group"、GenParamValuegenParamValuegen_param_value は 'device'"device" が設定されます。 このアクションは 'image_source'"image_source" グループには使用できません。

  • 'read_state_string'"read_state_string" 汎用パラメータ 'state_string'"state_string" に渡された状態文字列から、指定されたグループのすべての持続化可能な パラメータを復元します。 GenParamNamegenParamNamegen_param_name に指定できる有効なオプションは 'group'"group" および 'state_string'"state_string" です。 汎用パラメータ 'state_string'"state_string" は必須パラメータであり、'write_state_string'"write_state_string" アクションを 使用して取得可能な状態文字列が含まれている必要があります。 この操作は画像ソースモジュールに固有のものであるため、汎用パラメータを使用してパラメータグループを指定する 必要があります。以下のいずれかのオプションを設定して、GenParamValuegenParamValuegen_param_value にパラメータグループを指定します:

    • 'plugin'"plugin"

    • 'interface'"interface"

    • 'local_device'"local_device"

    • 'device'"device"

    • 'stream'"stream"

    汎用パラメータ 'group'"group" が設定されていない場合、デフォルトで 'device'"device" が設定されます。 この操作は 'image_source'"image_source" グループには使用できません。

  • 'write_config_file'"write_config_file" すべてのパラメータグループにおけるすべての持続可能なパラメータの値を復元するための情報、および正常な接続に 必要な情報を含む、画像ソース設定ファイルを書き込みます。 設定ファイルの書き込みは、接続状態でも未接続状態でも許可されています。未接続状態で書き込まれた場合、 画像ソースモジュール(デバイス、プラグインなど)の持続化可能なパラメータに関する情報は含まれません。 この操作には、書き込むファイルのパスが必要です。このパスは、GenParamNamegenParamNamegen_param_name = 'file_name'"file_name" と共に、 対応する GenParamValuegenParamValuegen_param_value に渡す必要があります。 画像ソース設定ファイルのデフォルトのHALCONファイル拡張子は '.hisc' です。拡張子が指定されていない 場合は、自動的に付加されます。 これらの設定ファイルを読み込む(および、そこから画像ソースハンドルを復元する)方法については、 create_image_sourceCreateImageSource を参照してください。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

ImageSourceHandleimageSourceHandleimage_source_handle (input_control) image_source → (handle)HTuple (HHandle)HImageSource, HTuple (IntPtr)HHandleHtuple (handle)

画像ソースのハンドル

Actionactionaction (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

実行する操作

初期値: 'enumerate_params'"enumerate_params"
推奨値: 'enumerate_params', 'enumerate_groups', 'query_param_tree', 'write_state_string', 'read_state_string', 'write_config_file'"enumerate_params", "enumerate_groups", "query_param_tree", "write_state_string", "read_state_string", "write_config_file"

GenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

汎用パラメータ名

初期値: [][]
推奨値: 'group', 'state_string', 'file_name'"group", "state_string", "file_name"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)Sequence[Union[int, float, str]]Htuple (Hlong / double / char*)

汎用パラメータ値

初期値: [][]
推奨値: 'image_source', 'plugin', 'interface', 'local_device', 'device', 'stream'"image_source", "plugin", "interface", "local_device", "device", "stream"

Resultresultresult (output_control) string-array → (string / real / integer / handle)HTuple (HString / double / Hlong / HHandle)HTuple (string / double / int / long / HHandle)Sequence[HTupleElementType]Htuple (char* / double / Hlong / handle)

結果がある場合、操作結果

結果🔗

パラメータ値が正しければ、control_image_sourceControlImageSource は 2 (H_MSG_TRUE) を返します。 さもなければ、例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

query_image_sourcesQueryImageSources, create_image_sourceCreateImageSource, connect_image_sourceConnectImageSource

後処理の候補

disconnect_image_sourceDisconnectImageSource

関連項目

set_image_source_paramSetImageSourceParam, get_image_source_paramGetImageSourceParam

モジュール🔗

Foundation