iCub-main
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
cDownloader Class Reference

#include <downloader.h>

Classes

struct  strain_value_t
 

Public Types

enum  {
  strain_regset_inuse = 0,
  strain_regset_one = 1,
  strain_regset_two = 2,
  strain_regset_three = 3
}
 
enum  {
  strain_regsetmode_temporary = 0,
  strain_regsetmode_permanent = 1
}
 
enum  strain_acquisition_mode_t {
  strain_acquisition_mode_streaming = 0,
  strain_acquisition_mode_polling = 1
}
 

Public Member Functions

int initdriver (yarp::os::Searchable &config, bool verbose=true)
 
int stopdriver ()
 
int initschede ()
 
int startscheda (int bus, int board_pid, bool board_eeprom, int download_type)
 
int stopscheda (int bus, int board_pid)
 
int download_file (int bus, int board_pid, int download_type, bool eeprom)
 
int open_file (std::string file)
 
int change_card_address (int bus, int target_id, int new_id, int board_type)
 
int change_board_info (int bus, int target_id, char *board_info)
 
int get_board_info (int bus, int target_id, char *board_info)
 
int get_serial_no (int bus, int target_id, char *board_info)
 
int get_firmware_version (int bus, int target_id, eObrd_cantype_t boardtype, eObrd_info_t *info, bool &noreply)
 
int get_canbus_id ()
 
void set_canbus_id (int id)
 
int strain_start_sampling (int bus, int target_id, string *errorstring=NULL)
 
int strain_stop_sampling (int bus, int target_id, string *errorstring=NULL)
 
float strain_amplifier_discretegain2float (strain2_ampl_discretegain_t c)
 
int strain_set_regulationset (int bus, int target_id, int regset=strain_regset_one, int regsetmode=strain_regsetmode_temporary, string *errorstring=NULL)
 
int strain_get_regulationset (int bus, int target_id, int &regset, const int regsetmode=strain_regsetmode_temporary, string *errorstring=NULL)
 
int strain_calibrate_offset (int bus, int target_id, icubCanProto_boardType_t boardtype, unsigned int middle_val, string *errorstring=NULL)
 
int strain_calibrate_offset2 (int bus, int target_id, icubCanProto_boardType_t boardtype, const std::vector< strain2_ampl_discretegain_t > &gains, const std::vector< int16_t > &targets, string *errorstring=NULL)
 
int strain_get_adc (int bus, int target_id, char channel, unsigned int &adc, int type, string *errorstring=NULL)
 
int strain_get_eeprom_saved (int bus, int target_id, bool *status, string *errorstring=NULL)
 
int strain_save_to_eeprom (int bus, int target_id, string *errorstring=NULL)
 
int strain_get_curr_bias (int bus, int target_id, char channel, signed int &bias, string *errorstring=NULL)
 
int strain_set_curr_bias (int bus, int target_id, string *errorstring=NULL)
 
int strain_set_curr_bias (int bus, int target_id, char channel, signed int bias, string *errorstring=NULL)
 
int strain_reset_curr_bias (int bus, int target_id, string *errorstring=NULL)
 
int strain_get_serial_number (int bus, int target_id, char *serial_number, string *errorstring=NULL)
 
int strain_set_serial_number (int bus, int target_id, const char *serial_number, string *errorstring=NULL)
 
