/** * @file KglDevice.h * * Copyright (c) 2019 Keyence Corporation. * All rights reserved. * */ #pragma once #include #include #include #include #include namespace Keyence { class KglDeviceEventSink; namespace Impl { class KglDeviceImpl; } //------------------------------------------------------------ /** * \~English @brief Defines a file type. * \~Japanese @brief ファイルの種類を定義します。 */ enum class KglDeviceFileType { //------------------------------------------------------------ /** * \~English @brief Model image. * \~Japanese @brief モデル画像 */ ModelImage = 0, /** * \~English @brief Trace Log. * \~Japanese @brief トレースログ */ TraceLog, /** * \~English @brief Calibration File. * \~Japanese @brief キャリブレーションファイル */ Calibration, }; //------------------------------------------------------------ /** * \~English @brief Defines the file overwrite option settings. * \~Japanese @brief ファイル上書き オプション設定を定義します。 */ enum class KglOverwriteOption { //------------------------------------------------------------ /** * \~English @brief Not overwrite an existing file. * \~Japanese @brief 既存ファイルがある場合は上書きしません。 */ NotOverwrite = 0, //------------------------------------------------------------ /** * \~English @brief Overwrite an existing file. * \~Japanese @brief 既存ファイルがある場合は上書きします。 */ Overwrite, //------------------------------------------------------------ /** * \~English @brief None. * \~Japanese @brief なし。 */ None, }; //------------------------------------------------------------ /** * \~English @brief Defines the target of a feature list. * \~Japanese @brief 帳票対象を定義します。 */ enum class KglTargetData { //------------------------------------------------------------ /** * \~English @brief Camera parameters * \~Japanese @brief カメラパラメーター */ CameraParameters = 0x0001, //------------------------------------------------------------ /** * \~English @brief Camera parameter sets * \~Japanese @brief カメラパラメーターセット */ ParameterSetOfCameraParameter = 0x0002, //------------------------------------------------------------ /** * \~English @brief Model image * \~Japanese @brief モデル画像 */ ModelImageOfCameraParameter = 0x0004, //------------------------------------------------------------ /** * \~English @brief Camera parameters (system settings) * \~Japanese @brief カメラパラメーター(環境設定) */ CameraParametersOfEnvironmentSettings = 0x0008, //------------------------------------------------------------ /** * \~English @brief Common settings (system settings) * \~Japanese @brief 共通設定(環境設定) */ CommonParametersOfEnvironmentSettings = 0x0010, //------------------------------------------------------------ /** * \~English @brief Common camera parameters * \~Japanese @brief カメラ間共通パラメータ */ CommonCameraParameters = 0x0020, //------------------------------------------------------------ /** * \~English @brief Calibration File. * \~Japanese @brief キャリブレーションファイル */ CalibrationOfCameraParameter = 0x0040, }; //------------------------------------------------------------ /** * \~English @brief KglTargetData bit flag. * \~Japanese @brief KglTargetDataのビットフラグ。 */ typedef uint16_t KglTargetDataSet; //------------------------------------------------------------ /** * \~English @brief Options for importing a feature list file to the camera. * \~Japanese @brief 帳票ファイルをカメラへインポートする際のオプションです。 */ struct KGLLIB_API KglImportDeviceParamOption { //------------------------------------------------------------ /** * \~English @brief whether the model image is to be overwritten. * \~Japanese @brief モデル画像を上書きするか否か。 */ bool bOverwriteModelImage; //------------------------------------------------------------ /** * \~English @brief whether the Calibration file is to be overwritten. * \~Japanese @brief キャリブレーションファイルを上書きするか否か。 */ bool bOverwriteCalibration; //------------------------------------------------------------ /** * \~English @brief Default constructor. * \~Japanese @brief デフォルトコンストラクタ。 */ KglImportDeviceParamOption(); //------------------------------------------------------------ /** * \~English @brief Constructor. * \~Japanese @brief コンストラクタ。 * \~English @param [in] bOverwriteModelImage Whether the model image is to be overwritten. * \~Japanese @param [in] bOverwriteModelImage モデル画像を上書きするか否か。 */ KglImportDeviceParamOption(bool bOverwriteModelImage); //------------------------------------------------------------ /** * \~English @brief Constructor. * \~Japanese @brief コンストラクタ。 * \~English @param [in] bOverwriteModelImage Whether the model image is to be overwritten. * \~Japanese @param [in] bOverwriteModelImage モデル画像を上書きするか否か。 * \~English @param [in] bOverwriteCalibration Whether the Calibration file is to be overwritten. * \~Japanese @param [in] bOverwriteCalibration キャリブレーションファイルを上書きするか否か。 */ KglImportDeviceParamOption(bool bOverwriteModelImage, bool bOverwriteCalibration); }; //------------------------------------------------------------ /** * \~English @brief Options for exporting a feature list file from the camera. * \~Japanese @brief 帳票ファイルをカメラからエクスポートする際のオプションです。 */ struct KGLLIB_API KglExportDeviceParamOption { //------------------------------------------------------------ /** * \~English @brief Whether the model image is to be overwritten. * \~Japanese @brief モデル画像を上書きするか否か。 */ bool bOverwriteModelImage; //------------------------------------------------------------ /** * \~English @brief Whether Register-type features are exported as register format or an array of integer. * \~Japanese @brief Register型のデータをそのままRegister型として出力するか否か。falseの場合はIntger型の配列として出力します。 */ bool bExportRegisterType; //------------------------------------------------------------ /** * \~English @brief Whether default values are to be output to the feature list. * \~Japanese @brief Default値であっても帳票に出力するか否か。 */ bool bExportDefaultParam; //------------------------------------------------------------ /** * \~English @brief whether the Calibration file is to be overwritten. * \~Japanese @brief キャリブレーションファイルを上書きするか否か。 */ bool bOverwriteCalibration; //------------------------------------------------------------ /** * \~English @brief Default constructor. * \~Japanese @brief デフォルトコンストラクタ。 */ KglExportDeviceParamOption(); //------------------------------------------------------------ /** * \~English @brief Constructor. * \~Japanese @brief コンストラクタ。 * \~English @param [in] bOverwriteModelImage Whether the model image is to be overwritten. * \~Japanese @param [in] bOverwriteModelImage モデル画像を上書きするか否か。 * \~English @param [in] bExportRegisterType Whether Register-type features are exported as register format or an array of integer. * \~Japanese @param [in] bExportRegisterType Register型のデータをそのままRegister型として出力するか否か。falseの場合はIntger型の配列として出力します。 * \~English @param [in] bExportDefaultParam Whether default values are to be output to the feature list. * \~Japanese @param [in] bExportDefaultParam Default値であっても帳票に出力するか否か。 */ KglExportDeviceParamOption(bool bOverwriteModelImage, bool bExportRegisterType, bool bExportDefaultParam); //------------------------------------------------------------ /** * \~English @brief Constructor. * \~Japanese @brief コンストラクタ。 * \~English @param [in] bOverwriteModelImage Whether the model image is to be overwritten. * \~Japanese @param [in] bOverwriteModelImage モデル画像を上書きするか否か。 * \~English @param [in] bExportRegisterType Whether Register-type features are exported as register format or an array of integer. * \~Japanese @param [in] bExportRegisterType Register型のデータをそのままRegister型として出力するか否か。falseの場合はIntger型の配列として出力します。 * \~English @param [in] bExportDefaultParam Whether default values are to be output to the feature list. * \~Japanese @param [in] bExportDefaultParam Default値であっても帳票に出力するか否か。 * \~English @param [in] bOverwriteCalibration Whether the Calibration file is to be overwritten. * \~Japanese @param [in] bOverwriteCalibration キャリブレーションファイルを上書きするか否か。 */ KglExportDeviceParamOption(bool bOverwriteModelImage, bool bExportRegisterType, bool bExportDefaultParam, bool bOverwriteCalibration); }; //------------------------------------------------------------ /** * \~English @brief Connects, configures and controls the camera. * \~Japanese @brief カメラに対して接続、設定、制御するためのクラスです。 */ class KGLLIB_API KglDevice { public: friend class Impl::KglDeviceImpl; //------------------------------------------------------------ /** * \~English @brief Retrieves the access type of the camera. * \~Japanese @brief カメラのアクセスタイプを取得します。 * \~English @param [in] ipAddress IP address. * \~Japanese @param [in] ipAddress IPアドレス。 * \~English @param [out] type Access type. * \~Japanese @param [out] type アクセスタイプ。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter, such as an empty IP address, has been passed to the argument. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER IPアドレスが空など、引数に不正なパラメータが渡されました。 * \~English @retval KGL_ERR_TIMEOUT A timeout has occurred. * \~Japanese @retval KGL_ERR_TIMEOUT タイムアウトが発生しました。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ static KglResult getAccessType(const KglString& ipAddress, KglAccessType& type); //------------------------------------------------------------ /** * \~English @brief Sets the IP address of a camera. A camera is identified by MAC address, and its properties such as IP address, subnet mask, and gateway can be changed. * \~Japanese @brief カメラのIPアドレスを設定します。カメラはMACアドレスで識別し、IPアドレス、サブネットマスク、ゲートウェイなどを変更します。 * \~English @param [in] macAddress MAC address. * \~Japanese @param [in] macAddress MACアドレス。 * \~English @param [in] ipAddress IP address. * \~Japanese @param [in] ipAddress IPアドレス。 * \~English @param [in] subnetMask Subnet mask. * \~Japanese @param [in] subnetMask サブネットマスク。 * \~English @param [in] gateWay Gateway address. * \~Japanese @param [in] gateWay ゲートウェイアドレス。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter, such as an empty IP address, has been passed to the argument. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER IPアドレスが空など、引数に不正なパラメータが渡されました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ static KglResult setIPConfiguration( const KglString& macAddress, const KglString& ipAddress, const KglString& subnetMask = KglString("255.255.255.0"), const KglString& gateWay = KglString("0.0.0.0")); //------------------------------------------------------------ /** * \~English @brief Default constructor. * \~Japanese @brief デフォルトコンストラクタ。 */ KglDevice(); //------------------------------------------------------------ /** * \~English @brief Destructor. * \~Japanese @brief デストラクタ。 */ ~KglDevice(); //------------------------------------------------------------ /** * \~English @brief Connects to the camera. * \~Japanese @brief カメラと接続します。 * \~English @param [in] ipAddress IP address * \~Japanese @param [in] ipAddress IPアドレス * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter, such as an empty IP address, has been passed to the argument. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER IPアドレスが空など、引数に不正なパラメータが渡されました。 * \~English @retval KGL_DEVICE_NOT_CONNECT Failed to connect the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラを接続する処理に失敗しました。 * \~English @retval KGL_NETWORK_ERROR Failed to send the packets. * \~Japanese @retval KGL_NETWORK_ERROR パケットの送信に失敗しました。 * \~English @retval KGL_ERR_TIMEOUT The connection timed out. * \~Japanese @retval KGL_ERR_TIMEOUT 接続がタイムアウトしました。 * \~English @retval KGL_THREAD_ERROR The heartbeat thread has not been started. * \~Japanese @retval KGL_THREAD_ERROR ハートビートスレッドが開始されていませんでした。 * \~English @retval KGL_GENICAM_XML_ERROR An error has occurred while the genicam node map of the camera was being created. * \~Japanese @retval KGL_GENICAM_XML_ERROR カメラのgenicam node map生成中にエラーが発生しました。 * \~English @retval KGL_NOT_FOUND No camera could be found. * \~Japanese @retval KGL_NOT_FOUND カメラが見つかりませんでした。 * \~English @retval KGL_NOT_SUPPORTED Not supported. * \~Japanese @retval KGL_NOT_SUPPORTED サポートされていません。 * \~English @retval KGL_NO_LICENSE Reinstallation is required because the license file is invalid. * \~Japanese @retval KGL_NO_LICENSE ライセンスファイルが有効でないため再インストールが必要です。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult connect(const KglString& ipAddress); //------------------------------------------------------------ /** * \~English @brief Disconnects from the camera. * \~Japanese @brief カメラとの接続を解除します。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult disconnect(); //------------------------------------------------------------ /** * \~English @brief Retrieves whether the camera is connected. * \~Japanese @brief カメラが接続済みか否かを取得します。 * \~English @retval true Connected. * \~Japanese @retval true 接続済。 * \~English @retval false Not connected. * \~Japanese @retval false 未接続。 */ bool isConnected(); //------------------------------------------------------------ /** * \~English @brief Retrieves the features of the camera. Those features allow to control the functions of the camera. * \~Japanese @brief カメラのFeatureを取得します。このFeatureを利用してカメラの機能を制御できます。 * \~English @return Pointer to the KglGenParameterArray object. Returns NULL if not available. * \~Japanese @return KglGenParameterArrayオブジェクトへのポインタ。取得できない場合はNULLを返します。 */ KglGenParameterArray* getDeviceParameters(); //------------------------------------------------------------ /** * \~English @brief Retrieves the features for the communication settings. Those features allow to control the communication settings between the PC and the camera. * \~Japanese @brief 通信設定のFeatureを取得します。このFeatureを利用してPCのカメラとの通信設定を制御できます。 * \~English @return Pointer to the KglGenParameterArray object. Returns NULL if not available. * \~Japanese @return KglGenParameterArrayオブジェクトへのポインタ。取得できない場合はNULLを返します。 */ KglGenParameterArray* getCommunicationParameters(); //------------------------------------------------------------ /** * \~English @brief Retrieves the MAC address. * \~Japanese @brief MACアドレスを取得します。 * \~English @return MAC address. * Returns a null character if not available. * \~Japanese @return MACアドレス。 * 取得できない場合は空文字を返します。 */ KglString getMACAddress() const; //------------------------------------------------------------ /** * \~English @brief Retrieves the IP address. * \~Japanese @brief IPアドレスを取得します。 * \~English @return IP address. * Returns a null character if not available. * \~Japanese @return IPアドレス。 * 取得できない場合は空文字を返します。 */ KglString getIPAddress() const; //------------------------------------------------------------ /** * \~English @brief Retrieves the payload size necessary for receiving images. * \~Japanese @brief 画像を受信するために必要なペイロードサイズを取得します。 * \~English @return Payload size [byte]. * \~Japanese @return ペイロードサイズ[byte]。 */ uint32_t getPayloadSize(); //------------------------------------------------------------ /** * \~English @brief Sets the packet size for receiving images. * \~Japanese @brief 画像受信パケットサイズを設定します。 * \~English @param [in] packetSize Packet size to be set. * \~Japanese @param [in] packetSize 設定するパケットサイズ。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_ERR_TIMEOUT A timeout has occurred. * \~Japanese @retval KGL_ERR_TIMEOUT タイムアウトが発生しました。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult setPacketSize(uint32_t packetSize); //------------------------------------------------------------ /** * \~English @brief Optimizes the packet size. * \~Japanese @brief 最適なパケットサイズに調整します。 * \~English @param [in] defaultPacketSize Packet size to be set on failure. When 0 is set, the original setting is used. * \~Japanese @param [in] defaultPacketSize 失敗時に設定するパケットサイズ。0のときは元設定を継続利用します。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_ERR_TIMEOUT A timeout has occurred. * \~Japanese @retval KGL_ERR_TIMEOUT タイムアウトが発生しました。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_NOT_FOUND No stream can be found. * \~Japanese @retval KGL_NOT_FOUND ストリームが見つかりません。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult negotiatePacketSize(uint32_t defaultPacketSize= 0); //------------------------------------------------------------ /** * \~English @brief Registers EventSink. * \~Japanese @brief EventSinkの登録をします。 * \~English @param [in] pEventSink Instance to be registered for receiving events. * \~Japanese @param [in] pEventSink イベントを受信するために登録するインスタンス。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. (such as when EventSink is already registered) * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。(既にEventSink登録済みなど) * \~English @retval KGL_SUCCESS Success * \~Japanese @retval KGL_SUCCESS 成功 */ KglResult registerEventSink(KglDeviceEventSink* pEventSink); //------------------------------------------------------------ /** * \~English @brief Unregisters EventSink. * \~Japanese @brief EventSinkの登録を解除します。 * \~English @param [in] pEventSink Instance to be unregistered. * \~Japanese @param [in] pEventSink 解除対象のインスタンス。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_NOT_FAUND The specified EventSink cannot be found. * \~Japanese @retval KGL_NOT_FAUND 指定されたEventSinkが見つかりません。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult unregisterEventSink(KglDeviceEventSink* pEventSink); //------------------------------------------------------------ /** * \~English @brief Load the register specified for the camera. * \~Japanese @brief カメラの指定レジスタを読込みます。 * \~English @param [in] address Address of the specified register. * \~Japanese @param [in] address 指定レジスタのアドレス。 * \~English @param [out] value Value loaded from the specified register. * \~Japanese @param [out] value 指定レジスタからの読込値。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_NETWORK_ERROR Failed to send the packets. * \~Japanese @retval KGL_NETWORK_ERROR パケットの送信に失敗しました。 * \~English @retval KGL_ERR_TIMEOUT A timeout has occurred. * \~Japanese @retval KGL_ERR_TIMEOUT タイムアウトが発生しました。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult readRegister(int64_t address, uint32_t& value); //------------------------------------------------------------ /** * \~English @brief Sets a value for the register specified for the camera. * \~Japanese @brief カメラの指定レジスタへ値を設定します。 * \~English @param [in] address Address of the specified register. * \~Japanese @param [in] address 指定レジスタのアドレス。 * \~English @param [in] value Value written to the specified register. * \~Japanese @param [in] value 指定レジスタへの書込値。 * \~English @param [in] acknowledge Set true when Acknowledge is to be waited for. * \~Japanese @param [in] acknowledge Acknowledgeを待つ場合はtrueを設定します。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_NETWORK_ERROR Failed to send the packets. * \~Japanese @retval KGL_NETWORK_ERROR パケットの送信に失敗しました。 * \~English @retval KGL_ERR_TIMEOUT A timeout has occurred. * \~Japanese @retval KGL_ERR_TIMEOUT タイムアウトが発生しました。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult writeRegister(int64_t address, uint32_t value, bool acknowledge = true); //------------------------------------------------------------ /** * \~English @brief Imports camera model image files or other files into the camera. * \~Japanese @brief モデル画像などtargetFileTypeで指定できるファイルをカメラへインポートします。 * \~English @param [in] deviceFileType Type of the file to be imported. (Example: ModelImage) * \~Japanese @param [in] deviceFileType インポート対象のファイルタイプ。(例:ModelImage) * \~English @param [in] deviceFileName Name of the file to be imported. * \~Japanese @param [in] deviceFileName インポート対象のファイル名称。 * \~English @param [in] localFilePath Path of the file to be imported. * \~Japanese @param [in] localFilePath インポート対象のファイルパス。 * \~English @param [in] option Whether to overwrite the file in the import destination. * \~Japanese @param [in] option インポート先でのファイル上書き可否。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_STATE_ERROR The operation is not available under this condition. One possible cause is that the operation mode (OperationMode) is not set to Setup Mode. * \~Japanese @retval KGL_STATE_ERROR 現在の状態では実行できません。動作モード(OperationMode)が設定モードになっていないなどが理由として考えられます。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a file to be imported or a file in the camera. * \~Japanese @retval KGL_CANNOT_OPEN_FILE インポート対象のファイル/カメラ内のファイルをOpenすることに失敗しました。 * \~English @retval KGL_FILE_ERROR Failed to load a file to be imported or to write to a file in the camera. * \~Japanese @retval KGL_FILE_ERROR インポート対象のファイル読込/カメラ内のファイルへの書込に失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path or the extension is not correct. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパス、拡張子が正しくないなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_ALREADY_EXISTS The file already exists. (Returned only when the file is not to be overwritten.) * \~Japanese @retval KGL_ALREADY_EXISTS 既に存在します。(上書き禁止時のみ返します) * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult importFile( KglDeviceFileType deviceFileType, const KglString& deviceFileName, const KglString& localFilePath, const KglOverwriteOption& option); //------------------------------------------------------------ /** * \~English @brief Exports camera model image files or other files from the camera. * \~Japanese @brief モデル画像などtargetFileTypeで指定できるファイルをカメラからエクスポートします。 * \~English @param [in] deviceFileType Type of the file to be exported. (Example: ModelImage) * \~Japanese @param [in] deviceFileType エクスポート対象のファイルタイプ。(例:ModelImage) * \~English @param [in] deviceFileName Name of the file to be exported. * \~Japanese @param [in] deviceFileName エクスポート対象のファイル名称。 * \~English @param [in] localFilePath Path of the file export destination * \~Japanese @param [in] localFilePath エクスポート先のファイルパス。 * \~English @param [in] option Whether to overwrite the file in the export destination. * \~Japanese @param [in] option エクスポート先でのファイル上書き可否。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_STATE_ERROR The operation is not available under this condition. One possible cause is that the operation mode (OperationMode) is not set to Setup Mode. * \~Japanese @retval KGL_STATE_ERROR 現在の状態では実行できません。動作モード(OperationMode)が設定モードになっていないなどが理由として考えられます。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a file to be exported or a file in the camera. * \~Japanese @retval KGL_CANNOT_OPEN_FILE エクスポート対象のファイル/カメラ内のファイルをOpenすることに失敗しました。 * \~English @retval KGL_NOT_FOUND The target cannot be found. * \~Japanese @retval KGL_NOT_FOUND 対象が見つかりません。 * \~English @retval KGL_FILE_ERROR Failed to load a file from the camera or to write to the export destination file. * \~Japanese @retval KGL_FILE_ERROR カメラ内のファイル読込/エクスポート先となるファイルへの書込に失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path or the extension is not correct. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパス、拡張子が正しくないなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_ALREADY_EXISTS The file already exists. (Returned only when the file is not to be overwritten.) * \~Japanese @retval KGL_ALREADY_EXISTS 既に存在します。(上書き禁止時のみ返します) * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult exportFile( KglDeviceFileType deviceFileType, const KglString& deviceFileName, const KglString& localFilePath, const KglOverwriteOption& option); //------------------------------------------------------------ /** * \~English @brief Imports a device feature settings file into the camera. (Device feature is a feature retrievable by getDeviceParameters()). * \~Japanese @brief 帳票ファイルをカメラへインポートします。 getDeviceParameters() で取得できるFeatureの値へ反映されます。 * \~English @param [in] filePath Path of the feature list file to be imported. * \~Japanese @param [in] filePath インポート対象の帳票ファイルパス。 * \~English @param [in] failFeature Feature that failed to be imported. * \~Japanese @param [in] failFeature インポート失敗したFeature。 * \~English @param [in] targetSet Category of the features to be included in the feature list. Currently only ModelImageOfCameraParameter can be deselected. * \~Japanese @param [in] targetSet 帳票対象とするFeatureカテゴリ。現状はModelImageOfCameraParameterのみ対象外にできます。 * \~English @param [in] option Option settings for importing a feature list. * \~Japanese @param [in] option 帳票インポート時のオプション設定。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_INVALID_DATA_FORMAT Unsupported data. * \~Japanese @retval KGL_INVALID_DATA_FORMAT サポートしていないデータです。 * \~English @retval KGL_STATE_ERROR The operation is not available under this condition. One possible cause is that the operation mode (OperationMode) is not set to Setup Mode. * \~Japanese @retval KGL_STATE_ERROR 現在の状態では実行できません。動作モード(OperationMode)が設定モードになっていないなどが理由として考えられます。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a feature list file. * \~Japanese @retval KGL_CANNOT_OPEN_FILE 帳票ファイルのOpenに失敗しました。 * \~English @retval KGL_FILE_ERROR Failed to import a feature list file. * \~Japanese @retval KGL_FILE_ERROR 帳票ファイルのインポートに失敗しました。 * \~English @retval KGL_NO_AVAILABLE_DATA The data stored in the feature list is invalid. * \~Japanese @retval KGL_NO_AVAILABLE_DATA 帳票ファイルに格納されるデータが不正です。 * \~English @retval KGL_MODEL_IMAGE_FILE_ERROR Failed to import a model image. * \~Japanese @retval KGL_MODEL_IMAGE_FILE_ERROR モデル画像のインポートに失敗しました。 * \~English @retval KGL_CALIBRATION_FILE_ERROR Failed to import a calibration file. * \~Japanese @retval KGL_CALIBRATION_FILE_ERROR キャリブレーションファイルのインポートに失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path or the extension is not correct. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパス、拡張子が正しくないなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult importDeviceParameters( const KglString& filePath, KglString& failFeature, const KglTargetDataSet targetSet = 0xFF, const KglImportDeviceParamOption& option = KglImportDeviceParamOption()); //------------------------------------------------------------ /** * \~English @brief Exports a device feature settings file from the camera. (Device feature is a feature retrievable by getDeviceParameters()). * \~Japanese @brief 帳票ファイルをカメラへエクスポートします。 getDeviceParameters() で取得できるFeatureの値を出力します。 * \~English @param [in] filePath Path of the feature list file export destination. * \~Japanese @param [in] filePath エクスポート先の帳票ファイルパス。 * \~English @param [in] targetSet Category of the features to be included in the feature list. * \~Japanese @param [in] targetSet 帳票対象とするFeatureカテゴリ。 * \~English @param [in] option Option settings for exporting a feature list. * \~Japanese @param [in] option 帳票エクスポート時のオプション設定。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_STATE_ERROR The operation is not available under this condition. One possible cause is that the operation mode (OperationMode) is not set to Setup Mode. * \~Japanese @retval KGL_STATE_ERROR 現在の状態では実行できません。動作モード(OperationMode)が設定モードになっていないなどが理由として考えられます。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a feature list file. * \~Japanese @retval KGL_CANNOT_OPEN_FILE 帳票ファイルのOpenに失敗しました。 * \~English @retval KGL_FILE_ERROR Failed to export a feature list file. * \~Japanese @retval KGL_FILE_ERROR 帳票ファイルのエクスポートに失敗しました。 * \~English @retval KGL_MODEL_IMAGE_FILE_ERROR Failed to export a model image. * \~Japanese @retval KGL_MODEL_IMAGE_FILE_ERROR モデル画像のエクスポートに失敗しました。 * \~English @retval KGL_CALIBRATION_FILE_ERROR Failed to export a calibration file. * \~Japanese @retval KGL_CALIBRATION_FILE_ERROR キャリブレーションファイルのエクスポートに失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path or the extension is not correct. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパス、拡張子が正しくないなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult exportDeviceParameters( const KglString& filePath, const KglTargetDataSet targetSet = 0xFF, const KglExportDeviceParamOption& option = KglExportDeviceParamOption()); //------------------------------------------------------------ /** * \~English @brief Imports a communication feature settings file into the camera. (Communication feature is a feature retrievable by getCommunicationParameters()). * \~Japanese @brief カメラとの通信設定をファイルからインポートします。 getCommunicationParameters() で取得できるFeatureの値へ反映されます。 * \~English @param [in] filePath Path of the file to be imported. * \~Japanese @param [in] filePath インポート元となるファイルパス。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a communication settings file. * \~Japanese @retval KGL_CANNOT_OPEN_FILE 通信の設定ファイルのOpenに失敗しました。 * \~English @retval KGL_FILE_ERROR Failed to import a communication settings file. * \~Japanese @retval KGL_FILE_ERROR 通信の設定ファイルのインポートに失敗しました。 * \~English @retval KGL_NO_AVAILABLE_DATA The data stored in the communication settings file is invalid. * \~Japanese @retval KGL_NO_AVAILABLE_DATA 通信の設定ファイルに格納されるデータが不正です。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path or the extension is not correct. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパス、拡張子が正しくないなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult importCommunicationParameters( const KglString& filePath); //------------------------------------------------------------ /** * \~English @brief Exports a communication feature settings file from the camera. (Communication feature is a feature retrievable by getCommunicationParameters()). * \~Japanese @brief カメラとの通信設定をファイルへエクスポートします。 getCommunicationParameters() で取得できるFeatureの値を出力します。 * \~English @param [in] filePath Path of the file export destination. * \~Japanese @param [in] filePath エクスポート先となるファイルパス。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a communication settings file. * \~Japanese @retval KGL_CANNOT_OPEN_FILE 通信の設定ファイルのOpenに失敗しました。 * \~English @retval KGL_FILE_ERROR Failed to export a communication setting file. * \~Japanese @retval KGL_FILE_ERROR 通信の設定ファイルのエクスポートに失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path or the extension is not correct. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパス、拡張子が正しくないなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult exportCommunicationParameters( const KglString& filePath); //------------------------------------------------------------ /** * \~English @brief Writes srcLocalfile to the file in the camera specified by the argument. (Progress callback is available.) * \~Japanese @brief 引数で指定したカメラ内のファイルへsrcLocalfileを書込みます。(進捗をコールバックできます。) * \~English @param [in] deviceFileSelector Import destination folder in the camera. (Select from the feature ""FileSelector"". Currently only ModelImage can be specified.) * \~Japanese @param [in] deviceFileSelector カメラへのインポート先フォルダ。(Feature""FileSelector""から指定。現状ではModelImageのみ指定可能です。) * \~English @param [in] deviceFileName Name of the file in the import destination in the camera. * \~Japanese @param [in] deviceFileName カメラへのインポート先ファイル名称。 * \~English @param [in] srcLocalfile Path of the file to be imported. * \~Japanese @param [in] srcLocalfile インポート元ファイルのファイルパス。 * \~English @param [in] option Whether to overwrite the file in the import destination. * \~Japanese @param [in] option インポート先ファイルの上書き可否。 * \~English @param [in] callback Destination to notify the file writing status. (If NULL, no progress is returned.) * \~Japanese @param [in] callback ファイル書込状況の通知先。(NULLの場合は進捗を返しません。) * \~English @param [in] callbackParam Parameter to be passed to the callback. * \~Japanese @param [in] callbackParam callbackへ渡すパラメータ。 * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_STATE_ERROR The operation is not available under this condition. One possible cause is that the operation mode (OperationMode) is not set to Setup Mode. * \~Japanese @retval KGL_STATE_ERROR 現在の状態では実行できません。動作モード(OperationMode)が設定モードになっていないなどが理由として考えられます。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a file to be imported or a file in the camera. * \~Japanese @retval KGL_CANNOT_OPEN_FILE インポート対象のファイル/カメラ内のファイルをOpenすることに失敗しました。 * \~English @retval KGL_FILE_ERROR Failed to load a file to be imported or to write to a file in the camera. * \~Japanese @retval KGL_FILE_ERROR インポート対象のファイル読込/カメラ内のファイルへの書込に失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path is a null character. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパスが空文字であることなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_ALREADY_EXISTS The file already exists in the camera. (Returned only when the file is not to be overwritten.) * \~Japanese @retval KGL_ALREADY_EXISTS カメラ内に既にファイルが存在します。(上書き禁止時のみ返します) * \~English @retval KGL_CANCEL The operation was canceled because the return value of the callback was other than KGL_SUCCESS. * \~Japanese @retval KGL_CANCEL callbackの戻り値がKGL_SUCCESS以外だったためキャンセルしました。 * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult importFile( const KglString& deviceFileSelector, const KglString& deviceFileName, const KglString& srcLocalfile, const KglOverwriteOption& option, KglResult(__stdcall *callback)(void* callbackParam, KglResult result, int64_t size, int64_t total), void* callbackParam); //------------------------------------------------------------ /** * \~English @brief Loads the file in the camera specified by the argument to srcLocalfile. (Progress callback is available.) * \~Japanese @brief 引数で指定したカメラ内のファイルをsrcLocalfileへ読込みます。(進捗をコールバックできます。) * \~English @param [in] deviceFileSelector Folder that stores the file to be exported from the camera. (Select from the feature ""FileSelector"". Currently only ModelImage can be specified.) * \~Japanese @param [in] deviceFileSelector カメラからのエクスポートするファイルが存在するフォルダ。(Feature""FileSelector""から指定。現状ではModelImageのみ指定可能です。) * \~English @param [in] deviceFileName Name of the file to be exported from the camera. * \~Japanese @param [in] deviceFileName カメラからエクスポートするファイル名称。 * \~English @param [in] dstLocalfile Path of the file export destination. * \~Japanese @param [in] dstLocalfile エクスポート先となるファイルのファイルパス。 * \~English @param [in] option Whether to overwrite the file in the export destination. * \~Japanese @param [in] option エクスポート先ファイルの書き可否。 * \~English @param [in] callback Destination to notify the file loading status. (If NULL, no progress is returned.) * \~Japanese @param [in] callback ファイル読込状況の通知先。(NULLの場合は進捗を返しません。) * \~English @param [in] callbackParam Parameter to be passed to the callback. * \~Japanese @param [in] callbackParam callbackへ渡すパラメータ * \~English @retval KGL_DEVICE_NOT_CONNECT Not connected to the camera. * \~Japanese @retval KGL_DEVICE_NOT_CONNECT カメラと接続されていません。 * \~English @retval KGL_STATE_ERROR The operation is not available under this condition. One possible cause is that the operation mode (OperationMode) is not set to Setup Mode. * \~Japanese @retval KGL_STATE_ERROR 現在の状態では実行できません。動作モード(OperationMode)が設定モードになっていないなどが理由として考えられます。 * \~English @retval KGL_CANNOT_OPEN_FILE Failed to open a file to be exported or a file in the camera. * \~Japanese @retval KGL_CANNOT_OPEN_FILE エクスポート対象のファイル/カメラ内のファイルをOpenすることに失敗しました。 * \~English @retval KGL_NOT_FOUND The target cannot be found. * \~Japanese @retval KGL_NOT_FOUND 対象が見つかりません。 * \~English @retval KGL_FILE_ERROR Failed to load a file from the camera or to write to the export destination file. * \~Japanese @retval KGL_FILE_ERROR カメラ内のファイル読込/エクスポート先となるファイルへの書込に失敗しました。 * \~English @retval KGL_ERR_INVALID_PARAMETER An invalid parameter has been passed to the argument. One possible cause is that the file path is a null character. * \~Japanese @retval KGL_ERR_INVALID_PARAMETER 引数に不正なパラメータが渡されました。ファイルパスが空文字であることなどが理由として考えられます。 * \~English @retval KGL_GENERIC_ERROR An unexpected exception has occurred. * \~Japanese @retval KGL_GENERIC_ERROR 予期しない例外が発生しました。 * \~English @retval KGL_ALREADY_EXISTS The file already exists in the export destination. (Returned only when the file is not to be overwritten.) * \~Japanese @retval KGL_ALREADY_EXISTS エクスポート先に既にファイルが存在します。(上書き禁止時のみ返します) * \~English @retval KGL_SUCCESS Success. * \~Japanese @retval KGL_SUCCESS 成功。 */ KglResult exportFile( const KglString& deviceFileSelector, const KglString& deviceFileName, const KglString& dstLocalfile, const KglOverwriteOption& option, KglResult(__stdcall *callback)(void* callbackParam, KglResult result, int64_t size, int64_t total), void* callbackParam); private: Impl::KglDeviceImpl* _pImpl; }; }; //end of namespace Keyence