Browse Source

Add XML and CSV export in view target profiles window

Neal Wilson 3 years ago
parent
commit
196e7f252b
Signed by: Neal Wilson <neal@typica.us> GPG Key ID: 2A0BDDE701E66EB9
1 changed files with 25 additions and 1 deletions
  1. 25
    1
      config/Windows/profilehistory.xml

+ 25
- 1
config/Windows/profilehistory.xml View File

28
 			</widget>
28
 			</widget>
29
 		</splitter>
29
 		</splitter>
30
 	</layout>
30
 	</layout>
31
+	<menu name="File">
32
+		<item id="save" shortcut="Ctrl+S">Save...</item>
33
+		<item id="export">Export CSV...</item>
34
+	</menu>
31
 	<menu name="Log">
35
 	<menu name="Log">
32
 		<item id="showC">Display Celsius</item>
36
 		<item id="showC">Display Celsius</item>
33
 		<item id="showF">Display Fahrenheit</item>
37
 		<item id="showF">Display Fahrenheit</item>
75
 			{
79
 			{
76
 				var buffer = new QBuffer(query.value(0));
80
 				var buffer = new QBuffer(query.value(0));
77
 				var input = new XMLInput(buffer, 1);
81
 				var input = new XMLInput(buffer, 1);
82
+				log.clearOutputColumns();
78
 				input.newTemperatureColumn.connect(log.setHeaderData);
83
 				input.newTemperatureColumn.connect(log.setHeaderData);
84
+				input.newTemperatureColumn.connect(log.addOutputTemperatureColumn);
79
 				input.newAnnotationColumn.connect(log.setHeaderData);
85
 				input.newAnnotationColumn.connect(log.setHeaderData);
86
+				input.newAnnotationColumn.connect(log.addOutputAnnotationColumn);
80
 				input.measure.connect(graph.newMeasurement);
87
 				input.measure.connect(graph.newMeasurement);
81
 				input.measure.connect(log.newMeasurement);
88
 				input.measure.connect(log.newMeasurement);
82
 				var lc;
89
 				var lc;
132
 			log.setDisplayUnits(Units.Fahrenheit);
139
 			log.setDisplayUnits(Units.Fahrenheit);
133
 			graph.showF();
140
 			graph.showF();
134
 		});
141
 		});
142
+		var saveMenu = findChildObject(this, 'save');
143
+        saveMenu.triggered.connect(function() {
144
+            var filename = QFileDialog.getSaveFileName(window, TTR("basicWindow", "Save Log As..."), QSettings.value("script/lastDir", "") + "/");
145
+            if(filename != "") {
146
+                var file = new QFile(filename);
147
+                log.saveXML(file);
148
+                QSettings.setValue("script/lastDir", dir(filename));
149
+            }
150
+        });
151
+		var exportMenu = findChildObject(this, 'export');
152
+        exportMenu.triggered.connect(function() {
153
+            var filename = QFileDialog.getSaveFileName(window, TTR("basicWindow", "Export CSV As..."), QSettings.value("script/lastDir", "") + "/");
154
+            if(filename != "") {
155
+                log.saveCSV(file);
156
+                QSettings.setValue("script/lastDir", dir(filename));
157
+            }
158
+        });
135
 	]]>
159
 	]]>
136
 	</program>
160
 	</program>
137
-</window>
161
+</window>

Loading…
Cancel
Save