Compare commits
17 Commits
v2.0.14
...
befda072e5
Author | SHA1 | Date | |
---|---|---|---|
befda072e5 | |||
0b1cb2f230 | |||
ce444814c2 | |||
eec3853af9 | |||
25e114dbea | |||
740116c7ba | |||
5899bd646b | |||
1d33a81ad2 | |||
b58efae107 | |||
cc0dd9978f | |||
4834f63a67 | |||
1be78a2c5e | |||
f5581557bc | |||
8cde88848b | |||
0799513ea2 | |||
effeee105c | |||
ed5b366341 |
10
.github/workflows/pypi-deploy.yml
vendored
10
.github/workflows/pypi-deploy.yml
vendored
@@ -1,9 +1,9 @@
|
||||
|
||||
name: Build Python Wheels
|
||||
name: CI Build Wheel
|
||||
|
||||
on:
|
||||
push:
|
||||
#branches: [master]
|
||||
# branches: [master]
|
||||
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
|
||||
|
||||
jobs:
|
||||
@@ -40,12 +40,6 @@ jobs:
|
||||
with:
|
||||
name: wheel-config
|
||||
path: python/
|
||||
- name: Install libiconv for windows
|
||||
if: matrix.os == 'windows-2019'
|
||||
run: |
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
.\vcpkg\bootstrap-vcpkg.bat
|
||||
vcpkg install libiconv
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
working-directory: python/
|
||||
|
21
README.md
21
README.md
@@ -1,15 +1,13 @@
|
||||
|
||||
[](https://lgtm.com/projects/g/RecordEvolution/IMCtermite/alerts/)
|
||||
[](https://lgtm.com/projects/g/RecordEvolution/IMCtermite/context:cpp)
|
||||
[](https://lgtm.com/projects/g/RecordEvolution/IMCtermite/context:python)
|
||||
[](https://img.shields.io/github/license/RecordEvolution/IMCtermite)
|
||||
[](https://img.shields.io/github/stars/RecordEvolution/IMCtermite)
|
||||

|
||||

|
||||
[](https://pypi.org/project/IMCtermite/)
|
||||
|
||||
# IMCtermite
|
||||
|
||||
_IMCtermite_ provides access to the proprietary data format
|
||||
_IMC Bus Format_ with the file extension _.raw_ introduced and developed by
|
||||
_IMC2 Data Format_ with the file extension _.raw_ (or .dat) introduced and developed by
|
||||
[imc Test & Measurement GmbH](https://www.imc-tm.de/). This data format is
|
||||
employed i.a. by the measurement hardware
|
||||
[imc CRONOSflex](https://www.imc-tm.de/produkte/messtechnik-hardware/imc-cronosflex/ueberblick/)
|
||||
@@ -20,7 +18,9 @@ for measurement data control and analysis. Thanks to the integrated Python modul
|
||||
the extracted measurement data can be stored in any open-source file format
|
||||
accessible by Python like i.a. _csv_, _json_ or _parquet_.
|
||||
|
||||
On the [Record Evolution Platform](https://www.record-evolution.de/en/home-en/), the library can be used both as a command line tool for interactive usage and as a Python module to integrate the _.raw_ format into any ETL workflow.
|
||||
On the [Record Evolution Platform](https://www.record-evolution.de/en/home-en/),
|
||||
the library can be used both as a command line tool for interactive usage and as a
|
||||
Python module to integrate the _.raw_ format into any ETL workflow.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -31,12 +31,11 @@ On the [Record Evolution Platform](https://www.record-evolution.de/en/home-en/),
|
||||
|
||||
## File format
|
||||
|
||||
[Warning: Take a look at [this issue](https://github.com/RecordEvolution/IMCtermite/issues/14) when reading this section regarding the file format.]
|
||||
|
||||
A data file of the _IMC Bus Format_ type with the extension _.raw_ is a _mixed text/binary
|
||||
A file of the _IMC2 Data Format_ type with extension _.raw_ (or .dat) is a _mixed text/binary
|
||||
file_ featuring a set of markers (keys) that indicate the start of various blocks
|
||||
of data that provide meta information and the actual measurement data. Every single
|
||||
marker is introduced by the character `"|" = 0x 7c` followed by two uppercase letters that characterize the type of marker. Each block is further divided into several
|
||||
marker is introduced by the character `"|" = 0x 7c` followed by two uppercase letters that
|
||||
characterize the type of marker. Each block is further divided into several
|
||||
parameters separated by commata `"," = 0x 2c` and terminated by a semicolon
|
||||
`";" = 0x 3b`. For instance, the header - first 600 bytes - of a raw file may
|
||||
look like this (in UTF-8 encoding):
|
||||
@@ -225,6 +224,8 @@ can be found in the `python/examples` folder.
|
||||
|
||||
- https://www.imc-tm.de/produkte/messtechnik-software/imc-famos/funktionen/im-und-export/
|
||||
- https://www.imc-tm.de/produkte/messtechnik-hardware/imc-cronosflex/ueberblick/
|
||||
- https://www.imc-tm.de/download-center/produkt-downloads/imc-famos/handbuecher
|
||||
- https://www.imc-tm.de/fileadmin/Public/Downloads/Manuals/imc_FAMOS/imcGemeinsameKomponenten.pdf
|
||||
- https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html
|
||||
- https://github.com/Apollo3zehn/ImcFamosFile
|
||||
- https://apollo3zehn.github.io/ImcFamosFile/api/ImcFamosFile.FamosFileKeyType.html
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#include <time.h>
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#include <iconv.h>
|
||||
#elif defined(__WIN32__) || defined(_WIN32)
|
||||
#define timegm _mkgmtime
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------//
|
||||
@@ -146,13 +148,12 @@ namespace imc
|
||||
return sumstr;
|
||||
}
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
// convert encoding of any descriptions, channel-names, units etc.
|
||||
class iconverter
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
iconv_t cd_;
|
||||
#endif
|
||||
std::string in_enc_, out_enc_;
|
||||
iconv_t cd_;
|
||||
size_t out_buffer_size_;
|
||||
|
||||
public:
|
||||
@@ -160,7 +161,6 @@ namespace imc
|
||||
iconverter(std::string in_enc, std::string out_enc, size_t out_buffer_size = 1024) :
|
||||
in_enc_(in_enc), out_enc_(out_enc), out_buffer_size_(out_buffer_size)
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
// allocate descriptor for character set conversion
|
||||
// (https://man7.org/linux/man-pages/man3/iconv_open.3.html)
|
||||
cd_ = iconv_open(out_enc.c_str(), in_enc.c_str());
|
||||
@@ -174,12 +174,10 @@ namespace imc
|
||||
throw std::runtime_error(errmsg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void convert(std::string &astring)
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
if ( astring.empty() ) return;
|
||||
|
||||
std::vector<char> in_buffer(astring.begin(),astring.end());
|
||||
@@ -221,8 +219,15 @@ namespace imc
|
||||
std::string outstring(out_buffer.begin(),out_buffer.end()-outbytes);
|
||||
astring = outstring;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
#elif defined(__WIN32__) || defined(_WIN32)
|
||||
class iconverter
|
||||
{
|
||||
public:
|
||||
iconverter(std::string in_enc, std::string out_enc, size_t out_buffer_size = 1024) {}
|
||||
void convert(std::string &astring) {}
|
||||
};
|
||||
#endif
|
||||
|
||||
// channel
|
||||
struct channel
|
||||
@@ -527,6 +532,7 @@ namespace imc
|
||||
<<std::setw(width)<<std::left<<"name:"<<name_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"comment:"<<comment_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"origin:"<<origin_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"origin-comment:"<<origin_comment_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"description:"<<text_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"trigger-time-nt:"<<std::put_time(std::gmtime(&tt),"%FT%T")<<"\n"
|
||||
<<std::setw(width)<<std::left<<"trigger-time:"<<std::put_time(std::gmtime(&att),"%FT%T")<<"\n"
|
||||
@@ -565,6 +571,7 @@ namespace imc
|
||||
<<"\",\"name\":\""<<name_
|
||||
<<"\",\"comment\":\""<<comment_
|
||||
<<"\",\"origin\":\""<<origin_
|
||||
<<"\",\"origin-comment\":\""<<origin_comment_
|
||||
<<"\",\"description\":\""<<text_
|
||||
<<"\",\"trigger-time-nt\":\""<<std::put_time(std::gmtime(&tt),"%FT%T")
|
||||
<<"\",\"trigger-time\":\""<<std::put_time(std::gmtime(&att),"%FT%T")
|
||||
|
@@ -1 +1 @@
|
||||
2.0.14
|
||||
2.0.20
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|CR,1,49,1,3.921568627450980E-2,0.000000000000000E+0,1,1,V;
|
||||
|ND,1,50,-1,-1,-1,0.000000000000000E+0,1.000000000000000E+1;|CN,1,17,1,0,0,6,kanal2,0,;
|
||||
|CS,1,8,1,leclass="Code Example" translate="true">
|
||||
|NO,1,37,1,9, imc-FAMOS,20,Erzeugt:E.Mustermann; |CG,1,5,2,2,2;
|
||||
|NO,1,37,1,9,imc-FAMOS,20,Erzeugt:E.Mustermann; |CG,1,5,2,2,2;
|
||||
|CD,1,31,1.000000000000000E-1,1,0,,0,0,0;|NT,1,27,10, 6,1993,19,18,20.0000000;
|
||||
|CC,1,3,1,1;|CP,1,16,1,4,7,32,0,0,1,0;|Cb,1,40,1,0,1,1,0,16,0,16,1,0.000000000000E+0,0,;
|
||||
|CR,1,11,0,0,0,1,1,V;|CN,1,20,0,0,0,9,E06_6_121,0,;|CC,1,3,2,1;|CP,1,16,2,4,5,32,0,0,1,0;
|
||||
|
Reference in New Issue
Block a user