int strain_get_offset (int bus, int target_id, char channel, unsigned int &offset, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_offset (int bus, int target_id, char channel, unsigned int offset, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_get_matrix_rc (int bus, int target_id, char r, char c, unsigned int &elem, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_matrix_rc (int bus, int target_id, char r, char c, unsigned int elem, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_get_matrix_gain (int bus, int target_id, unsigned int &gain, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_matrix_gain (int bus, int target_id, unsigned int gain, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_amplifier_regs (int bus, int target_id, unsigned char channel, const strain2_ampl_regs_t &ampregs, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_get_amplifier_regs (int bus, int target_id, unsigned char channel, strain2_ampl_regs_t &ampregs, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_amplifier_discretegain (int bus, int target_id, unsigned char channel, strain2_ampl_discretegain_t ampset, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_get_amplifier_gain_offset (int bus, int target_id, unsigned char channel, float &gain, uint16_t &offset, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_amplifier_gain_offset (int bus, int target_id, unsigned char channel, float gain, uint16_t offset, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_get_calib_bias (int bus, int target_id, char channel, signed int &bias, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_set_calib_bias (int bus, int target_id, string *errorstring=NULL)
 
int strain_set_calib_bias (int bus, int target_id, char channel, signed int bias, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_reset_calib_bias (int bus, int target_id, string *errorstring=NULL)
 
int strain_set_full_scale (int bus, int target_id, unsigned char channel, unsigned int full_scale, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_get_full_scale (int bus, int target_id, unsigned char channel, unsigned int &full_scale, int regset=strain_regset_inuse, string *errorstring=NULL)
 
int strain_acquire_start (int bus, int target_id, uint8_t txratemilli=20, bool calibmode=true, strain_acquisition_mode_t acqmode=strain_acquisition_mode_streaming, string *errorstring=NULL)
 
int strain_acquire_get (int bus, int target_id, vector< strain_value_t > &values, const unsigned int howmany=10, void(*updateProgressBar)(void *, float)=NULL, void *arg=NULL, strain_acquisition_mode_t acqmode=strain_acquisition_mode_streaming, const unsigned int maxerrors=1, string *errorstring=NULL)
 
int strain_acquire_stop (int bus, int target_id, strain_acquisition_mode_t acqmode=strain_acquisition_mode_streaming, string *errorstring=NULL)
 
 cDownloader (bool verbose=true)
 
void set_verbose (bool verbose)
 
void set_external_logger (void *caller=NULL, void(*logger)(void *, const std::string &)=NULL)
 

Public Attributes

sBoardboard_list
 
int board_list_size
 
int progress
 
int file_length
 
unsigned int sprsPage
 
std::fstream filestr
 
int nSelectedBoards
 
bool connected
 

Detailed Description

Definition at line 111 of file downloader.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
strain_regset_inuse 
strain_regset_one 
strain_regset_two 
strain_regset_three 

Definition at line 147 of file downloader.h.

◆ anonymous enum

anonymous enum
Enumerator
strain_regsetmode_temporary 
strain_regsetmode_permanent 

Definition at line 148 of file downloader.h.

◆ strain_acquisition_mode_t

Enumerator
strain_acquisition_mode_streaming 
strain_acquisition_mode_polling 

Definition at line 256 of file downloader.h.

Constructor & Destructor Documentation

◆ cDownloader()

cDownloader::cDownloader ( bool  verbose = true)

Definition at line 87 of file downloader.cpp.

Member Function Documentation

◆ change_board_info()

int cDownloader::change_board_info ( int  bus,
int  target_id,
char *  board_info 
)

Definition at line 2363 of file downloader.cpp.

◆ change_card_address()

int cDownloader::change_card_address ( int  bus,
int  target_id,
int  new_id,
int  board_type 
)

Definition at line 2412 of file downloader.cpp.

◆ download_file()

int cDownloader::download_file ( int  bus,
int  board_pid,
int  download_type,
bool  eeprom 
)

Definition at line 3454 of file downloader.cpp.

◆ get_board_info()

int cDownloader::get_board_info ( int  bus,
int  target_id,
char *  board_info 
)

Definition at line 2280 of file downloader.cpp.

◆ get_canbus_id()

int cDownloader::get_canbus_id ( )

Definition at line 2729 of file downloader.cpp.

◆ get_firmware_version()

int cDownloader::get_firmware_version ( int  bus,
int  target_id,
eObrd_cantype_t  boardtype,
eObrd_info_t *  info,
bool &  noreply 
)

Definition at line 2155 of file downloader.cpp.

◆ get_serial_no()

int cDownloader::get_serial_no ( int  bus,
int  target_id,
char *  board_info 
)

Definition at line 2123 of file downloader.cpp.

◆ initdriver()

int cDownloader::initdriver ( yarp::os::Searchable &  config,
bool  verbose = true 
)

Definition at line 142 of file downloader.cpp.

◆ initschede()

int cDownloader::initschede ( )

Definition at line 2480 of file downloader.cpp.

◆ open_file()

int cDownloader::open_file ( std::string  file)

Definition at line 3416 of file downloader.cpp.

◆ set_canbus_id()

void cDownloader::set_canbus_id ( int  id)

Definition at line 2734 of file downloader.cpp.

◆ set_external_logger()

void cDownloader::set_external_logger ( void *  caller = NULL,
void(*)(void *, const std::string &)  logger = NULL 
)

Definition at line 103 of file downloader.cpp.

◆ set_verbose()

void cDownloader::set_verbose ( bool  verbose)

Definition at line 98 of file downloader.cpp.

◆ startscheda()

int cDownloader::startscheda ( int  bus,
int  board_pid,
bool  board_eeprom,
int  download_type 
)

Definition at line 2741 of file downloader.cpp.

◆ stopdriver()

int cDownloader::stopdriver ( )

Definition at line 122 of file downloader.cpp.

◆ stopscheda()

int cDownloader::stopscheda ( int  bus,
int  board_pid 
)

Definition at line 2836 of file downloader.cpp.

◆ strain_acquire_get()

int cDownloader::strain_acquire_get ( int  bus,
int  target_id,
vector< strain_value_t > &  values,
const unsigned int  howmany = 10,
void(*)(void *, float)  updateProgressBar = NULL,
void *  arg = NULL,
strain_acquisition_mode_t  acqmode = strain_acquisition_mode_streaming,
const unsigned int  maxerrors = 1,
string errorstring = NULL 
)

Definition at line 1450 of file downloader.cpp.

◆ strain_acquire_start()

int cDownloader::strain_acquire_start ( int  bus,
int  target_id,
uint8_t  txratemilli = 20,
bool  calibmode = true,
strain_acquisition_mode_t  acqmode = strain_acquisition_mode_streaming,
string errorstring = NULL 
)

Definition at line 1351 of file downloader.cpp.

◆ strain_acquire_stop()

int cDownloader::strain_acquire_stop ( int  bus,
int  target_id,
strain_acquisition_mode_t  acqmode = strain_acquisition_mode_streaming,
string errorstring = NULL 
)

Definition at line 1404 of file downloader.cpp.

◆ strain_amplifier_discretegain2float()

float cDownloader::strain_amplifier_discretegain2float ( strain2_ampl_discretegain_t  c)

Definition at line 992 of file downloader.cpp.

◆ strain_calibrate_offset()

int cDownloader::strain_calibrate_offset ( int  bus,
int  target_id,
icubCanProto_boardType_t  boardtype,
unsigned int  middle_val,
string errorstring = NULL 
)

Definition at line 1718 of file downloader.cpp.

◆ strain_calibrate_offset2()

int cDownloader::strain_calibrate_offset2 ( int  bus,
int  target_id,
icubCanProto_boardType_t  boardtype,
const std::vector< strain2_ampl_discretegain_t > &  gains,
const std::vector< int16_t > &  targets,
string errorstring = NULL 
)

Definition at line 1699 of file downloader.cpp.

◆ strain_get_adc()

int cDownloader::strain_get_adc ( int  bus,
int  target_id,
char  channel,
unsigned int &  adc,
int  type,
string errorstring = NULL 
)

Definition at line 348 of file downloader.cpp.

◆ strain_get_amplifier_gain_offset()

int cDownloader::strain_get_amplifier_gain_offset ( int  bus,
int  target_id,
unsigned char  channel,
float &  gain,
uint16_t &  offset,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1088 of file downloader.cpp.

◆ strain_get_amplifier_regs()

int cDownloader::strain_get_amplifier_regs ( int  bus,
int  target_id,
unsigned char  channel,
strain2_ampl_regs_t ampregs,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 947 of file downloader.cpp.

◆ strain_get_calib_bias()

int cDownloader::strain_get_calib_bias ( int  bus,
int  target_id,
char  channel,
signed int &  bias,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 444 of file downloader.cpp.

◆ strain_get_curr_bias()

int cDownloader::strain_get_curr_bias ( int  bus,
int  target_id,
char  channel,
signed int &  bias,
string errorstring = NULL 
)

Definition at line 545 of file downloader.cpp.

◆ strain_get_eeprom_saved()

int cDownloader::strain_get_eeprom_saved ( int  bus,
int  target_id,
bool *  status,
string errorstring = NULL 
)

Definition at line 713 of file downloader.cpp.

◆ strain_get_full_scale()

int cDownloader::strain_get_full_scale ( int  bus,
int  target_id,
unsigned char  channel,
unsigned int &  full_scale,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1184 of file downloader.cpp.

◆ strain_get_matrix_gain()

int cDownloader::strain_get_matrix_gain ( int  bus,
int  target_id,
unsigned int &  gain,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 746 of file downloader.cpp.

◆ strain_get_matrix_rc()

int cDownloader::strain_get_matrix_rc ( int  bus,
int  target_id,
char  r,
char  c,
unsigned int &  elem,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1245 of file downloader.cpp.

◆ strain_get_offset()

int cDownloader::strain_get_offset ( int  bus,
int  target_id,
char  channel,
unsigned int &  offset,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 399 of file downloader.cpp.

◆ strain_get_regulationset()

int cDownloader::strain_get_regulationset ( int  bus,
int  target_id,
int &  regset,
const int  regsetmode = strain_regsetmode_temporary,
string errorstring = NULL 
)

Definition at line 837 of file downloader.cpp.

◆ strain_get_serial_number()

int cDownloader::strain_get_serial_number ( int  bus,
int  target_id,
char *  serial_number,
string errorstring = NULL 
)

Definition at line 672 of file downloader.cpp.

◆ strain_reset_calib_bias()

int cDownloader::strain_reset_calib_bias ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 524 of file downloader.cpp.

◆ strain_reset_curr_bias()

int cDownloader::strain_reset_curr_bias ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 622 of file downloader.cpp.

◆ strain_save_to_eeprom()

int cDownloader::strain_save_to_eeprom ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 214 of file downloader.cpp.

◆ strain_set_amplifier_discretegain()

int cDownloader::strain_set_amplifier_discretegain ( int  bus,
int  target_id,
unsigned char  channel,
strain2_ampl_discretegain_t  ampset,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1009 of file downloader.cpp.

◆ strain_set_amplifier_gain_offset()

int cDownloader::strain_set_amplifier_gain_offset ( int  bus,
int  target_id,
unsigned char  channel,
float  gain,
uint16_t  offset,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1127 of file downloader.cpp.

◆ strain_set_amplifier_regs()

int cDownloader::strain_set_amplifier_regs ( int  bus,
int  target_id,
unsigned char  channel,
const strain2_ampl_regs_t ampregs,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 913 of file downloader.cpp.

◆ strain_set_calib_bias() [1/2]

int cDownloader::strain_set_calib_bias ( int  bus,
int  target_id,
char  channel,
signed int  bias,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

◆ strain_set_calib_bias() [2/2]

int cDownloader::strain_set_calib_bias ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 476 of file downloader.cpp.

◆ strain_set_curr_bias() [1/2]

int cDownloader::strain_set_curr_bias ( int  bus,
int  target_id,
char  channel,
signed int  bias,
string errorstring = NULL 
)

◆ strain_set_curr_bias() [2/2]

int cDownloader::strain_set_curr_bias ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 575 of file downloader.cpp.

◆ strain_set_full_scale()

int cDownloader::strain_set_full_scale ( int  bus,
int  target_id,
unsigned char  channel,
unsigned int  full_scale,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1221 of file downloader.cpp.

◆ strain_set_matrix_gain()

int cDownloader::strain_set_matrix_gain ( int  bus,
int  target_id,
unsigned int  gain,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 891 of file downloader.cpp.

◆ strain_set_matrix_rc()

int cDownloader::strain_set_matrix_rc ( int  bus,
int  target_id,
char  r,
char  c,
unsigned int  elem,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1291 of file downloader.cpp.

◆ strain_set_offset()

int cDownloader::strain_set_offset ( int  bus,
int  target_id,
char  channel,
unsigned int  offset,
int  regset = strain_regset_inuse,
string errorstring = NULL 
)

Definition at line 1316 of file downloader.cpp.

◆ strain_set_regulationset()

int cDownloader::strain_set_regulationset ( int  bus,
int  target_id,
int  regset = strain_regset_one,
int  regsetmode = strain_regsetmode_temporary,
string errorstring = NULL 
)

Definition at line 804 of file downloader.cpp.

◆ strain_set_serial_number()

int cDownloader::strain_set_serial_number ( int  bus,
int  target_id,
const char *  serial_number,
string errorstring = NULL 
)

Definition at line 644 of file downloader.cpp.

◆ strain_start_sampling()

int cDownloader::strain_start_sampling ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 1633 of file downloader.cpp.

◆ strain_stop_sampling()

int cDownloader::strain_stop_sampling ( int  bus,
int  target_id,
string errorstring = NULL 
)

Definition at line 1659 of file downloader.cpp.

Member Data Documentation

◆ board_list

sBoard* cDownloader::board_list

Definition at line 150 of file downloader.h.

◆ board_list_size

int cDownloader::board_list_size

Definition at line 151 of file downloader.h.

◆ connected

bool cDownloader::connected

Definition at line 158 of file downloader.h.

◆ file_length

int cDownloader::file_length

Definition at line 153 of file downloader.h.

◆ filestr

std::fstream cDownloader::filestr

Definition at line 155 of file downloader.h.

◆ nSelectedBoards

int cDownloader::nSelectedBoards

Definition at line 156 of file downloader.h.

◆ progress

int cDownloader::progress

Definition at line 152 of file downloader.h.

◆ sprsPage

unsigned int cDownloader::sprsPage

Definition at line 154 of file downloader.h.


The documentation for this class was generated from the following files: