[med-svn] [Git][med-team/edfbrowser][upstream] New upstream version 1.79+dfsg

Nilesh Patra gitlab at salsa.debian.org
Sun Oct 25 16:24:30 GMT 2020



Nilesh Patra pushed to branch upstream at Debian Med / edfbrowser


Commits:
58510500 by Nilesh Patra at 2020-10-25T21:30:26+05:30
New upstream version 1.79+dfsg
- - - - -


15 changed files:

- doc/manual.html
- edfplusd_cnv.cpp
- filteredblockread.cpp
- global.h
- install/edfbrowser.desktop
- main.cpp
- mainwindow.cpp
- mainwindow.h
- mainwindow_constr.cpp
- signalcurve.cpp
- signals_dialog.cpp
- special_button.cpp
- statistics_dialog.cpp
- version.txt
- viewcurve.cpp


Changes:

=====================================
doc/manual.html
=====================================
@@ -7,7 +7,7 @@
     <meta name="description" content="EDFbrowser manual">
 </head><body>
 
-<h1>EDFbrowser 1.78 manual</h1>
+<h1>EDFbrowser 1.79 manual</h1>
 
 <p><br></p>
 


=====================================
edfplusd_cnv.cpp
=====================================
@@ -656,10 +656,14 @@ void UI_EDFDwindow::write_values_to_hdr(FILE *outputfile, long long timestamp, i
   utc_to_date_time(edfhdr->utc_starttime + (timestamp / TIME_DIMENSION), &date_time);
 
   fseeko(outputfile, 98LL, SEEK_SET);
-  fprintf(outputfile, "%02i-%s-%04i",
-          date_time.day,
-          date_time.month_str,
-          date_time.year);
+  if(fgetc(outputfile) != 'X')
+  {
+    fseeko(outputfile, 98LL, SEEK_SET);
+    fprintf(outputfile, "%02i-%s-%04i",
+            date_time.day,
+            date_time.month_str,
+            date_time.year);
+  }
 
   fseeko(outputfile, 168LL, SEEK_SET);
   fprintf(outputfile, "%02i.%02i.%02i%02i.%02i.%02i",


=====================================
filteredblockread.cpp
=====================================
@@ -28,6 +28,19 @@
 #include "filteredblockread.h"
 
 
+//#define FBR_DEBUG
+
+#ifdef FBR_DEBUG
+
+#include "edflib.h"
+
+int edf_hdl=-1, edf_chan=0, *edf_ibuf=NULL;
+
+struct edf_hdr_struct edfhdr;
+
+#endif
+
+
 double * FilteredBlockReadClass::init_signalcomp(struct signalcompblock *i_signalcomp, int datarecord_or_smpls_cnt, int skip_f, int mode)
 {
   skip_filters = skip_f;
@@ -113,7 +126,7 @@ double * FilteredBlockReadClass::init_signalcomp(struct signalcompblock *i_signa
   {
     free(readbuf);
   }
-  readbuf = (char *)malloc(hdr->recordsize  * datarecord_cnt);
+  readbuf = (char *)malloc(hdr->recordsize  * (datarecord_cnt + 1));
   if(readbuf == NULL)
   {
     datarecord_cnt = -1;
@@ -125,7 +138,31 @@ double * FilteredBlockReadClass::init_signalcomp(struct signalcompblock *i_signa
   }
 
   bitvalue = signalcomp->edfhdr->edfparam[signalcomp->edfsignal[0]].bitvalue;
+#ifdef FBR_DEBUG
+  edf_hdl = -1;
+
+  if(smpl_mode)
+  {
+    if(!edfopen_file_readonly(signalcomp->edfhdr->filename, &edfhdr, 0))
+    {
+      edf_hdl = edfhdr.handle;
+
+      printf("datarecord_duration: %lli    smp_in_datarecord: %i    sf: %f Hz   total samples in file: %lli\n",
+             edfhdr.datarecord_duration, edfhdr.signalparam[0].smp_in_datarecord,
+             (edfhdr.signalparam[0].smp_in_datarecord * EDFLIB_TIME_DIMENSION) / (double)edfhdr.datarecord_duration,
+              edfhdr.signalparam[0].smp_in_file);
+
+      edf_ibuf = (int *)malloc(total_samples * sizeof(int));
+      if(edf_ibuf == NULL)
+      {
+        edfclose_file(edf_hdl);
+        edf_hdl = -1;
 
+        printf("malloc error\n");
+      }
+    }
+  }
+#endif
   return processed_samples_buf;
 }
 
@@ -152,6 +189,14 @@ FilteredBlockReadClass::FilteredBlockReadClass()
 
 FilteredBlockReadClass::~FilteredBlockReadClass()
 {
+#ifdef FBR_DEBUG
+  if(edf_hdl >= 0)
+  {
+    edfclose_file(edf_hdl);
+  }
+
+  free(edf_ibuf);
+#endif
   free(processed_samples_buf);
 
   free(readbuf);
@@ -160,7 +205,7 @@ FilteredBlockReadClass::~FilteredBlockReadClass()
 
 int FilteredBlockReadClass::process_signalcomp(int datarecord_or_sample_start)
 {
-  int j, k, datarecord_start;
+  int j, k, datarecord_start, extra_datrec=0;
 
   long long s, s_end, sample_start, s_off=0;
 
@@ -198,6 +243,11 @@ int FilteredBlockReadClass::process_signalcomp(int datarecord_or_sample_start)
     datarecord_start = sample_start / (long long)samples_per_datrec;
 
     s_off = sample_start % (long long)samples_per_datrec;
+
+    if(((long long)samples_per_datrec - s_off) < total_samples)
+    {
+      extra_datrec = 1;
+    }
   }
   else
   {
@@ -221,7 +271,7 @@ int FilteredBlockReadClass::process_signalcomp(int datarecord_or_sample_start)
     return -4;
   }
 
-  if(fread(readbuf, hdr->recordsize * datarecord_cnt, 1, inputfile) != 1)
+  if(fread(readbuf, hdr->recordsize * (datarecord_cnt + extra_datrec), 1, inputfile) != 1)
   {
     return -5;
   }
@@ -230,7 +280,23 @@ int FilteredBlockReadClass::process_signalcomp(int datarecord_or_sample_start)
   {
     return -6;
   }
+#ifdef FBR_DEBUG
+  if(smpl_mode)
+  {
+    if(edf_hdl >= 0)
+    {
+      if(edfseek(edf_hdl, 0, sample_start, EDFSEEK_SET) != sample_start)
+      {
+        printf("error: edfseek(%lli)\n", sample_start);
+      }
 
+      if(edfread_digital_samples(edf_hdl, 0, total_samples, edf_ibuf) != total_samples)
+      {
+        printf("error: edfread_digital_samples(%lli)\n", total_samples);
+      }
+    }
+  }
+#endif
   s_end = total_samples + s_off;
 
   for(s=s_off; s<s_end; s++)
@@ -280,7 +346,12 @@ int FilteredBlockReadClass::process_signalcomp(int datarecord_or_sample_start)
 
       dig_value += f_tmp;
     }
-
+#ifdef FBR_DEBUG
+    if(((dig_value - edf_ibuf[s - s_off]) > 1) || ((dig_value - edf_ibuf[s - s_off]) < -1 ))
+    {
+      printf("dig_value: %f   edf_ibuf[%lli]: %i\n", dig_value, s - s_off, edf_ibuf[s - s_off]);
+    }
+#endif
     if(!skip_filters)
     {
       if(signalcomp->spike_filter)
@@ -326,7 +397,7 @@ int FilteredBlockReadClass::process_signalcomp(int datarecord_or_sample_start)
       dig_value *= signalcomp->polarity;
     }
 
-    processed_samples_buf[s] = (dig_value * bitvalue);
+    processed_samples_buf[s - s_off] = (dig_value * bitvalue);
   }
 
   return 0;


=====================================
global.h
=====================================
@@ -59,7 +59,7 @@
 #define QT_NO_DEPRECATED_WARNINGS
 
 #define PROGRAM_NAME                "EDFbrowser"
-#define PROGRAM_VERSION                   "1.78"
+#define PROGRAM_VERSION                   "1.79"
 #define PROGRAM_BETA_SUFFIX                   ""
 #define MINIMUM_QT4_VERSION             0x040701
 #define MINIMUM_QT5_VERSION             0x050901


=====================================
install/edfbrowser.desktop
=====================================
@@ -6,7 +6,7 @@ Name=EDFbrowser
 GenericName=EDF viewer
 Comment=A viewer/toolbox for timeseries storage files
 Icon=edf
-Exec=edfbrowser
+Exec=edfbrowser %f
 Terminal=false
 Categories=Science;Application;
 MimeType=application/x-edf;application/x-bdf


=====================================
main.cpp
=====================================
@@ -73,7 +73,8 @@ int main(int argc, char *argv[])
   }
   else
   {
-    p.drawText(150, 260, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, "version " PROGRAM_VERSION " " PROGRAM_BETA_SUFFIX "    " THIS_APP_BITS_W);
+    p.drawText(50, 240, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, "version " PROGRAM_VERSION "  " THIS_APP_BITS_W);
+    p.drawText(50, 260, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, PROGRAM_BETA_SUFFIX);
   }
 
   QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint);


=====================================
mainwindow.cpp
=====================================
@@ -2018,8 +2018,11 @@ void UI_Mainwindow::add_signals_dialog()
 
 void UI_Mainwindow::show_splashscreen()
 {
+#if QT_VERSION >= 0x050F00
+  splash = new QSplashScreen(this->screen(), *splash_pixmap);
+#else
   splash = new QSplashScreen(this, *splash_pixmap, Qt::WindowStaysOnTopHint);
-
+#endif
   splash->show();
 }
 


=====================================
mainwindow.h
=====================================
@@ -86,6 +86,7 @@
 #include <QFontMetrics>
 #include <QSize>
 #include <QToolTip>
+#include <QKeySequence>
 
 #if QT_VERSION >= 0x050200
 #include <QFontDatabase>


=====================================
mainwindow_constr.cpp
=====================================
@@ -327,13 +327,20 @@ UI_Mainwindow::UI_Mainwindow()
 
   font_pixel_height = fm.ascent();
 
+#if QT_VERSION >= 0x050B00
+  font_pixel_width = (fm.horizontalAdvance("ABCDEFGHIJKLMNOPQRSTUVWXYZ") / 26.0) + 0.5;
+#else
   font_pixel_width = (fm.width("ABCDEFGHIJKLMNOPQRSTUVWXYZ") / 26.0) + 0.5;
-
+#endif
 //  printf("font_pixel_height: %i    font_pixel_width: %i\n", font_pixel_height, font_pixel_width);
 
   h_scaling = fm.height() / 18.0;
 
+#if QT_VERSION >= 0x050B00
+  w_scaling = fm.horizontalAdvance("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") / 260.0;
+#else
   w_scaling = fm.width("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") / 260.0;
+#endif
 
   if(w_scaling > 4.0)  w_scaling = 4.0;
   if(w_scaling < 1.0)  w_scaling = 1.0;
@@ -1166,10 +1173,11 @@ UI_Mainwindow::UI_Mainwindow()
   }
   else
   {
-    p.drawText(150, 260, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, "version " PROGRAM_VERSION " " PROGRAM_BETA_SUFFIX "    " THIS_APP_BITS_W);
+    p.drawText(50, 240, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, "version " PROGRAM_VERSION "  " THIS_APP_BITS_W);
+    p.drawText(50, 260, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, PROGRAM_BETA_SUFFIX);
   }
