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

Andreas Tille (@tille) gitlab at salsa.debian.org
Wed Dec 21 07:36:00 GMT 2022



Andreas Tille pushed to branch upstream at Debian Med / edfbrowser


Commits:
ee84969b by Andreas Tille at 2022-12-21T08:28:31+01:00
New upstream version 1.98+dfsg
- - - - -


11 changed files:

- doc/manual.html
- edfbrowser.pro
- global.h
- hypnogram_dialog.cpp
- hypnogram_dock.cpp
- hypnogram_dock.h
- load_session.cpp
- mainwindow.cpp
- read_write_settings.cpp
- version.txt
- view_session_dialog.cpp


Changes:

=====================================
doc/manual.html
=====================================
@@ -21,7 +21,7 @@
     </style>
 </head><body>
 
-<h1>EDFbrowser 1.97 manual</h1>
+<h1>EDFbrowser 1.98 manual</h1>
 
 <p><br></p>
 


=====================================
edfbrowser.pro
=====================================
@@ -2,11 +2,11 @@
 contains(QT_MAJOR_VERSION, 4) {
 
 LIST = 0 1 2 3 4 5 6
-for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.0")
+for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.1")
 
 contains(QT_MINOR_VERSION, 7) {
   LIST = 0
-  for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.0")
+  for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.1")
 }
 }
 
