{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "",
    "type": "object",
    "properties": {
        "meta": {
            "type": "object",
            "properties": {
                "inputFileType": {
                    "type": "string",
                    "minLength": 1
                },
                "inputFileVersion": {
                    "type": "string",
                    "minLength": 1
                },
                "targetMachine": {
                    "type": "string",
                    "minLength": 1
                },
                "programName": {
                    "type": "string",
                    "minLength": 1
                },
                "programVersion": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "required": [
                "inputFileType",
                "inputFileVersion",
                "targetMachine",
                "programName",
                "programVersion"
            ],
            "examples": [
                {
                    "inputFileType": "LumiScan-Ctrlx-Camera-Configuration",
                    "inputFileVersion": "0.0.1",
                    "targetMachine": "CtrlX7",
                    "programName": "lumiscan-cam-driver",
                    "programVersion": "2.1.0"
                }
            ]
        },
        "id": {
            "type": "string",
            "minLength": 1,
            "description": "only [a-Z], [0-9], '-' and '_' are allowed. Unique ID of the camera configuration. This is used to identify different camera on datalayer.",
            "pattern": "^[a-zA-Z0-9_-]+$",
            "examples": [
                "camera1",
                "camera-left"
            ]
        },
        "serial": {
            "type": "string",
            "minLength": 1,
            "description": "Serial number of the camera. Special serial 'simulation' is used for testing without camera. This is used as default value in setting. And storage setup is required to be able to load image for simulation.",
            "default": "simulation",
            "examples": [
                "simulation",
                "LX123456"
            ]
        },
        "exposureTimeUS": {
            "type": "number",
            "minimum": 500,
            "maximum": 2000000,
            "default": 10000,
            "description": "Exposure time in microseconds. This is used as default value on datalayer and can be overwriten by the user."
        },
        "pixelFormat": {
            "type": "string",
            "minLength": 1,
            "enum": [
                "Mono8",
                "RGB8",
                "BGR8",
                "Mono12",
                "RGB12",
                "BGR12",
                "BayerGR8",
                "BayerRG8"
            ],
            "description": "Pixel format of the camera. Use bayer format if the camera support color and faster frame rate is required. This is used as default value on datalayer and can be overwriten by the user."
        },
        "exportPixelFormat": {
            "type": "string",
            "minLength": 1,
            "enum": [
                "Mono8",
                "RGB8",
                "BGR8",
                "Mono12",
                "RGB12",
                "BGR12"
            ],
            "description": "Pixel format of the exported image. This is used as default value on datalayer and can be overwriten by the user."
        },
        "packetSize": {
            "type": "number",
            "minimum": 576,
            "maximum": 9000,
            "default": 1496,
            "multipleOf": 8,
            "description": "Size of the packet in bytes, must be multiple of 8. Please confirm it matches the configured MTU of the network. Default is 1496 bytes. This is used as default value on datalayer and can be overwriten by the user. It is only writeable only before camera is connected.",
            "examples": [
                1496,
                8192
            ]
        },
        "packetDelay_us": {
            "type": "number",
            "minimum": 0,
            "maximum": 12449,
            "default": 0,
            "description": "Delay between packets in microseconds. Default is 0 microseconds. Increase it if image is corrupted or faild to capture image. This is used as default value on datalayer and can be overwriten by the user."
        },
        "timeout_ms": {
            "type": "number",
            "minimum": 100,
            "maximum": 10000,
            "default": 2000,
            "description": "Timeout in milliseconds. Default is 2000 milliseconds. How long to wait for the image to be captured before giving up. This is used as default value on datalayer and can be overwriten by the user."
        },
        "initialFeatureFile":{
            "type": "string",
            "description": "path to feature file with <FEATURENAME> <FEATURE VALUE> pairs. These values will be set after connect to camera.",
            "examples": [
                "",
                "features/camera1-features.txt"
            ]
        },
        "timestampSource": {
            "type": "string",
            "enum": [
                "Camera",
                "System"
            ],
            "default": "Camera",
            "description": "Source of the timestamp for each frame. 'Camera' uses the timestamp provided by the camera hardware, while 'System' uses the system clock of the ctrlX."
        },
        "clearBufferBeforeCapture": {
            "type": "boolean",
            "default": false,
            "description": "If true, the buffer will be cleared before capture, this is useful when the camera is running in continuous mode and we want to get the latest image."
        },
        "driverId": {
            "type": "string",
            "minLength": 1,
            "default": "default",
            "description": "Id of a GenTL driver defined in the app settings 'cameraDrivers' array. Defaults to 'default' (the built-in Baumer producer).",
            "examples": [
                "default",
                "basler-producer"
            ]
        }
    },
    "required": [
        "meta",
        "id",
        "serial",
        "exposureTimeUS",
        "pixelFormat"
    ],
    "examples": [
        {
            "$schema": "schemas/lumiscan-cam-driver-module.schema.json",
            "meta": {
                "inputFileType": "LumiScan-Ctrlx-Camera-Configuration",
                "inputFileVersion": "0.0.1",
                "targetMachine": "CtrlX7",
                "programName": "lumiscan-cam-driver",
                "programVersion": "2.1.0"
            },
            "id": "camera1",
            "serial": "simulation",
            "exposureTimeUS": 6000,
            "pixelFormat": "Mono8",
            "exportPixelFormat": "RGB8",
            "packetSize": 1496,
            "packetDelay_us": 0,
            "timeout_ms": 2000,
            "initialFeatureFile": "",
            "timestampSource": "System",
            "clearBufferBeforeCapture": false,
            "driverId": "default"
        },
        {
            "$schema": "schemas/lumiscan-cam-driver-module.schema.json",
            "meta": {
                "inputFileType": "LumiScan-Ctrlx-Camera-Configuration",
                "inputFileVersion": "0.0.1",
                "targetMachine": "CtrlX7",
                "programName": "lumiscan-cam-driver",
                "programVersion": "2.1.0"
            },
            "id": "camera-left",
            "serial": "LX123456",
            "exposureTimeUS": 10000,
            "pixelFormat": "BayerRG8",
            "exportPixelFormat": "BGR8",
            "packetSize": 8192,
            "packetDelay_us": 1000,
            "timeout_ms": 2000,
            "initialFeatureFile": "features/camera-left-features.txt",
            "timestampSource": "Camera",
            "clearBufferBeforeCapture": true,
            "driverId": "basler-producer"
        }
    ]
}