-#if QT_VERSION >= 0x050E00
-  splash = new QSplashScreen(this->screen(), *splash_pixmap, Qt::WindowStaysOnTopHint);
+#if QT_VERSION >= 0x050F00
+  splash = new QSplashScreen(this->screen(), *splash_pixmap);
 #else
   splash = new QSplashScreen(this, *splash_pixmap, Qt::WindowStaysOnTopHint);
 #endif


=====================================
signalcurve.cpp
=====================================
@@ -53,7 +53,11 @@ SignalCurve::SignalCurve(QWidget *w_parent) : QWidget(w_parent)
 
   h_scaling = fm.height() / 18.0;
 
+#if QT_VERSION >= 0x050B00
+  w_scaling = fm.horizontalAdvance("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") / 260.0;
+#else
   w_scaling = fm.width("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") / 260.0;
+#endif
 
   if(w_scaling > 4.0)  w_scaling = 4.0;
   if(w_scaling < 1.0)  w_scaling = 1.0;


=====================================
signals_dialog.cpp
=====================================
@@ -168,7 +168,9 @@ UI_Signalswindow::UI_Signalswindow(QWidget *w_parent)
 
   QHBoxLayout *hlayout3 = new QHBoxLayout;
   hlayout3->addWidget(label3);
-  hlayout3->addStretch(1000);
+  hlayout3->addStretch(100);
+  hlayout3->addWidget(label4);
+  hlayout3->addStretch(900);
 
   QHBoxLayout *hlayout5 = new QHBoxLayout;
   hlayout5->addWidget(SelectAllButton);