@@ -14,11 +14,11 @@ contains(QT_MINOR_VERSION, 7) {
 contains(QT_MAJOR_VERSION, 5) {
 
 LIST = 0 1 2 3 4 5 6 7 8
-for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.0")
+for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.1")
 
 contains(QT_MINOR_VERSION, 9) {
   LIST = 0
-  for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.0")
+  for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.1")
 }
 }
 
@@ -26,11 +26,11 @@ contains(QT_MINOR_VERSION, 9) {
 contains(QT_MAJOR_VERSION, 6) {
 
 LIST = 0 1 2 3
-for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.0")
+for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.1")
 
-contains(QT_MINOR_VERSION, 9) {
+contains(QT_MINOR_VERSION, 4) {
   LIST = 0
-  for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.0")
+  for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("This project needs Qt4 version >= 4.7.1 or Qt5 version >= 5.9.1 or Qt6 version >= 6.4.1")
 }
 }
 


=====================================
global.h
=====================================
@@ -67,11 +67,11 @@
 #endif
 
 #define PROGRAM_NAME                "EDFbrowser"
-#define PROGRAM_VERSION                   "1.97"
+#define PROGRAM_VERSION                   "1.98"
 #define PROGRAM_BETA_SUFFIX                   ""
 #define MINIMUM_QT4_VERSION           (0x040701)
 #define MINIMUM_QT5_VERSION           (0x050901)
-#define MINIMUM_QT6_VERSION           (0x060400)
+#define MINIMUM_QT6_VERSION           (0x060401)
 #define MAXFILES                            (32)
 #define MAXSIGNALS                         (640)
 #define MAXFILTERS                          (16)
@@ -174,6 +174,15 @@
 #include "filt/math_func.h"
 
 
+struct t_rgba_color_struct
+{
+  int r;
+  int g;
+  int b;
+  int a;
+};
+
+
 struct edfparamblock{
         char   label[17];
         char   transducer[81];


=====================================
hypnogram_dialog.cpp
=====================================
@@ -434,13 +434,23 @@ void UI_hypnogram_window::start_button_clicked()
   strlcpy(dock_param.annot_ov_name[4], annot5_ov_edit->text().toUtf8().data(), 32);
   strlcpy(dock_param.annot_ov_name[5], annot6_ov_edit->text().toUtf8().data(), 32);
 
+  mainwindow->hypnogram_annot_ov_color[0] = ov_color_button1->color();
+  mainwindow->hypnogram_annot_ov_color[1] = ov_color_button2->color();
+  mainwindow->hypnogram_annot_ov_color[2] = ov_color_button3->color();
+  mainwindow->hypnogram_annot_ov_color[3] = ov_color_button4->color();
+  mainwindow->hypnogram_annot_ov_color[4] = ov_color_button5->color();
+  mainwindow->hypnogram_annot_ov_color[5] = ov_color_button6->color();
+
   for(i=0; i<HYPNOGRAM_OVNUM; i++)
   {
     trim_spaces(dock_param.annot_ov_name[i]);
 
     strlcpy(mainwindow->hypnogram_annot_ov_name[i], dock_param.annot_ov_name[i], 32);
 
-    dock_param.annot_ov_color[i] = mainwindow->hypnogram_annot_ov_color[i];
+    dock_param.annot_ov_color[i].r = mainwindow->hypnogram_annot_ov_color[i].red();
+    dock_param.annot_ov_color[i].g = mainwindow->hypnogram_annot_ov_color[i].green();
+    dock_param.annot_ov_color[i].b = mainwindow->hypnogram_annot_ov_color[i].blue();
+    dock_param.annot_ov_color[i].a = mainwindow->hypnogram_annot_ov_color[i].alpha();
   }
 
   dock_param.use_epoch_len = mainwindow->hypnogram_use_epoch_len;


=====================================
hypnogram_dock.cpp
=====================================
@@ -352,9 +352,16 @@ hypnogram_curve_widget::hypnogram_curve_widget(QWidget *w_parent) : QWidget(w_pa
 
 void hypnogram_curve_widget::set_params(struct hypnogram_dock_param_struct *parms)
 {
+  int i;
+
   param = *parms;
 
   mainwindow = param.mainwindow;
+
+  for(i=0; i<HYPNOGRAM_OVNUM; i++)
+  {
+    annot_ov_q_color[i] = QColor(param.annot_ov_color[i].r, param.annot_ov_color[i].g, param.annot_ov_color[i].b, param.annot_ov_color[i].a);
+  }
 }
 
 
@@ -425,15 +432,18 @@ void hypnogram_curve_widget::paintEvent(QPaintEvent *)
 
           if(param.use_epoch_len)
           {
-            pos_x1 = ((double)(annot->long_duration) * pixel_per_sec) / TIME_DIMENSION;
+            if(annot->long_duration > 0LL)
+            {
+              pos_x1 = ((double)(annot->long_duration) * pixel_per_sec) / TIME_DIMENSION;
 
-            painter.fillRect(pos_x2, 0, pos_x1, h, param.annot_ov_color[j]);
+              painter.fillRect(pos_x2, 0, pos_x1, h, annot_ov_q_color[j]);
+            }
           }
           else
           {
             if(k)
             {
-              painter.fillRect(pos_x1, 0, pos_x2 - pos_x1, h, param.annot_ov_color[stage]);
+              painter.fillRect(pos_x1, 0, pos_x2 - pos_x1, h, annot_ov_q_color[stage]);
             }
 
             pos_x1 = pos_x2;
@@ -452,7 +462,7 @@ void hypnogram_curve_widget::paintEvent(QPaintEvent *)
     {
       if(k)
       {
-        painter.fillRect(pos_x1, 0, w - pos_x1, h, param.annot_ov_color[stage]);
+        painter.fillRect(pos_x1, 0, w - pos_x1, h, annot_ov_q_color[stage]);
       }
     }
   }
@@ -476,12 +486,15 @@ void hypnogram_curve_widget::paintEvent(QPaintEvent *)
 
         if(param.use_epoch_len)
         {
-          annot_end = annot->onset + annot->long_duration;
+          if(annot->long_duration > 0LL)
+          {
+            annot_end = annot->onset + annot->long_duration;
 
-          pos_x1 = ((double)(annot_end) * pixel_per_sec) / TIME_DIMENSION;
+            pos_x1 = ((double)(annot_end) * pixel_per_sec) / TIME_DIMENSION;
 
-          painter.drawLine(pos_x1, offset + (j * pixel_per_unit) + 0.5,
-                           pos_x2, offset + (j * pixel_per_unit) + 0.5);
+            painter.drawLine(pos_x1, offset + (j * pixel_per_unit) + 0.5,
+                             pos_x2, offset + (j * pixel_per_unit) + 0.5);
+          }
         }
         else
         {


=====================================
hypnogram_dock.h
=====================================
@@ -58,7 +58,7 @@ struct hypnogram_dock_param_struct
   char stage_name[HYPNOGRAM_STAGENUM][32];
   char annot_name[HYPNOGRAM_STAGENUM][32];
   char annot_ov_name[HYPNOGRAM_OVNUM][32];
-  QColor annot_ov_color[HYPNOGRAM_OVNUM];
+  struct t_rgba_color_struct annot_ov_color[HYPNOGRAM_OVNUM];
   struct edfhdrblock *edfhdr;
   UI_Mainwindow  *mainwindow;
 };
@@ -186,6 +186,8 @@ protected:
 private:
 
   struct hypnogram_dock_param_struct param;
+
+  QColor annot_ov_q_color[HYPNOGRAM_OVNUM];
 };
 
 


=====================================
load_session.cpp
=====================================
@@ -79,7 +79,6 @@ int UI_Mainwindow::read_session_file(const char *path_session)
          dthreshold,
          fir_vars[1000];
 
-
   struct xml_handle *xml_hdl=NULL;
 
   struct signalcompblock *newsignalcomp=NULL;
@@ -2236,9 +2235,12 @@ int UI_Mainwindow::read_session_file(const char *path_session)
 
       for(j=0; j<HYPNOGRAM_OVNUM; j++)
       {
-        get_rgbcolor_settings(xml_hdl, "annot_ov_color", j, &hypnogram_param.annot_ov_color[j]);
+        get_rgbcolor_settings(xml_hdl, "annot_ov_color", j, &hypnogram_annot_ov_color[j]);
 
-        hypnogram_annot_ov_color[j] = hypnogram_param.annot_ov_color[j] ;
+        hypnogram_param.annot_ov_color[j].r = hypnogram_annot_ov_color[j].red();
+        hypnogram_param.annot_ov_color[j].g = hypnogram_annot_ov_color[j].green();
+        hypnogram_param.annot_ov_color[j].b = hypnogram_annot_ov_color[j].blue();
+        hypnogram_param.annot_ov_color[j].a = hypnogram_annot_ov_color[j].alpha();
       }
 
       hypnogram_param.mainwindow = this;


=====================================
mainwindow.cpp
=====================================
@@ -848,10 +848,10 @@ void UI_Mainwindow::save_session()
                         "      <blue>%i</blue>\n"
                         "      <alpha>%i</alpha>\n"
                         "    </annot_ov_color>\n",
-                        hypnogram_dock[i]->param.annot_ov_color[j].red(),
-                        hypnogram_dock[i]->param.annot_ov_color[j].green(),
-                        hypnogram_dock[i]->param.annot_ov_color[j].blue(),
-                        hypnogram_dock[i]->param.annot_ov_color[j].alpha());
+                        hypnogram_dock[i]->param.annot_ov_color[j].r,
+                        hypnogram_dock[i]->param.annot_ov_color[j].g,
+                        hypnogram_dock[i]->param.annot_ov_color[j].b,
+                        hypnogram_dock[i]->param.annot_ov_color[j].a);
     }
 
     fprintf(pro_file, "    <hypnogram_use_epoch_len>%i</hypnogram_use_epoch_len>\n", hypnogram_dock[i]->param.use_epoch_len);
@@ -4232,7 +4232,14 @@ void UI_Mainwindow::fit_signals_to_pane(int n)
 
   if(!signalcomps)  return;
 
-  pane_size = maincurve->height() / (signalcomps + 1);
+  if(mc_v_scrollarea_auto && (signalcomps > mc_v_scrollarea_max_signals))
+  {
+    pane_size = maincurve->height() / (mc_v_scrollarea_max_signals + 1);
+  }
+  else
+  {
+    pane_size = maincurve->height() / (signalcomps + 1);
+  }
 
   for(i=0; i<signalcomps; i++)
   {


=====================================
read_write_settings.cpp
=====================================
@@ -1985,7 +1985,7 @@ void UI_Mainwindow::read_general_settings()
       }
     }
 
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_STAGENUM; i++)
     {
       if(!(xml_goto_nth_element_inside(xml_hdl, "annot_name", i)))
       {
@@ -2001,7 +2001,7 @@ void UI_Mainwindow::read_general_settings()
       }
     }
 
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_STAGENUM; i++)
     {
       if(!(xml_goto_nth_element_inside(xml_hdl, "annot_ov_name", i)))
       {
@@ -2017,7 +2017,7 @@ void UI_Mainwindow::read_general_settings()
       }
     }
 
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_OVNUM; i++)
     {
       get_rgbcolor_settings(xml_hdl, "annot_ov_color", i, &hypnogram_annot_ov_color[i]);
     }
