@speleotica/frcsdata 4.0.3 → 4.0.4

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.
Files changed (43) hide show
  1. package/FrcsPlotFile.d.ts +1 -1
  2. package/FrcsPlotShot.d.ts +1 -1
  3. package/FrcsShot.d.ts +1 -1
  4. package/FrcsShot.js +2 -3
  5. package/FrcsSurveyFile.d.ts +1 -1
  6. package/FrcsTrip.d.ts +2 -2
  7. package/FrcsTripSummary.d.ts +1 -1
  8. package/FrcsTripSummaryFile.d.ts +1 -1
  9. package/formatFrcsShot.js +7 -6
  10. package/index.js +11 -11
  11. package/node/index.js +6 -9
  12. package/package.json +26 -124
  13. package/parseFrcsPlotFile.js +4 -3
  14. package/parseFrcsSurveyFile.js +13 -12
  15. package/parseFrcsTripSummaryFile.js +5 -4
  16. package/string/index.js +8 -11
  17. package/es/FrcsPlotFile.js +0 -6
  18. package/es/FrcsPlotShot.js +0 -6
  19. package/es/FrcsShot.js +0 -14
  20. package/es/FrcsSurveyFile.js +0 -6
  21. package/es/FrcsTrip.js +0 -6
  22. package/es/FrcsTripSummary.js +0 -6
  23. package/es/FrcsTripSummaryFile.js +0 -6
  24. package/es/formatFrcsShot.js +0 -75
  25. package/es/formatFrcsShot.spec.js +0 -141
  26. package/es/index.js +0 -96
  27. package/es/node/index.js +0 -20
  28. package/es/node/parseFrcsPlotFile.spec.js +0 -167
  29. package/es/node/parseFrcsSurveyFile.spec.js +0 -314
  30. package/es/node/parseFrcsTripSummaryFile.spec.js +0 -78
  31. package/es/parseFrcsPlotFile.js +0 -135
  32. package/es/parseFrcsSurveyFile.js +0 -503
  33. package/es/parseFrcsTripSummaryFile.js +0 -73
  34. package/es/string/index.js +0 -21
  35. package/es/string/parseFrcsPlotFile.spec.js +0 -179
  36. package/es/string/parseFrcsSurveyFile.spec.js +0 -646
  37. package/formatFrcsShot.spec.js +0 -139
  38. package/node/parseFrcsPlotFile.spec.js +0 -181
  39. package/node/parseFrcsSurveyFile.spec.js +0 -328
  40. package/node/parseFrcsTripSummaryFile.spec.js +0 -104
  41. package/string/parseFrcsPlotFile.spec.js +0 -182
  42. package/string/parseFrcsSurveyFile.spec.js +0 -673
  43. package/yarn.lock +0 -9542
