@smarterplan/ngx-smarterplan-core 1.2.14 → 1.2.16

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.
@@ -1961,22 +1961,24 @@ class PoiService {
1961
1961
  var _a;
1962
1962
  return __awaiter(this, void 0, void 0, function* () {
1963
1963
  removeNullKeysFromObject(poi);
1964
- this.awsKinesisAnalytics.getInstance().record(
1965
- // @ts-ignore
1966
- {
1967
- data: {
1968
- eventType: 'Object Creation',
1969
- objectType: 'poi',
1970
- poi: poi,
1971
- user: this.userService.cu,
1972
- timestamp: new Date(),
1973
- floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
1974
- locationId: this.currentSpaceID,
1975
- zoneId: this.zoneIDFilter,
1976
- },
1977
- streamName: 'smarterplanKinesis-analytics',
1978
- // partitionKey: "",
1979
- }, 'AWSKinesis');
1964
+ if (!!this.awsKinesisAnalytics) {
1965
+ this.awsKinesisAnalytics.getInstance().record(
1966
+ // @ts-ignore
1967
+ {
1968
+ data: {
1969
+ eventType: 'Object Creation',
1970
+ objectType: 'poi',
1971
+ poi: poi,
1972
+ user: this.userService.cu,
1973
+ timestamp: new Date(),
1974
+ floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
1975
+ locationId: this.currentSpaceID,
1976
+ zoneId: this.zoneIDFilter,
1977
+ },
1978
+ streamName: 'smarterplanKinesis-analytics',
1979
+ // partitionKey: "",
1980
+ }, 'AWSKinesis');
1981
+ }
1980
1982
  return this.API.__proto__.CreatePOI(poi);
1981
1983
  });
1982
1984
  }