@@ -3493,25 +3493,25 @@ void UI_Mainwindow::write_settings()
     fprintf(cfgfile, "    </aeeg>\n");
 
     fprintf(cfgfile, "    <hypnogram>\n");
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_STAGENUM; i++)
     {
       xml_strlcpy_encode_entity(str, hypnogram_stage_name[i], 1024);
 
       fprintf(cfgfile, "      <stage_name>%s</stage_name>\n", str);
     }
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_STAGENUM; i++)
     {
       xml_strlcpy_encode_entity(str, hypnogram_annot_name[i], 1024);
 
       fprintf(cfgfile, "      <annot_name>%s</annot_name>\n", str);
     }
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_OVNUM; i++)
     {
       xml_strlcpy_encode_entity(str, hypnogram_annot_ov_name[i], 1024);
 
       fprintf(cfgfile, "      <annot_ov_name>%s</annot_ov_name>\n", str);
     }
-    for(i=0; i<6; i++)
+    for(i=0; i<HYPNOGRAM_OVNUM; i++)
     {
       fprintf(cfgfile, "      <annot_ov_color>\n"
                       "        <red>%i</red>\n"


=====================================
version.txt
=====================================
@@ -1,4 +1,14 @@
 
+ version 1.98      December 17, 2022
+ --------------
+
+ - Amplitude -> Fit to pane: fixed calculation in case the verticall scrollbar is enabled
+
+ - Hypnogram: fixed a compiler warning
+
+ - bumped minimum Qt6 version to 6.4.1
+
+
  version 1.97      November 19, 2022
  --------------
 


=====================================
view_session_dialog.cpp
=====================================
@@ -177,6 +177,8 @@ void UI_ViewSessionwindow::SelectButtonClicked()
                 *math_item_before=NULL,
                 *math_item_after=NULL;
 
+  QColor tmp_color;
+
   struct xml_handle *xml_hdl=NULL;
 
   struct date_time_struct dt;
@@ -1557,39 +1559,81 @@ void UI_ViewSessionwindow::SelectButtonClicked()
 
     for(j=0; j<HYPNOGRAM_STAGENUM; j++)
     {
-      if(xml_goto_nth_element_inside(xml_hdl, "stage_name", j))
+      if(!xml_goto_nth_element_inside(xml_hdl, "stage_name", j))
       {
-        view_session_format_error(__FILE__, __LINE__, xml_hdl);
-        return;
+        if(xml_get_content_of_element(xml_hdl, result, XML_STRBUFLEN))
+        {
+          view_session_format_error(__FILE__, __LINE__, xml_hdl);
+          return;
+        }
+
+        snprintf(str2, 2048, "Stage %i name: %.2000s", j + 1, result);
+
+        xml_go_up(xml_hdl);
+
+        if(xml_goto_nth_element_inside(xml_hdl, "annot_name", j))
+        {
+          view_session_format_error(__FILE__, __LINE__, xml_hdl);
+          return;
+        }
+
+        if(xml_get_content_of_element(xml_hdl, result, XML_STRBUFLEN))
+        {
+          view_session_format_error(__FILE__, __LINE__, xml_hdl);
+          return;
+        }
+
+        strlcat(str2, "   Annotation: ", 2048);
+        strlcat(str2, result, 2048);
+        hypnogramItem->appendRow(new QStandardItem(str2));
+
+        xml_go_up(xml_hdl);
       }
+    }
 
+    if(!xml_goto_nth_element_inside(xml_hdl, "use_overlays", 0))
+    {
       if(xml_get_content_of_element(xml_hdl, result, XML_STRBUFLEN))
       {
         view_session_format_error(__FILE__, __LINE__, xml_hdl);
         return;
       }
 
-      snprintf(str2, 2048, "Stage %i name: %.2000s", j + 1, result);
+      if(atoi(result) == 1)
+      {
+        hypnogramItem->appendRow(new QStandardItem(" use overlays: yes"));
+      }
+      else
+      {
+        hypnogramItem->appendRow(new QStandardItem(" use overlays: no"));
+      }
 
       xml_go_up(xml_hdl);
+    }
 
-      if(xml_goto_nth_element_inside(xml_hdl, "annot_name", j))
+    for(j=0; j<HYPNOGRAM_OVNUM; j++)
+    {
+      if(!xml_goto_nth_element_inside(xml_hdl, "annot_ov_name", j))
       {
-        view_session_format_error(__FILE__, __LINE__, xml_hdl);
-        return;
-      }
+        if(xml_get_content_of_element(xml_hdl, result, XML_STRBUFLEN))
+        {
+          view_session_format_error(__FILE__, __LINE__, xml_hdl);
+          return;
+        }
 
-      if(xml_get_content_of_element(xml_hdl, result, XML_STRBUFLEN))
-      {
-        view_session_format_error(__FILE__, __LINE__, xml_hdl);
-        return;
-      }
+        xml_go_up(xml_hdl);
 
-      strlcat(str2, "   Annotation: ", 2048);
-      strlcat(str2, result, 2048);
-      hypnogramItem->appendRow(new QStandardItem(str2));
+        snprintf(str2, 2048, "Overlay annotation: %s", result);
+        tmp_item = new QStandardItem(str2);
 
-      xml_go_up(xml_hdl);
+        mainwindow->get_rgbcolor_settings(xml_hdl, "annot_ov_color", j, &tmp_color);
+        if(tmp_color.isValid() == true)
+        {
+          tmp_item->setBackground(QBrush(tmp_color));
+        }
+
+        hypnogramItem->appendRow(tmp_item);
+      }
     }
 
     xml_go_up(xml_hdl);



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

-- 
View it on GitLab: https://salsa.debian.org/med-team/edfbrowser/-/commit/ee84969b3daf13192e2ace121b4988119a96f157
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/20221221/af6a7576/attachment-0001.htm>


More information about the debian-med-commit mailing list