=====================================
special_button.cpp
=====================================
@@ -121,7 +121,11 @@ void SpecialButton::setText(const char *str)
 
     QFontMetrics fm(font);
 
+#if QT_VERSION >= 0x050B00
+    sz_hint_w = fm.horizontalAdvance(buttonText) + 40;
+#else
     sz_hint_w = fm.width(buttonText) + 40;
+#endif
     sz_hint_h = fm.height() + 8;
 
     if(sz_hint_w < 50)  sz_hint_w = 50;


=====================================
statistics_dialog.cpp
=====================================
@@ -107,7 +107,7 @@ UI_StatisticWindow::UI_StatisticWindow(struct signalcompblock *signalcomp,
 
   if((job_src == STAT_JOB_SRC_ECG) || (job_src == STAT_JOB_SRC_ANNOT))
   {
-    StatDialog->setMinimumSize(600, 400);
+    StatDialog->setMinimumSize(600 * mainwindow->w_scaling, 450 * mainwindow->h_scaling);
     StatDialog->setSizeGripEnabled(true);
 
     startSlider = new QSlider;
@@ -154,15 +154,13 @@ UI_StatisticWindow::UI_StatisticWindow(struct signalcompblock *signalcomp,
 
   if(job_src == STAT_JOB_SRC_SIGNAL)
   {
-    StatDialog->setMinimumSize(300, 440);
-    StatDialog->setMaximumSize(300, 440);
+    StatDialog->setMinimumSize(300 * mainwindow->w_scaling, 440 * mainwindow->h_scaling);
   }
 
   Label1 = new QLabel(StatDialog);
   Label1->setAlignment(Qt::AlignLeft | Qt::AlignTop);
 
   pushButton1 = new QPushButton(StatDialog);
-  pushButton1->setMinimumSize(100, 25);
   pushButton1->setText("&Close");
 
   hlayout1_1_1 = new QHBoxLayout;


=====================================
version.txt
=====================================
@@ -1,4 +1,18 @@
 
+
+ version 1.79      October 25, 2020
+ --------------
+
+ - CDSA: fixed a bug that caused a crash when the datarecord duration of an EDF file is longer than
+   the segment length of the CDSA.
+
+ - EDF+D to EDF+C converter: bugfix: don't write EDF+ startdate in the output file if it wasn't
+   used in the input file.
+
+ - Add signals dialog: fixed a regression bug that caused the field "Recording duration" not to appear.
+
+
+
  version 1.78      October 10, 2020
  --------------
 


=====================================
viewcurve.cpp
=====================================
@@ -3778,8 +3778,8 @@ void ViewCurve::exec_sidemenu(int signal_nr_intern)
   QVBoxLayout *vlayout1 = new QVBoxLayout;
   vlayout1->addWidget(SidemenuLabel);
   vlayout1->addLayout(flayout);
-  vlayout1->addStretch(1000);
   vlayout1->addLayout(gr);
+  vlayout1->addStretch(1000);
   sidemenu->setLayout(vlayout1);
 
   QObject::connect(ScaleBox,          SIGNAL(valueChanged(double)),     this,     SLOT(ScaleBoxChanged(double)));



View it on GitLab: https://salsa.debian.org/med-team/edfbrowser/-/commit/58510500d75f96fee4644c3314c78f21d4692627

-- 
View it on GitLab: https://salsa.debian.org/med-team/edfbrowser/-/commit/58510500d75f96fee4644c3314c78f21d4692627
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201025/0a822762/attachment-0001.html>


More information about the debian-med-commit mailing list