Browse Source

Least squares fit fixed.

Neal Wilson 7 years ago
parent
commit
8482ad1353
1 changed files with 4 additions and 9 deletions
  1. 4
    9
      qml/BrewPlot/main.qml

+ 4
- 9
qml/BrewPlot/main.qml View File

@@ -10,8 +10,7 @@ Rectangle {
10 10
     property real sumxy : 0
11 11
     property int n : 0
12 12
 
13
-    width: 720
14
-    height: 680
13
+    width: 720; height: 680
15 14
 
16 15
     BrewingControlChart {
17 16
         id: graph
@@ -27,9 +26,7 @@ Rectangle {
27 26
 
28 27
             ListView {
29 28
                 spacing: 3
30
-                height: 400
31
-                width: 100
32
-                z: -1
29
+                height: 600; width: 100
33 30
                 contentHeight: dataViewModel.count * 35
34 31
 
35 32
                 model: ListModel {
@@ -55,7 +52,6 @@ Rectangle {
55 52
         }
56 53
     }
57 54
 
58
-
59 55
     Component.onCompleted: {
60 56
         var quitItem = window.addMenuItem("File", "Quit");
61 57
         quitItem.shortcut = "Ctrl+Q";
@@ -77,7 +73,6 @@ Rectangle {
77 73
         showLeastSquares.checkable = true;
78 74
         showLeastSquares.triggered.connect(function() {
79 75
             graph.setFitVisible(showLeastSquares.checked);
80
-            lsfrow.visible = showLeastSquares.checked;
81 76
         });
82 77
         window.newPoint.connect(function(pointDescription) {
83 78
             graph.plotPoint(pointDescription.extraction,
@@ -87,8 +82,8 @@ Rectangle {
87 82
             root.n += 1
88 83
             root.sumy += pointDescription.ptds / 100
89 84
             root.sumx += pointDescription.extraction
90
-            root.sumxy += ((pointDescription.ptds / 100) * extraction)
91
-            root.sumxsq += Math.pow(extraction, 2)
85
+            root.sumxy += ((pointDescription.ptds / 100) * pointDescription.extraction)
86
+            root.sumxsq += Math.pow(pointDescription.extraction, 2)
92 87
             if(root.n > 1) {
93 88
                 var a = ((root.sumy * root.sumxsq)-(root.sumx * root.sumxy))/((root.n * root.sumxsq)-Math.pow(root.sumx, 2))
94 89
                 var b = ((root.n * root.sumxy)-(root.sumx * root.sumy))/((root.n * root.sumxsq) - Math.pow(root.sumx, 2))

Loading…
Cancel
Save