@speleotica/frcs2walls 1.2.0 → 1.3.0-beta.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.
@@ -0,0 +1,21 @@
1
+ import { FrcsSurveyFile, FrcsTripSummaryFile } from '@speleotica/frcsdata';
2
+ import { FixDirective } from "@speleotica/walls/srv/WallsSrvFile.js";
3
+ import { WallsWpjFile, Georeference } from "@speleotica/walls/wpj/index.js";
4
+ export type InputCave = {
5
+ subdir: string;
6
+ namePrefix?: string;
7
+ survey: FrcsSurveyFile;
8
+ summaries?: FrcsTripSummaryFile;
9
+ fixedStations?: FixDirective[];
10
+ georeference?: Georeference;
11
+ };
12
+ export default function convertToWalls({
13
+ title,
14
+ name,
15
+ caves
16
+ }: {
17
+ title: string;
18
+ name?: string;
19
+ caves: InputCave[];
20
+ }): WallsWpjFile;
21
+ //# sourceMappingURL=convertToWalls.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertToWalls.d.mts","names":["FrcsSurveyFile","FrcsTripSummaryFile","FixDirective","WallsWpjFile","Georeference","InputCave","subdir","namePrefix","survey","summaries","fixedStations","georeference","convertToWalls","title","name","caves"],"sources":["src/convertToWalls.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,cAAc,EAGdC,mBAAmB,QACd,sBAAsB;AAE7B,SAOEC,YAAY;AAYd,SACEC,YAAY,EAKZC,YAAY;AAId,OAAM,KAAMC,SAAS,GAAG;EACtBC,MAAM,EAAE,MAAM;EACdC,UAAU,CAAC,EAAE,MAAM;EACnBC,MAAM,EAAER,cAAc;EACtBS,SAAS,CAAC,EAAER,mBAAmB;EAC/BS,aAAa,CAAC,EAAER,YAAY,EAAE;EAC9BS,YAAY,CAAC,EAAEP,YAAY;CAC5B;AAOD,eAAc,SAAUQ,cAAcA,CAAC;EACrCC,KAAK;EACLC,IAAI;EACJC;CACD,EAAE;EACDF,KAAK,EAAE,MAAM;EACbC,IAAI,CAAC,EAAE,MAAM;EACbC,KAAK,EAAEV,SAAS,EAAE;CACnB,GAAGF,YAAY","ignoreList":[]}
@@ -1,16 +1,22 @@
1
1
  import { FrcsSurveyFile, FrcsTripSummaryFile } from '@speleotica/frcsdata';
