@speleotica/frcsdata 4.0.0 → 4.0.1

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 (42) hide show
  1. package/FrcsPlotFile.js +5 -1
  2. package/FrcsPlotShot.js +5 -1
  3. package/FrcsShot.js +4 -5
  4. package/FrcsSurveyFile.js +5 -1
  5. package/FrcsTrip.js +5 -1
  6. package/FrcsTripSummary.js +5 -1
  7. package/FrcsTripSummaryFile.js +5 -1
  8. package/es/FrcsPlotFile.js +5 -1
  9. package/es/FrcsPlotShot.js +5 -1
  10. package/es/FrcsShot.js +5 -6
  11. package/es/FrcsSurveyFile.js +5 -1
  12. package/es/FrcsTrip.js +5 -1
  13. package/es/FrcsTripSummary.js +5 -1
  14. package/es/FrcsTripSummaryFile.js +5 -1
  15. package/es/formatFrcsShot.js +5 -19
  16. package/es/formatFrcsShot.spec.js +8 -17
  17. package/es/index.js +21 -33
  18. package/es/node/index.js +2 -10
  19. package/es/node/parseFrcsPlotFile.spec.js +1 -5
  20. package/es/node/parseFrcsSurveyFile.spec.js +2 -6
  21. package/es/node/parseFrcsTripSummaryFile.spec.js +1 -5
  22. package/es/parseFrcsPlotFile.js +1 -26
  23. package/es/parseFrcsSurveyFile.js +45 -95
  24. package/es/parseFrcsTripSummaryFile.js +1 -12
  25. package/es/string/index.js +2 -9
  26. package/es/string/parseFrcsPlotFile.spec.js +1 -5
  27. package/es/string/parseFrcsSurveyFile.spec.js +8 -14
  28. package/formatFrcsShot.js +5 -19
  29. package/formatFrcsShot.spec.js +4 -15
  30. package/index.js +20 -32
  31. package/node/index.js +1 -9
  32. package/node/parseFrcsPlotFile.spec.js +165 -180
  33. package/node/parseFrcsSurveyFile.spec.js +306 -321
  34. package/node/parseFrcsTripSummaryFile.spec.js +83 -106
  35. package/package.json +15 -15
  36. package/parseFrcsPlotFile.js +224 -318
  37. package/parseFrcsSurveyFile.js +411 -452
  38. package/parseFrcsTripSummaryFile.js +102 -142
  39. package/string/index.js +10 -27
  40. package/string/parseFrcsPlotFile.spec.js +165 -180
  41. package/string/parseFrcsSurveyFile.spec.js +598 -689
  42. package/yarn.lock +1285 -702
@@ -1,196 +1,181 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
-
7
5
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
-
9
6
  var _mocha = require("mocha");
10
-
11
7
  var _index = require("./index");
12
-
13
8
  var _unitized = require("@speleotica/unitized");
14
-
15
9
  var _chai = require("chai");
16
-
17
10
  var data = " 123.182259\n AE20 1 1 0 0 0 153 -257 -51 85 0 20 1\n AE19 1 2 653 402 -548 1046 -587 -174 97 0 200 1\n AE18 2 3 669 449 -3002 995 94 -597 -56 250 0 1\n AE17 3 4 539 1217 -2770 497 47 -298 -28 0 0 1\n AE16 4 5 544 1230 -3441 411 -284 -246 170 60 10 1\n AE15 5 6 1679 1663 -3833 0 0 -282 283 20 10 1\n AE14 6 7 2026 2617 -3730 446 225 -446 -225 0 30 \n AE13 7 8 391 3152 -5788 -111 691 0 0 200 50 1\n AE12 8 9 -1019 2175 -4630 -369 336 221 -201 40 40 1\n AE11 9 10 -1516 1289 -3919 -348 195 610 -342 50 10 1\n";
