Compare commits
4 Commits
71c9bb7a5c
...
56f83b8132
Author | SHA1 | Date | |
---|---|---|---|
![]() |
56f83b8132 | ||
![]() |
cda6673f85 | ||
![]() |
1d7a512fd4 | ||
658a73a284 |
@ -15,7 +15,7 @@ extensions = Extension(
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="imc_termite",
|
name="imc_termite",
|
||||||
version='1.2.6',
|
version='1.2.8',
|
||||||
description='IMCtermite cython extension',
|
description='IMCtermite cython extension',
|
||||||
author='Record Evolution GmbH',
|
author='Record Evolution GmbH',
|
||||||
author_email='mario.fink@record-evolution.de',
|
author_email='mario.fink@record-evolution.de',
|
||||||
|
@ -63,7 +63,7 @@ namespace imc
|
|||||||
std::cout<<"WARNING: invalid length parameter in "<<thekey_.name_<<"-block "
|
std::cout<<"WARNING: invalid length parameter in "<<thekey_.name_<<"-block "
|
||||||
<<"(block-end:"<<end_<<",buffer-size:"<<buffer_->size()<<")"
|
<<"(block-end:"<<end_<<",buffer-size:"<<buffer_->size()<<")"
|
||||||
<<" => resetting block-end to buffer-size\n";
|
<<" => resetting block-end to buffer-size\n";
|
||||||
end_ = buffer_->size();
|
end_ = (unsigned long int)(buffer_->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -215,7 +215,7 @@ namespace imc
|
|||||||
// xname_ = std::string("time");
|
// xname_ = std::string("time");
|
||||||
|
|
||||||
// find appropriate precision for "xdata_" by means of "xstepwidth_"
|
// find appropriate precision for "xdata_" by means of "xstepwidth_"
|
||||||
xprec_ = (xstepwidth_ > 0 ) ? ceil(fabs(log10(xstepwidth_))) : 10;
|
xprec_ = (xstepwidth_ > 0 ) ? (int)ceil(fabs(log10(xstepwidth_))) : 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract associated CP data
|
// extract associated CP data
|
||||||
@ -296,7 +296,7 @@ namespace imc
|
|||||||
buffer_->begin()+buffstrt+buffer_size_+1 );
|
buffer_->begin()+buffstrt+buffer_size_+1 );
|
||||||
|
|
||||||
// determine number of values in buffer
|
// determine number of values in buffer
|
||||||
unsigned long int num_values = CSbuffer.size()/(signbits_/8);
|
unsigned long int num_values = (unsigned long int)(CSbuffer.size()/(signbits_/8));
|
||||||
if ( num_values*(signbits_/8) != CSbuffer.size() )
|
if ( num_values*(signbits_/8) != CSbuffer.size() )
|
||||||
{
|
{
|
||||||
throw std::runtime_error("CSbuffer and significant bits of datatype don't match");
|
throw std::runtime_error("CSbuffer and significant bits of datatype don't match");
|
||||||
@ -390,8 +390,8 @@ namespace imc
|
|||||||
<<std::setw(width)<<std::left<<"offset:"<<offset_<<"\n"
|
<<std::setw(width)<<std::left<<"offset:"<<offset_<<"\n"
|
||||||
<<std::setw(width)<<std::left<<"group:"<<"("<<group_index_<<","<<group_name_
|
<<std::setw(width)<<std::left<<"group:"<<"("<<group_index_<<","<<group_name_
|
||||||
<<","<<group_comment_<<")"<<"\n"
|
<<","<<group_comment_<<")"<<"\n"
|
||||||
<<std::setw(width)<<std::left<<"ydata:"<<imc::joinvec<imc::datatype>(ydata_,10,9,true)<<"\n"
|
<<std::setw(width)<<std::left<<"ydata:"<<imc::joinvec<imc::datatype>(ydata_,6,9,true)<<"\n"
|
||||||
<<std::setw(width)<<std::left<<"xdata:"<<imc::joinvec<double>(xdata_,10,xprec_,true)<<"\n";
|
<<std::setw(width)<<std::left<<"xdata:"<<imc::joinvec<double>(xdata_,6,xprec_,true)<<"\n";
|
||||||
// <<std::setw(width)<<std::left<<"aff. blocks:"<<chnenv_.get_json()<<"\n";
|
// <<std::setw(width)<<std::left<<"aff. blocks:"<<chnenv_.get_json()<<"\n";
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace imc
|
|||||||
public:
|
public:
|
||||||
datatype(): ubyte_(0), sbyte_(0),
|
datatype(): ubyte_(0), sbyte_(0),
|
||||||
ushort_(0), sshort_(0),
|
ushort_(0), sshort_(0),
|
||||||
ulint_(0.0), slint_(0.0),
|
ulint_(0), slint_(0),
|
||||||
sfloat_(0.0), sdouble_(0.0),
|
sfloat_(0.0), sdouble_(0.0),
|
||||||
sdigital_(0),
|
sdigital_(0),
|
||||||
dtidx_(0) { };
|
dtidx_(0) { };
|
||||||
@ -61,10 +61,10 @@ namespace imc
|
|||||||
datatype(imc_Slongint num): slint_(num), dtidx_(5) {};
|
datatype(imc_Slongint num): slint_(num), dtidx_(5) {};
|
||||||
datatype(imc_float num): sfloat_(num), dtidx_(6) {};
|
datatype(imc_float num): sfloat_(num), dtidx_(6) {};
|
||||||
datatype(imc_double num): ubyte_(0), sbyte_(0), ushort_(0), sshort_(0),
|
datatype(imc_double num): ubyte_(0), sbyte_(0), ushort_(0), sshort_(0),
|
||||||
ulint_(0.0), slint_(0.0), sfloat_(0.0), sdouble_(num),
|
ulint_(0), slint_(0), sfloat_(0.0), sdouble_(num),
|
||||||
sdigital_(0), dtidx_(7) {};
|
sdigital_(0), dtidx_(7) {};
|
||||||
datatype(imc_digital num): ubyte_(0), sbyte_(0), ushort_(0), sshort_(0),
|
datatype(imc_digital num): ubyte_(0), sbyte_(0), ushort_(0), sshort_(0),
|
||||||
ulint_(0.0), slint_(0.0), sfloat_(0.0), sdouble_(num),
|
ulint_(0), slint_(0), sfloat_(0.0), sdouble_(num),
|
||||||
sdigital_(num), dtidx_(10) {};
|
sdigital_(num), dtidx_(10) {};
|
||||||
|
|
||||||
// identify type
|
// identify type
|
||||||
|
@ -500,22 +500,22 @@ namespace imc
|
|||||||
minute_ = std::stoi( get_parameter(buffer,¶meters[6]) );
|
minute_ = std::stoi( get_parameter(buffer,¶meters[6]) );
|
||||||
second_ = std::stod( get_parameter(buffer,¶meters[7]) );
|
second_ = std::stod( get_parameter(buffer,¶meters[7]) );
|
||||||
|
|
||||||
time_t rawtime;
|
//time_t rawtime;
|
||||||
struct tm ts;
|
//struct tm ts;
|
||||||
time(&rawtime);
|
//time(&rawtime);
|
||||||
localtime_r(&rawtime,&ts);
|
//localtime_r(&rawtime,&ts);
|
||||||
ts.tm_mday = day_;
|
//ts.tm_mday = day_;
|
||||||
ts.tm_mon = month_-1;
|
//ts.tm_mon = month_-1;
|
||||||
ts.tm_year = year_-1900;
|
//ts.tm_year = year_-1900;
|
||||||
ts.tm_hour = hour_;
|
//ts.tm_hour = hour_;
|
||||||
ts.tm_min = minute_;
|
//ts.tm_min = minute_;
|
||||||
ts.tm_sec = (int)second_;
|
//ts.tm_sec = (int)second_;
|
||||||
asctime_r(&ts,×tamp_[0]);
|
//asctime_r(&ts,×tamp_[0]);
|
||||||
// timestamp_ = std::to_string(year_) + std::string("-") + std::to_string(month_)
|
timestamp_ = std::to_string(year_) + std::string("-") + std::to_string(month_)
|
||||||
// + std::string("-") + std::to_string(day_)
|
+ std::string("-") + std::to_string(day_)
|
||||||
// + std::string("T") + std::to_string(hour_)
|
+ std::string("T") + std::to_string(hour_)
|
||||||
// + std::string(":") + std::to_string(minute_)
|
+ std::string(":") + std::to_string(minute_)
|
||||||
// + std::string(":") + std::to_string(second_);
|
+ std::string(":") + std::to_string(second_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get info string
|
// get info string
|
||||||
|
@ -123,20 +123,20 @@ namespace imc
|
|||||||
leng.push_back((char)*(it+pos));
|
leng.push_back((char)*(it+pos));
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
unsigned long length = std::stoul(leng);
|
unsigned long int length = std::stoul(leng);
|
||||||
|
|
||||||
// declare and initialize corresponding key and block
|
// declare and initialize corresponding key and block
|
||||||
// imc::key bkey( *(it+1)==imc::key_crit_ , newkey,
|
// imc::key bkey( *(it+1)==imc::key_crit_ , newkey,
|
||||||
// imc::keys.at(newkey).description_, version );
|
// imc::keys.at(newkey).description_, version );
|
||||||
imc::block blk(itkey,it-buffer_.begin(),
|
imc::block blk(itkey,(unsigned long int)(it-buffer_.begin()),
|
||||||
it-buffer_.begin()+pos+1+length,
|
(unsigned long int)(it-buffer_.begin()+pos+1+length),
|
||||||
raw_file_, &buffer_);
|
raw_file_, &buffer_);
|
||||||
|
|
||||||
// add block to list
|
// add block to list
|
||||||
rawblocks_.push_back(blk);
|
rawblocks_.push_back(blk);
|
||||||
|
|
||||||
// skip the remaining block according to its length
|
// skip the remaining block according to its length
|
||||||
if ( it-buffer_.begin()+length < buffer_.size() )
|
if ( (unsigned long int)(it-buffer_.begin()+length) < (unsigned long int)(buffer_.size()) )
|
||||||
{
|
{
|
||||||
std::advance(it,length);
|
std::advance(it,length);
|
||||||
}
|
}
|
||||||
@ -253,7 +253,7 @@ namespace imc
|
|||||||
// provide buffer size
|
// provide buffer size
|
||||||
unsigned long int buffer_size()
|
unsigned long int buffer_size()
|
||||||
{
|
{
|
||||||
return buffer_.size();
|
return (unsigned long int)buffer_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get blocks
|
// get blocks
|
||||||
@ -377,7 +377,7 @@ namespace imc
|
|||||||
std::filesystem::path pf = pd / filenam;
|
std::filesystem::path pf = pd / filenam;
|
||||||
|
|
||||||
// and print the channel
|
// and print the channel
|
||||||
it->second.print(pf,sep);
|
it->second.print(pf.u8string(),sep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
21
pip/setup.py
21
pip/setup.py
@ -1,12 +1,24 @@
|
|||||||
|
|
||||||
from setuptools import setup, Extension
|
from setuptools import setup, Extension
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print("building on platform: "+sys.platform)
|
||||||
|
|
||||||
|
if sys.platform == "linux" or sys.platform == "darwin" :
|
||||||
|
cmpargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
lnkargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
elif sys.platform == "win32" :
|
||||||
|
cmpargs = ['/EHsc','/std:c++17']
|
||||||
|
lnkargs = []
|
||||||
|
else :
|
||||||
|
raise RuntimeError("unknown platform")
|
||||||
|
|
||||||
with open("README.md", "r", encoding="utf-8") as fh:
|
with open("README.md", "r", encoding="utf-8") as fh:
|
||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="IMCtermite",
|
name="IMCtermite",
|
||||||
version="1.2.6",
|
version="1.2.8",
|
||||||
author="Record Evolution GmbH",
|
author="Record Evolution GmbH",
|
||||||
author_email="mario.fink@record-evolution.de",
|
author_email="mario.fink@record-evolution.de",
|
||||||
maintainer="Record Evolution GmbH",
|
maintainer="Record Evolution GmbH",
|
||||||
@ -30,7 +42,8 @@ setup(
|
|||||||
# include_dirs=["3rdparty/pugixml/","lib/"],
|
# include_dirs=["3rdparty/pugixml/","lib/"],
|
||||||
# depends=["../lib/tdm_termite.hpp"]
|
# depends=["../lib/tdm_termite.hpp"]
|
||||||
language='c++',
|
language='c++',
|
||||||
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
extra_compile_args=cmpargs,
|
||||||
extra_link_args=['-std=c++17'],
|
extra_link_args=lnkargs,
|
||||||
)],
|
)
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user