Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
75d70a9521 | |||
![]() |
36cf0c9c18 | ||
![]() |
2326725756 | ||
![]() |
59de48424e | ||
![]() |
a44461cba6 | ||
cee146593b | |||
223f25b6e0 | |||
8ec02d21c5 | |||
df445bfd7f | |||
af6622492a | |||
ef67e14ee7 | |||
![]() |
1500943cc4 | ||
![]() |
be282a8aae | ||
![]() |
9ea7186090 |
39
.github/workflows/pypi-deploy.yml
vendored
39
.github/workflows/pypi-deploy.yml
vendored
@@ -10,16 +10,18 @@ jobs:
|
||||
|
||||
build_setup:
|
||||
name: Prepare environment for wheel builds
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare wheel build
|
||||
run: make -C python/ setup
|
||||
- name: Store wheel configuration files
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
name: wheel-config
|
||||
path: python/
|
||||
- name: Display files
|
||||
run: ls -lR
|
||||
|
||||
build_wheels:
|
||||
name: Build binary wheels on ${{ matrix.os }}
|
||||
@@ -27,7 +29,7 @@ jobs:
|
||||
needs: [build_setup]
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, windows-2019]
|
||||
os: [ubuntu-24.04, windows-2022]
|
||||
arch: [auto32, auto64, aarch64]
|
||||
|
||||
steps:
|
||||
@@ -36,31 +38,33 @@ jobs:
|
||||
- name: Install cibuildwheel
|
||||
run: python -m pip install cibuildwheel==2.1.2
|
||||
- name: Get wheel configuration files
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: wheel-config
|
||||
path: python/
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
run: python -m cibuildwheel --output-dir wheelhouse/
|
||||
working-directory: python/
|
||||
# env:
|
||||
# CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-*
|
||||
- name: Store binary wheels
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
name: binary-wheels
|
||||
name: binary-wheels-${{matrix.os}}-${{matrix.arch}}
|
||||
path: python/wheelhouse/*.whl
|
||||
- name: Display files
|
||||
run: ls -lR
|
||||
|
||||
build_sdist:
|
||||
name: Build source distribution
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build_setup]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install cython
|
||||
run: python -m pip install cython==0.29.24
|
||||
- name: Get wheel configuration files
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: wheel-config
|
||||
path: python/
|
||||
@@ -68,28 +72,33 @@ jobs:
|
||||
run: python setup.py sdist
|
||||
working-directory: python/
|
||||
- name: Store source wheels
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
name: source-wheels
|
||||
path: python/dist/*.tar.gz
|
||||
- name: Display files
|
||||
run: ls -lR
|
||||
|
||||
|
||||
upload_pypi:
|
||||
name: Upload binary wheels to PyPI
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build_wheels, build_sdist]
|
||||
|
||||
steps:
|
||||
- name: Get source wheels
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: source-wheels
|
||||
path: dist/
|
||||
- name: Get binary wheels
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: binary-wheels
|
||||
path: dist/
|
||||
path: dist/binary-wheels
|
||||
pattern: dist/binary-wheels-*
|
||||
merge-multiple: true
|
||||
- name: Display files
|
||||
run: ls -lR
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
|
15
README.md
15
README.md
@@ -222,18 +222,31 @@ can be found in the `python/examples` folder.
|
||||
|
||||
## References
|
||||
|
||||
### IMC
|
||||
|
||||
- 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
|
||||
|
||||
### Cython
|
||||
|
||||
- https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html
|
||||
|
||||
### PyPI
|
||||
|
||||
- https://pypi.org/help/#apitoken
|
||||
- https://sgoel.dev/posts/uploading-binary-wheels-to-pypi-from-github-actions/
|
||||
- https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
|
||||
- https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/
|
||||
- https://github.com/actions/download-artifact#download-all-artifacts
|
||||
- https://github.com/actions/download-artifact?tab=readme-ov-file#download-multiple-filtered-artifacts-to-the-same-directory
|
||||
|
||||
### iconv
|
||||
|
||||
- https://www.gnu.org/software/libiconv/
|
||||
- https://vcpkg.io/en/packages.html
|
||||
- https://vcpkg.io/en/getting-started
|
||||
|
@@ -393,7 +393,6 @@ namespace imc
|
||||
ybuffer_offset_ = comp_group1.Cb_.offset_buffer_;
|
||||
ybuffer_size_ = comp_group1.Cb_.number_bytes_;
|
||||
xstart_ = comp_group1.Cb_.x0_;
|
||||
addtime_ = static_cast<long int>(comp_group1.Cb_.add_time_);
|
||||
yfactor_ = comp_group1.CR_.factor_;
|
||||
yoffset_ = comp_group1.CR_.offset_;
|
||||
yunit_ = comp_group1.CR_.unit_;
|
||||
@@ -407,6 +406,10 @@ namespace imc
|
||||
std::time_t ts = timegm(&comp_group1.NT_.tms_); // std::mktime(&tms);
|
||||
trigger_time_ = std::chrono::system_clock::from_time_t(ts);
|
||||
trigger_time_frac_secs_ = comp_group1.NT_.trigger_time_frac_secs_;
|
||||
// calculate absolute trigger-time
|
||||
addtime_ = static_cast<long int>(comp_group1.Cb_.add_time_);
|
||||
absolute_trigger_time_ = trigger_time_ + std::chrono::seconds(addtime_);
|
||||
// + std::chrono::nanoseconds((long int)(trigger_time_frac_secs_*1.e9));
|
||||
}
|
||||
else if ( !chnenv_.compenv1_.uuid_.empty() && !chnenv_.compenv2_.uuid_.empty() )
|
||||
{
|
||||
@@ -438,6 +441,7 @@ namespace imc
|
||||
std::time_t ts = timegm(&comp_group2.NT_.tms_); // std::mktime(&tms);
|
||||
trigger_time_ = std::chrono::system_clock::from_time_t(ts);
|
||||
trigger_time_frac_secs_ = comp_group2.NT_.trigger_time_frac_secs_;
|
||||
absolute_trigger_time_ = trigger_time_;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -447,10 +451,6 @@ namespace imc
|
||||
// start converting binary buffer to imc::datatype
|
||||
if ( !chnenv_.CSuuid_.empty() ) convert_buffer();
|
||||
|
||||
// calculate absolute trigger-time
|
||||
absolute_trigger_time_ = trigger_time_ + std::chrono::seconds(addtime_);
|
||||
// + std::chrono::nanoseconds((long int)(trigger_time_frac_secs_*1.e9));
|
||||
|
||||
// convert any non-UTF-8 codepage to UTF-8
|
||||
convert_encoding();
|
||||
}
|
||||
@@ -508,6 +508,8 @@ namespace imc
|
||||
throw std::runtime_error("x and y data have different number of values");
|
||||
}
|
||||
|
||||
xprec_ = 9;
|
||||
|
||||
process_data(xdata_, xnum_values, xdatatp_, xCSbuffer);
|
||||
process_data(ydata_, ynum_values, ydatatp_, yCSbuffer);
|
||||
}
|
||||
@@ -624,7 +626,6 @@ namespace imc
|
||||
<<std::setw(width)<<std::left<<"significant bits:"<<ysignbits_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"buffer-offset:"<<ybuffer_offset_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"buffer-size:"<<ybuffer_size_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"add-time:"<<addtime_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"xname:"<<xname_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"xunit:"<<xunit_<<"\n"
|
||||
<<std::setw(width)<<std::left<<"xstepwidth:"<<xstepwidth_<<"\n"
|
||||
@@ -660,7 +661,6 @@ namespace imc
|
||||
<<"\",\"yname\":\""<<prepjsonstr(yname_)
|
||||
<<"\",\"yunit\":\""<<prepjsonstr(yunit_)
|
||||
<<"\",\"significantbits\":\""<<ysignbits_
|
||||
<<"\",\"addtime\":\""<<addtime_
|
||||
<<"\",\"buffer-size\":\""<<ybuffer_size_
|
||||
<<"\",\"xname\":\""<<prepjsonstr(xname_)
|
||||
<<"\",\"xunit\":\""<<prepjsonstr(xunit_)
|
||||
|
@@ -482,7 +482,7 @@ namespace imc
|
||||
// construct members by parsing particular parameters from buffer
|
||||
void parse(const std::vector<unsigned char>* buffer, const std::vector<parameter>& parameters)
|
||||
{
|
||||
if ( parameters.size() < 7 ) throw std::runtime_error("invalid number of parameters in CD2");
|
||||
if ( parameters.size() < 7 ) throw std::runtime_error("invalid number of parameters in NO");
|
||||
origin_ = ( get_parameter(buffer,¶meters[2]) == std::string("1") );
|
||||
generator_ = get_parameter(buffer,¶meters[4]);
|
||||
comment_ = get_parameter(buffer,¶meters[6]);
|
||||
@@ -508,7 +508,7 @@ namespace imc
|
||||
// construct members by parsing particular parameters from buffer
|
||||
void parse(const std::vector<unsigned char>* buffer, const std::vector<parameter>& parameters)
|
||||
{
|
||||
if ( parameters.size() < 8 ) throw std::runtime_error("invalid number of parameters in CD2");
|
||||
if ( parameters.size() < 8 ) throw std::runtime_error("invalid number of parameters in NT1");
|
||||
tms_ = std::tm();
|
||||
tms_.tm_mday = std::stoi( get_parameter(buffer,¶meters[2]) );
|
||||
tms_.tm_mon = std::stoi( get_parameter(buffer,¶meters[3]) ) - 1;
|
||||
|
@@ -1 +1 @@
|
||||
2.1.0
|
||||
2.1.8
|
||||
|
BIN
samples/XY_dataset_example.dat
Normal file
BIN
samples/XY_dataset_example.dat
Normal file
Binary file not shown.
14
samples/exampleA-20230124.raw
Normal file
14
samples/exampleA-20230124.raw
Normal file
@@ -0,0 +1,14 @@
|
||||
|CF,2,1,1;|CK,1,3,1,1;
|
||||
|Nv,1,12,7,3,4,64,1,0;
|
||||
|NO,1,12,1,5,FAMOS,0,;
|
||||
|NL,1,10,1252,0x407;
|
||||
|CG,1,5,1,1,1;
|
||||
|CD,1,13,1,1,1,s,0,0,0;
|
||||
|NT,1,19, 6, 4,2018,11,33,54;
|
||||
|CC,1,3,1,1;
|
||||
|CP,1,16,1,8,8,64,0,0,1,0;
|
||||
|Cb,1,22,1,0,1,1,0,8,0,8,1,0,0,;
|
||||
|CR,1,11,0,0,0,1,1,V;
|
||||
|CN,1,35,0,0,0,7,Average,16,Measurement 0815;
|
||||
|CT,1,43,0,8,TxTester,8,E. Smith,16,Measurement 0815;
|
||||
|CS,1,10,1,ÍÌÌÌÌÌ(@;
|
24
samples/exampleB-20230124.raw
Normal file
24
samples/exampleB-20230124.raw
Normal file
@@ -0,0 +1,24 @@
|
||||
|CF,2,1,1;|CK,1,3,1,1;
|
||||
|Nv,1,12,7,3,4,64,1,0;
|
||||
|NO,1,12,1,5,FAMOS,0,;
|
||||
|NL,1,10,1252,0x407;
|
||||
|CB,1,12,1,5,Meas1,0,;
|
||||
|CG,1,5,1,1,1;
|
||||
|CD,1,16,5E-1,1,1,2,0,0,0;
|
||||
|NT,1,19, 6, 4,2018,11,24,18;
|
||||
|CC,1,3,1,1;
|
||||
|CP,1,15,1,1,2,8,0,0,1,0;
|
||||
|Cb,1,22,1,0,1,1,0,3,0,3,1,3,0,;
|
||||
|CR,1,30,1,3.937007874015748E-2,5,1,1,V;
|
||||
|ND,1,15,-1,-1,-1,0,1E+1;
|
||||
|CN,1,16,1,0,0,5,Chan1,0,;
|
||||
|CG,1,5,1,1,1;
|
||||
|CD,1,16,5E-1,1,1,2,0,0,0;
|
||||
|NT,1,19, 6, 4,2018,11,24,18;
|
||||
|CC,1,3,1,1;
|
||||
|CP,1,15,2,1,2,8,0,0,1,0;
|
||||
|Cb,1,22,1,0,2,1,3,3,0,3,1,3,0,;
|
||||
|CR,1,30,1,3.937007874015748E-2,5,1,1,V;
|
||||
|ND,1,15,-1,-1,-1,0,1E+1;
|
||||
|CN,1,16,1,0,0,5,Chan2,0,;
|
||||
|CS,1,8,1, šš šš;
|
17
samples/exampleC-20230124.raw
Normal file
17
samples/exampleC-20230124.raw
Normal file
@@ -0,0 +1,17 @@
|
||||
|CF,2,1,1;|CK,1,3,1,1;
|
||||
|Nv,1,12,7,3,4,64,1,0;
|
||||
|NO,1,12,1,5,FAMOS,0,;
|
||||
|NL,1,10,1252,0x407;
|
||||
|CG,1,5,2,2,2;
|
||||
|CD,1,12,1,1,0,,2,0,0;
|
||||
|NT,1,18, 6, 4,2018,11,37,1;
|
||||
|CC,1,3,1,1;
|
||||
|CP,1,16,1,4,7,32,0,0,1,0;
|
||||
|Cb,1,24,1,0,1,1,0,16,0,16,1,0,0,;
|
||||
|CR,1,11,0,0,0,1,1,V;
|
||||
|CN,1,20,0,0,0,9,MyXY_plot,0,;
|
||||
|CC,1,3,2,1;
|
||||
|CP,1,16,2,2,3,16,0,0,1,0;
|
||||
|Cb,1,23,1,0,2,1,16,8,0,8,1,0,0,;
|
||||
|CR,1,30,1,4.577706569008927E-5,0,1,1,s;
|
||||
|CS,1,26,1, @ €? @ffF@ UUªªÿÿ;
|
Reference in New Issue
Block a user