Skip to content

Commit

Permalink
Test save/resume of measurements. Add release notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitrohatgi committed Apr 3, 2019
1 parent ea462e6 commit 4185596
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/release_notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ Coming soon!

New Features:
- Save and resume auto-detection algorithm settings along with masks in the project file (per dataset).
- Crop images before digitization
- Crop images before digitization.
- Undo/Redo management system (used only for cropping images at the moment)
- Initial ability to run digitization on multiple images via NodeJS command-line

Bug fixes:
- Improve X Step with Interpolation algorithm for log-scale charts
- Improved unit test coverage

Misc:
- Minor UI tweaks for mask creation

Version 4.1
===========
Expand Down
26 changes: 25 additions & 1 deletion app/tests/save_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,38 @@ QUnit.test("Resume Version 4.2 with masks", function(assert) {
assert.equal(autodetection1.mask.size, 264662, testLabelPrefix + "Check mask size for 1st dataset");
let autodetection2 = plotData.getAutoDetectionDataForDataset(datasets[5]);
assert.equal(autodetection2.mask.size, 14710, testLabelPrefix + "Check mask size for 6th dataset");

};
let checkMeasurements = function(plotData, assert, testLabelPrefix) {
// distance
let distanceMeasurements = plotData.getMeasurementsByType(wpd.DistanceMeasurement);
assert.equal(distanceMeasurements.length, 1, testLabelPrefix + "Number of distance measurements");
assert.equal(distanceMeasurements[0].connectionCount(), 1, testLabelPrefix + "Number of distances");
let axes = plotData.getAxesForMeasurement(distanceMeasurements[0]);
assert.equal(axes.pixelToDataDistance(distanceMeasurements[0].getDistance(0)), 5.969022081900202, testLabelPrefix + "Distance value");

// angle
let angleMeasurements = plotData.getMeasurementsByType(wpd.AngleMeasurement);
assert.equal(angleMeasurements.length, 1, testLabelPrefix + "Number of angle measurements");
assert.equal(angleMeasurements[0].connectionCount(), 1, testLabelPrefix + "Number of angles");
assert.equal(angleMeasurements[0].getAngle(0), 45.01999740464475, testLabelPrefix + "Angle value");

// area/perimeter
let areaMeasurements = plotData.getMeasurementsByType(wpd.AreaMeasurement);
assert.equal(areaMeasurements.length, 1, testLabelPrefix + "Number of area measurements");
assert.equal(areaMeasurements[0].connectionCount(), 1, testLabelPrefix + "Number of areas");
axes = plotData.getAxesForMeasurement(areaMeasurements[0]);
assert.equal(axes.pixelToDataDistance(areaMeasurements[0].getPerimeter(0)), 22.18065208060926, testLabelPrefix + "Perimeter value");
assert.equal(axes.pixelToDataArea(areaMeasurements[0].getArea(0)), 30.245012069196335, testLabelPrefix + "Area value");

};
let done = assert.async();
wpdtest.loadPlotData("files/wpd4_2_with_masks.json").then(plotDataObjs => {
checkAxes(plotDataObjs.plotData, assert, "Deserialize from JSON: ");
checkAxes(plotDataObjs.plotData2, assert, "Serialize then deserialize: ");
checkDatasets(plotDataObjs.plotData, assert, "Deserialize from JSON: ");
checkDatasets(plotDataObjs.plotData2, assert, "Serialize then deserialize: ");
checkMeasurements(plotDataObjs.plotData, assert, "Deserialize from JSON: ");
checkMeasurements(plotDataObjs.plotData2, assert, "Serialize then deserialize: ");
done();
});
});

0 comments on commit 4185596

Please sign in to comment.