#!/usr/bin/env python

PACKAGE='camera_pylon'
import roslib; roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator import *
from driver_base.msg import SensorLevels

gen = ParameterGenerator()

onoff_enum          = gen.enum([gen.const("Off",                    str_t, "Off",        "Off"),
                                gen.const("On",                     str_t, "On",         "On") ],
                                "On or Off")
                                
shutter_enum        = gen.enum([gen.const("Rolling",                str_t, "Rolling",    "Rolling Shutter Mode"),
                                gen.const("Global",                 str_t, "Global",     "Global Shutter Mode") ],
                                "Shutter Mode")
                                

auto_enum           = gen.enum([gen.const("Off_",                   str_t, "Off",        "Use Manual Settings"),
                                gen.const("Once",                   str_t, "Once",       "Recalc Once"),
                                gen.const("Continuous",             str_t, "Continuous", "Recalc Continually") ],
                                "Automatic Settings") 
                                
pixel_enum          = gen.enum([gen.const("Bayer_RG8",              str_t, "Bayer_RG8",  "Color"),
                                gen.const("Mono_8",                 str_t, "Mono_8",     "Grayscale"),
                                gen.const("YUV_422",                str_t, "YUV_422",	 "Color") ],
                                "Pixel Format") 
                                                                
acquisitionmode_enum = gen.enum([gen.const("Continuous_",           str_t, "Continuous",  "Capture continuously upon trigger."),
                                gen.const("SingleFrame",            str_t, "SingleFrame", "Capture one frame upon trigger."),
                                gen.const("MultiFrame",             str_t, "MultiFrame",  "Capture multiple frames upon trigger.")],
                                "AcquisitionMode")


gen.add("Width",       int_t,    SensorLevels.RECONFIGURE_RUNNING, "Width)",  		1600, 0, 10000)
gen.add("Height",      int_t,    SensorLevels.RECONFIGURE_RUNNING, "Height",  		1200, 0, 10000)
gen.add("OffsetX",      int_t,    SensorLevels.RECONFIGURE_RUNNING, "OffsetX",  		0, 0, 10000)
gen.add("OffsetY",      int_t,    SensorLevels.RECONFIGURE_RUNNING, "OffsetY",  		0, 0, 10000)
gen.add("ExposureAuto",         str_t,    SensorLevels.RECONFIGURE_RUNNING, "Automatic exposure",  		"Off", edit_method=auto_enum)
gen.add("ExposureTimeAbs",      int_t,    SensorLevels.RECONFIGURE_RUNNING, "Exposure time (us)",  		14000, 35, 840000)
gen.add("GainAuto",             str_t,    SensorLevels.RECONFIGURE_RUNNING, "Automatic gain",      		"Off", edit_method=auto_enum)
gen.add("Gain",                 int_t,    SensorLevels.RECONFIGURE_RUNNING, "Gain (%)",            		1, 1, 3)
gen.add("PixelFormat",          str_t,    SensorLevels.RECONFIGURE_RUNNING, "Pixel Format",      		"Bayer_RG8", edit_method=pixel_enum)
gen.add("AcquisitionMode",      str_t,    SensorLevels.RECONFIGURE_RUNNING, "Acquisition Mode",    		"Continuous", edit_method=acquisitionmode_enum)
gen.add("FixedFrameRate",       bool_t,   SensorLevels.RECONFIGURE_RUNNING, "fixed Framerate enable",	False)
gen.add("Display"	,       bool_t,   SensorLevels.RECONFIGURE_RUNNING, "Show Image",		False)
gen.add("FrameRate",            double_t, SensorLevels.RECONFIGURE_RUNNING, "Framerate (fps)",     		10.0, 1.19048 , 1000.0)
gen.add("ShutterMode",          str_t,    SensorLevels.RECONFIGURE_RUNNING, "Shutter Mode",    		    "Rolling", edit_method=shutter_enum)
exit(gen.generate(PACKAGE, "camera_tracking_params", "CameraTracking"))