18
11
  (0, _mocha.describe)('parseFrcsPlotFile', function () {
19
- (0, _mocha.it)('basic test',
20
- /*#__PURE__*/
21
- (0, _asyncToGenerator2["default"])(
22
- /*#__PURE__*/
23
- _regenerator["default"].mark(function _callee() {
12
+ (0, _mocha.it)('basic test', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
24
13
  var parsed;
25
14
  return _regenerator["default"].wrap(function _callee$(_context) {
26
- while (1) {
27
- switch (_context.prev = _context.next) {
28
- case 0:
29
- _context.next = 2;
30
- return (0, _index.parseFrcsPlotFile)('cdata.fr', data);
31
-
32
- case 2:
33
- parsed = _context.sent;
34
- (0, _chai.expect)(parsed).to.deep.equal({
35
- totalLength: _unitized.Unitize.feet(123.182259),
36
- errors: [],
37
- shots: [{
38
- toName: 'AE20',
39
- isSurface: false,
40
- fromNumber: 1,
41
- toNumber: 1,
42
- easting: _unitized.Unitize.feet(0),
43
- northing: _unitized.Unitize.feet(0),
44
- elevation: _unitized.Unitize.feet(0),
45
- leftEasting: _unitized.Unitize.feet(1.53),
46
- leftNorthing: _unitized.Unitize.feet(-2.57),
47
- rightEasting: _unitized.Unitize.feet(-0.51),
48
- rightNorthing: _unitized.Unitize.feet(0.85),
49
- up: _unitized.Unitize.feet(0),
50
- down: _unitized.Unitize.feet(2),
51
- tripNumber: 1
52
- }, {
53
- toName: 'AE19',
54
- isSurface: false,
55
- fromNumber: 1,
56
- toNumber: 2,
57
- easting: _unitized.Unitize.feet(6.53),
58
- northing: _unitized.Unitize.feet(4.02),
59
- elevation: _unitized.Unitize.feet(-5.48),
60
- leftEasting: _unitized.Unitize.feet(10.46),
61
- leftNorthing: _unitized.Unitize.feet(-5.87),
62
- rightEasting: _unitized.Unitize.feet(-1.74),
63
- rightNorthing: _unitized.Unitize.feet(0.97),
64
- up: _unitized.Unitize.feet(0),
65
- down: _unitized.Unitize.feet(20),
66
- tripNumber: 1
67
- }, {
68
- toName: 'AE18',
69
- isSurface: false,
70
- fromNumber: 2,
71
- toNumber: 3,
72
- easting: _unitized.Unitize.feet(6.69),
73
- northing: _unitized.Unitize.feet(4.49),
74
- elevation: _unitized.Unitize.feet(-30.02),
75
- leftEasting: _unitized.Unitize.feet(9.95),
76
- leftNorthing: _unitized.Unitize.feet(0.94),
77
- rightEasting: _unitized.Unitize.feet(-5.97),
78
- rightNorthing: _unitized.Unitize.feet(-0.56),
79
- up: _unitized.Unitize.feet(25),
80
- down: _unitized.Unitize.feet(0),
81
- tripNumber: 1
82
- }, {
83
- toName: 'AE17',
84
- isSurface: false,
85
- fromNumber: 3,
86
- toNumber: 4,
87
- easting: _unitized.Unitize.feet(5.39),
88
- northing: _unitized.Unitize.feet(12.17),
89
- elevation: _unitized.Unitize.feet(-27.7),
90
- leftEasting: _unitized.Unitize.feet(4.97),
91
- leftNorthing: _unitized.Unitize.feet(0.47),
92
- rightEasting: _unitized.Unitize.feet(-2.98),
93
- rightNorthing: _unitized.Unitize.feet(-0.28),
94
- up: _unitized.Unitize.feet(0),
95
- down: _unitized.Unitize.feet(0),
96
- tripNumber: 1
97
- }, {
98
- toName: 'AE16',
99
- isSurface: false,
100
- fromNumber: 4,
101
- toNumber: 5,
102
- easting: _unitized.Unitize.feet(5.44),
103
- northing: _unitized.Unitize.feet(12.3),
104
- elevation: _unitized.Unitize.feet(-34.41),
105
- leftEasting: _unitized.Unitize.feet(4.11),
106
- leftNorthing: _unitized.Unitize.feet(-2.84),
107
- rightEasting: _unitized.Unitize.feet(-2.46),
108
- rightNorthing: _unitized.Unitize.feet(1.7),
109
- up: _unitized.Unitize.feet(6),
110
- down: _unitized.Unitize.feet(1),
111
- tripNumber: 1
112
- }, {
113
- toName: 'AE15',
114
- isSurface: false,
115
- fromNumber: 5,
116
- toNumber: 6,
117
- easting: _unitized.Unitize.feet(16.79),
118
- northing: _unitized.Unitize.feet(16.63),
119
- elevation: _unitized.Unitize.feet(-38.33),
120
- leftEasting: _unitized.Unitize.feet(0),
121
- leftNorthing: _unitized.Unitize.feet(0),
122
- rightEasting: _unitized.Unitize.feet(-2.82),
123
- rightNorthing: _unitized.Unitize.feet(2.83),
124
- up: _unitized.Unitize.feet(2),
125
- down: _unitized.Unitize.feet(1),
126
- tripNumber: 1
127
- }, {
128
- toName: 'AE14',
129
- isSurface: false,
130
- fromNumber: 6,
131
- toNumber: 7,
132
- easting: _unitized.Unitize.feet(20.26),
133
- northing: _unitized.Unitize.feet(26.17),
134
- elevation: _unitized.Unitize.feet(-37.3),
135
- leftEasting: _unitized.Unitize.feet(4.46),
136
- leftNorthing: _unitized.Unitize.feet(2.25),
137
- rightEasting: _unitized.Unitize.feet(-4.46),
138
- rightNorthing: _unitized.Unitize.feet(-2.25),
139
- up: _unitized.Unitize.feet(0),
140
- down: _unitized.Unitize.feet(3),
141
- tripNumber: null
142
- }, {
143
- toName: 'AE13',
144
- isSurface: false,
145
- fromNumber: 7,
146
- toNumber: 8,
147
- easting: _unitized.Unitize.feet(3.91),
148
- northing: _unitized.Unitize.feet(31.52),
149
- elevation: _unitized.Unitize.feet(-57.88),
150
- leftEasting: _unitized.Unitize.feet(-1.11),
151
- leftNorthing: _unitized.Unitize.feet(6.91),
152
- rightEasting: _unitized.Unitize.feet(0),
153
- rightNorthing: _unitized.Unitize.feet(0),
154
- up: _unitized.Unitize.feet(20),
155
- down: _unitized.Unitize.feet(5),
156
- tripNumber: 1
157
- }, {
158
- toName: 'AE12',
159
- isSurface: false,
160
- fromNumber: 8,
161
- toNumber: 9,
162
- easting: _unitized.Unitize.feet(-10.19),
163
- northing: _unitized.Unitize.feet(21.75),
164
- elevation: _unitized.Unitize.feet(-46.3),
165
- leftEasting: _unitized.Unitize.feet(-3.69),
166
- leftNorthing: _unitized.Unitize.feet(3.36),
167
- rightEasting: _unitized.Unitize.feet(2.21),
168
- rightNorthing: _unitized.Unitize.feet(-2.01),
169
- up: _unitized.Unitize.feet(4),
170
- down: _unitized.Unitize.feet(4),
171
- tripNumber: 1
172
- }, {
173
- toName: 'AE11',
174
- isSurface: false,
175
- fromNumber: 9,
176
- toNumber: 10,
177
- easting: _unitized.Unitize.feet(-15.16),
178
- northing: _unitized.Unitize.feet(12.89),
179
- elevation: _unitized.Unitize.feet(-39.19),
180
- leftEasting: _unitized.Unitize.feet(-3.48),
181
- leftNorthing: _unitized.Unitize.feet(1.95),
182
- rightEasting: _unitized.Unitize.feet(6.1),
183
- rightNorthing: _unitized.Unitize.feet(-3.42),
184
- up: _unitized.Unitize.feet(5),
185
- down: _unitized.Unitize.feet(1),
186
- tripNumber: 1
187
- }]
188
- });
189
-
190
- case 4:
191
- case "end":
192
- return _context.stop();
193
- }
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ _context.next = 2;
18
+ return (0, _index.parseFrcsPlotFile)('cdata.fr', data);
19
+ case 2:
20
+ parsed = _context.sent;
21
+ (0, _chai.expect)(parsed).to.deep.equal({
22
+ totalLength: _unitized.Unitize.feet(123.182259),
23
+ errors: [],
24
+ shots: [{
25
+ toName: 'AE20',
26
+ isSurface: false,
27
+ fromNumber: 1,
28
+ toNumber: 1,
29
+ easting: _unitized.Unitize.feet(0),
30
+ northing: _unitized.Unitize.feet(0),
31
+ elevation: _unitized.Unitize.feet(0),
32
+ leftEasting: _unitized.Unitize.feet(1.53),
33
+ leftNorthing: _unitized.Unitize.feet(-2.57),
34
+ rightEasting: _unitized.Unitize.feet(-0.51),
35
+ rightNorthing: _unitized.Unitize.feet(0.85),
36
+ up: _unitized.Unitize.feet(0),
37
+ down: _unitized.Unitize.feet(2),
38
+ tripNumber: 1
39
+ }, {
40
+ toName: 'AE19',
41
+ isSurface: false,
42
+ fromNumber: 1,
43
+ toNumber: 2,
44
+ easting: _unitized.Unitize.feet(6.53),
45
+ northing: _unitized.Unitize.feet(4.02),
46
+ elevation: _unitized.Unitize.feet(-5.48),
47
+ leftEasting: _unitized.Unitize.feet(10.46),
48
+ leftNorthing: _unitized.Unitize.feet(-5.87),
49
+ rightEasting: _unitized.Unitize.feet(-1.74),
50
+ rightNorthing: _unitized.Unitize.feet(0.97),
51
+ up: _unitized.Unitize.feet(0),
52
+ down: _unitized.Unitize.feet(20),
53
+ tripNumber: 1
54
+ }, {
55
+ toName: 'AE18',
56
+ isSurface: false,
57
+ fromNumber: 2,
58
+ toNumber: 3,
59
+ easting: _unitized.Unitize.feet(6.69),
60
+ northing: _unitized.Unitize.feet(4.49),
61
+ elevation: _unitized.Unitize.feet(-30.02),
62
+ leftEasting: _unitized.Unitize.feet(9.95),
63
+ leftNorthing: _unitized.Unitize.feet(0.94),
64
+ rightEasting: _unitized.Unitize.feet(-5.97),
65
+ rightNorthing: _unitized.Unitize.feet(-0.56),
66
+ up: _unitized.Unitize.feet(25),
67
+ down: _unitized.Unitize.feet(0),
68
+ tripNumber: 1
69
+ }, {
70
+ toName: 'AE17',
71
+ isSurface: false,
72
+ fromNumber: 3,
73
+ toNumber: 4,
74
+ easting: _unitized.Unitize.feet(5.39),
75
+ northing: _unitized.Unitize.feet(12.17),
76
+ elevation: _unitized.Unitize.feet(-27.7),
77
+ leftEasting: _unitized.Unitize.feet(4.97),
78
+ leftNorthing: _unitized.Unitize.feet(0.47),
79
+ rightEasting: _unitized.Unitize.feet(-2.98),
80
+ rightNorthing: _unitized.Unitize.feet(-0.28),
81
+ up: _unitized.Unitize.feet(0),
82
+ down: _unitized.Unitize.feet(0),
83
+ tripNumber: 1
84
+ }, {
85
+ toName: 'AE16',
86
+ isSurface: false,
87
+ fromNumber: 4,
88
+ toNumber: 5,
89
+ easting: _unitized.Unitize.feet(5.44),
90
+ northing: _unitized.Unitize.feet(12.3),
91
+ elevation: _unitized.Unitize.feet(-34.41),
92
+ leftEasting: _unitized.Unitize.feet(4.11),
93
+ leftNorthing: _unitized.Unitize.feet(-2.84),
94
+ rightEasting: _unitized.Unitize.feet(-2.46),
95
+ rightNorthing: _unitized.Unitize.feet(1.7),
96
+ up: _unitized.Unitize.feet(6),
97
+ down: _unitized.Unitize.feet(1),
98
+ tripNumber: 1
99
+ }, {
100
+ toName: 'AE15',
101
+ isSurface: false,
102
+ fromNumber: 5,
103
+ toNumber: 6,
104
+ easting: _unitized.Unitize.feet(16.79),
105
+ northing: _unitized.Unitize.feet(16.63),
106
+ elevation: _unitized.Unitize.feet(-38.33),
107
+ leftEasting: _unitized.Unitize.feet(0),
108
+ leftNorthing: _unitized.Unitize.feet(0),
109
+ rightEasting: _unitized.Unitize.feet(-2.82),
110
+ rightNorthing: _unitized.Unitize.feet(2.83),
111
+ up: _unitized.Unitize.feet(2),
112
+ down: _unitized.Unitize.feet(1),
113
+ tripNumber: 1
114
+ }, {
115
+ toName: 'AE14',
116
+ isSurface: false,
117
+ fromNumber: 6,
118
+ toNumber: 7,
119
+ easting: _unitized.Unitize.feet(20.26),
120
+ northing: _unitized.Unitize.feet(26.17),
121
+ elevation: _unitized.Unitize.feet(-37.3),
122
+ leftEasting: _unitized.Unitize.feet(4.46),
123
+ leftNorthing: _unitized.Unitize.feet(2.25),
124
+ rightEasting: _unitized.Unitize.feet(-4.46),
125
+ rightNorthing: _unitized.Unitize.feet(-2.25),
126
+ up: _unitized.Unitize.feet(0),
127
+ down: _unitized.Unitize.feet(3),
128
+ tripNumber: null
129
+ }, {
130
+ toName: 'AE13',
131
+ isSurface: false,
132
+ fromNumber: 7,
133
+ toNumber: 8,
134
+ easting: _unitized.Unitize.feet(3.91),
135
+ northing: _unitized.Unitize.feet(31.52),
136
+ elevation: _unitized.Unitize.feet(-57.88),
137
+ leftEasting: _unitized.Unitize.feet(-1.11),
138
+ leftNorthing: _unitized.Unitize.feet(6.91),
139
+ rightEasting: _unitized.Unitize.feet(0),
140
+ rightNorthing: _unitized.Unitize.feet(0),
141
+ up: _unitized.Unitize.feet(20),
142
+ down: _unitized.Unitize.feet(5),
143
+ tripNumber: 1
144
+ }, {
145
+ toName: 'AE12',
146
+ isSurface: false,
147
+ fromNumber: 8,
148
+ toNumber: 9,
149
+ easting: _unitized.Unitize.feet(-10.19),
150
+ northing: _unitized.Unitize.feet(21.75),
151
+ elevation: _unitized.Unitize.feet(-46.3),
152
+ leftEasting: _unitized.Unitize.feet(-3.69),
153
+ leftNorthing: _unitized.Unitize.feet(3.36),
154
+ rightEasting: _unitized.Unitize.feet(2.21),
155
+ rightNorthing: _unitized.Unitize.feet(-2.01),
156
+ up: _unitized.Unitize.feet(4),
157
+ down: _unitized.Unitize.feet(4),
158
+ tripNumber: 1
159
+ }, {
160
+ toName: 'AE11',
161
+ isSurface: false,
162
+ fromNumber: 9,
163
+ toNumber: 10,
164
+ easting: _unitized.Unitize.feet(-15.16),
165
+ northing: _unitized.Unitize.feet(12.89),
166
+ elevation: _unitized.Unitize.feet(-39.19),
167
+ leftEasting: _unitized.Unitize.feet(-3.48),
168
+ leftNorthing: _unitized.Unitize.feet(1.95),
169
+ rightEasting: _unitized.Unitize.feet(6.1),
170
+ rightNorthing: _unitized.Unitize.feet(-3.42),
171
+ up: _unitized.Unitize.feet(5),
172
+ down: _unitized.Unitize.feet(1),
173
+ tripNumber: 1
174
+ }]
175
+ });
176
+ case 4:
177
+ case "end":
178
+ return _context.stop();
194
179
  }
195
180
  }, _callee);
196
181
  })));