@speleotica/frcsdata 4.0.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FrcsPlotFile.d.ts +1 -1
- package/FrcsPlotShot.d.ts +1 -1
- package/FrcsShot.d.ts +1 -1
- package/FrcsShot.js +2 -3
- package/FrcsSurveyFile.d.ts +1 -1
- package/FrcsTrip.d.ts +2 -2
- package/FrcsTripSummary.d.ts +1 -1
- package/FrcsTripSummaryFile.d.ts +1 -1
- package/formatFrcsShot.js +7 -6
- package/index.js +11 -11
- package/node/index.js +6 -9
- package/package.json +30 -124
- package/parseFrcsPlotFile.js +4 -3
- package/parseFrcsSurveyFile.js +13 -12
- package/parseFrcsTripSummaryFile.js +5 -4
- package/string/index.js +8 -11
- package/web/index.d.ts +12 -0
- package/web/index.js +71 -0
- package/es/FrcsPlotFile.js +0 -6
- package/es/FrcsPlotShot.js +0 -6
- package/es/FrcsShot.js +0 -14
- package/es/FrcsSurveyFile.js +0 -6
- package/es/FrcsTrip.js +0 -6
- package/es/FrcsTripSummary.js +0 -6
- package/es/FrcsTripSummaryFile.js +0 -6
- package/es/formatFrcsShot.js +0 -75
- package/es/formatFrcsShot.spec.js +0 -141
- package/es/index.js +0 -96
- package/es/node/index.js +0 -20
- package/es/node/parseFrcsPlotFile.spec.js +0 -167
- package/es/node/parseFrcsSurveyFile.spec.js +0 -314
- package/es/node/parseFrcsTripSummaryFile.spec.js +0 -78
- package/es/parseFrcsPlotFile.js +0 -135
- package/es/parseFrcsSurveyFile.js +0 -503
- package/es/parseFrcsTripSummaryFile.js +0 -73
- package/es/string/index.js +0 -21
- package/es/string/parseFrcsPlotFile.spec.js +0 -179
- package/es/string/parseFrcsSurveyFile.spec.js +0 -646
- package/formatFrcsShot.spec.js +0 -139
- package/node/parseFrcsPlotFile.spec.js +0 -181
- package/node/parseFrcsSurveyFile.spec.js +0 -328
- package/node/parseFrcsTripSummaryFile.spec.js +0 -104
- package/string/parseFrcsPlotFile.spec.js +0 -182
- package/string/parseFrcsSurveyFile.spec.js +0 -673
- package/yarn.lock +0 -9542
package/formatFrcsShot.spec.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
5
|
-
var _mocha = require("mocha");
|
|
6
|
-
var _chai = require("chai");
|
|
7
|
-
var _formatFrcsShot = _interopRequireDefault(require("./formatFrcsShot"));
|
|
8
|
-
var _unitized = require("@speleotica/unitized");
|
|
9
|
-
var _FrcsShot = require("./FrcsShot");
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
(0, _mocha.describe)("formatFrcsShot", function () {
|
|
13
|
-
var defaultHeader = {
|
|
14
|
-
name: 'Foo',
|
|
15
|
-
distanceUnit: _unitized.Length.feet,
|
|
16
|
-
azimuthUnit: _unitized.Angle.degrees,
|
|
17
|
-
inclinationUnit: _unitized.Angle.degrees,
|
|
18
|
-
backsightAzimuthCorrected: true,
|
|
19
|
-
backsightInclinationCorrected: true
|
|
20
|
-
};
|
|
21
|
-
function testCase(desc, shot, expected) {
|
|
22
|
-
var header = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : defaultHeader;
|
|
23
|
-
(0, _mocha.it)(desc, function () {
|
|
24
|
-
(0, _chai.expect)((0, _formatFrcsShot["default"])(shot, header)).to.equal(expected);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
testCase('normal shot', {
|
|
28
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
29
|
-
to: 'PDF28',
|
|
30
|
-
from: 'PDF27',
|
|
31
|
-
distance: _unitized.Unitize.feet(31.7),
|
|
32
|
-
frontsightAzimuth: _unitized.Unitize.degrees(174.3),
|
|
33
|
-
backsightAzimuth: _unitized.Unitize.degrees(174.1),
|
|
34
|
-
frontsightInclination: _unitized.Unitize.degrees(-1.2),
|
|
35
|
-
backsightInclination: _unitized.Unitize.degrees(-1.6),
|
|
36
|
-
toLruds: {
|
|
37
|
-
left: _unitized.Unitize.feet(2),
|
|
38
|
-
right: _unitized.Unitize.feet(3),
|
|
39
|
-
up: _unitized.Unitize.feet(0.5),
|
|
40
|
-
down: _unitized.Unitize.feet(1.5)
|
|
41
|
-
}
|
|
42
|
-
}, 'PDF28PDF27 31.7 174.3 174.1 -1.2 -1.6 2 30.51.5');
|
|
43
|
-
testCase('excluded shot', {
|
|
44
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
45
|
-
to: 'PDF28',
|
|
46
|
-
from: 'PDF27',
|
|
47
|
-
distance: _unitized.Unitize.feet(31.7),
|
|
48
|
-
excludeDistance: true,
|
|
49
|
-
frontsightAzimuth: _unitized.Unitize.degrees(174.3),
|
|
50
|
-
backsightAzimuth: _unitized.Unitize.degrees(174.1),
|
|
51
|
-
frontsightInclination: _unitized.Unitize.degrees(-1.2),
|
|
52
|
-
backsightInclination: _unitized.Unitize.degrees(-1.6),
|
|
53
|
-
toLruds: {
|
|
54
|
-
left: _unitized.Unitize.feet(2),
|
|
55
|
-
right: _unitized.Unitize.feet(3),
|
|
56
|
-
up: _unitized.Unitize.feet(0.5),
|
|
57
|
-
down: _unitized.Unitize.feet(1.5)
|
|
58
|
-
}
|
|
59
|
-
}, 'PDF28PDF27 31.7 * 174.3 174.1 -1.2 -1.6 2 30.51.5');
|
|
60
|
-
testCase('excluded horizontal shot', {
|
|
61
|
-
kind: _FrcsShot.FrcsShotKind.Horizontal,
|
|
62
|
-
to: 'PDF28',
|
|
63
|
-
from: 'PDF27',
|
|
64
|
-
distance: null,
|
|
65
|
-
horizontalDistance: _unitized.Unitize.feet(31.7),
|
|
66
|
-
verticalDistance: _unitized.Unitize.feet(5),
|
|
67
|
-
excludeDistance: true,
|
|
68
|
-
frontsightAzimuth: _unitized.Unitize.degrees(174.3),
|
|
69
|
-
backsightAzimuth: _unitized.Unitize.degrees(174.1),
|
|
70
|
-
toLruds: {
|
|
71
|
-
left: _unitized.Unitize.feet(2),
|
|
72
|
-
right: _unitized.Unitize.feet(3),
|
|
73
|
-
up: _unitized.Unitize.feet(0.5),
|
|
74
|
-
down: _unitized.Unitize.feet(1.5)
|
|
75
|
-
}
|
|
76
|
-
}, 'PDF28PDF27 31.7H* 174.3 174.1 5 2 30.51.5');
|
|
77
|
-
testCase('excluded diagonal shot', {
|
|
78
|
-
kind: _FrcsShot.FrcsShotKind.Diagonal,
|
|
79
|
-
to: 'PDF28',
|
|
80
|
-
from: 'PDF27',
|
|
81
|
-
distance: _unitized.Unitize.feet(31.7),
|
|
82
|
-
verticalDistance: _unitized.Unitize.feet(5),
|
|
83
|
-
excludeDistance: true,
|
|
84
|
-
frontsightAzimuth: _unitized.Unitize.degrees(174.3),
|
|
85
|
-
backsightAzimuth: _unitized.Unitize.degrees(174.1),
|
|
86
|
-
toLruds: {
|
|
87
|
-
left: _unitized.Unitize.feet(2),
|
|
88
|
-
right: _unitized.Unitize.feet(3),
|
|
89
|
-
up: _unitized.Unitize.feet(0.5),
|
|
90
|
-
down: _unitized.Unitize.feet(1.5)
|
|
91
|
-
}
|
|
92
|
-
}, 'PDF28PDF27 31.7D* 174.3 174.1 5 2 30.51.5');
|
|
93
|
-
testCase('horizontal feet and inches shot', {
|
|
94
|
-
to: 'A27',
|
|
95
|
-
from: 'A26',
|
|
96
|
-
kind: _FrcsShot.FrcsShotKind.Horizontal,
|
|
97
|
-
distance: null,
|
|
98
|
-
horizontalDistance: _unitized.Unitize.inches(16 * 12 + 9.6),
|
|
99
|
-
frontsightAzimuth: _unitized.Unitize.degrees(345),
|
|
100
|
-
backsightAzimuth: _unitized.Unitize.degrees(163),
|
|
101
|
-
verticalDistance: _unitized.Unitize.feet(-1),
|
|
102
|
-
toLruds: {
|
|
103
|
-
left: _unitized.Unitize.feet(0),
|
|
104
|
-
right: _unitized.Unitize.feet(3),
|
|
105
|
-
up: _unitized.Unitize.feet(5),
|
|
106
|
-
down: _unitized.Unitize.feet(4)
|
|
107
|
-
}
|
|
108
|
-
}, ' A27 A26 16 10H 345 163 -1 0 3 5 4', _objectSpread(_objectSpread({}, defaultHeader), {}, {
|
|
109
|
-
distanceUnit: _unitized.Length.inches
|
|
110
|
-
}));
|
|
111
|
-
testCase('diagonal feet and inches shot', {
|
|
112
|
-
to: 'A27',
|
|
113
|
-
from: 'A26',
|
|
114
|
-
kind: _FrcsShot.FrcsShotKind.Diagonal,
|
|
115
|
-
distance: _unitized.Unitize.inches(16 * 12 + 9.6),
|
|
116
|
-
frontsightAzimuth: _unitized.Unitize.degrees(345),
|
|
117
|
-
backsightAzimuth: _unitized.Unitize.degrees(163),
|
|
118
|
-
verticalDistance: _unitized.Unitize.feet(-1),
|
|
119
|
-
toLruds: {
|
|
120
|
-
left: _unitized.Unitize.feet(0),
|
|
121
|
-
right: _unitized.Unitize.feet(3),
|
|
122
|
-
up: _unitized.Unitize.feet(5),
|
|
123
|
-
down: _unitized.Unitize.feet(4)
|
|
124
|
-
}
|
|
125
|
-
}, ' A27 A26 16 10D 345 163 -1 0 3 5 4', _objectSpread(_objectSpread({}, defaultHeader), {}, {
|
|
126
|
-
distanceUnit: _unitized.Length.inches
|
|
127
|
-
}));
|
|
128
|
-
testCase('lrud-only shot', {
|
|
129
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
130
|
-
from: 'A27',
|
|
131
|
-
distance: null,
|
|
132
|
-
fromLruds: {
|
|
133
|
-
left: _unitized.Unitize.feet(0),
|
|
134
|
-
right: _unitized.Unitize.feet(3),
|
|
135
|
-
up: _unitized.Unitize.feet(5),
|
|
136
|
-
down: _unitized.Unitize.feet(4)
|
|
137
|
-
}
|
|
138
|
-
}, ' A27 0 3 5 4');
|
|
139
|
-
});
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
-
var _mocha = require("mocha");
|
|
7
|
-
var _index = require("./index");
|
|
8
|
-
var _unitized = require("@speleotica/unitized");
|
|
9
|
-
var _chai = require("chai");
|
|
10
|
-
(0, _mocha.describe)('parseFrcsPlotFile', function () {
|
|
11
|
-
(0, _mocha.it)('basic test', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
12
|
-
var parsed;
|
|
13
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
14
|
-
while (1) switch (_context.prev = _context.next) {
|
|
15
|
-
case 0:
|
|
16
|
-
_context.next = 2;
|
|
17
|
-
return (0, _index.parseFrcsPlotFile)(require.resolve('./FOR008.fr'));
|
|
18
|
-
case 2:
|
|
19
|
-
parsed = _context.sent;
|
|
20
|
-
(0, _chai.expect)(parsed).to.deep.equal({
|
|
21
|
-
totalLength: _unitized.Unitize.feet(123.182259),
|
|
22
|
-
errors: [],
|
|
23
|
-
shots: [{
|
|
24
|
-
toName: 'AE20',
|
|
25
|
-
isSurface: false,
|
|
26
|
-
fromNumber: 1,
|
|
27
|
-
toNumber: 1,
|
|
28
|
-
easting: _unitized.Unitize.feet(0),
|
|
29
|
-
northing: _unitized.Unitize.feet(0),
|
|
30
|
-
elevation: _unitized.Unitize.feet(0),
|
|
31
|
-
leftEasting: _unitized.Unitize.feet(1.53),
|
|
32
|
-
leftNorthing: _unitized.Unitize.feet(-2.57),
|
|
33
|
-
rightEasting: _unitized.Unitize.feet(-0.51),
|
|
34
|
-
rightNorthing: _unitized.Unitize.feet(0.85),
|
|
35
|
-
up: _unitized.Unitize.feet(0),
|
|
36
|
-
down: _unitized.Unitize.feet(2),
|
|
37
|
-
tripNumber: 1
|
|
38
|
-
}, {
|
|
39
|
-
toName: 'AE19',
|
|
40
|
-
isSurface: false,
|
|
41
|
-
fromNumber: 1,
|
|
42
|
-
toNumber: 2,
|
|
43
|
-
easting: _unitized.Unitize.feet(6.53),
|
|
44
|
-
northing: _unitized.Unitize.feet(4.02),
|
|
45
|
-
elevation: _unitized.Unitize.feet(-5.48),
|
|
46
|
-
leftEasting: _unitized.Unitize.feet(10.46),
|
|
47
|
-
leftNorthing: _unitized.Unitize.feet(-5.87),
|
|
48
|
-
rightEasting: _unitized.Unitize.feet(-1.74),
|
|
49
|
-
rightNorthing: _unitized.Unitize.feet(0.97),
|
|
50
|
-
up: _unitized.Unitize.feet(0),
|
|
51
|
-
down: _unitized.Unitize.feet(20),
|
|
52
|
-
tripNumber: 1
|
|
53
|
-
}, {
|
|
54
|
-
toName: 'AE18',
|
|
55
|
-
isSurface: false,
|
|
56
|
-
fromNumber: 2,
|
|
57
|
-
toNumber: 3,
|
|
58
|
-
easting: _unitized.Unitize.feet(6.69),
|
|
59
|
-
northing: _unitized.Unitize.feet(4.49),
|
|
60
|
-
elevation: _unitized.Unitize.feet(-30.02),
|
|
61
|
-
leftEasting: _unitized.Unitize.feet(9.95),
|
|
62
|
-
leftNorthing: _unitized.Unitize.feet(0.94),
|
|
63
|
-
rightEasting: _unitized.Unitize.feet(-5.97),
|
|
64
|
-
rightNorthing: _unitized.Unitize.feet(-0.56),
|
|
65
|
-
up: _unitized.Unitize.feet(25),
|
|
66
|
-
down: _unitized.Unitize.feet(0),
|
|
67
|
-
tripNumber: 1
|
|
68
|
-
}, {
|
|
69
|
-
toName: 'AE17',
|
|
70
|
-
isSurface: false,
|
|
71
|
-
fromNumber: 3,
|
|
72
|
-
toNumber: 4,
|
|
73
|
-
easting: _unitized.Unitize.feet(5.39),
|
|
74
|
-
northing: _unitized.Unitize.feet(12.17),
|
|
75
|
-
elevation: _unitized.Unitize.feet(-27.7),
|
|
76
|
-
leftEasting: _unitized.Unitize.feet(4.97),
|
|
77
|
-
leftNorthing: _unitized.Unitize.feet(0.47),
|
|
78
|
-
rightEasting: _unitized.Unitize.feet(-2.98),
|
|
79
|
-
rightNorthing: _unitized.Unitize.feet(-0.28),
|
|
80
|
-
up: _unitized.Unitize.feet(0),
|
|
81
|
-
down: _unitized.Unitize.feet(0),
|
|
82
|
-
tripNumber: 1
|
|
83
|
-
}, {
|
|
84
|
-
toName: 'AE16',
|
|
85
|
-
isSurface: false,
|
|
86
|
-
fromNumber: 4,
|
|
87
|
-
toNumber: 5,
|
|
88
|
-
easting: _unitized.Unitize.feet(5.44),
|
|
89
|
-
northing: _unitized.Unitize.feet(12.3),
|
|
90
|
-
elevation: _unitized.Unitize.feet(-34.41),
|
|
91
|
-
leftEasting: _unitized.Unitize.feet(4.11),
|
|
92
|
-
leftNorthing: _unitized.Unitize.feet(-2.84),
|
|
93
|
-
rightEasting: _unitized.Unitize.feet(-2.46),
|
|
94
|
-
rightNorthing: _unitized.Unitize.feet(1.7),
|
|
95
|
-
up: _unitized.Unitize.feet(6),
|
|
96
|
-
down: _unitized.Unitize.feet(1),
|
|
97
|
-
tripNumber: 1
|
|
98
|
-
}, {
|
|
99
|
-
toName: 'AE15',
|
|
100
|
-
isSurface: false,
|
|
101
|
-
fromNumber: 5,
|
|
102
|
-
toNumber: 6,
|
|
103
|
-
easting: _unitized.Unitize.feet(16.79),
|
|
104
|
-
northing: _unitized.Unitize.feet(16.63),
|
|
105
|
-
elevation: _unitized.Unitize.feet(-38.33),
|
|
106
|
-
leftEasting: _unitized.Unitize.feet(0),
|
|
107
|
-
leftNorthing: _unitized.Unitize.feet(0),
|
|
108
|
-
rightEasting: _unitized.Unitize.feet(-2.82),
|
|
109
|
-
rightNorthing: _unitized.Unitize.feet(2.83),
|
|
110
|
-
up: _unitized.Unitize.feet(2),
|
|
111
|
-
down: _unitized.Unitize.feet(1),
|
|
112
|
-
tripNumber: 1
|
|
113
|
-
}, {
|
|
114
|
-
toName: 'AE14',
|
|
115
|
-
isSurface: false,
|
|
116
|
-
fromNumber: 6,
|
|
117
|
-
toNumber: 7,
|
|
118
|
-
easting: _unitized.Unitize.feet(20.26),
|
|
119
|
-
northing: _unitized.Unitize.feet(26.17),
|
|
120
|
-
elevation: _unitized.Unitize.feet(-37.3),
|
|
121
|
-
leftEasting: _unitized.Unitize.feet(4.46),
|
|
122
|
-
leftNorthing: _unitized.Unitize.feet(2.25),
|
|
123
|
-
rightEasting: _unitized.Unitize.feet(-4.46),
|
|
124
|
-
rightNorthing: _unitized.Unitize.feet(-2.25),
|
|
125
|
-
up: _unitized.Unitize.feet(0),
|
|
126
|
-
down: _unitized.Unitize.feet(3),
|
|
127
|
-
tripNumber: 1
|
|
128
|
-
}, {
|
|
129
|
-
toName: 'AE13',
|
|
130
|
-
isSurface: false,
|
|
131
|
-
fromNumber: 7,
|
|
132
|
-
toNumber: 8,
|
|
133
|
-
easting: _unitized.Unitize.feet(3.91),
|
|
134
|
-
northing: _unitized.Unitize.feet(31.52),
|
|
135
|
-
elevation: _unitized.Unitize.feet(-57.88),
|
|
136
|
-
leftEasting: _unitized.Unitize.feet(-1.11),
|
|
137
|
-
leftNorthing: _unitized.Unitize.feet(6.91),
|
|
138
|
-
rightEasting: _unitized.Unitize.feet(0),
|
|
139
|
-
rightNorthing: _unitized.Unitize.feet(0),
|
|
140
|
-
up: _unitized.Unitize.feet(20),
|
|
141
|
-
down: _unitized.Unitize.feet(5),
|
|
142
|
-
tripNumber: 1
|
|
143
|
-
}, {
|
|
144
|
-
toName: 'AE12',
|
|
145
|
-
isSurface: false,
|
|
146
|
-
fromNumber: 8,
|
|
147
|
-
toNumber: 9,
|
|
148
|
-
easting: _unitized.Unitize.feet(-10.19),
|
|
149
|
-
northing: _unitized.Unitize.feet(21.75),
|
|
150
|
-
elevation: _unitized.Unitize.feet(-46.3),
|
|
151
|
-
leftEasting: _unitized.Unitize.feet(-3.69),
|
|
152
|
-
leftNorthing: _unitized.Unitize.feet(3.36),
|
|
153
|
-
rightEasting: _unitized.Unitize.feet(2.21),
|
|
154
|
-
rightNorthing: _unitized.Unitize.feet(-2.01),
|
|
155
|
-
up: _unitized.Unitize.feet(4),
|
|
156
|
-
down: _unitized.Unitize.feet(4),
|
|
157
|
-
tripNumber: 1
|
|
158
|
-
}, {
|
|
159
|
-
toName: 'AE11',
|
|
160
|
-
isSurface: false,
|
|
161
|
-
fromNumber: 9,
|
|
162
|
-
toNumber: 10,
|
|
163
|
-
easting: _unitized.Unitize.feet(-15.16),
|
|
164
|
-
northing: _unitized.Unitize.feet(12.89),
|
|
165
|
-
elevation: _unitized.Unitize.feet(-39.19),
|
|
166
|
-
leftEasting: _unitized.Unitize.feet(-3.48),
|
|
167
|
-
leftNorthing: _unitized.Unitize.feet(1.95),
|
|
168
|
-
rightEasting: _unitized.Unitize.feet(6.1),
|
|
169
|
-
rightNorthing: _unitized.Unitize.feet(-3.42),
|
|
170
|
-
up: _unitized.Unitize.feet(5),
|
|
171
|
-
down: _unitized.Unitize.feet(1),
|
|
172
|
-
tripNumber: 1
|
|
173
|
-
}]
|
|
174
|
-
});
|
|
175
|
-
case 4:
|
|
176
|
-
case "end":
|
|
177
|
-
return _context.stop();
|
|
178
|
-
}
|
|
179
|
-
}, _callee);
|
|
180
|
-
})));
|
|
181
|
-
});
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
-
var _mocha = require("mocha");
|
|
7
|
-
var _index = require("./index");
|
|
8
|
-
var _unitized = require("@speleotica/unitized");
|
|
9
|
-
var _chai = require("chai");
|
|
10
|
-
var _FrcsShot = require("../FrcsShot");
|
|
11
|
-
/* eslint-env node */
|
|
12
|
-
|
|
13
|
-
(0, _mocha.describe)('parseFrcsSurveyFile', function () {
|
|
14
|
-
(0, _mocha.it)('basic test', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
15
|
-
var parsed;
|
|
16
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
17
|
-
while (1) switch (_context.prev = _context.next) {
|
|
18
|
-
case 0:
|
|
19
|
-
_context.next = 2;
|
|
20
|
-
return (0, _index.parseFrcsSurveyFile)(require.resolve('./cdata.fr'));
|
|
21
|
-
case 2:
|
|
22
|
-
parsed = _context.sent;
|
|
23
|
-
(0, _chai.expect)(parsed).to.deep.equal({
|
|
24
|
-
cave: 'Fisher Ridge Cave System',
|
|
25
|
-
errors: [],
|
|
26
|
-
location: 'Hart Co., KY',
|
|
27
|
-
trips: [{
|
|
28
|
-
header: {
|
|
29
|
-
name: 'ENTRANCE DROPS, JOE\'S "I LOVE MY WIFE TRAVERSE", TRICKY TRAVERSE',
|
|
30
|
-
comment: 'This File has Crumps test connected. 11/20/12',
|
|
31
|
-
section: undefined,
|
|
32
|
-
date: undefined,
|
|
33
|
-
team: undefined,
|
|
34
|
-
distanceUnit: _unitized.Length.feet,
|
|
35
|
-
azimuthUnit: _unitized.Angle.degrees,
|
|
36
|
-
inclinationUnit: _unitized.Angle.degrees,
|
|
37
|
-
backsightAzimuthCorrected: true,
|
|
38
|
-
backsightInclinationCorrected: false,
|
|
39
|
-
hasBacksightAzimuth: true,
|
|
40
|
-
hasBacksightInclination: false
|
|
41
|
-
},
|
|
42
|
-
shots: [{
|
|
43
|
-
backsightAzimuth: null,
|
|
44
|
-
backsightInclination: null,
|
|
45
|
-
comment: null,
|
|
46
|
-
distance: _unitized.Unitize.feet(0),
|
|
47
|
-
excludeDistance: true,
|
|
48
|
-
from: 'AE20',
|
|
49
|
-
frontsightAzimuth: null,
|
|
50
|
-
frontsightInclination: null,
|
|
51
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
52
|
-
to: null,
|
|
53
|
-
fromLruds: {
|
|
54
|
-
left: _unitized.Unitize.feet(1),
|
|
55
|
-
right: _unitized.Unitize.feet(3),
|
|
56
|
-
up: _unitized.Unitize.feet(0),
|
|
57
|
-
down: _unitized.Unitize.feet(2)
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
from: 'AE20',
|
|
61
|
-
to: 'AE19',
|
|
62
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
63
|
-
distance: _unitized.Unitize.feet(9.3),
|
|
64
|
-
frontsightAzimuth: _unitized.Unitize.degrees(60),
|
|
65
|
-
backsightAzimuth: _unitized.Unitize.degrees(60),
|
|
66
|
-
frontsightInclination: _unitized.Unitize.degrees(-36),
|
|
67
|
-
backsightInclination: null,
|
|
68
|
-
excludeDistance: false,
|
|
69
|
-
comment: "AE20 0 0 0 Bug-can't put before so put after-so can't make 2 fixed 10/28/12",
|
|
70
|
-
toLruds: {
|
|
71
|
-
left: _unitized.Unitize.feet(2),
|
|
72
|
-
right: _unitized.Unitize.feet(12),
|
|
73
|
-
up: _unitized.Unitize.feet(0),
|
|
74
|
-
down: _unitized.Unitize.feet(20)
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
|
-
from: 'AE19',
|
|
78
|
-
to: 'AE18',
|
|
79
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
80
|
-
distance: _unitized.Unitize.feet(24.5),
|
|
81
|
-
frontsightAzimuth: _unitized.Unitize.degrees(0),
|
|
82
|
-
backsightAzimuth: _unitized.Unitize.degrees(0),
|
|
83
|
-
frontsightInclination: _unitized.Unitize.degrees(-90),
|
|
84
|
-
backsightInclination: null,
|
|
85
|
-
excludeDistance: false,
|
|
86
|
-
comment: null,
|
|
87
|
-
toLruds: {
|
|
88
|
-
left: _unitized.Unitize.feet(6),
|
|
89
|
-
right: _unitized.Unitize.feet(10),
|
|
90
|
-
up: _unitized.Unitize.feet(25),
|
|
91
|
-
down: _unitized.Unitize.feet(0)
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
from: 'AE18',
|
|
95
|
-
to: 'AE17',
|
|
96
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
97
|
-
distance: _unitized.Unitize.feet(8),
|
|
98
|
-
frontsightAzimuth: _unitized.Unitize.degrees(350.5),
|
|
99
|
-
backsightAzimuth: _unitized.Unitize.degrees(350.5),
|
|
100
|
-
frontsightInclination: _unitized.Unitize.degrees(17),
|
|
101
|
-
backsightInclination: null,
|
|
102
|
-
excludeDistance: false,
|
|
103
|
-
comment: null,
|
|
104
|
-
toLruds: {
|
|
105
|
-
left: _unitized.Unitize.feet(3),
|
|
106
|
-
right: _unitized.Unitize.feet(5),
|
|
107
|
-
up: _unitized.Unitize.feet(0),
|
|
108
|
-
down: _unitized.Unitize.feet(0)
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
from: 'AE17',
|
|
112
|
-
to: 'AE16',
|
|
113
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
114
|
-
distance: _unitized.Unitize.feet(6.7),
|
|
115
|
-
frontsightAzimuth: _unitized.Unitize.degrees(0),
|
|
116
|
-
backsightAzimuth: _unitized.Unitize.degrees(0),
|
|
117
|
-
frontsightInclination: _unitized.Unitize.degrees(-90),
|
|
118
|
-
backsightInclination: null,
|
|
119
|
-
excludeDistance: false,
|
|
120
|
-
comment: null,
|
|
121
|
-
toLruds: {
|
|
122
|
-
left: _unitized.Unitize.feet(3),
|
|
123
|
-
right: _unitized.Unitize.feet(5),
|
|
124
|
-
up: _unitized.Unitize.feet(6),
|
|
125
|
-
down: _unitized.Unitize.feet(1)
|
|
126
|
-
}
|
|
127
|
-
}, {
|
|
128
|
-
from: 'AE16',
|
|
129
|
-
to: 'AE15',
|
|
130
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
131
|
-
distance: _unitized.Unitize.feet(12.6),
|
|
132
|
-
frontsightAzimuth: _unitized.Unitize.degrees(70.5),
|
|
133
|
-
backsightAzimuth: _unitized.Unitize.degrees(71),
|
|
134
|
-
frontsightInclination: _unitized.Unitize.degrees(-18),
|
|
135
|
-
backsightInclination: null,
|
|
136
|
-
excludeDistance: false,
|
|
137
|
-
comment: null,
|
|
138
|
-
toLruds: {
|
|
139
|
-
left: _unitized.Unitize.feet(4),
|
|
140
|
-
right: _unitized.Unitize.feet(0),
|
|
141
|
-
up: _unitized.Unitize.feet(2),
|
|
142
|
-
down: _unitized.Unitize.feet(1)
|
|
143
|
-
}
|
|
144
|
-
}, {
|
|
145
|
-
from: 'AE15',
|
|
146
|
-
to: 'AE14',
|
|
147
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
148
|
-
distance: _unitized.Unitize.feet(10),
|
|
149
|
-
frontsightAzimuth: _unitized.Unitize.degrees(21.5),
|
|
150
|
-
backsightAzimuth: _unitized.Unitize.degrees(20),
|
|
151
|
-
frontsightInclination: _unitized.Unitize.degrees(6),
|
|
152
|
-
backsightInclination: null,
|
|
153
|
-
excludeDistance: false,
|
|
154
|
-
comment: null,
|
|
155
|
-
toLruds: {
|
|
156
|
-
left: _unitized.Unitize.feet(5),
|
|
157
|
-
right: _unitized.Unitize.feet(5),
|
|
158
|
-
up: _unitized.Unitize.feet(0),
|
|
159
|
-
down: _unitized.Unitize.feet(3)
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
from: 'AE14',
|
|
163
|
-
to: 'AE13',
|
|
164
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
165
|
-
distance: _unitized.Unitize.feet(26.8),
|
|
166
|
-
frontsightAzimuth: _unitized.Unitize.degrees(288),
|
|
167
|
-
backsightAzimuth: _unitized.Unitize.degrees(286),
|
|
168
|
-
frontsightInclination: _unitized.Unitize.degrees(-50),
|
|
169
|
-
backsightInclination: null,
|
|
170
|
-
excludeDistance: false,
|
|
171
|
-
comment: null,
|
|
172
|
-
toLruds: {
|
|
173
|
-
left: _unitized.Unitize.feet(0),
|
|
174
|
-
right: _unitized.Unitize.feet(7),
|
|
175
|
-
up: _unitized.Unitize.feet(20),
|
|
176
|
-
down: _unitized.Unitize.feet(5)
|
|
177
|
-
}
|
|
178
|
-
}, {
|
|
179
|
-
from: 'AE13',
|
|
180
|
-
to: 'AE12',
|
|
181
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
182
|
-
distance: _unitized.Unitize.feet(20.7),
|
|
183
|
-
frontsightAzimuth: _unitized.Unitize.degrees(236),
|
|
184
|
-
backsightAzimuth: _unitized.Unitize.degrees(236),
|
|
185
|
-
frontsightInclination: _unitized.Unitize.degrees(34),
|
|
186
|
-
backsightInclination: null,
|
|
187
|
-
excludeDistance: false,
|
|
188
|
-
comment: 'SHORT CANYON AT THE BASE OF THE SECOND DROP',
|
|
189
|
-
toLruds: {
|
|
190
|
-
left: _unitized.Unitize.feet(3),
|
|
191
|
-
right: _unitized.Unitize.feet(5),
|
|
192
|
-
up: _unitized.Unitize.feet(4),
|
|
193
|
-
down: _unitized.Unitize.feet(4)
|
|
194
|
-
}
|
|
195
|
-
}]
|
|
196
|
-
}, {
|
|
197
|
-
header: {
|
|
198
|
-
name: 'TRICKY TRAVERSE AND THEN FIRST SURVEY IN UPPER CROWLWAY',
|
|
199
|
-
comment: null,
|
|
200
|
-
section: undefined,
|
|
201
|
-
date: undefined,
|
|
202
|
-
team: undefined,
|
|
203
|
-
distanceUnit: _unitized.Length.inches,
|
|
204
|
-
azimuthUnit: _unitized.Angle.degrees,
|
|
205
|
-
inclinationUnit: _unitized.Angle.degrees,
|
|
206
|
-
backsightAzimuthCorrected: false,
|
|
207
|
-
backsightInclinationCorrected: false,
|
|
208
|
-
hasBacksightAzimuth: true,
|
|
209
|
-
hasBacksightInclination: false
|
|
210
|
-
},
|
|
211
|
-
shots: [{
|
|
212
|
-
from: 'A1',
|
|
213
|
-
to: 'A2',
|
|
214
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
215
|
-
distance: _unitized.Unitize.inches(48 * 12 + 10),
|
|
216
|
-
frontsightAzimuth: _unitized.Unitize.degrees(292),
|
|
217
|
-
backsightAzimuth: _unitized.Unitize.degrees(110),
|
|
218
|
-
frontsightInclination: _unitized.Unitize.degrees(-42),
|
|
219
|
-
backsightInclination: null,
|
|
220
|
-
excludeDistance: false,
|
|
221
|
-
comment: null,
|
|
222
|
-
fromLruds: {
|
|
223
|
-
left: _unitized.Unitize.feet(2),
|
|
224
|
-
right: _unitized.Unitize.feet(7),
|
|
225
|
-
up: _unitized.Unitize.feet(3),
|
|
226
|
-
down: _unitized.Unitize.feet(4.5)
|
|
227
|
-
},
|
|
228
|
-
toLruds: {
|
|
229
|
-
left: _unitized.Unitize.feet(5),
|
|
230
|
-
right: _unitized.Unitize.feet(10),
|
|
231
|
-
up: _unitized.Unitize.feet(35),
|
|
232
|
-
down: _unitized.Unitize.feet(5)
|
|
233
|
-
}
|
|
234
|
-
}, {
|
|
235
|
-
from: 'A2',
|
|
236
|
-
to: 'A3',
|
|
237
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
238
|
-
distance: _unitized.Unitize.inches(12 * 12 + 5),
|
|
239
|
-
frontsightAzimuth: _unitized.Unitize.degrees(333.5),
|
|
240
|
-
backsightAzimuth: _unitized.Unitize.degrees(153.5),
|
|
241
|
-
frontsightInclination: _unitized.Unitize.degrees(35),
|
|
242
|
-
backsightInclination: null,
|
|
243
|
-
excludeDistance: false,
|
|
244
|
-
comment: null,
|
|
245
|
-
toLruds: {
|
|
246
|
-
left: _unitized.Unitize.feet(3),
|
|
247
|
-
right: _unitized.Unitize.feet(1),
|
|
248
|
-
up: _unitized.Unitize.feet(15),
|
|
249
|
-
down: _unitized.Unitize.feet(5)
|
|
250
|
-
}
|
|
251
|
-
}, {
|
|
252
|
-
from: 'A3',
|
|
253
|
-
to: 'A4',
|
|
254
|
-
kind: _FrcsShot.FrcsShotKind.Normal,
|
|
255
|
-
distance: _unitized.Unitize.inches(4 * 12 + 2),
|
|
256
|
-
frontsightAzimuth: _unitized.Unitize.degrees(0),
|
|
257
|
-
backsightAzimuth: _unitized.Unitize.degrees(0),
|
|
258
|
-
frontsightInclination: _unitized.Unitize.degrees(90),
|
|
259
|
-
backsightInclination: null,
|
|
260
|
-
excludeDistance: false,
|
|
261
|
-
comment: null,
|
|
262
|
-
toLruds: {
|
|
263
|
-
left: _unitized.Unitize.feet(3),
|
|
264
|
-
right: _unitized.Unitize.feet(1),
|
|
265
|
-
up: _unitized.Unitize.feet(10),
|
|
266
|
-
down: _unitized.Unitize.feet(10)
|
|
267
|
-
}
|
|
268
|
-
}]
|
|
269
|
-
}, {
|
|
270
|
-
header: {
|
|
271
|
-
azimuthUnit: _unitized.Angle.degrees,
|
|
272
|
-
backsightAzimuthCorrected: true,
|
|
273
|
-
backsightInclinationCorrected: false,
|
|
274
|
-
comment: null,
|
|
275
|
-
date: undefined,
|
|
276
|
-
distanceUnit: _unitized.Length.feet,
|
|
277
|
-
hasBacksightAzimuth: true,
|
|
278
|
-
hasBacksightInclination: false,
|
|
279
|
-
inclinationUnit: _unitized.Angle.degrees,
|
|
280
|
-
name: "DOUG'S DEMISE (50 FT DROP), CHRIS CROSS, CRAWL ABOVE DROP",
|
|
281
|
-
section: undefined,
|
|
282
|
-
team: undefined
|
|
283
|
-
},
|
|
284
|
-
shots: [{
|
|
285
|
-
backsightAzimuth: _unitized.Unitize.degrees(0),
|
|
286
|
-
backsightInclination: null,
|
|
287
|
-
comment: null,
|
|
288
|
-
distance: _unitized.Unitize.feet(13.7),
|
|
289
|
-
excludeDistance: false,
|
|
290
|
-
from: 'B30',
|
|
291
|
-
frontsightAzimuth: _unitized.Unitize.degrees(0),
|
|
292
|
-
frontsightInclination: _unitized.Unitize.degrees(40),
|
|
293
|
-
kind: ' ',
|
|
294
|
-
to: 'B31',
|
|
295
|
-
toLruds: {
|
|
296
|
-
left: _unitized.Unitize.feet(2),
|
|
297
|
-
right: _unitized.Unitize.feet(4),
|
|
298
|
-
up: _unitized.Unitize.feet(6),
|
|
299
|
-
down: null
|
|
300
|
-
}
|
|
301
|
-
}, {
|
|
302
|
-
backsightAzimuth: _unitized.Unitize.degrees(0),
|
|
303
|
-
backsightInclination: null,
|
|
304
|
-
comment: null,
|
|
305
|
-
distance: _unitized.Unitize.feet(13.7),
|
|
306
|
-
excludeDistance: true,
|
|
307
|
-
isSplay: true,
|
|
308
|
-
from: 'B30',
|
|
309
|
-
frontsightAzimuth: _unitized.Unitize.degrees(0),
|
|
310
|
-
frontsightInclination: _unitized.Unitize.degrees(40),
|
|
311
|
-
kind: ' ',
|
|
312
|
-
to: 'B30sp',
|
|
313
|
-
toLruds: {
|
|
314
|
-
left: _unitized.Unitize.feet(2),
|
|
315
|
-
right: _unitized.Unitize.feet(4),
|
|
316
|
-
up: _unitized.Unitize.feet(6),
|
|
317
|
-
down: null
|
|
318
|
-
}
|
|
319
|
-
}]
|
|
320
|
-
}]
|
|
321
|
-
});
|
|
322
|
-
case 4:
|
|
323
|
-
case "end":
|
|
324
|
-
return _context.stop();
|
|
325
|
-
}
|
|
326
|
-
}, _callee);
|
|
327
|
-
})));
|
|
328
|
-
});
|