@@ -2925,81 +2927,80 @@ class MatterportService {
2925
2927
  // renderer.shadowMap.type = three.PCFSoftShadowMap;
2926
2928
  // });
2927
2929
  // Wait until Showcase is actually playing....
2928
- this.sdk.Tag.data.subscribe({
2929
- onAdded: function (index, item, collection) {
2930
- return __awaiter(this, void 0, void 0, function* () {
2931
- let thisOpacity = 0.2;
2932
- this.sdk.Tag.editOpacity(index, thisOpacity);
2933
- let source = null;
2934
- try {
2935
- source = yield Promise.all([
2936
- this.sdk.Sensor.createSource(this.sdk.Sensor.SourceType.SPHERE, {
2937
- origin: item.anchorPosition,
2938
- radius: Number(3),
2939
- userData: {
2940
- id: index + '-sphere-source',
2941
- },
2942
- })
2943
- ]);
2944
- }
2945
- catch (e) {
2946
- console.log('could not create Sphere sensor');
2947
- console.error(e);
2948
- }
2949
- if (!source) {
2950
- return;
2951
- }
2952
- let sensor = null;
2953
- try {
2954
- sensor = yield this.sdk.Sensor.createSensor(this.sdk.Sensor.SensorType.CAMERA);
2955
- }
2956
- catch (e) {
2957
- console.log('could not create Camera sensor');
2958
- console.error(e);
2959
- }
2960
- if (!sensor) {
2961
- return;
2962
- }
2963
- sensor.addSource(...source);
2964
- sensor.readings.subscribe({
2965
- onUpdated(source, reading) {
2966
- console.log(thisOpacity);
2967
- let oldOpacity = thisOpacity;
2968
- if (reading.inRange) {
2969
- thisOpacity = 1;
2970
- console.log(index + ' is inRange');
2971
- }
2972
- else if (reading.inView) {
2973
- console.log(index + ' is inView but not inRange');
2974
- thisOpacity = 0.5;
2975
- }
2976
- else {
2977
- thisOpacity = 0.2;
2978
- console.log(index + ' is not inView or inRange');
2979
- }
2980
- this.sdk.Tag.editOpacity(index, thisOpacity);
2981
- /*
2982
- let inc = 0.01;
2983
- if (oldOpacity > thisOpacity) {
2984
- inc = -0.01;
2985
- }
2986
-
2987
- for(var i = oldOpacity; i != thisOpacity; i=i+inc) {
2988
- setTimeout(function() {
2989
- mpSdk.Tag.editOpacity(index, i);
2990
- console.log('Delay', i);
2991
- },10);
2992
- }
2993
- */
2994
- }
2995
- });
2996
- //sensor.showDebug(true);
2997
- });
2998
- }.bind(this),
2999
- onCollectionUpdated: function (collection) {
3000
- console.log('Collection received. There are ', Object.keys(collection).length, ' Tags in the collection', collection);
3001
- }
3002
- });
2930
+ // this.sdk.Tag.data.subscribe({
2931
+ // onAdded: async function (index, item, collection) {
2932
+ //
2933
+ // let thisOpacity = 0.2;
2934
+ // this.sdk.Tag.editOpacity(index, thisOpacity);
2935
+ //
2936
+ // let source = null;
2937
+ // try {
2938
+ // source = await Promise.all([
2939
+ // this.sdk.Sensor.createSource(this.sdk.Sensor.SourceType.SPHERE, {
2940
+ // origin: item.anchorPosition,
2941
+ // radius: Number(3),
2942
+ // userData: {
2943
+ // id: index + '-sphere-source',
2944
+ // },
2945
+ // })
2946
+ // ]);
2947
+ // } catch (e) {
2948
+ // console.log('could not create Sphere sensor')
2949
+ // console.error(e);
2950
+ // }
2951
+ // if (!source) {
2952
+ // return;
2953
+ // }
2954
+ //
2955
+ // let sensor = null;
2956
+ // try {
2957
+ // sensor = await this.sdk.Sensor.createSensor(this.sdk.Sensor.SensorType.CAMERA);
2958
+ // } catch (e) {
2959
+ // console.log('could not create Camera sensor')
2960
+ // console.error(e);
2961
+ // }
2962
+ // if (!sensor) {
2963
+ // return;
2964
+ // }
2965
+ //
2966
+ // sensor.addSource(...source);
2967
+ // sensor.readings.subscribe({
2968
+ // onUpdated(source, reading) {
2969
+ // console.log(thisOpacity);
2970
+ // let oldOpacity = thisOpacity;
2971
+ // if (reading.inRange) {
2972
+ // thisOpacity = 1;
2973
+ // console.log(index + ' is inRange');
2974
+ // } else if (reading.inView) {
2975
+ // console.log(index + ' is inView but not inRange');
2976
+ // thisOpacity = 0.5;
2977
+ // } else {
2978
+ // thisOpacity = 0.2;
2979
+ // console.log(index + ' is not inView or inRange');
2980
+ // }
2981
+ //
2982
+ // this.sdk.Tag.editOpacity(index, thisOpacity);
2983
+ // /*
2984
+ // let inc = 0.01;
2985
+ // if (oldOpacity > thisOpacity) {
2986
+ // inc = -0.01;
2987
+ // }
2988
+ //
2989
+ // for(var i = oldOpacity; i != thisOpacity; i=i+inc) {
2990
+ // setTimeout(function() {
2991
+ // mpSdk.Tag.editOpacity(index, i);
2992
+ // console.log('Delay', i);
2993
+ // },10);
2994
+ // }
2995
+ // */
2996
+ // }
2997
+ // });
2998
+ // //sensor.showDebug(true);
2999
+ // }.bind(this),
3000
+ // onCollectionUpdated: function (collection) {
3001
+ // console.log('Collection received. There are ', Object.keys(collection).length, ' Tags in the collection', collection);
3002
+ // }
3003
+ // });
3003
3004
  resolve(true);
3004
3005
  });
3005
3006
  }.bind(this));