@@ -1,673 +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
- var _parseSegment = require("parse-segment");
12
- var data = " Fisher Ridge Cave System, Hart Co., KY\nENTRANCE DROPS, JOE'S \"I LOVE MY WIFE TRAVERSE\", TRICKY TRAVERSE\nPETER QUICK, KEITH ORTIZ - 2-15-81\nThis File has Crumps test connected. 11/20/12\n *\nFT C DD A\n AE20 0 1 3 0 2\n* %FS\n* AE20 0 0 0 Bug-can't put before so put after-so can't make 2 fixed 10/28/12\n AE19 AE20 9.3 60.0 60.0-36.0 2 12 0 20\n AE18 AE19 24.5 0.0 0.0-90.0 6 10 25 0\n AE17 AE18 8.0 350.5 350.5 17.0 3 5 0 0\n AE16 AE17 6.7 0.0 0.0-90.0 3 5 6 1\n AE15 AE16 12.6 70.5 71.0-18.0 4 0 2 1\n AE14 AE15 10.0 21.5 20.0 6.0 5 5 0 3\n AE13 AE14 26.8 288.0 286.0-50.0 0 7 20 5\n*\n*SHORT CANYON AT THE BASE OF THE SECOND DROP\n AE12 AE13 20.7 236.0 236.0 34.0 3 5 4 4\n *\nTRICKY TRAVERSE AND THEN FIRST SURVEY IN UPPER CROWLWAY\nDAN CROWL, KEITH ORTIZ, CHIP HOPPER, PETER QUICK, LARRY BEAN 14 FEB 1981\n *\nFI B DD\n*\n* A1 2 7 3 4.5\n*\n* test comment after from station lrud\n A2 A1 48 10 292.0 110.0-42.0 5 10 35 5\n A3 A2 12 5 333.5 153.5 35.0 3 1 15 5\n A4 A3 4 2 0.0 0.0 90.0 3 1 10 10\n *\nDOUG'S DEMISE (50 FT DROP), CHRIS CROSS, CRAWL ABOVE DROP\nPETER QUICK, CHRIS GERACE, PHIL ODEN, CHIP HOPPER - 3-6-81\n *\nFT C DD\n B31 B30 13.7 360.0 360.0 40.0 2 4 6 B30 8 3 5 1.2\nB30sp B30 13.7 s 360.0 360.0 40.0 2 4 6 \n";
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)('cdata.fr', data);
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: 'test comment after from station lrud',
222
- fromLruds: {
223
- left: _unitized.Unitize.inches(2),
224
- right: _unitized.Unitize.inches(7),
225
- up: _unitized.Unitize.inches(3),
226
- down: _unitized.Unitize.inches(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
- fromLruds: {
296
- left: _unitized.Unitize.feet(8),
297
- right: _unitized.Unitize.feet(3),
298
- up: _unitized.Unitize.feet(5),
299
- down: _unitized.Unitize.feet(1.2)
300
- },
301
- toLruds: {
302
- left: _unitized.Unitize.feet(2),
303
- right: _unitized.Unitize.feet(4),
304
- up: _unitized.Unitize.feet(6),
305
- down: null
306
- }
307
- }, {
308
- backsightAzimuth: _unitized.Unitize.degrees(0),
309
- backsightInclination: null,
310
- comment: null,
311
- distance: _unitized.Unitize.feet(13.7),
312
- excludeDistance: true,
313
- isSplay: true,
314
- from: 'B30',
315
- frontsightAzimuth: _unitized.Unitize.degrees(0),
316
- frontsightInclination: _unitized.Unitize.degrees(40),
317
- kind: ' ',
318
- to: 'B30sp',
319
- toLruds: {
320
- left: _unitized.Unitize.feet(2),
321
- right: _unitized.Unitize.feet(4),
322
- up: _unitized.Unitize.feet(6),
323
- down: null
324
- }
325
- }]
326
- }]
327
- });
328
- case 4:
329
- case "end":
330
- return _context.stop();
331
- }
332
- }, _callee);
333
- })));
334
- (0, _mocha.it)('horizontal shots', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
335
- var data, parsed;
336
- return _regenerator["default"].wrap(function _callee2$(_context2) {
337
- while (1) switch (_context2.prev = _context2.next) {
338
- case 0:
339
- data = "blah\n *\n *\nTEST\n *\nFT C DD\n E22 E21 36.2H 338.5 340.0 1.0 12 2 15 15\n";
340
- _context2.next = 3;
341
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
342
- case 3:
343
- parsed = _context2.sent;
344
- (0, _chai.expect)(parsed.trips[0].shots[0]).to.deep.equal({
345
- from: 'E21',
346
- to: 'E22',
347
- kind: _FrcsShot.FrcsShotKind.Horizontal,
348
- distance: _unitized.Unitize.feet(Math.sqrt(36.2 * 36.2 + 1)),
349
- horizontalDistance: _unitized.Unitize.feet(36.2),
350
- verticalDistance: _unitized.Unitize.feet(1),
351
- frontsightAzimuth: _unitized.Unitize.degrees(338.5),
352
- backsightAzimuth: _unitized.Unitize.degrees(340),
353
- frontsightInclination: _unitized.Angle.atan2(1, 36.2),
354
- backsightInclination: null,
355
- excludeDistance: false,
356
- comment: null,
357
- toLruds: {
358
- left: _unitized.Unitize.feet(12),
359
- right: _unitized.Unitize.feet(2),
360
- up: _unitized.Unitize.feet(15),
361
- down: _unitized.Unitize.feet(15)
362
- }
363
- });
364
- case 5:
365
- case "end":
366
- return _context2.stop();
367
- }
368
- }, _callee2);
369
- })));
370
- (0, _mocha.it)('horizontal feet and inches shots', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
371
- var data, parsed;
372
- return _regenerator["default"].wrap(function _callee3$(_context3) {
373
- while (1) switch (_context3.prev = _context3.next) {
374
- case 0:
375
- data = "blah\n *\n *\nTEST\n *\nFI C DD\n A27 A26 16 9H 345.0 163.0 -1.0 0 3 5 4\n";
376
- _context3.next = 3;
377
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
378
- case 3:
379
- parsed = _context3.sent;
380
- (0, _chai.expect)(parsed.trips[0].shots[0]).to.deep.equal({
381
- from: 'A26',
382
- to: 'A27',
383
- kind: _FrcsShot.FrcsShotKind.Horizontal,
384
- distance: _unitized.Unitize.feet(Math.sqrt(16.75 * 16.75 + 1)),
385
- horizontalDistance: _unitized.Unitize.inches(16 * 12 + 9),
386
- verticalDistance: _unitized.Unitize.feet(-1),
387
- frontsightAzimuth: _unitized.Unitize.degrees(345),
388
- backsightAzimuth: _unitized.Unitize.degrees(163),
389
- frontsightInclination: _unitized.Angle.atan2(-1, 16.75),
390
- backsightInclination: null,
391
- excludeDistance: false,
392
- comment: null,
393
- toLruds: {
394
- left: _unitized.Unitize.feet(0),
395
- right: _unitized.Unitize.feet(3),
396
- up: _unitized.Unitize.feet(5),
397
- down: _unitized.Unitize.feet(4)
398
- }
399
- });
400
- case 5:
401
- case "end":
402
- return _context3.stop();
403
- }
404
- }, _callee3);
405
- })));
406
- (0, _mocha.it)('diagonal shots', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
407
- var data, parsed;
408
- return _regenerator["default"].wrap(function _callee4$(_context4) {
409
- while (1) switch (_context4.prev = _context4.next) {
410
- case 0:
411
- data = "blah\n *\n *\nTEST\n *\nFT C DD\n E37 E36 31.6D 231.0 232.0 2.0 3 10 20 32\n";
412
- _context4.next = 3;
413
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
414
- case 3:
415
- parsed = _context4.sent;
416
- (0, _chai.expect)(parsed.trips[0].shots[0]).to.deep.equal({
417
- from: 'E36',
418
- to: 'E37',
419
- kind: _FrcsShot.FrcsShotKind.Diagonal,
420
- distance: _unitized.Unitize.feet(31.6),
421
- verticalDistance: _unitized.Unitize.feet(2),
422
- frontsightAzimuth: _unitized.Unitize.degrees(231),
423
- backsightAzimuth: _unitized.Unitize.degrees(232),
424
- frontsightInclination: _unitized.Angle.asin(2 / 31.6),
425
- backsightInclination: null,
426
- excludeDistance: false,
427
- comment: null,
428
- toLruds: {
429
- left: _unitized.Unitize.feet(3),
430
- right: _unitized.Unitize.feet(10),
431
- up: _unitized.Unitize.feet(20),
432
- down: _unitized.Unitize.feet(32)
433
- }
434
- });
435
- case 5:
436
- case "end":
437
- return _context4.stop();
438
- }
439
- }, _callee4);
440
- })));
441
- (0, _mocha.it)('invalid distance unit', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
442
- var data;
443
- return _regenerator["default"].wrap(function _callee5$(_context5) {
444
- while (1) switch (_context5.prev = _context5.next) {
445
- case 0:
446
- data = "blah\n *\n *\nTEST\n * \nFJ C DD\n";
447
- _context5.t0 = _chai.expect;
448
- _context5.next = 4;
449
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
450
- case 4:
451
- _context5.t1 = _context5.sent;
452
- (0, _context5.t0)(_context5.t1).to.deep.equal({
453
- cave: 'blah',
454
- errors: [new _parseSegment.SegmentParseError('Invalid distance unit', new _parseSegment.Segment({
455
- value: 'FJ C DD',
456
- source: 'cdata.fr',
457
- startLine: 5,
458
- startCol: 0
459
- }).substring(0, 2))],
460
- location: null,
461
- trips: [{
462
- header: {
463
- azimuthUnit: _unitized.Angle.degrees,
464
- backsightAzimuthCorrected: true,
465
- backsightInclinationCorrected: false,
466
- comment: null,
467
- date: undefined,
468
- distanceUnit: _unitized.Length.feet,
469
- hasBacksightAzimuth: true,
470
- hasBacksightInclination: false,
471
- inclinationUnit: _unitized.Angle.degrees,
472
- name: 'TEST',
473
- section: undefined,
474
- team: undefined
475
- },
476
- shots: []
477
- }]
478
- });
479
- case 6:
480
- case "end":
481
- return _context5.stop();
482
- }
483
- }, _callee5);
484
- })));
485
- (0, _mocha.it)('meters', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
486
- var data;
487
- return _regenerator["default"].wrap(function _callee6$(_context6) {
488
- while (1) switch (_context6.prev = _context6.next) {
489
- case 0:
490
- data = "blah\n *\n *\nTEST\n * \nMT CC DD\n E37 E36 31.6 231.0 232.0 2.0 3.0 3 10 20 32\n";
491
- _context6.t0 = _chai.expect;
492
- _context6.next = 4;
493
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
494
- case 4:
495
- _context6.t1 = _context6.sent;
496
- (0, _context6.t0)(_context6.t1).to.deep.equal({
497
- cave: 'blah',
498
- errors: [],
499
- location: null,
500
- trips: [{
501
- header: {
502
- azimuthUnit: _unitized.Angle.degrees,
503
- backsightAzimuthCorrected: true,
504
- backsightInclinationCorrected: true,
505
- comment: null,
506
- date: undefined,
507
- distanceUnit: _unitized.Length.meters,
508
- hasBacksightAzimuth: true,
509
- hasBacksightInclination: true,
510
- inclinationUnit: _unitized.Angle.degrees,
511
- name: 'TEST',
512
- section: undefined,
513
- team: undefined
514
- },
515
- shots: [{
516
- from: 'E36',
517
- to: 'E37',
518
- kind: _FrcsShot.FrcsShotKind.Normal,
519
- distance: _unitized.Unitize.meters(31.6),
520
- frontsightAzimuth: _unitized.Unitize.degrees(231),
521
- backsightAzimuth: _unitized.Unitize.degrees(232),
522
- frontsightInclination: _unitized.Unitize.degrees(2),
523
- backsightInclination: _unitized.Unitize.degrees(3),
524
- excludeDistance: false,
525
- comment: null,
526
- toLruds: {
527
- left: _unitized.Unitize.meters(3),
528
- right: _unitized.Unitize.meters(10),
529
- up: _unitized.Unitize.meters(20),
530
- down: _unitized.Unitize.meters(32)
531
- }
532
- }]
533
- }]
534
- });
535
- case 6:
536
- case "end":
537
- return _context6.stop();
538
- }
539
- }, _callee6);
540
- })));
541
- (0, _mocha.it)('exclude length', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
542
- var data, parsed;
543
- return _regenerator["default"].wrap(function _callee7$(_context7) {
544
- while (1) switch (_context7.prev = _context7.next) {
545
- case 0:
546
- data = "blah\n *\n *\nTEST\n * \nMT CC DD\n E37 E36 31.6 * 231.0 232.0 2.0 3.0 3 10 20 32\n";
547
- _context7.next = 3;
548
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
549
- case 3:
550
- parsed = _context7.sent;
551
- (0, _chai.expect)(parsed.trips[0].shots[0]).to.deep.equal({
552
- from: 'E36',
553
- to: 'E37',
554
- kind: _FrcsShot.FrcsShotKind.Normal,
555
- distance: _unitized.Unitize.meters(31.6),
556
- frontsightAzimuth: _unitized.Unitize.degrees(231),
557
- backsightAzimuth: _unitized.Unitize.degrees(232),
558
- frontsightInclination: _unitized.Unitize.degrees(2),
559
- backsightInclination: _unitized.Unitize.degrees(3),
560
- excludeDistance: true,
561
- comment: null,
562
- toLruds: {
563
- left: _unitized.Unitize.meters(3),
564
- right: _unitized.Unitize.meters(10),
565
- up: _unitized.Unitize.meters(20),
566
- down: _unitized.Unitize.meters(32)
567
- }
568
- });
569
- case 5:
570
- case "end":
571
- return _context7.stop();
572
- }
573
- }, _callee7);
574
- })));
575
- (0, _mocha.it)('negative LRUD', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
576
- var data, parsed;
577
- return _regenerator["default"].wrap(function _callee8$(_context8) {
578
- while (1) switch (_context8.prev = _context8.next) {
579
- case 0:
580
- data = "blah\n *\n *\nTEST\n * \nMT CC DD\n E37 E36 31.6 231.0 232.0 2.0 3.0 -3 10 20 32\n";
581
- _context8.next = 3;
582
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
583
- case 3:
584
- parsed = _context8.sent;
585
- (0, _chai.expect)(parsed.trips[0].shots[0]).to.deep.equal({
586
- from: 'E36',
587
- to: 'E37',
588
- kind: _FrcsShot.FrcsShotKind.Normal,
589
- distance: _unitized.Unitize.meters(31.6),
590
- frontsightAzimuth: _unitized.Unitize.degrees(231),
591
- backsightAzimuth: _unitized.Unitize.degrees(232),
592
- frontsightInclination: _unitized.Unitize.degrees(2),
593
- backsightInclination: _unitized.Unitize.degrees(3),
594
- excludeDistance: false,
595
- comment: null,
596
- toLruds: {
597
- left: null,
598
- right: _unitized.Unitize.meters(10),
599
- up: _unitized.Unitize.meters(20),
600
- down: _unitized.Unitize.meters(32)
601
- }
602
- });
603
- case 5:
604
- case "end":
605
- return _context8.stop();
606
- }
607
- }, _callee8);
608
- })));
609
- (0, _mocha.it)('- for no backsight', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
610
- var data, parsed;
611
- return _regenerator["default"].wrap(function _callee9$(_context9) {
612
- while (1) switch (_context9.prev = _context9.next) {
613
- case 0:
614
- data = "blah\n *\n *\nTEST\n * \nMT B- DD \n ";
615
- _context9.next = 3;
616
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
617
- case 3:
618
- parsed = _context9.sent;
619
- (0, _chai.expect)(parsed.trips[0].header).to.deep.equal({
620
- name: 'TEST',
621
- comment: null,
622
- section: undefined,
623
- date: undefined,
624
- team: undefined,
625
- distanceUnit: _unitized.Length.meters,
626
- azimuthUnit: _unitized.Angle.degrees,
627
- inclinationUnit: _unitized.Angle.degrees,
628
- backsightAzimuthCorrected: false,
629
- backsightInclinationCorrected: false,
630
- hasBacksightAzimuth: true,
631
- hasBacksightInclination: false
632
- });
633
- case 5:
634
- case "end":
635
- return _context9.stop();
636
- }
637
- }, _callee9);
638
- })));
639
- (0, _mocha.it)('missing both frontsight and backsight inclination', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
640
- var data, parsed;
641
- return _regenerator["default"].wrap(function _callee10$(_context10) {
642
- while (1) switch (_context10.prev = _context10.next) {
643
- case 0:
644
- data = "blah\n *\n *\nTEST\n * \nMT B- DD \n E37 E36 31.6 231.0 232.0 -3 10 20 32\n ";
645
- _context10.next = 3;
646
- return (0, _index.parseFrcsSurveyFile)('cdata.fr', data);
647
- case 3:
648
- parsed = _context10.sent;
649
- (0, _chai.expect)(parsed.trips[0].shots[0]).to.deep.equal({
650
- from: 'E36',
651
- to: 'E37',
652
- kind: _FrcsShot.FrcsShotKind.Normal,
653
- distance: _unitized.Unitize.meters(31.6),
654
- frontsightAzimuth: _unitized.Unitize.degrees(231),
655
- backsightAzimuth: _unitized.Unitize.degrees(232),
656
- frontsightInclination: _unitized.Unitize.degrees(0),
657
- backsightInclination: null,
658
- excludeDistance: false,
659
- comment: null,
660
- toLruds: {
661
- left: null,
662
- right: _unitized.Unitize.meters(10),
663
- up: _unitized.Unitize.meters(20),
664
- down: _unitized.Unitize.meters(32)
665
- }
666
- });
667
- case 5:
668
- case "end":
669
- return _context10.stop();
670
- }
671
- }, _callee10);
672
- })));
673
- });