Пример #1
0
 void S3::setup(kerberos::StringMap & settings)
 {
     Cloud::setup(settings);
     
     // -------------------------
     // Initialize S3 credentials
     
     setBucket(settings.at("clouds.S3.bucket"));
     setFolder(settings.at("clouds.S3.folder"));
     setPublicKey(settings.at("clouds.S3.publicKey"));
     setPrivateKey(settings.at("clouds.S3.privateKey"));
 }
Пример #2
0
 void USBCamera::setup(kerberos::StringMap &settings)
 {
     int width = std::atoi(settings.at("captures.USBCamera.frameWidth").c_str());
     int height = std::atoi(settings.at("captures.USBCamera.frameHeight").c_str());
     int angle = std::atoi(settings.at("captures.USBCamera.angle").c_str());
     int delay = std::atoi(settings.at("captures.USBCamera.delay").c_str());
     
     // Save width and height in settings
     Capture::setup(settings, width, height);
     setImageSize(width, height);
     setRotation(angle);
     setDelay(delay);
     
     // Initialize executor (update the usb camera at specific times).
     tryToUpdateCapture.setAction(this, &USBCamera::update);
     tryToUpdateCapture.setInterval("thrice in 10 functions calls");
 }
Пример #3
0
 void VideoCapture::setup(kerberos::StringMap &settings)
 {
     int width = std::atoi(settings.at("captures.VideoCapture.frameWidth").c_str());
     int height = std::atoi(settings.at("captures.VideoCapture.frameHeight").c_str());
     std::string path = settings.at("captures.VideoCapture.path");
     int angle = std::atoi(settings.at("captures.VideoCapture.angle").c_str());
     int delay = std::atoi(settings.at("captures.VideoCapture.delay").c_str());
     
     // Save width and height in settings
     Capture::setup(settings, width, height);
     setImageSize(width, height);
     setRotation(angle);
     setDelay(delay);
     setPath(path);
     
     // Initialize video
     open();
 }
Пример #4
0
    void Machinery::setup(const kerberos::StringMap & settings)
    {
        // -----------------------------------------------------------
        // Creates condition, algorithms, expositors, heuristics and io handlers.
        
        LINFO << "Starting conditions: " + settings.at("condition");
        std::vector<Condition *> conditions = Factory<Condition>::getInstance()->createMultiple(settings.at("condition"));
        for(int i = 0; i < conditions.size(); i++)
        {
            conditions[i]->setup(settings);
        }
        setCondition(conditions);

        LINFO << "Starting algorithm: " + settings.at("algorithm");
        Algorithm * algorithm = Factory<Algorithm>::getInstance()->create(settings.at("algorithm"));
        algorithm->setup(settings);
        setAlgorithm(algorithm);

        LINFO << "Starting expositor: " + settings.at("expositor");
        Expositor * expositor = Factory<Expositor>::getInstance()->create(settings.at("expositor"));
        expositor->setup(settings);
        setExpositor(expositor);

        LINFO << "Starting heuristic: " + settings.at("heuristic");
        Heuristic * heuristic = Factory<Heuristic>::getInstance()->create(settings.at("heuristic"));
        heuristic->setup(settings);
        setHeuristic(heuristic);  

        LINFO << "Starting io devices: " + settings.at("io");
        std::vector<Io *> ios = Factory<Io>::getInstance()->createMultiple(settings.at("io"));
        for(int i = 0; i < ios.size(); i++)
        {
            ios[i]->setup(settings);
        }
        setIo(ios);
    }