@@ -7088,24 +7089,26 @@ class TicketsService extends BaseObjectService {
7088
7089
  event.ownerID = event.ownerID ? event.ownerID : currentMission.id;
7089
7090
  try {
7090
7091
  const receivedEvent = yield this.eventService.createEvent(event);
7091
- this.awsKinesisAnalytics.getInstance().record(
7092
- // @ts-ignore
7093
- {
7094
- data: {
7095
- eventType: 'Ticket Change',
7096
- ticketId: event.ticketID,
7097
- ticket: ticket,
7098
- status: event.status,
7099
- event: event,
7100
- user: this.userService.cu,
7101
- locationId: this.currentSpaceID,
7102
- timestamp: new Date(),
7103
- zoneId: this.zoneIDFilter,
7104
- floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
7105
- },
7106
- streamName: 'smarterplanKinesis-analytics',
7107
- // partitionKey: "",
7108
- }, 'AWSKinesis');
7092
+ if (!!this.awsKinesisAnalytics) {
7093
+ this.awsKinesisAnalytics.getInstance().record(
7094
+ // @ts-ignore
7095
+ {
7096
+ data: {
7097
+ eventType: 'Ticket Change',
7098
+ ticketId: event.ticketID,
7099
+ ticket: ticket,
7100
+ status: event.status,
7101
+ event: event,
7102
+ user: this.userService.cu,
7103
+ locationId: this.currentSpaceID,
7104
+ timestamp: new Date(),
7105
+ zoneId: this.zoneIDFilter,
7106
+ floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
7107
+ },
7108
+ streamName: 'smarterplanKinesis-analytics',
7109
+ // partitionKey: "",
7110
+ }, 'AWSKinesis');
7111
+ }
7109
7112
  // console.log('Event successfully created !');
7110
7113
  return receivedEvent;
7111
7114
  }
@@ -7229,23 +7232,25 @@ class TicketsService extends BaseObjectService {
7229
7232
  createTicket(input) {
7230
7233
  var _a;
7231
7234
  return __awaiter(this, void 0, void 0, function* () {
7232
- this.awsKinesisAnalytics.getInstance().record(
7233
- // @ts-ignore
7234
- {
7235
- data: {
7236
- eventType: 'Object Creation',
7237
- objectType: 'ticket',
7238
- //zoneId: input.spaceID, // TODO: check if spaceId == zoneId
7239
- domain: input.domain,
7240
- user: this.userService.cu,
7241
- locationId: this.currentSpaceID,
7242
- timestamp: new Date(),
7243
- zoneId: this.zoneIDFilter,
7244
- floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
7245
- },
7246
- streamName: 'smarterplanKinesis-analytics',
7247
- // partitionKey: "",
7248
- }, 'AWSKinesis');
7235
+ if (!!this.awsKinesisAnalytics) {
7236
+ this.awsKinesisAnalytics.getInstance().record(
7237
+ // @ts-ignore
7238
+ {
7239
+ data: {
7240
+ eventType: 'Object Creation',
7241
+ objectType: 'ticket',
7242
+ //zoneId: input.spaceID, // TODO: check if spaceId == zoneId
7243
+ domain: input.domain,
7244
+ user: this.userService.cu,
7245
+ locationId: this.currentSpaceID,
7246
+ timestamp: new Date(),
7247
+ zoneId: this.zoneIDFilter,
7248
+ floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
7249
+ },
7250
+ streamName: 'smarterplanKinesis-analytics',
7251
+ // partitionKey: "",
7252
+ }, 'AWSKinesis');
7253
+ }
7249
7254
  return this.API.__proto__.CreateTicket(input);
7250
7255
  });
7251
7256
  }
@@ -7498,22 +7503,24 @@ class EquipmentService extends BaseObjectService {
7498
7503
  var _a;
7499
7504
  return __awaiter(this, void 0, void 0, function* () {
7500
7505
  removeNullKeysFromObject(equip);
7501
- this.awsKinesisAnalytics.getInstance().record(
7502
- // @ts-ignore
7503
- {
7504
- data: {
7505
- eventType: 'Object Creation',
7506
- objectType: 'equipment',
7507
- poi: equip,
7508
- user: this.userService.cu,
7509
- locationId: this.currentSpaceID,
7510
- timestamp: new Date(),
7511
- zoneId: this.currentZone.id,
7512
- floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
7513
- },
7514
- streamName: 'smarterplanKinesis-analytics',
7515
- // partitionKey: "",
7516
- }, 'AWSKinesis');
7506
+ if (!!this.awsKinesisAnalytics) {
7507
+ this.awsKinesisAnalytics.getInstance().record(
7508
+ // @ts-ignore
7509
+ {
7510
+ data: {
7511
+ eventType: 'Object Creation',
7512
+ objectType: 'equipment',
7513
+ poi: equip,
7514
+ user: this.userService.cu,
7515
+ locationId: this.currentSpaceID,
7516
+ timestamp: new Date(),
7517
+ zoneId: this.currentZone.id,
7518
+ floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
7519
+ },
7520
+ streamName: 'smarterplanKinesis-analytics',
7521
+ // partitionKey: "",
7522
+ }, 'AWSKinesis');
7523
+ }
7517
7524
  return this.API.CreateEquipment(equip).then((receivedEquipment) => __awaiter(this, void 0, void 0, function* () {
7518
7525
  let equipment = receivedEquipment;
7519
7526
  if (equipment) {
@@ -10987,23 +10994,25 @@ class MeasurementService {
10987
10994
  comment,
10988
10995
  poi,
10989
10996
  };
10990
- this.awsKinesisAnalytics.getInstance().record(
10991
- // @ts-ignore
10992
- {
10993
- data: {
10994
- eventType: 'Object Creation',
10995
- objectType: 'measurement',
10996
- measurement: measurement,
10997
- //zoneId: spaceID,
10998
- user: this.userService.cu,
10999
- locationId: this.currentSpaceID,
11000
- timestamp: new Date(),
11001
- zoneId: this.zoneIDFilter,
11002
- floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
11003
- },
11004
- streamName: 'smarterplanKinesis-analytics',
11005
- // partitionKey: "",
11006
- }, 'AWSKinesis');
10997
+ if (!!this.awsKinesisAnalytics) {
10998
+ this.awsKinesisAnalytics.getInstance().record(
10999
+ // @ts-ignore
11000
+ {
11001
+ data: {
11002
+ eventType: 'Object Creation',
11003
+ objectType: 'measurement',
11004
+ measurement: measurement,
11005
+ //zoneId: spaceID,
11006
+ user: this.userService.cu,
11007
+ locationId: this.currentSpaceID,
11008
+ timestamp: new Date(),
11009
+ zoneId: this.zoneIDFilter,
11010
+ floorId: (_a = this.selectedFloor) === null || _a === void 0 ? void 0 : _a.id,
11011
+ },
11012
+ streamName: 'smarterplanKinesis-analytics',
11013
+ // partitionKey: "",
11014
+ }, 'AWSKinesis');
11015
+ }
11007
11016
  return measurement;
11008
11017
  });
11009
11018
  }
@@ -11548,23 +11557,25 @@ class NavigationBarComponent {
11548
11557
  sendKinesisAnalyticsEventForZone(zoneId, zoneName) {
11549
11558
  var _a, _b, _c, _d, _e;
11550
11559
  return __awaiter(this, void 0, void 0, function* () {
11551
- this.awsKinesisAnalytics.getInstance().record(
11552
- // @ts-ignore
11553
- {
11554
- data: {
11555
- eventType: 'Zone Change',
11556
- zoneId: zoneId,
11557
- zoneName: zoneName,
11558
- locationId: (_a = this.selectedLocation) === null || _a === void 0 ? void 0 : _a.id,
11559
- locationName: (_b = this.selectedLocation) === null || _b === void 0 ? void 0 : _b.name,
11560
- user: (_c = this.userService) === null || _c === void 0 ? void 0 : _c.cu,
11561
- timestamp: new Date(),
11562
- floorId: (_d = this.selectedFloor) === null || _d === void 0 ? void 0 : _d.id,
11563
- childZoneId: (_e = this.selectedChildZone) === null || _e === void 0 ? void 0 : _e.id,
11564
- },
11565
- streamName: 'smarterplanKinesis-analytics',
11566
- // partitionKey: "",
11567
- }, 'AWSKinesis');
11560
+ if (!!this.awsKinesisAnalytics) {
11561
+ this.awsKinesisAnalytics.getInstance().record(
11562
+ // @ts-ignore
11563
+ {
11564
+ data: {
11565
+ eventType: 'Zone Change',
11566
+ zoneId: zoneId,
11567
+ zoneName: zoneName,
11568
+ locationId: (_a = this.selectedLocation) === null || _a === void 0 ? void 0 : _a.id,
11569
+ locationName: (_b = this.selectedLocation) === null || _b === void 0 ? void 0 : _b.name,
11570
+ user: (_c = this.userService) === null || _c === void 0 ? void 0 : _c.cu,
11571
+ timestamp: new Date(),
11572
+ floorId: (_d = this.selectedFloor) === null || _d === void 0 ? void 0 : _d.id,
11573
+ childZoneId: (_e = this.selectedChildZone) === null || _e === void 0 ? void 0 : _e.id,
11574
+ },
11575
+ streamName: 'smarterplanKinesis-analytics',
11576
+ // partitionKey: "",
11577
+ }, 'AWSKinesis');
11578
+ }
11568
11579
  });
11569
11580
  }
11570
11581
  onVisitClick(event) {
@@ -12033,7 +12044,7 @@ class MatterportImportService {
12033
12044
  this.importingImages = new Subject();
12034
12045
  this.sweepProcessedCount = new Subject();
12035
12046
  this.totalSweepsCount = new Subject();
12036
- this.MAX_SCANS_RELOAD = 500;
12047
+ this.MAX_SCANS_RELOAD = 10;
12037
12048
  }
12038
12049
  get spaceID() {
12039
12050
  return this._spaceID;
@@ -12221,7 +12232,6 @@ class MatterportImportService {
12221
12232
  nmbScans < this.MAX_SCANS_RELOAD
12222
12233
  ? (maxScan = nmbScans)
12223
12234
  : (maxScan = this.MAX_SCANS_RELOAD);
12224
- maxScan;
12225
12235
  }
12226
12236
  for (let index = indexScan; index < maxScan; index += 1) {
12227
12237
  if (!this.stop) {