2
- import { FixDirective } from '@speleotica/walls/srv/WallsSrvFile';
3
- import { WallsWpjFile, Georeference } from '@speleotica/walls/wpj';
4
- export declare type InputCave = {
5
- subdir: string;
6
- namePrefix?: string;
7
- survey: FrcsSurveyFile;
8
- summaries?: FrcsTripSummaryFile;
9
- fixedStations?: FixDirective[];
10
- georeference?: Georeference;
2
+ import { FixDirective } from "@speleotica/walls/srv/WallsSrvFile.js";
3
+ import { WallsWpjFile, Georeference } from "@speleotica/walls/wpj/index.js";
4
+ export type InputCave = {
5
+ subdir: string;
6
+ namePrefix?: string;
7
+ survey: FrcsSurveyFile;
8
+ summaries?: FrcsTripSummaryFile;
9
+ fixedStations?: FixDirective[];
10
+ georeference?: Georeference;
11
11
  };
12
- export default function convertToWalls({ title, name, caves, }: {
13
- title: string;
14
- name?: string;
15
- caves: InputCave[];
12
+ declare function convertToWalls({
13
+ title,
14
+ name,
15
+ caves
16
+ }: {
17
+ title: string;
18
+ name?: string;
19
+ caves: InputCave[];
16
20
  }): WallsWpjFile;
21
+ export = convertToWalls;
22
+ //# sourceMappingURL=convertToWalls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertToWalls.d.ts","names":["FrcsSurveyFile","FrcsTripSummaryFile","FixDirective","WallsWpjFile","Georeference","InputCave","subdir","namePrefix","survey","summaries","fixedStations","georeference","convertToWalls","title","name","caves"],"sources":["src/convertToWalls.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,cAAc,EAGdC,mBAAmB,QACd,sBAAsB;AAE7B,SAOEC,YAAY;AAYd,SACEC,YAAY,EAKZC,YAAY;AAId,OAAM,KAAMC,SAAS,GAAG;EACtBC,MAAM,EAAE,MAAM;EACdC,UAAU,CAAC,EAAE,MAAM;EACnBC,MAAM,EAAER,cAAc;EACtBS,SAAS,CAAC,EAAER,mBAAmB;EAC/BS,aAAa,CAAC,EAAER,YAAY,EAAE;EAC9BS,YAAY,CAAC,EAAEP,YAAY;CAC5B;AAOa,iBAAUQ,cAAcA,CAAC;EACrCC,KAAK;EACLC,IAAI;EACJC;CACD,EAAE;EACDF,KAAK,EAAE,MAAM;EACbC,IAAI,CAAC,EAAE,MAAM;EACbC,KAAK,EAAEV,SAAS,EAAE;CACnB,GAAGF,YAAY;AAiBf,SAAAS,cAAA","ignoreList":[]}
package/convertToWalls.js CHANGED
@@ -1,229 +1,181 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = convertToWalls;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _frcsdata = require("@speleotica/frcsdata");
13
-
6
+ exports.default = convertToWalls;
14
7
  var _unitized = require("@speleotica/unitized");
15
-
16
- var _WallsSrvFile = require("@speleotica/walls/srv/WallsSrvFile");
17
-
18
- var _wpj = require("@speleotica/walls/wpj");
19
-
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
-
24
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
25
-
26
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
-
28
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
29
-
30
- function convertToWalls(_ref) {
31
- var title = _ref.title,
32
- name = _ref.name,
33
- caves = _ref.caves;
34
-
8
+ var _WallsSrvFile = require("@speleotica/walls/srv/WallsSrvFile.js");
9
+ var _index = require("@speleotica/walls/wpj/index.js");
10
+ const commonOptions = {
11
+ reviewDistanceUnit: _unitized.Length.feet,
12
+ defaultViewAfterCompilation: _index.View.North
13
+ };
14
+ function convertToWalls({
15
+ title,
16
+ name,
17
+ caves
18
+ }) {
35
19
  if (caves.length === 1) {
36
- var _root = convertCave(caves[0]);
37
-
38
- _root.title = title;
39
- _root.name = name;
20
+ const root = convertCave(caves[0]);
21
+ root.title = title;
22
+ root.name = name;
40
23
  return {
41
- root: _root
24
+ root
42
25
  };
43
26
  }
44
-
45
- var root = (0, _wpj.wallsProjectBook)(title, name);
46
- root.reviewDistanceUnit = _unitized.Length.feet;
47
-
48
- var _iterator = _createForOfIteratorHelper(caves),
49
- _step;
50
-
51
- try {
52
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
53
- var cave = _step.value;
54
- root.children.push(convertCave(cave, {
55
- multicave: true
56
- }));
57
- }
58
- } catch (err) {
59
- _iterator.e(err);
60
- } finally {
61
- _iterator.f();
62
- }
63
-
27
+ const root = (0, _index.wallsProjectBook)(title, name, null, caves.map(cave => convertCave(cave, {
28
+ multicave: true
29
+ })), {
30
+ ...commonOptions
31
+ });
64
32
  return {
65
- root: root
33
+ root
66
34
  };
67
35
  }
68
-
69
- function convertCave(_ref2) {
70
- var subdir = _ref2.subdir,
71
- namePrefix = _ref2.namePrefix,
72
- survey = _ref2.survey,
73
- summaries = _ref2.summaries,
74
- fixedStations = _ref2.fixedStations,
75
- georeference = _ref2.georeference;
76
-
77
- var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
78
- multicave = _ref3.multicave;
79
-
36
+ function convertCave({
37
+ subdir,
38
+ namePrefix,
39
+ survey,
40
+ summaries,
41
+ fixedStations,
42
+ georeference
43
+ }, {
44
+ multicave
45
+ } = {}) {
80
46
  if (namePrefix == null) namePrefix = multicave ? subdir : '';
81
- var book = (0, _wpj.wallsProjectBook)(survey.cave || subdir, null, subdir, [], _objectSpread({
82
- reviewDistanceUnit: _unitized.Length.feet,
83
- georeference: georeference
84
- }, multicave && {
85
- options: "PREFIX=".concat(subdir)
86
- }));
87
-
47
+ const book = (0, _index.wallsProjectBook)(survey.cave || subdir, namePrefix, subdir, [], {
48
+ ...commonOptions,
49
+ georeference,
50
+ ...(multicave && {
51
+ options: `PREFIX=${subdir}`
52
+ })
53
+ });
88
54
  if (fixedStations) {
89
- book.children.push((0, _wpj.wallsProjectSurvey)('Fixed Stations', "".concat(namePrefix, "fix"), null, {
55
+ book.children.push((0, _index.wallsProjectSurvey)('Fixed Stations', `${namePrefix}fix`, null, {
90
56
  content: {
91
57
  lines: fixedStations
92
58
  }
93
59
  }));
94
60
  }
95
-
96
- for (var tripIndex = 0; tripIndex < survey.trips.length; tripIndex++) {
97
- var trip = survey.trips[tripIndex];
61
+ for (let tripIndex = 0; tripIndex < survey.trips.length; tripIndex++) {
62
+ const trip = survey.trips[tripIndex];
63
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
98
64
  if (trip == null) continue;
99
- var summary = summaries === null || summaries === void 0 ? void 0 : summaries.tripSummaries[tripIndex];
65
+ const summary = summaries === null || summaries === void 0 ? void 0 : summaries.tripSummaries[tripIndex];
100
66
  book.children.push(convertTrip({
101
- tripIndex: tripIndex,
102
- trip: trip,
103
- summary: summary,
104
- namePrefix: namePrefix
67
+ tripIndex,
68
+ trip,
69
+ summary,
70
+ namePrefix
105
71
  }));
106
72
  }
107
-
108
73
  return book;
109
74
  }
110
-
111
- function convertTrip(_ref4) {
112
- var _summary$tripNumber;
113
-
114
- var tripIndex = _ref4.tripIndex,
115
- trip = _ref4.trip,
116
- summary = _ref4.summary,
117
- namePrefix = _ref4.namePrefix;
118
- var tripNum = (_summary$tripNumber = summary === null || summary === void 0 ? void 0 : summary.tripNumber) !== null && _summary$tripNumber !== void 0 ? _summary$tripNumber : tripIndex + 1;
119
- var _trip$header = trip.header,
120
- name = _trip$header.name,
121
- azimuthUnit = _trip$header.azimuthUnit,
122
- inclinationUnit = _trip$header.inclinationUnit,
123
- backsightAzimuthCorrected = _trip$header.backsightAzimuthCorrected,
124
- backsightInclinationCorrected = _trip$header.backsightInclinationCorrected,
125
- hasBacksightAzimuth = _trip$header.hasBacksightAzimuth,
126
- hasBacksightInclination = _trip$header.hasBacksightInclination;
127
- var team = trip.header.team || (summary === null || summary === void 0 ? void 0 : summary.team);
128
- var distanceUnit = trip.header.distanceUnit;
75
+ function convertTrip({
76
+ tripIndex,
77
+ trip,
78
+ summary,
79
+ namePrefix
80
+ }) {
81
+ const tripNum = (summary === null || summary === void 0 ? void 0 : summary.tripNumber) ?? tripIndex + 1;
82
+ const {
83
+ header: {
84
+ name
85
+ },
86
+ units: {
87
+ azimuthUnit,
88
+ inclinationUnit,
89
+ backsightAzimuthCorrected,
90
+ backsightInclinationCorrected,
91
+ hasBacksightAzimuth,
92
+ hasBacksightInclination
93
+ }
94
+ } = trip;
95
+ const team = trip.header.team || (summary === null || summary === void 0 ? void 0 : summary.team);
96
+ let {
97
+ distanceUnit
98
+ } = trip.units;
129
99
  if (distanceUnit === _unitized.Length.inches) distanceUnit = _unitized.Length.feet;
130
- var date = (summary === null || summary === void 0 ? void 0 : summary.date) || trip.header.date;
131
- var srv = {
132
- lines: [(0, _WallsSrvFile.comment)("".concat(tripNum, " ").concat(name))]
100
+ const date = (summary === null || summary === void 0 ? void 0 : summary.date) || trip.header.date;
101
+ const srv = {
102
+ lines: [(0, _WallsSrvFile.comment)(`${tripNum} ${name}`)]
133
103
  };
134
-
135
104
  if (team) {
136
- srv.lines.push((0, _WallsSrvFile.comment)(team.join(team.find(function (t) {
137
- return /,/.test(t);
138
- }) ? '; ' : ', ')));
105
+ srv.lines.push((0, _WallsSrvFile.comment)(team.join(team.find(t => /,/.test(t)) ? '; ' : ', ')));
139
106
  }
140
-
141
107
  if (date) srv.lines.push((0, _WallsSrvFile.dateDirective)(date));
142
- var unitsOptions = [(0, _WallsSrvFile.distanceUnitOption)(distanceUnit), (0, _WallsSrvFile.frontsightAzimuthUnitOption)(azimuthUnit), (0, _WallsSrvFile.frontsightInclinationUnitOption)(inclinationUnit), (0, _WallsSrvFile.lrudStyleOption)(_WallsSrvFile.LrudStyle.ToStationBisector)];
143
-
108
+ const unitsOptions = [(0, _WallsSrvFile.distanceUnitOption)(distanceUnit), (0, _WallsSrvFile.frontsightAzimuthUnitOption)(azimuthUnit), (0, _WallsSrvFile.frontsightInclinationUnitOption)(inclinationUnit), (0, _WallsSrvFile.lrudStyleOption)(_WallsSrvFile.LrudStyle.ToStationBisector)];
144
109
  if (hasBacksightAzimuth) {
145
110
  unitsOptions.push((0, _WallsSrvFile.backsightAzimuthTypeOption)(Boolean(backsightAzimuthCorrected), _unitized.Unitize.degrees(2), false));
146
111
  }
147
-
148
112
  if (hasBacksightInclination) {
149
113
  unitsOptions.push((0, _WallsSrvFile.backsightInclinationTypeOption)(Boolean(backsightInclinationCorrected), _unitized.Unitize.degrees(2), false));
150
114
  }
151
-
152
115
  srv.lines.push((0, _WallsSrvFile.unitsDirective)(unitsOptions));
153
- var lastTapingMethod = _WallsSrvFile.TapingMethod.InstrumentToTarget;
154
-
155
- var _iterator2 = _createForOfIteratorHelper(trip.shots),
156
- _step2;
157
-
158
- try {
159
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
160
- var shot = _step2.value;
161
- var distance = shot.distance;
162
- var kind = shot.kind,
163
- from = shot.from,
164
- to = shot.to,
165
- horizontalDistance = shot.horizontalDistance,
166
- verticalDistance = shot.verticalDistance,
167
- backsightAzimuth = shot.backsightAzimuth,
168
- frontsightInclination = shot.frontsightInclination,
169
- backsightInclination = shot.backsightInclination,
170
- fromLruds = shot.fromLruds,
171
- toLruds = shot.toLruds,
172
- comment = shot.comment;
173
- var frontsightAzimuth = shot.frontsightAzimuth;
174
-
175
- if (frontsightAzimuth == null && backsightAzimuth == null && (frontsightInclination != null && frontsightInclination.abs().get(_unitized.Angle.degrees) !== 90 || backsightInclination != null && backsightInclination.abs().get(_unitized.Angle.degrees) !== 90)) {
176
- frontsightAzimuth = _unitized.Unitize.degrees(0);
177
- }
178
-
179
- if (kind === _frcsdata.FrcsShotKind.Horizontal) {
180
- if (!horizontalDistance) {
181
- throw new Error("horizontalDistance must be provided when kind is horizontal");
182
- }
183
-
184
- distance = horizontalDistance;
185
- }
186
-
187
- var tapingMethod = kind === _frcsdata.FrcsShotKind.Diagonal ? _WallsSrvFile.TapingMethod.InstrumentToStation : _WallsSrvFile.TapingMethod.InstrumentToTarget;
188
-
189
- if (tapingMethod !== lastTapingMethod) {
190
- srv.lines.push((0, _WallsSrvFile.unitsDirective)([(0, _WallsSrvFile.tapingMethodOption)(tapingMethod)]));
191
- lastTapingMethod = tapingMethod;
192
- }
193
-
194
- if (from && fromLruds) {
195
- var left = fromLruds.left,
196
- right = fromLruds.right,
197
- up = fromLruds.up,
198
- down = fromLruds.down;
199
- srv.lines.push((0, _WallsSrvFile.stationLruds)(from, [left, right, up, down]));
116
+ let lastTapingMethod = _WallsSrvFile.TapingMethod.InstrumentToTarget;
117
+ for (const shot of trip.shots) {
118
+ let {
119
+ distance
120
+ } = shot;
121
+ const {
122
+ specialKind,
123
+ from,
124
+ to,
125
+ horizontalDistance,
126
+ verticalDistance,
127
+ backsightAzimuth,
128
+ frontsightInclination,
129
+ backsightInclination,
130
+ fromLruds,
131
+ toLruds,
132
+ comment
133
+ } = shot;
134
+ let {
135
+ frontsightAzimuth
136
+ } = shot;
137
+ if (frontsightAzimuth == null && backsightAzimuth == null && (frontsightInclination != null && frontsightInclination.abs().get(_unitized.Angle.degrees) !== 90 || backsightInclination != null && backsightInclination.abs().get(_unitized.Angle.degrees) !== 90)) {
138
+ frontsightAzimuth = _unitized.Unitize.degrees(0);
139
+ }
140
+ if (specialKind === 'horizontal') {
141
+ if (!horizontalDistance) {
142
+ throw new Error(`horizontalDistance must be provided when kind is horizontal`);
200
143
  }
201
-
202
- if (from && to) {
203
- var _verticalDistance$neg;
204
-
205
- var wallsShot = (0, _WallsSrvFile.compassAndTapeShot)(from, to, distance, backsightAzimuth ? [frontsightAzimuth, backsightAzimuth] : frontsightAzimuth, kind === _frcsdata.FrcsShotKind.Normal ? backsightInclination ? [frontsightInclination, backsightInclination] : frontsightInclination : _unitized.Unitize.degrees(0), toLruds ? [toLruds.left, toLruds.right, toLruds.up, toLruds.down] : undefined, _objectSpread({}, kind !== _frcsdata.FrcsShotKind.Normal && {
206
- targetHeight: verticalDistance === null || verticalDistance === void 0 ? void 0 : (_verticalDistance$neg = verticalDistance.negate) === null || _verticalDistance$neg === void 0 ? void 0 : _verticalDistance$neg.call(verticalDistance)
207
- }));
208
-
209
- if (comment && /\n/m.test(comment)) {
210
- srv.lines.push((0, _WallsSrvFile.comment)(comment));
211
- } else {
212
- wallsShot.comment = comment;
213
- }
214
-
215
- srv.lines.push(wallsShot);
144
+ distance = horizontalDistance;
145
+ }
146
+ const tapingMethod = specialKind === 'diagonal' ? _WallsSrvFile.TapingMethod.InstrumentToStation : _WallsSrvFile.TapingMethod.InstrumentToTarget;
147
+ if (tapingMethod !== lastTapingMethod) {
148
+ srv.lines.push((0, _WallsSrvFile.unitsDirective)([(0, _WallsSrvFile.tapingMethodOption)(tapingMethod)]));
149
+ lastTapingMethod = tapingMethod;
150
+ }
151
+ if (from && fromLruds) {
152
+ const {
153
+ left,
154
+ right,
155
+ up,
156
+ down
157
+ } = fromLruds;
158
+ srv.lines.push((0, _WallsSrvFile.stationLruds)(from, [left, right, up, down]));
159
+ }
160
+ if (from && to) {
161
+ const wallsShot = (0, _WallsSrvFile.compassAndTapeShot)(from, to, distance, backsightAzimuth ? [frontsightAzimuth, backsightAzimuth] : frontsightAzimuth, !specialKind ? backsightInclination ? [frontsightInclination, backsightInclination] : frontsightInclination : _unitized.Unitize.degrees(0), toLruds ? [toLruds.left, toLruds.right, toLruds.up, toLruds.down] : undefined, {
162
+ ...(specialKind && {
163
+ targetHeight: verticalDistance === null || verticalDistance === void 0 ? void 0 : verticalDistance.negate()
164
+ })
165
+ });
166
+ if (comment && /\n/m.test(comment)) {
167
+ srv.lines.push((0, _WallsSrvFile.comment)(comment));
168
+ } else {
169
+ wallsShot.comment = comment;
216
170
  }
171
+ srv.lines.push(wallsShot);
217
172
  }
218
- } catch (err) {
219
- _iterator2.e(err);
220
- } finally {
221
- _iterator2.f();
222
173
  }
223
-
224
- return (0, _wpj.wallsProjectSurvey)("".concat(tripNum, " ").concat(name), "".concat(namePrefix).concat(tripNum), null, {
174
+ return (0, _index.wallsProjectSurvey)(`${tripNum} ${name}`, `${namePrefix}${tripNum}`, null, {
225
175
  content: srv,
226
176
  nameDefinesSegment: true,
227
177
  reviewDistanceUnit: _unitized.Length.feet
228
178
  });
229
- }
179
+ }
180
+ module.exports = exports.default;
181
+ //# sourceMappingURL=convertToWalls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertToWalls.js","names":["_unitized","require","_WallsSrvFile","_index","commonOptions","reviewDistanceUnit","Length","feet","defaultViewAfterCompilation","View","North","convertToWalls","title","name","caves","length","root","convertCave","wallsProjectBook","map","cave","multicave","subdir","namePrefix","survey","summaries","fixedStations","georeference","book","options","children","push","wallsProjectSurvey","content","lines","tripIndex","trips","trip","summary","tripSummaries","convertTrip","tripNum","tripNumber","header","units","azimuthUnit","inclinationUnit","backsightAzimuthCorrected","backsightInclinationCorrected","hasBacksightAzimuth","hasBacksightInclination","team","distanceUnit","inches","date","srv","commentLine","join","find","t","test","dateDirective","unitsOptions","distanceUnitOption","frontsightAzimuthUnitOption","frontsightInclinationUnitOption","lrudStyleOption","LrudStyle","ToStationBisector","backsightAzimuthTypeOption","Boolean","Unitize","degrees","backsightInclinationTypeOption","unitsDirective","lastTapingMethod","TapingMethod","InstrumentToTarget","shot","shots","distance","specialKind","from","to","horizontalDistance","verticalDistance","backsightAzimuth","frontsightInclination","backsightInclination","fromLruds","toLruds","comment","frontsightAzimuth","abs","get","Angle","Error","tapingMethod","InstrumentToStation","tapingMethodOption","left","right","up","down","stationLruds","wallsShot","compassAndTapeShot","undefined","targetHeight","negate","nameDefinesSegment","module","exports","default"],"sources":["src/convertToWalls.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAmBA,IAAAE,MAAA,GAAAF,OAAA;AAmBA,MAAMG,aAAa,GAAG;EACpBC,kBAAkB,EAAEC,gBAAM,CAAC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,EACpB,GAAGU,UAAU,GAAGkB,OAAO,EAAE,EACzB,IAAI,EACJ;IACER,OAAO,EAAEsB,GAAG;IACZuD,kBAAkB,EAAE,IAAI;IACxBzG,kBAAkB,EAAEC,gBAAM,CAACC;EAC7B,CACF,CAAC;AACH;AAACwG,MAAA,CAAAC,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,174 @@
1
+ import { Angle, Length, Unitize } from '@speleotica/unitized';
2
+ import { backsightAzimuthTypeOption, backsightInclinationTypeOption, comment as commentLine, compassAndTapeShot, dateDirective, distanceUnitOption, frontsightAzimuthUnitOption, frontsightInclinationUnitOption, LrudStyle, lrudStyleOption, stationLruds, TapingMethod, tapingMethodOption, unitsDirective } from "@speleotica/walls/srv/WallsSrvFile.js";
3
+ import { wallsProjectBook, wallsProjectSurvey, View } from "@speleotica/walls/wpj/index.js";
4
+ const commonOptions = {
5
+ reviewDistanceUnit: Length.feet,
6
+ defaultViewAfterCompilation: View.North
7
+ };
8
+ export default function convertToWalls({
9
+ title,
10
+ name,
11
+ caves
12
+ }) {
13
+ if (caves.length === 1) {
14
+ const root = convertCave(caves[0]);
15
+ root.title = title;
16
+ root.name = name;
17
+ return {
18
+ root
19
+ };
20
+ }
21
+ const root = wallsProjectBook(title, name, null, caves.map(cave => convertCave(cave, {
22
+ multicave: true
23
+ })), {
24
+ ...commonOptions
25
+ });
26
+ return {
27
+ root
28
+ };
29
+ }
30
+ function convertCave({
31
+ subdir,
32
+ namePrefix,
33
+ survey,
34
+ summaries,
35
+ fixedStations,
36
+ georeference
37
+ }, {
38
+ multicave
39
+ } = {}) {
40
+ if (namePrefix == null) namePrefix = multicave ? subdir : '';
41
+ const book = wallsProjectBook(survey.cave || subdir, namePrefix, subdir, [], {
42
+ ...commonOptions,
43
+ georeference,
44
+ ...(multicave && {
45
+ options: `PREFIX=${subdir}`
46
+ })
47
+ });
48
+ if (fixedStations) {
49
+ book.children.push(wallsProjectSurvey('Fixed Stations', `${namePrefix}fix`, null, {
50
+ content: {
51
+ lines: fixedStations
52
+ }
53
+ }));
54
+ }
55
+ for (let tripIndex = 0; tripIndex < survey.trips.length; tripIndex++) {
56
+ const trip = survey.trips[tripIndex];
57
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
58
+ if (trip == null) continue;
59
+ const summary = summaries === null || summaries === void 0 ? void 0 : summaries.tripSummaries[tripIndex];
60
+ book.children.push(convertTrip({
61
+ tripIndex,
62
+ trip,
63
+ summary,
64
+ namePrefix
65
+ }));
66
+ }
67
+ return book;
68
+ }
69
+ function convertTrip({
70
+ tripIndex,
71
+ trip,
72
+ summary,
73
+ namePrefix
74
+ }) {
75
+ const tripNum = (summary === null || summary === void 0 ? void 0 : summary.tripNumber) ?? tripIndex + 1;
76
+ const {
77
+ header: {
78
+ name
79
+ },
80
+ units: {
81
+ azimuthUnit,
82
+ inclinationUnit,
83
+ backsightAzimuthCorrected,
84
+ backsightInclinationCorrected,
85
+ hasBacksightAzimuth,
86
+ hasBacksightInclination
87
+ }
88
+ } = trip;
89
+ const team = trip.header.team || (summary === null || summary === void 0 ? void 0 : summary.team);
90
+ let {
91
+ distanceUnit
92
+ } = trip.units;
93
+ if (distanceUnit === Length.inches) distanceUnit = Length.feet;
94
+ const date = (summary === null || summary === void 0 ? void 0 : summary.date) || trip.header.date;
95
+ const srv = {
96
+ lines: [commentLine(`${tripNum} ${name}`)]
97
+ };
98
+ if (team) {
99
+ srv.lines.push(commentLine(team.join(team.find(t => /,/.test(t)) ? '; ' : ', ')));
100
+ }
101
+ if (date) srv.lines.push(dateDirective(date));
102
+ const unitsOptions = [distanceUnitOption(distanceUnit), frontsightAzimuthUnitOption(azimuthUnit), frontsightInclinationUnitOption(inclinationUnit), lrudStyleOption(LrudStyle.ToStationBisector)];
103
+ if (hasBacksightAzimuth) {
104
+ unitsOptions.push(backsightAzimuthTypeOption(Boolean(backsightAzimuthCorrected), Unitize.degrees(2), false));
105
+ }
106
+ if (hasBacksightInclination) {
107
+ unitsOptions.push(backsightInclinationTypeOption(Boolean(backsightInclinationCorrected), Unitize.degrees(2), false));
108
+ }
109
+ srv.lines.push(unitsDirective(unitsOptions));
110
+ let lastTapingMethod = TapingMethod.InstrumentToTarget;
111
+ for (const shot of trip.shots) {
112
+ let {
113
+ distance
114
+ } = shot;
115
+ const {
116
+ specialKind,
117
+ from,
118
+ to,
119
+ horizontalDistance,
120
+ verticalDistance,
121
+ backsightAzimuth,
122
+ frontsightInclination,
123
+ backsightInclination,
124
+ fromLruds,
125
+ toLruds,
126
+ comment
127
+ } = shot;
128
+ let {
129
+ frontsightAzimuth
130
+ } = shot;
131
+ if (frontsightAzimuth == null && backsightAzimuth == null && (frontsightInclination != null && frontsightInclination.abs().get(Angle.degrees) !== 90 || backsightInclination != null && backsightInclination.abs().get(Angle.degrees) !== 90)) {
132
+ frontsightAzimuth = Unitize.degrees(0);
133
+ }
134
+ if (specialKind === 'horizontal') {
135
+ if (!horizontalDistance) {
136
+ throw new Error(`horizontalDistance must be provided when kind is horizontal`);
137
+ }
138
+ distance = horizontalDistance;
139
+ }
140
+ const tapingMethod = specialKind === 'diagonal' ? TapingMethod.InstrumentToStation : TapingMethod.InstrumentToTarget;
141
+ if (tapingMethod !== lastTapingMethod) {
142
+ srv.lines.push(unitsDirective([tapingMethodOption(tapingMethod)]));
143
+ lastTapingMethod = tapingMethod;
144
+ }
145
+ if (from && fromLruds) {
146
+ const {
147
+ left,
148
+ right,
149
+ up,
150
+ down
151
+ } = fromLruds;
152
+ srv.lines.push(stationLruds(from, [left, right, up, down]));
153
+ }
154
+ if (from && to) {
155
+ const wallsShot = compassAndTapeShot(from, to, distance, backsightAzimuth ? [frontsightAzimuth, backsightAzimuth] : frontsightAzimuth, !specialKind ? backsightInclination ? [frontsightInclination, backsightInclination] : frontsightInclination : Unitize.degrees(0), toLruds ? [toLruds.left, toLruds.right, toLruds.up, toLruds.down] : undefined, {
156
+ ...(specialKind && {
157
+ targetHeight: verticalDistance === null || verticalDistance === void 0 ? void 0 : verticalDistance.negate()
158
+ })
159
+ });
160
+ if (comment && /\n/m.test(comment)) {
161
+ srv.lines.push(commentLine(comment));
162
+ } else {
163
+ wallsShot.comment = comment;
164
+ }
165
+ srv.lines.push(wallsShot);
166
+ }
167
+ }
168
+ return wallsProjectSurvey(`${tripNum} ${name}`, `${namePrefix}${tripNum}`, null, {
169
+ content: srv,
170
+ nameDefinesSegment: true,
171
+ reviewDistanceUnit: Length.feet
172
+ });
173
+ }
174
+ //# sourceMappingURL=convertToWalls.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertToWalls.mjs","names":["Angle","Length","Unitize","backsightAzimuthTypeOption","backsightInclinationTypeOption","comment","commentLine","compassAndTapeShot","dateDirective","distanceUnitOption","frontsightAzimuthUnitOption","frontsightInclinationUnitOption","LrudStyle","lrudStyleOption","stationLruds","TapingMethod","tapingMethodOption","unitsDirective","wallsProjectBook","wallsProjectSurvey","View","commonOptions","reviewDistanceUnit","feet","defaultViewAfterCompilation","North","convertToWalls","title","name","caves","length","root","convertCave","map","cave","multicave","subdir","namePrefix","survey","summaries","fixedStations","georeference","book","options","children","push","content","lines","tripIndex","trips","trip","summary","tripSummaries","convertTrip","tripNum","tripNumber","header","units","azimuthUnit","inclinationUnit","backsightAzimuthCorrected","backsightInclinationCorrected","hasBacksightAzimuth","hasBacksightInclination","team","distanceUnit","inches","date","srv","join","find","t","test","unitsOptions","ToStationBisector","Boolean","degrees","lastTapingMethod","InstrumentToTarget","shot","shots","distance","specialKind","from","to","horizontalDistance","verticalDistance","backsightAzimuth","frontsightInclination","backsightInclination","fromLruds","toLruds","frontsightAzimuth","abs","get","Error","tapingMethod","InstrumentToStation","left","right","up","down","wallsShot","undefined","targetHeight","negate","nameDefinesSegment"],"sources":["src/convertToWalls.ts"],"sourcesContent":[null],"mappings":"AAMA,SAASA,KAAK,EAAEC,MAAM,EAAEC,OAAO,QAAQ,sBAAsB;AAC7D,SACEC,0BAA0B,EAC1BC,8B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C;MACtC,CAAC,MAAM;QACLiG,SAAS,CAACjG,OAAO,GAAGA,OAAO;MAC7B;MACA+D,GAAG,CAACrB,KAAK,CAACF,IAAI,CAACyD,SAAS,CAAC;IAC3B;EACF;EACA,OAAOnF,kBAAkB,CACvB,GAAGmC,OAAO,IAAI1B,IAAI,EAAE,EACpB,GAAGS,UAAU,GAAGiB,OAAO,EAAE,EACzB,IAAI,EACJ;IACER,OAAO,EAAEsB,GAAG;IACZsC,kBAAkB,EAAE,IAAI;IACxBpF,kBAAkB,EAAErB,MAAM,CAACsB;EAC7B,CACF,CAAC;AACH","ignoreList":[]}
package/index.d.mts ADDED
@@ -0,0 +1,2 @@
1
+ export { default as convertToWalls, type InputCave } from "./convertToWalls.mjs";
2
+ //# sourceMappingURL=index.d.mts.map