mirror of
https://github.com/nasa/openmct.git
synced 2025-01-29 15:43:52 +00:00
[Style] Pull functions out of loop
Pull functions out of loop for jshint compliance.
This commit is contained in:
parent
b9e0a77655
commit
668b09b789
@ -57,14 +57,23 @@ define([], function () {
|
||||
rows = [],
|
||||
row,
|
||||
i;
|
||||
|
||||
function copyDomainsToRow(row, index) {
|
||||
domains.forEach(function (domain) {
|
||||
row[domain.name] = series.getDomainValue(index, domain.key);
|
||||
});
|
||||
}
|
||||
|
||||
function copyRangesToRow(row, index) {
|
||||
ranges.forEach(function (range) {
|
||||
row[range.name] = series.getRangeValue(index, range.key);
|
||||
});
|
||||
}
|
||||
|
||||
for (i = 0; i < series.getPointCount(); i += 1) {
|
||||
row = {};
|
||||
domains.forEach(function (domain) {
|
||||
row[domain.name] = series.getDomainValue(i, domain.key);
|
||||
});
|
||||
ranges.forEach(function (range) {
|
||||
row[range.name] = series.getRangeValue(i, range.key);
|
||||
});
|
||||
copyDomainsToRow(row, i);
|
||||
copyRangesToRow(row, i);
|
||||
rows.push(row);
|
||||
}
|
||||
exportService.exportCSV(rows, { headers: headers });
|
||||
@ -77,4 +86,4 @@ define([], function () {
|
||||
};
|
||||
|
||||
return ExportTelemetryAsCSVAction;
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user