Logo Search packages:      
Sourcecode: libdc1394-22 version File versions  Download package

dc1394error_t dc1394_feature_print ( dc1394feature_info_t feature,
FILE *  fd 
)

Displays the bounds and options of the given feature

Definition at line 325 of file control.c.

References __dc1394feature_info_t_struct::abs_max, __dc1394feature_info_t_struct::abs_min, __dc1394feature_info_t_struct::abs_value, __dc1394feature_info_t_struct::absolute_capable, __dc1394feature_info_t_struct::available, __dc1394feature_info_t_struct::B_value, __dc1394feature_info_t_struct::BU_value, __dc1394feature_info_t_struct::current_mode, __dc1394feature_info_t_struct::G_value, __dc1394feature_info_t_struct::id, __dc1394feature_info_t_struct::is_on, __dc1394feature_info_t_struct::max, __dc1394feature_info_t_struct::min, dc1394trigger_modes_t::modes, dc1394feature_modes_t::modes, __dc1394feature_info_t_struct::modes, dc1394trigger_sources_t::num, dc1394trigger_modes_t::num, dc1394feature_modes_t::num, __dc1394feature_info_t_struct::on_off_capable, __dc1394feature_info_t_struct::polarity_capable, __dc1394feature_info_t_struct::R_value, __dc1394feature_info_t_struct::readout_capable, __dc1394feature_info_t_struct::RV_value, dc1394trigger_sources_t::sources, __dc1394feature_info_t_struct::target_value, __dc1394feature_info_t_struct::trigger_mode, __dc1394feature_info_t_struct::trigger_modes, __dc1394feature_info_t_struct::trigger_polarity, __dc1394feature_info_t_struct::trigger_source, __dc1394feature_info_t_struct::trigger_sources, and __dc1394feature_info_t_struct::value.

{
    int fid= f->id;

    if ( (fid < DC1394_FEATURE_MIN) || (fid > DC1394_FEATURE_MAX) ) {
        return DC1394_INVALID_FEATURE;
    }
    const char *feature_string = dc1394_feature_get_string (fid);
    fprintf(fd,"%s:\n\t", feature_string);

    if (!f->available) {
        fprintf(fd,"NOT AVAILABLE\n");
        return DC1394_SUCCESS;
    }

    if (f->readout_capable)
        fprintf(fd,"RC  ");
    if (f->on_off_capable)
        fprintf(fd,"O/OC  ");
    int i;
    for (i=0;i<f->modes.num;i++) {
        switch (f->modes.modes[i]) {
        case DC1394_FEATURE_MODE_MANUAL:
            fprintf(fd,"MC  ");
            break;
        case DC1394_FEATURE_MODE_AUTO:
            fprintf(fd,"AC  ");
            break;
        case DC1394_FEATURE_MODE_ONE_PUSH_AUTO:
            fprintf(fd,"OP  ");
            break;
        }
        fprintf(fd,"(active is: ");
        switch (f->current_mode) {
        case DC1394_FEATURE_MODE_MANUAL:
            fprintf(fd,"MAN)  ");
            break;
        case DC1394_FEATURE_MODE_AUTO:
            fprintf(fd,"AUTO)  ");
            break;
        case DC1394_FEATURE_MODE_ONE_PUSH_AUTO:
            fprintf(fd,"ONE PUSH)  ");
            break;
        }

    }
    if (f->absolute_capable)
        fprintf(fd,"ABS  ");
    fprintf(fd,"\n");

    if (f->on_off_capable) {
        if (f->is_on)
            fprintf(fd,"\tFeature: ON  ");
        else
            fprintf(fd,"\tFeature: OFF  ");
    }
    else
        fprintf(fd,"\t");

    if (fid != DC1394_FEATURE_TRIGGER)
        fprintf(fd,"min: %d max %d\n", f->min, f->max);

    switch(fid) {
    case DC1394_FEATURE_TRIGGER:
        fprintf(fd,"\n\tAvailableTriggerModes: ");
        if (f->trigger_modes.num==0) {
            fprintf(fd,"none");
        }
        else {
            int i;
            for (i=0;i<f->trigger_modes.num;i++) {
                fprintf(fd,"%d ",f->trigger_modes.modes[i]);
            }
        }
        fprintf(fd,"\n\tAvailableTriggerSources: ");
        if (f->trigger_sources.num==0) {
            fprintf(fd,"none");
        }
        else {
            int i;
            for (i=0;i<f->trigger_sources.num;i++) {
                fprintf(fd,"%d ",f->trigger_sources.sources[i]);
            }
        }
        fprintf(fd,"\n\tPolarity Change Capable: ");

        if (f->polarity_capable)
            fprintf(fd,"True");
        else
            fprintf(fd,"False");

        fprintf(fd,"\n\tCurrent Polarity: ");

        if (f->trigger_polarity)
            fprintf(fd,"POS");
        else
            fprintf(fd,"NEG");

        fprintf(fd,"\n\tcurrent mode: %d\n", f->trigger_mode);
        if (f->trigger_sources.num>0) {
            fprintf(fd,"\n\tcurrent source: %d\n", f->trigger_source);
        }
        break;
    case DC1394_FEATURE_WHITE_BALANCE:
        fprintf(fd,"\tB/U value: %d R/V value: %d\n", f->BU_value, f->RV_value);
        break;
    case DC1394_FEATURE_TEMPERATURE:
        fprintf(fd,"\tTarget temp: %d Current Temp: %d\n", f->target_value, f->value);
        break;
    case DC1394_FEATURE_WHITE_SHADING:
        fprintf(fd,"\tR value: %d G value: %d B value: %d\n", f->R_value,
                f->G_value, f->B_value);
        break;
    default:
        fprintf(fd,"\tcurrent value is: %d\n",f->value);
        break;
    }
    if (f->absolute_capable)
        fprintf(fd,"\tabsolute settings:\n\t value: %f\n\t min: %f\n\t max: %f\n", f->abs_value,f->abs_min,f->abs_max);

    return DC1394_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index