Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Creator Serial Port Plotter
Forum Updated to NodeBB v4.3 + New Features

QT Creator Serial Port Plotter

Scheduled Pinned Locked Moved Solved General and Desktop
24 Posts 5 Posters 6.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    priscilla v
    wrote on 20 Dec 2018, 17:47 last edited by
    #1

    I'm completely new to QT Creator I have never ussed it before so I just installed it. Cause I need to change a little thing of this amazing program I'm ussing to graph serial data comming from an Arduino sensor:

    https://os.mbed.com/users/borislav/notebook/serial-port-plotter/#commentform

    Basically I'm doing an electrocardiogram and this program works perfectly but I need to change the colors cause is a standard medical thing to read the heart data in a white backround and the graph in color black. (this program has a black backround and a red graph).

    And that's basically all I need, an executable program with just that colors, so I thought I try to edit the code but after I open this proyect in QT it appears an error:

    13:37:46: Configuration is faulty. Check the Issues view for details. Error while building/deploying project prueba1 (kit: Desktop Qt 5.11.1 MSVC2015 32bit) When executing step "Make"

    QT Creator needs a compiler set up to build, configure a compiler in the kit options.

    How does this can be done? Step by step. Thanks so much, I'm new to this plataform.

    K 1 Reply Last reply 20 Dec 2018, 19:47
    0
    • P priscilla v
      20 Dec 2018, 17:47

      I'm completely new to QT Creator I have never ussed it before so I just installed it. Cause I need to change a little thing of this amazing program I'm ussing to graph serial data comming from an Arduino sensor:

      https://os.mbed.com/users/borislav/notebook/serial-port-plotter/#commentform

      Basically I'm doing an electrocardiogram and this program works perfectly but I need to change the colors cause is a standard medical thing to read the heart data in a white backround and the graph in color black. (this program has a black backround and a red graph).

      And that's basically all I need, an executable program with just that colors, so I thought I try to edit the code but after I open this proyect in QT it appears an error:

      13:37:46: Configuration is faulty. Check the Issues view for details. Error while building/deploying project prueba1 (kit: Desktop Qt 5.11.1 MSVC2015 32bit) When executing step "Make"

      QT Creator needs a compiler set up to build, configure a compiler in the kit options.

      How does this can be done? Step by step. Thanks so much, I'm new to this plataform.

      K Offline
      K Offline
      koahnig
      wrote on 20 Dec 2018, 19:47 last edited by
      #2

      @priscilla-v

      Hi and welcome to devnet forum

      Qt creator is an IDE and requires a tool chain and Qt libs in addition.

      How did you install Qt creator?

      For getting started with Qt see http://doc.qt.io/qt-5/windows.html
      and http://doc.qt.io/qt-5/gettingstarted.html

      Vote the answer(s) that helped you to solve your issue(s)

      P 1 Reply Last reply 21 Dec 2018, 07:18
      4
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 21 Dec 2018, 05:43 last edited by mrjj
        #3

        Hi
        For faster fun, use the mingw Qt version as it comes with all included.
        The visual studio version requires you to go download the compiler/debugger from Microsoft site.

        alt text

        I checked , it compiles fine with mingw and the colors are easy to change.

        P 1 Reply Last reply 21 Dec 2018, 06:29
        4
        • M mrjj
          21 Dec 2018, 05:43

          Hi
          For faster fun, use the mingw Qt version as it comes with all included.
          The visual studio version requires you to go download the compiler/debugger from Microsoft site.

          alt text

          I checked , it compiles fine with mingw and the colors are easy to change.

          P Offline
          P Offline
          priscilla v
          wrote on 21 Dec 2018, 06:29 last edited by
          #4

          @mrjj Hi, do I just download it again after uninstalling it?, from this page
          https://www.qt.io/download
          and then just select the options in that image?

          I you could explain to me step by step ho can this be done I'll be extremely thankfull, just need to do this change in the program and the final exe file, so the electrocardiogram sensor can be seen well.

          1 Reply Last reply
          0
          • K koahnig
            20 Dec 2018, 19:47

            @priscilla-v

            Hi and welcome to devnet forum

            Qt creator is an IDE and requires a tool chain and Qt libs in addition.

            How did you install Qt creator?

            For getting started with Qt see http://doc.qt.io/qt-5/windows.html
            and http://doc.qt.io/qt-5/gettingstarted.html

            P Offline
            P Offline
            priscilla v
            wrote on 21 Dec 2018, 07:18 last edited by
            #5

            @koahnig Hi thanks, I downloaded from the official site and selected all the options available when installing. Now I'm reinstalling it again.

            J 1 Reply Last reply 21 Dec 2018, 07:29
            0
            • P priscilla v
              21 Dec 2018, 07:18

              @koahnig Hi thanks, I downloaded from the official site and selected all the options available when installing. Now I'm reinstalling it again.

              J Offline
              J Offline
              J.Hilk
              Moderators
              wrote on 21 Dec 2018, 07:29 last edited by
              #6

              @priscilla-v said in QT Creator Serial Port Plotter:

              selected all the options available when installing

              I would not recommend doing that! That will eat about 80gb of hard disk memory!! And that's if you only selected everything from 5.12.0

              You only need to select what @mrjj showed, everything else should be preselected for you.


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              3
              • M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 21 Dec 2018, 08:14 last edited by mrjj
                #7

                Hi
                So after you installed the mingw Qt version. ( and only that one :)

                I assumed you unzipped the project to some folder.

                You go to that folder and double click on the SerialPortPlotter.pro

                Now in Left side,
                Click on the .pro file and put a # in front of line 31.
                The file is not included in project but seems not to matter so we just comment it out.

                alt text

                Now press the build/run button
                alt text

                Regarding colors.
                In mainwindow.cpp
                Line 59 , the var gui_colors contains the color used.
                You can change them there

                Also its used at line 185
                /* Background for the plot area */
                ui->plot->setBackground (gui_colors[0]);

                so fast fix is just to do
                ui->plot->setBackground (Qt::white);
                To get white background.

                The line color uses
                ui->plot->graph()->setPen (line_colors[channels % CUSTOM_LINE_COLORS]);
                so you can change the line_colors array to get new ones.

                So basically the colors comes from
                alt text

                In mainwindow.cpp

                P 1 Reply Last reply 21 Dec 2018, 09:09
                6
                • M mrjj
                  21 Dec 2018, 08:14

                  Hi
                  So after you installed the mingw Qt version. ( and only that one :)

                  I assumed you unzipped the project to some folder.

                  You go to that folder and double click on the SerialPortPlotter.pro

                  Now in Left side,
                  Click on the .pro file and put a # in front of line 31.
                  The file is not included in project but seems not to matter so we just comment it out.

                  alt text

                  Now press the build/run button
                  alt text

                  Regarding colors.
                  In mainwindow.cpp
                  Line 59 , the var gui_colors contains the color used.
                  You can change them there

                  Also its used at line 185
                  /* Background for the plot area */
                  ui->plot->setBackground (gui_colors[0]);

                  so fast fix is just to do
                  ui->plot->setBackground (Qt::white);
                  To get white background.

                  The line color uses
                  ui->plot->graph()->setPen (line_colors[channels % CUSTOM_LINE_COLORS]);
                  so you can change the line_colors array to get new ones.

                  So basically the colors comes from
                  alt text

                  In mainwindow.cpp

                  P Offline
                  P Offline
                  priscilla v
                  wrote on 21 Dec 2018, 09:09 last edited by
                  #8

                  @mrjj Thank you so much, it worked perfectly! the graph now is working as I needed for this project :D ! 0_1545383290313_10013.png

                  M K 2 Replies Last reply 21 Dec 2018, 09:10
                  2
                  • P priscilla v
                    21 Dec 2018, 09:09

                    @mrjj Thank you so much, it worked perfectly! the graph now is working as I needed for this project :D ! 0_1545383290313_10013.png

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 21 Dec 2018, 09:10 last edited by
                    #9

                    @priscilla-v
                    Super. good work.
                    Good luck with project.

                    P 1 Reply Last reply 23 Dec 2018, 21:28
                    0
                    • P priscilla v
                      21 Dec 2018, 09:09

                      @mrjj Thank you so much, it worked perfectly! the graph now is working as I needed for this project :D ! 0_1545383290313_10013.png

                      K Offline
                      K Offline
                      koahnig
                      wrote on 21 Dec 2018, 09:16 last edited by
                      #10

                      @priscilla-v

                      Good to see that you managed to get around the obstacles so fast.

                      Please mark your post as solved.

                      Have fun using Qt.

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      1
                      • M mrjj
                        21 Dec 2018, 09:10

                        @priscilla-v
                        Super. good work.
                        Good luck with project.

                        P Offline
                        P Offline
                        priscilla v
                        wrote on 23 Dec 2018, 21:28 last edited by
                        #11

                        @mrjj
                        Hi, I have a question maybe you can help me with this.
                        In this program how could I change the values in the X axis of the grid, to measure each one 40 mili seconds.
                        And then modify the Y axis to be a square, and not the rectangle shape that conforms each part of the grid right now.
                        And can you think of a way to just set default values in the "Plot Controls" so the program always start like this and have no need to configure it everytime?

                        M 1 Reply Last reply 23 Dec 2018, 23:06
                        0
                        • P priscilla v
                          23 Dec 2018, 21:28

                          @mrjj
                          Hi, I have a question maybe you can help me with this.
                          In this program how could I change the values in the X axis of the grid, to measure each one 40 mili seconds.
                          And then modify the Y axis to be a square, and not the rectangle shape that conforms each part of the grid right now.
                          And can you think of a way to just set default values in the "Plot Controls" so the program always start like this and have no need to configure it everytime?

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 23 Dec 2018, 23:06 last edited by
                          #12

                          @priscilla-v

                          Hi
                          Its controlled via the QCPAxisTicker
                          Im not sure if you mean the Big Ticks or the Sub Ticks.
                          There is lots of info here
                          https://www.qcustomplot.com/index.php/tutorials/basicplotting

                          Anyway for the big Ticks.
                          if you add to
                          void MainWindow::setupPlot()
                          around line 220

                          QSharedPointer<QCPAxisTickerFixed> fixedTicker(new QCPAxisTickerFixed);
                              ui->plot->xAxis->setTicker(fixedTicker);
                              fixedTicker->setTickStep(40.0);
                              fixedTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone); 
                          

                          It looks like this
                          alt text
                          Which might be what you want.

                          • Y axis to be a square,
                            Well that depends entirely on the y range and step versus the x
                            alt text

                          • "Plot Controls" new default values.
                            You can click on the UI file and alter them there
                            alt text

                          P 1 Reply Last reply 23 Dec 2018, 23:21
                          2
                          • M mrjj
                            23 Dec 2018, 23:06

                            @priscilla-v

                            Hi
                            Its controlled via the QCPAxisTicker
                            Im not sure if you mean the Big Ticks or the Sub Ticks.
                            There is lots of info here
                            https://www.qcustomplot.com/index.php/tutorials/basicplotting

                            Anyway for the big Ticks.
                            if you add to
                            void MainWindow::setupPlot()
                            around line 220

                            QSharedPointer<QCPAxisTickerFixed> fixedTicker(new QCPAxisTickerFixed);
                                ui->plot->xAxis->setTicker(fixedTicker);
                                fixedTicker->setTickStep(40.0);
                                fixedTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone); 
                            

                            It looks like this
                            alt text
                            Which might be what you want.

                            • Y axis to be a square,
                              Well that depends entirely on the y range and step versus the x
                              alt text

                            • "Plot Controls" new default values.
                              You can click on the UI file and alter them there
                              alt text

                            P Offline
                            P Offline
                            priscilla v
                            wrote on 23 Dec 2018, 23:21 last edited by
                            #13

                            @mrjj Thank you so much :D

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              priscilla v
                              wrote on 24 Dec 2018, 00:40 last edited by
                              #14

                              Hi, how would you get each frame of the small ones to measure 40 milliseconds? I was trying but I can not achieve it.

                              0_1545612001544_Captura.PNG

                              M 1 Reply Last reply 24 Dec 2018, 00:52
                              0
                              • P priscilla v
                                24 Dec 2018, 00:40

                                Hi, how would you get each frame of the small ones to measure 40 milliseconds? I was trying but I can not achieve it.

                                0_1545612001544_Captura.PNG

                                M Offline
                                M Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 24 Dec 2018, 00:52 last edited by
                                #15

                                @priscilla-v
                                Hi
                                Im not sure how to get change that.
                                You could try ask here
                                https://www.qcustomplot.com/index.php/support/forum/
                                Its the actual plotter being used in the project.

                                P 2 Replies Last reply 27 Dec 2018, 00:53
                                0
                                • M mrjj
                                  24 Dec 2018, 00:52

                                  @priscilla-v
                                  Hi
                                  Im not sure how to get change that.
                                  You could try ask here
                                  https://www.qcustomplot.com/index.php/support/forum/
                                  Its the actual plotter being used in the project.

                                  P Offline
                                  P Offline
                                  priscilla v
                                  wrote on 27 Dec 2018, 00:53 last edited by priscilla v
                                  #16

                                  @mrjj
                                  Hi, I managed to change the little squares values to 40ms, which is what I needed, though it only look like this when I haven't clicked the Play button. I commented line 208, and add the code in line 210.

                                  0_1545872017777_Code_changed.PNG

                                  When clicked, it changes all the x-axis configuration.
                                  Do you know why is this happening?

                                  When I run the program

                                  0_1545871775695_before.PNG

                                  When I click play button

                                  0_1545871786170_After.PNG

                                  (I don't mind the numbers written in the scale like 0.25, 0.5 , 0.75 or 50, 100, 150 etc I just calculated that 20 of those I think they are called ticks is equivalent to 4 seconds, and each one has 5 subticks so, when i did the math realize that each subtick would be 40ms that way)

                                  1 Reply Last reply
                                  0
                                  • M mrjj
                                    24 Dec 2018, 00:52

                                    @priscilla-v
                                    Hi
                                    Im not sure how to get change that.
                                    You could try ask here
                                    https://www.qcustomplot.com/index.php/support/forum/
                                    Its the actual plotter being used in the project.

                                    P Offline
                                    P Offline
                                    priscilla v
                                    wrote on 16 Jan 2019, 15:35 last edited by
                                    #17

                                    @mrjj Excuse one more question, how could you achieve a 50 Hz low pass filter in this serial plotter software?

                                    M 1 Reply Last reply 16 Jan 2019, 15:37
                                    0
                                    • P priscilla v
                                      16 Jan 2019, 15:35

                                      @mrjj Excuse one more question, how could you achieve a 50 Hz low pass filter in this serial plotter software?

                                      M Offline
                                      M Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on 16 Jan 2019, 15:37 last edited by
                                      #18

                                      @priscilla-v
                                      Hi welcome back
                                      funny enough, its being discussed here
                                      https://forum.qt.io/topic/98570/implement-low-pass-filter
                                      for same program :)

                                      1 Reply Last reply
                                      1
                                      • P Offline
                                        P Offline
                                        priscilla v
                                        wrote on 16 Jan 2019, 22:39 last edited by
                                        #19

                                        This is my ECG in a noise-free environment.

                                        0_1547678218132_3036.png

                                        When the charger is connected to the PC but not to the power outlet.
                                        0_1547678256288_14874.png

                                        When the PC is near any outlet.
                                        0_1547678293057_1483.png

                                        When the PC is connected to the electrical network.0_1547678317653_803.png

                                        I tried to use this piece of code but there was no change.

                                        0_1547678344924_Captura.PNG

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on 16 Jan 2019, 22:44 last edited by
                                          #20

                                          Hi
                                          well it seems the code only
                                          does an assignment to a double variable.
                                          Where is the actual filter function ?

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved