* add support for datatype 11 = 2-byte-word digital

* usage.py: raise proper exception
* usage_adv.py: use different example file
This commit is contained in:
2021-04-27 11:38:43 +02:00
parent 8708d2d008
commit 2b2e69f0e5
4 changed files with 39 additions and 14 deletions

View File

@@ -149,7 +149,9 @@ namespace imc
// constructor takes channel's block environment
channel(channel_env chnenv, std::map<std::string,imc::block>* blocks,
std::vector<unsigned char>* buffer):
chnenv_(chnenv), blocks_(blocks), buffer_(buffer), group_index_(-1)
chnenv_(chnenv), blocks_(blocks), buffer_(buffer),
factor_(1.), offset_(0.),
group_index_(-1)
{
// declare list of block parameters
std::vector<imc::parameter> prms;
@@ -292,6 +294,11 @@ namespace imc
{
imc::convert_data_to_type<imc_double>(CSbuffer,ydata_);
}
// ...
else if ( datatp_ == 11 )
{
imc::convert_data_to_type<imc_digital>(CSbuffer,ydata_);
}
else
{
throw std::runtime_error(std::string("unsupported/unknown datatype") + std::to_string(datatp_));