Beispiel #1
0
 const std::vector<const runtime::Parameter*> ConvertPixelType::setupInitParameters()
 {
     std::vector<const runtime::Parameter*> parameters;
     
     EnumParameter* dataFlow = new runtime::EnumParameter(DATA_FLOW);
     dataFlow->setAccessMode(runtime::Parameter::NONE_WRITE);
     dataFlow->setTitle("Data flow");
     dataFlow->add(runtime::EnumDescription(runtime::Enum(MANUAL), "Manual"));
     dataFlow->add(runtime::EnumDescription(runtime::Enum(ALLOCATE), "Allocate"));
     parameters.push_back(dataFlow);
     
     return parameters;
 }
Beispiel #2
0
 const std::vector<const Parameter*> ConvertPixelType::setupParameters()
 {
     std::vector<const runtime::Parameter*> parameters;
     
     EnumParameter* pixelType = new EnumParameter(PIXEL_TYPE);
     pixelType->setTitle("Pixel type");
     pixelType->setAccessMode(runtime::Parameter::ACTIVATED_WRITE);
     pixelType->add(EnumDescription(Enum(runtime::Image::MONO_8), "Mono image 8-bit"));
     pixelType->add(EnumDescription(Enum(runtime::Image::RGB_24), "RGB image 24-bit"));
     pixelType->add(EnumDescription(Enum(runtime::Image::BGR_24), "BGR image 24-bit"));
     pixelType->add(EnumDescription(Enum(runtime::Image::BAYERBG_8), "Bayer BG pattern 8-bit"));
     pixelType->add(EnumDescription(Enum(runtime::Image::BAYERGB_8), "Bayer GB pattern 8-bit"));
     parameters.push_back(pixelType);
                                 
     return parameters;
 }
Beispiel #3
0
 const std::vector<const Parameter*> ReadDirectory::setupParameters()
 {
     std::vector<const runtime::Parameter*> parameters;
     
     EnumParameter* directory = new EnumParameter(DIRECTORY);
     directory->setTitle(L_("Directory"));
     directory->setAccessMode(runtime::Parameter::INITIALIZED_WRITE);
     parameters.push_back(directory);
     
     directory->add(EnumDescription(Enum(NO_DIRECTORY), L_("None")));
     boost::filesystem::path path (BASE_DIRECTORY);
     m_directoryMap.clear();
     std::vector<std::string> dirNames;
     if (boost::filesystem::exists(path))
     {
         if (boost::filesystem::is_directory(path))
         {
             for(boost::filesystem::directory_iterator iter(path);
                 iter != boost::filesystem::directory_iterator();
                 ++iter)
             {
                 if (! boost::filesystem::is_directory(iter->path()))
                     continue;
                 
                 dirNames.push_back(iter->path().filename().string());
             }
         }
     }
     
     std::sort(dirNames.begin(), dirNames.end());
     std::size_t i = NO_DIRECTORY + 1;
     for (std::vector<std::string>::const_iterator iter = dirNames.begin();
          iter != dirNames.end(); ++iter)
     {
         directory->add(EnumDescription(Enum(i), *iter));
         m_directoryMap[i] = *iter;
         i++;
     }
                                 
     return parameters;
 }
Beispiel #4
0
 const std::vector<const Parameter*> ParameterOperator::setupParameters()
 {
     std::vector<const Parameter*> parameters;
     
     ParameterGroup* group1 = new ParameterGroup(PARAM_GROUP_1);
     group1->setTitle("Group 1");
     parameters.push_back(group1);
     
     ParameterGroup* group2 = new ParameterGroup(PARAM_GROUP_2, group1);
     group2->setTitle("Group 2");
     parameters.push_back(group2);
     
     NumericParameter<Int32>* intParam = new NumericParameter<Int32>(INT_PARAM, group1);
     intParam->setTitle("Integer parameter");
     intParam->setMax(Int32(1000));
     intParam->setMin(Int32(-1000));
     intParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     parameters.push_back(intParam);
     
     EnumParameter* enumParam = new EnumParameter(ENUM_PARAM, group2);
     enumParam->setTitle("Enum parameter");
     enumParam->setAccessMode(Parameter::ACTIVATED_WRITE);
     enumParam->add(EnumDescription(Enum(0), "Choice 0"));
     enumParam->add(EnumDescription(Enum(1), "Choice 1"));
     enumParam->add(EnumDescription(Enum(2), "Choice 2"));
     parameters.push_back(enumParam);
     
     Parameter* boolParam = new Parameter(BOOL_PARAM, Variant::BOOL);
     boolParam->setTitle("Boolean parameter");
     boolParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     parameters.push_back(boolParam);
     
     Parameter* matrixParam = new MatrixParameter(MATRIX_PARAM, Variant::FLOAT_32_MATRIX);
     matrixParam->setTitle("Matrix parameter");
     matrixParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     parameters.push_back(matrixParam);
     
     MatrixParameter* intMatrixParam = new MatrixParameter(INT_MATRIX_PARAM, Variant::UINT_32_MATRIX);
     intMatrixParam->setTitle("Integer matrix parameter");
     intMatrixParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     intMatrixParam->setRows(1);
     intMatrixParam->setCols(2);
     parameters.push_back(intMatrixParam);
     
     Parameter* triggerValueParam = new Parameter(TRIGGER_VALUE_PARAM, Variant::BOOL);
     triggerValueParam->setTitle("Trigger value");
     triggerValueParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     parameters.push_back(triggerValueParam);
     
     Parameter* triggerParam = new Parameter(TRIGGER_PARAM, Variant::TRIGGER);
     triggerParam->setTitle("Trigger");
     triggerParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     triggerParam->setUpdateBehavior(Parameter::PUSH);
     parameters.push_back(triggerParam);
     
     Parameter* pushParam = new Parameter(PUSH_PARAM, Variant::FLOAT_32);
     pushParam->setTitle("Push");
     pushParam->setAccessMode(Parameter::INITIALIZED_WRITE);
     pushParam->setUpdateBehavior(Parameter::PUSH);
     parameters.push_back(pushParam);
     
     Parameter* pullParam = new Parameter(PULL_PARAM, Variant::FLOAT_32);
     pullParam->setTitle("Pull");
     pullParam->setAccessMode(Parameter::INITIALIZED_READ);
     pullParam->setUpdateBehavior(Parameter::PULL);
     parameters.push_back(pullParam);
     
     return parameters;
 }