motion-master-client 0.0.419 → 0.0.421

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.
@@ -680,6 +680,11 @@ export declare class MotionMasterReqResClient {
680
680
  * At the end of the procedure Motion Master will rotate the motor back to the starting position and run commutation offset detection.
681
681
  * There will also be a final iteration that only measures the values of a (now) calibrated encoder for display.
682
682
  *
683
+ * Every progress status carries `maxPermissiblePhaseError`, the limit the calibration library measures the ring
684
+ * against. Motion Master 5.8.3 and later report it. An older Motion Master reports 0, and this method fills in
685
+ * the limit derived from the product and the external encoder type instead. That limit is only right for the
686
+ * Circulo 7 and Circulo 9 rings. Score a progress status with `computeCirculoEncoderCalibrationProgressResult`.
687
+ *
683
688
  * This request will turn the motor.
684
689
  */
685
690
  startCirculoEncoderNarrowAngleCalibrationProcedure(props: StartCirculoEncoderNarrowAngleCalibrationProcedureRequest, requestTimeout: number, messageId?: string): Observable<CirculoEncoderNarrowAngleCalibrationProcedureStatus>;
@@ -1011,13 +1011,30 @@ class MotionMasterReqResClient {
1011
1011
  * At the end of the procedure Motion Master will rotate the motor back to the starting position and run commutation offset detection.
1012
1012
  * There will also be a final iteration that only measures the values of a (now) calibrated encoder for display.
1013
1013
  *
1014
+ * Every progress status carries `maxPermissiblePhaseError`, the limit the calibration library measures the ring
1015
+ * against. Motion Master 5.8.3 and later report it. An older Motion Master reports 0, and this method fills in
1016
+ * the limit derived from the product and the external encoder type instead. That limit is only right for the
1017
+ * Circulo 7 and Circulo 9 rings. Score a progress status with `computeCirculoEncoderCalibrationProgressResult`.
1018
+ *
1014
1019
  * This request will turn the motor.
1015
1020
  */
1016
1021
  startCirculoEncoderNarrowAngleCalibrationProcedure(props, requestTimeout, messageId) {
1017
1022
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
1018
1023
  const startCirculoEncoderNarrowAngleCalibrationProcedure = types_1.MotionMasterMessage.Request.StartCirculoEncoderNarrowAngleCalibrationProcedure.create(Object.assign(Object.assign({}, props), { deviceAddress }));
1019
1024
  const id = this.sendRequest({ startCirculoEncoderNarrowAngleCalibrationProcedure }, messageId);
1020
- return this.socket.message$.pipe((0, operators_2.transformMotionMasterMessageToStatus)('circuloEncoderNarrowAngleCalibrationProcedure', requestTimeout, id));
1025
+ // Resolved at most once, and only when a progress status reports no limit
1026
+ const productMaxPermissiblePhaseError$ = (0, rxjs_1.defer)(() => this.resolveDevice(props)).pipe((0, operators_1.map)((device) => {
1027
+ var _a, _b;
1028
+ return (0, circulo_1.getCirculoEncoderMaxPermissiblePhaseError)(((_a = device.hardwareDescription) === null || _a === void 0 ? void 0 : _a.device.serialNumber) ? device.hardwareDescription : device.serialNumber, (_b = props.externalEncoderType) !== null && _b !== void 0 ? _b : circulo_1.CirculoExternalEncoderType.NONE);
1029
+ }), (0, operators_1.shareReplay)(1));
1030
+ return this.socket.message$.pipe((0, operators_2.transformMotionMasterMessageToStatus)('circuloEncoderNarrowAngleCalibrationProcedure', requestTimeout, id), (0, operators_1.concatMap)((status) => {
1031
+ var _a;
1032
+ const progress = status.progress;
1033
+ if (!progress || ((_a = progress.maxPermissiblePhaseError) !== null && _a !== void 0 ? _a : 0) > 0) {
1034
+ return (0, rxjs_1.of)(status);
1035
+ }
1036
+ return productMaxPermissiblePhaseError$.pipe((0, operators_1.map)((maxPermissiblePhaseError) => (Object.assign(Object.assign({}, status), { progress: Object.assign(Object.assign({}, progress), { maxPermissiblePhaseError }) }))));
1037
+ }));
1021
1038
  }));
1022
1039
  }
1023
1040
  /**