Best JavaScript code snippet using storybook-root
profile.ts
Source:profile.ts
...510 let subfieldIndex: number;511 const newMesg: Mesg = new Mesg('FileId', MesgNum.fileId);512 fieldIndex = 0;513 // tslint:disable-next-line: max-line-length514 newMesg.setField(new Field('Type', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.File));515 fieldIndex++;516 // tslint:disable-next-line: max-line-length517 newMesg.setField(new Field('Manufacturer', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));518 fieldIndex++;519 // tslint:disable-next-line: max-line-length520 newMesg.setField(new Field('Product', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));521 subfieldIndex = 0;522 // tslint:disable-next-line: max-line-length523 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('FaveroProduct', 132, 1, 0, ''));524 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 263);525 subfieldIndex++;526 // tslint:disable-next-line: max-line-length527 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GarminProduct', 132, 1, 0, ''));528 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 1);529 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 15);530 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 13);531 subfieldIndex++;532 fieldIndex++;533 // tslint:disable-next-line: max-line-length534 newMesg.setField(new Field('SerialNumber', 3, FitFieldType.uint32z, 1, 0, '', false, ProfileType.Uint32z));535 fieldIndex++;536 // tslint:disable-next-line: max-line-length537 newMesg.setField(new Field('TimeCreated', 4, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));538 fieldIndex++;539 // tslint:disable-next-line: max-line-length540 newMesg.setField(new Field('Number', 5, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));541 fieldIndex++;542 // tslint:disable-next-line: max-line-length543 newMesg.setField(new Field('ProductName', 8, FitFieldType.string, 1, 0, '', false, ProfileType.String));544 fieldIndex++;545 return newMesg;546 }547 private static createFileCreatorMesg(): Mesg {548 const newMesg: Mesg = new Mesg('FileCreator', MesgNum.fileCreator);549 // tslint:disable-next-line: max-line-length550 newMesg.setField(new Field('SoftwareVersion', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));551 // tslint:disable-next-line: max-line-length552 newMesg.setField(new Field('HardwareVersion', 1, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));553 return newMesg;554 }555 private static createTimestampCorrelationMesg(): Mesg {556 const newMesg: Mesg = new Mesg('TimestampCorrelation', MesgNum.timestampCorrelation);557 // tslint:disable-next-line: max-line-length558 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));559 // tslint:disable-next-line: max-line-length560 newMesg.setField(new Field('FractionalTimestamp', 0, FitFieldType.uint16, 32768, 0, 's', false, ProfileType.Uint16));561 // tslint:disable-next-line: max-line-length562 newMesg.setField(new Field('SystemTimestamp', 1, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));563 // tslint:disable-next-line: max-line-length564 newMesg.setField(new Field('FractionalSystemTimestamp', 2, FitFieldType.uint16, 32768, 0, 's', false, ProfileType.Uint16));565 // tslint:disable-next-line: max-line-length566 newMesg.setField(new Field('LocalTimestamp', 3, FitFieldType.uint32, 1, 0, 's', false, ProfileType.LocalDateTime));567 // tslint:disable-next-line: max-line-length568 newMesg.setField(new Field('TimestampMs', 4, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));569 // tslint:disable-next-line: max-line-length570 newMesg.setField(new Field('SystemTimestampMs', 5, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));571 return newMesg;572 }573 private static createSoftwareMesg(): Mesg {574 const newMesg: Mesg = new Mesg('Software', MesgNum.software);575 // tslint:disable-next-line: max-line-length576 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));577 // tslint:disable-next-line: max-line-length578 newMesg.setField(new Field('Version', 3, FitFieldType.uint16, 100, 0, '', false, ProfileType.Uint16));579 // tslint:disable-next-line: max-line-length580 newMesg.setField(new Field('PartNumber', 5, FitFieldType.string, 1, 0, '', false, ProfileType.String));581 return newMesg;582 }583 private static createSlaveDeviceMesg(): Mesg {584 let fieldIndex: number;585 let subfieldIndex: number;586 const newMesg: Mesg = new Mesg('SlaveDevice', MesgNum.slaveDevice);587 fieldIndex = 0;588 // tslint:disable-next-line: max-line-length589 newMesg.setField(new Field('Manufacturer', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));590 fieldIndex++;591 // tslint:disable-next-line: max-line-length592 newMesg.setField(new Field('Product', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));593 subfieldIndex = 0;594 // tslint:disable-next-line: max-line-length595 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('FaveroProduct', 132, 1, 0, ''));596 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 263);597 subfieldIndex++;598 // tslint:disable-next-line: max-line-length599 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GarminProduct', 132, 1, 0, ''));600 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 1);601 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 15);602 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 13);603 subfieldIndex++;604 fieldIndex++;605 return newMesg;606 }607 private static createCapabilitiesMesg(): Mesg {608 const newMesg: Mesg = new Mesg('Capabilities', MesgNum.capabilities);609 // tslint:disable-next-line: max-line-length610 newMesg.setField(new Field('Languages', 0, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));611 // tslint:disable-next-line: max-line-length612 newMesg.setField(new Field('Sports', 1, FitFieldType.uint8z, 1, 0, '', false, ProfileType.SportBits0));613 // tslint:disable-next-line: max-line-length614 newMesg.setField(new Field('WorkoutsSupported', 21, FitFieldType.uint32z, 1, 0, '', false, ProfileType.WorkoutCapabilities));615 // tslint:disable-next-line: max-line-length616 newMesg.setField(new Field('ConnectivitySupported', 23, FitFieldType.uint32z, 1, 0, '', false, ProfileType.ConnectivityCapabilities));617 return newMesg;618 }619 private static createFileCapabilitiesMesg(): Mesg {620 const newMesg: Mesg = new Mesg('FileCapabilities', MesgNum.fileCapabilities);621 // tslint:disable-next-line: max-line-length622 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));623 // tslint:disable-next-line: max-line-length624 newMesg.setField(new Field('Type', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.File));625 // tslint:disable-next-line: max-line-length626 newMesg.setField(new Field('Flags', 1, FitFieldType.uint8z, 1, 0, '', false, ProfileType.FileFlags));627 // tslint:disable-next-line: max-line-length628 newMesg.setField(new Field('Directory', 2, FitFieldType.string, 1, 0, '', false, ProfileType.String));629 // tslint:disable-next-line: max-line-length630 newMesg.setField(new Field('MaxCount', 3, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));631 // tslint:disable-next-line: max-line-length632 newMesg.setField(new Field('MaxSize', 4, FitFieldType.uint32, 1, 0, 'bytes', false, ProfileType.Uint32));633 return newMesg;634 }635 private static createMesgCapabilitiesMesg(): Mesg {636 let fieldIndex: number;637 let subfieldIndex: number;638 const newMesg: Mesg = new Mesg('MesgCapabilities', MesgNum.mesgCapabilities);639 fieldIndex = 0;640 // tslint:disable-next-line: max-line-length641 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));642 fieldIndex++;643 // tslint:disable-next-line: max-line-length644 newMesg.setField(new Field('File', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.File));645 fieldIndex++;646 // tslint:disable-next-line: max-line-length647 newMesg.setField(new Field('MesgNum', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.MesgNum));648 fieldIndex++;649 // tslint:disable-next-line: max-line-length650 newMesg.setField(new Field('CountType', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.MesgCount));651 fieldIndex++;652 // tslint:disable-next-line: max-line-length653 newMesg.setField(new Field('Count', 3, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));654 subfieldIndex = 0;655 // tslint:disable-next-line: max-line-length656 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('NumPerFile', 132, 1, 0, ''));657 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 0);658 subfieldIndex++;659 // tslint:disable-next-line: max-line-length660 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('MaxPerFile', 132, 1, 0, ''));661 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 1);662 subfieldIndex++;663 // tslint:disable-next-line: max-line-length664 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('MaxPerFileType', 132, 1, 0, ''));665 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 2);666 subfieldIndex++;667 fieldIndex++;668 return newMesg;669 }670 private static createFieldCapabilitiesMesg(): Mesg {671 const newMesg: Mesg = new Mesg('FieldCapabilities', MesgNum.fieldCapabilities);672 // tslint:disable-next-line: max-line-length673 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));674 // tslint:disable-next-line: max-line-length675 newMesg.setField(new Field('File', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.File));676 // tslint:disable-next-line: max-line-length677 newMesg.setField(new Field('MesgNum', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.MesgNum));678 // tslint:disable-next-line: max-line-length679 newMesg.setField(new Field('FieldNum', 2, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));680 // tslint:disable-next-line: max-line-length681 newMesg.setField(new Field('Count', 3, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));682 return newMesg;683 }684 private static createDeviceSettingsMesg(): Mesg {685 const newMesg: Mesg = new Mesg('DeviceSettings', MesgNum.deviceSettings);686 // tslint:disable-next-line: max-line-length687 newMesg.setField(new Field('ActiveTimeZone', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));688 // tslint:disable-next-line: max-line-length689 newMesg.setField(new Field('UtcOffset', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));690 // tslint:disable-next-line: max-line-length691 newMesg.setField(new Field('TimeOffset', 2, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));692 // tslint:disable-next-line: max-line-length693 newMesg.setField(new Field('TimeMode', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.TimeMode));694 // tslint:disable-next-line: max-line-length695 newMesg.setField(new Field('TimeZoneOffset', 5, FitFieldType.sint8, 4, 0, 'hr', false, ProfileType.Sint8));696 // tslint:disable-next-line: max-line-length697 newMesg.setField(new Field('BacklightMode', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.BacklightMode));698 // tslint:disable-next-line: max-line-length699 newMesg.setField(new Field('ActivityTrackerEnabled', 36, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));700 // tslint:disable-next-line: max-line-length701 newMesg.setField(new Field('ClockTime', 39, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));702 // tslint:disable-next-line: max-line-length703 newMesg.setField(new Field('PagesEnabled', 40, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));704 // tslint:disable-next-line: max-line-length705 newMesg.setField(new Field('MoveAlertEnabled', 46, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));706 // tslint:disable-next-line: max-line-length707 newMesg.setField(new Field('DateMode', 47, FitFieldType.enum, 1, 0, '', false, ProfileType.DateMode));708 // tslint:disable-next-line: max-line-length709 newMesg.setField(new Field('DisplayOrientation', 55, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayOrientation));710 // tslint:disable-next-line: max-line-length711 newMesg.setField(new Field('MountingSide', 56, FitFieldType.enum, 1, 0, '', false, ProfileType.Side));712 // tslint:disable-next-line: max-line-length713 newMesg.setField(new Field('DefaultPage', 57, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));714 // tslint:disable-next-line: max-line-length715 newMesg.setField(new Field('AutosyncMinSteps', 58, FitFieldType.uint16, 1, 0, 'steps', false, ProfileType.Uint16));716 // tslint:disable-next-line: max-line-length717 newMesg.setField(new Field('AutosyncMinTime', 59, FitFieldType.uint16, 1, 0, 'minutes', false, ProfileType.Uint16));718 // tslint:disable-next-line: max-line-length719 newMesg.setField(new Field('LactateThresholdAutodetectEnabled', 80, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));720 // tslint:disable-next-line: max-line-length721 newMesg.setField(new Field('BleAutoUploadEnabled', 86, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));722 // tslint:disable-next-line: max-line-length723 newMesg.setField(new Field('AutoSyncFrequency', 89, FitFieldType.enum, 1, 0, '', false, ProfileType.AutoSyncFrequency));724 // tslint:disable-next-line: max-line-length725 newMesg.setField(new Field('AutoActivityDetect', 90, FitFieldType.uint32, 1, 0, '', false, ProfileType.AutoActivityDetect));726 // tslint:disable-next-line: max-line-length727 newMesg.setField(new Field('NumberOfScreens', 94, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));728 // tslint:disable-next-line: max-line-length729 newMesg.setField(new Field('SmartNotificationDisplayOrientation', 95, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayOrientation));730 // tslint:disable-next-line: max-line-length731 newMesg.setField(new Field('TapInterface', 134, FitFieldType.enum, 1, 0, '', false, ProfileType.Switch));732 return newMesg;733 }734 private static createUserProfileMesg(): Mesg {735 const newMesg: Mesg = new Mesg('UserProfile', MesgNum.userProfile);736 // tslint:disable-next-line: max-line-length737 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));738 // tslint:disable-next-line: max-line-length739 newMesg.setField(new Field('FriendlyName', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));740 // tslint:disable-next-line: max-line-length741 newMesg.setField(new Field('Gender', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.Gender));742 // tslint:disable-next-line: max-line-length743 newMesg.setField(new Field('Age', 2, FitFieldType.uint8, 1, 0, 'years', false, ProfileType.Uint8));744 // tslint:disable-next-line: max-line-length745 newMesg.setField(new Field('Height', 3, FitFieldType.uint8, 100, 0, 'm', false, ProfileType.Uint8));746 // tslint:disable-next-line: max-line-length747 newMesg.setField(new Field('Weight', 4, FitFieldType.uint16, 10, 0, 'kg', false, ProfileType.Uint16));748 // tslint:disable-next-line: max-line-length749 newMesg.setField(new Field('Language', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.Language));750 // tslint:disable-next-line: max-line-length751 newMesg.setField(new Field('ElevSetting', 6, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));752 // tslint:disable-next-line: max-line-length753 newMesg.setField(new Field('WeightSetting', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));754 // tslint:disable-next-line: max-line-length755 newMesg.setField(new Field('RestingHeartRate', 8, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));756 // tslint:disable-next-line: max-line-length757 newMesg.setField(new Field('DefaultMaxRunningHeartRate', 9, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));758 // tslint:disable-next-line: max-line-length759 newMesg.setField(new Field('DefaultMaxBikingHeartRate', 10, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));760 // tslint:disable-next-line: max-line-length761 newMesg.setField(new Field('DefaultMaxHeartRate', 11, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));762 // tslint:disable-next-line: max-line-length763 newMesg.setField(new Field('HrSetting', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayHeart));764 // tslint:disable-next-line: max-line-length765 newMesg.setField(new Field('SpeedSetting', 13, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));766 // tslint:disable-next-line: max-line-length767 newMesg.setField(new Field('DistSetting', 14, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));768 // tslint:disable-next-line: max-line-length769 newMesg.setField(new Field('PowerSetting', 16, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayPower));770 // tslint:disable-next-line: max-line-length771 newMesg.setField(new Field('ActivityClass', 17, FitFieldType.enum, 1, 0, '', false, ProfileType.ActivityClass));772 // tslint:disable-next-line: max-line-length773 newMesg.setField(new Field('PositionSetting', 18, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayPosition));774 // tslint:disable-next-line: max-line-length775 newMesg.setField(new Field('TemperatureSetting', 21, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));776 // tslint:disable-next-line: max-line-length777 newMesg.setField(new Field('LocalId', 22, FitFieldType.uint16, 1, 0, '', false, ProfileType.UserLocalId));778 // tslint:disable-next-line: max-line-length779 newMesg.setField(new Field('GlobalId', 23, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));780 // tslint:disable-next-line: max-line-length781 newMesg.setField(new Field('WakeTime', 28, FitFieldType.uint32, 1, 0, '', false, ProfileType.LocaltimeIntoDay));782 // tslint:disable-next-line: max-line-length783 newMesg.setField(new Field('SleepTime', 29, FitFieldType.uint32, 1, 0, '', false, ProfileType.LocaltimeIntoDay));784 // tslint:disable-next-line: max-line-length785 newMesg.setField(new Field('HeightSetting', 30, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));786 // tslint:disable-next-line: max-line-length787 newMesg.setField(new Field('UserRunningStepLength', 31, FitFieldType.uint16, 1000, 0, 'm', false, ProfileType.Uint16));788 // tslint:disable-next-line: max-line-length789 newMesg.setField(new Field('UserWalkingStepLength', 32, FitFieldType.uint16, 1000, 0, 'm', false, ProfileType.Uint16));790 // tslint:disable-next-line: max-line-length791 newMesg.setField(new Field('DepthSetting', 47, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));792 // tslint:disable-next-line: max-line-length793 newMesg.setField(new Field('DiveCount', 49, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));794 return newMesg;795 }796 private static createHrmProfileMesg(): Mesg {797 const newMesg: Mesg = new Mesg('HrmProfile', MesgNum.hrmProfile);798 // tslint:disable-next-line: max-line-length799 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));800 // tslint:disable-next-line: max-line-length801 newMesg.setField(new Field('Enabled', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));802 // tslint:disable-next-line: max-line-length803 newMesg.setField(new Field('HrmAntId', 1, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));804 // tslint:disable-next-line: max-line-length805 newMesg.setField(new Field('LogHrv', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));806 // tslint:disable-next-line: max-line-length807 newMesg.setField(new Field('HrmAntIdTransType', 3, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));808 return newMesg;809 }810 private static createSdmProfileMesg(): Mesg {811 const newMesg: Mesg = new Mesg('SdmProfile', MesgNum.sdmProfile);812 // tslint:disable-next-line: max-line-length813 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));814 // tslint:disable-next-line: max-line-length815 newMesg.setField(new Field('Enabled', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));816 // tslint:disable-next-line: max-line-length817 newMesg.setField(new Field('SdmAntId', 1, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));818 // tslint:disable-next-line: max-line-length819 newMesg.setField(new Field('SdmCalFactor', 2, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));820 // tslint:disable-next-line: max-line-length821 newMesg.setField(new Field('Odometer', 3, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));822 // tslint:disable-next-line: max-line-length823 newMesg.setField(new Field('SpeedSource', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));824 // tslint:disable-next-line: max-line-length825 newMesg.setField(new Field('SdmAntIdTransType', 5, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));826 // tslint:disable-next-line: max-line-length827 newMesg.setField(new Field('OdometerRollover', 7, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));828 return newMesg;829 }830 private static createBikeProfileMesg(): Mesg {831 const newMesg: Mesg = new Mesg('BikeProfile', MesgNum.bikeProfile);832 // tslint:disable-next-line: max-line-length833 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));834 // tslint:disable-next-line: max-line-length835 newMesg.setField(new Field('Name', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));836 // tslint:disable-next-line: max-line-length837 newMesg.setField(new Field('Sport', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));838 // tslint:disable-next-line: max-line-length839 newMesg.setField(new Field('SubSport', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));840 // tslint:disable-next-line: max-line-length841 newMesg.setField(new Field('Odometer', 3, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));842 // tslint:disable-next-line: max-line-length843 newMesg.setField(new Field('BikeSpdAntId', 4, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));844 // tslint:disable-next-line: max-line-length845 newMesg.setField(new Field('BikeCadAntId', 5, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));846 // tslint:disable-next-line: max-line-length847 newMesg.setField(new Field('BikeSpdcadAntId', 6, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));848 // tslint:disable-next-line: max-line-length849 newMesg.setField(new Field('BikePowerAntId', 7, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));850 // tslint:disable-next-line: max-line-length851 newMesg.setField(new Field('CustomWheelsize', 8, FitFieldType.uint16, 1000, 0, 'm', false, ProfileType.Uint16));852 // tslint:disable-next-line: max-line-length853 newMesg.setField(new Field('AutoWheelsize', 9, FitFieldType.uint16, 1000, 0, 'm', false, ProfileType.Uint16));854 // tslint:disable-next-line: max-line-length855 newMesg.setField(new Field('BikeWeight', 10, FitFieldType.uint16, 10, 0, 'kg', false, ProfileType.Uint16));856 // tslint:disable-next-line: max-line-length857 newMesg.setField(new Field('PowerCalFactor', 11, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));858 // tslint:disable-next-line: max-line-length859 newMesg.setField(new Field('AutoWheelCal', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));860 // tslint:disable-next-line: max-line-length861 newMesg.setField(new Field('AutoPowerZero', 13, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));862 // tslint:disable-next-line: max-line-length863 newMesg.setField(new Field('Id', 14, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));864 // tslint:disable-next-line: max-line-length865 newMesg.setField(new Field('SpdEnabled', 15, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));866 // tslint:disable-next-line: max-line-length867 newMesg.setField(new Field('CadEnabled', 16, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));868 // tslint:disable-next-line: max-line-length869 newMesg.setField(new Field('SpdcadEnabled', 17, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));870 // tslint:disable-next-line: max-line-length871 newMesg.setField(new Field('PowerEnabled', 18, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));872 // tslint:disable-next-line: max-line-length873 newMesg.setField(new Field('CrankLength', 19, FitFieldType.uint8, 2, -110, 'mm', false, ProfileType.Uint8));874 // tslint:disable-next-line: max-line-length875 newMesg.setField(new Field('Enabled', 20, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));876 // tslint:disable-next-line: max-line-length877 newMesg.setField(new Field('BikeSpdAntIdTransType', 21, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));878 // tslint:disable-next-line: max-line-length879 newMesg.setField(new Field('BikeCadAntIdTransType', 22, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));880 // tslint:disable-next-line: max-line-length881 newMesg.setField(new Field('BikeSpdcadAntIdTransType', 23, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));882 // tslint:disable-next-line: max-line-length883 newMesg.setField(new Field('BikePowerAntIdTransType', 24, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));884 // tslint:disable-next-line: max-line-length885 newMesg.setField(new Field('OdometerRollover', 37, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));886 // tslint:disable-next-line: max-line-length887 newMesg.setField(new Field('FrontGearNum', 38, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));888 // tslint:disable-next-line: max-line-length889 newMesg.setField(new Field('FrontGear', 39, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));890 // tslint:disable-next-line: max-line-length891 newMesg.setField(new Field('RearGearNum', 40, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));892 // tslint:disable-next-line: max-line-length893 newMesg.setField(new Field('RearGear', 41, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));894 // tslint:disable-next-line: max-line-length895 newMesg.setField(new Field('ShimanoDi2Enabled', 44, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));896 return newMesg;897 }898 private static createConnectivityMesg(): Mesg {899 const newMesg: Mesg = new Mesg('Connectivity', MesgNum.connectivity);900 // tslint:disable-next-line: max-line-length901 newMesg.setField(new Field('BluetoothEnabled', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));902 // tslint:disable-next-line: max-line-length903 newMesg.setField(new Field('BluetoothLeEnabled', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));904 // tslint:disable-next-line: max-line-length905 newMesg.setField(new Field('AntEnabled', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));906 // tslint:disable-next-line: max-line-length907 newMesg.setField(new Field('Name', 3, FitFieldType.string, 1, 0, '', false, ProfileType.String));908 // tslint:disable-next-line: max-line-length909 newMesg.setField(new Field('LiveTrackingEnabled', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));910 // tslint:disable-next-line: max-line-length911 newMesg.setField(new Field('WeatherConditionsEnabled', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));912 // tslint:disable-next-line: max-line-length913 newMesg.setField(new Field('WeatherAlertsEnabled', 6, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));914 // tslint:disable-next-line: max-line-length915 newMesg.setField(new Field('AutoActivityUploadEnabled', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));916 // tslint:disable-next-line: max-line-length917 newMesg.setField(new Field('CourseDownloadEnabled', 8, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));918 // tslint:disable-next-line: max-line-length919 newMesg.setField(new Field('WorkoutDownloadEnabled', 9, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));920 // tslint:disable-next-line: max-line-length921 newMesg.setField(new Field('GpsEphemerisDownloadEnabled', 10, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));922 // tslint:disable-next-line: max-line-length923 newMesg.setField(new Field('IncidentDetectionEnabled', 11, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));924 // tslint:disable-next-line: max-line-length925 newMesg.setField(new Field('GrouptrackEnabled', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));926 return newMesg;927 }928 private static createWatchfaceSettingsMesg(): Mesg {929 let fieldIndex: number;930 let subfieldIndex: number;931 const newMesg: Mesg = new Mesg('WatchfaceSettings', MesgNum.watchfaceSettings);932 fieldIndex = 0;933 // tslint:disable-next-line: max-line-length934 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));935 fieldIndex++;936 // tslint:disable-next-line: max-line-length937 newMesg.setField(new Field('Mode', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.WatchfaceMode));938 fieldIndex++;939 // tslint:disable-next-line: max-line-length940 newMesg.setField(new Field('Layout', 1, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));941 subfieldIndex = 0;942 // tslint:disable-next-line: max-line-length943 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DigitalLayout', 0, 1, 0, ''));944 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 0);945 subfieldIndex++;946 // tslint:disable-next-line: max-line-length947 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('AnalogLayout', 0, 1, 0, ''));948 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 1);949 subfieldIndex++;950 fieldIndex++;951 return newMesg;952 }953 private static createOhrSettingsMesg(): Mesg {954 const newMesg: Mesg = new Mesg('OhrSettings', MesgNum.ohrSettings);955 // tslint:disable-next-line: max-line-length956 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));957 // tslint:disable-next-line: max-line-length958 newMesg.setField(new Field('Enabled', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Switch));959 return newMesg;960 }961 private static createZonesTargetMesg(): Mesg {962 const newMesg: Mesg = new Mesg('ZonesTarget', MesgNum.zonesTarget);963 // tslint:disable-next-line: max-line-length964 newMesg.setField(new Field('MaxHeartRate', 1, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));965 // tslint:disable-next-line: max-line-length966 newMesg.setField(new Field('ThresholdHeartRate', 2, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));967 // tslint:disable-next-line: max-line-length968 newMesg.setField(new Field('FunctionalThresholdPower', 3, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));969 // tslint:disable-next-line: max-line-length970 newMesg.setField(new Field('HrCalcType', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.HrZoneCalc));971 // tslint:disable-next-line: max-line-length972 newMesg.setField(new Field('PwrCalcType', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.PwrZoneCalc));973 return newMesg;974 }975 private static createSportMesg(): Mesg {976 const newMesg: Mesg = new Mesg('Sport', MesgNum.sport);977 // tslint:disable-next-line: max-line-length978 newMesg.setField(new Field('Sport', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));979 // tslint:disable-next-line: max-line-length980 newMesg.setField(new Field('SubSport', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));981 // tslint:disable-next-line: max-line-length982 newMesg.setField(new Field('Name', 3, FitFieldType.string, 1, 0, '', false, ProfileType.String));983 return newMesg;984 }985 private static createHrZoneMesg(): Mesg {986 const newMesg: Mesg = new Mesg('HrZone', MesgNum.hrZone);987 // tslint:disable-next-line: max-line-length988 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));989 // tslint:disable-next-line: max-line-length990 newMesg.setField(new Field('HighBpm', 1, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));991 // tslint:disable-next-line: max-line-length992 newMesg.setField(new Field('Name', 2, FitFieldType.string, 1, 0, '', false, ProfileType.String));993 return newMesg;994 }995 private static createSpeedZoneMesg(): Mesg {996 const newMesg: Mesg = new Mesg('SpeedZone', MesgNum.speedZone);997 // tslint:disable-next-line: max-line-length998 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));999 // tslint:disable-next-line: max-line-length1000 newMesg.setField(new Field('HighValue', 0, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1001 // tslint:disable-next-line: max-line-length1002 newMesg.setField(new Field('Name', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));1003 return newMesg;1004 }1005 private static createCadenceZoneMesg(): Mesg {1006 const newMesg: Mesg = new Mesg('CadenceZone', MesgNum.cadenceZone);1007 // tslint:disable-next-line: max-line-length1008 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1009 // tslint:disable-next-line: max-line-length1010 newMesg.setField(new Field('HighValue', 0, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1011 // tslint:disable-next-line: max-line-length1012 newMesg.setField(new Field('Name', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));1013 return newMesg;1014 }1015 private static createPowerZoneMesg(): Mesg {1016 const newMesg: Mesg = new Mesg('PowerZone', MesgNum.powerZone);1017 // tslint:disable-next-line: max-line-length1018 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1019 // tslint:disable-next-line: max-line-length1020 newMesg.setField(new Field('HighValue', 1, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1021 // tslint:disable-next-line: max-line-length1022 newMesg.setField(new Field('Name', 2, FitFieldType.string, 1, 0, '', false, ProfileType.String));1023 return newMesg;1024 }1025 private static createMetZoneMesg(): Mesg {1026 const newMesg: Mesg = new Mesg('MetZone', MesgNum.metZone);1027 // tslint:disable-next-line: max-line-length1028 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1029 // tslint:disable-next-line: max-line-length1030 newMesg.setField(new Field('HighBpm', 1, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1031 // tslint:disable-next-line: max-line-length1032 newMesg.setField(new Field('Calories', 2, FitFieldType.uint16, 10, 0, 'kcal / min', false, ProfileType.Uint16));1033 // tslint:disable-next-line: max-line-length1034 newMesg.setField(new Field('FatCalories', 3, FitFieldType.uint8, 10, 0, 'kcal / min', false, ProfileType.Uint8));1035 return newMesg;1036 }1037 private static createDiveSettingsMesg(): Mesg {1038 let fieldIndex: number;1039 let subfieldIndex: number;1040 const newMesg: Mesg = new Mesg('DiveSettings', MesgNum.diveSettings);1041 fieldIndex = 0;1042 // tslint:disable-next-line: max-line-length1043 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1044 fieldIndex++;1045 // tslint:disable-next-line: max-line-length1046 newMesg.setField(new Field('Name', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));1047 fieldIndex++;1048 // tslint:disable-next-line: max-line-length1049 newMesg.setField(new Field('Model', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.TissueModelType));1050 fieldIndex++;1051 // tslint:disable-next-line: max-line-length1052 newMesg.setField(new Field('GfLow', 2, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));1053 fieldIndex++;1054 // tslint:disable-next-line: max-line-length1055 newMesg.setField(new Field('GfHigh', 3, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));1056 fieldIndex++;1057 // tslint:disable-next-line: max-line-length1058 newMesg.setField(new Field('WaterType', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.WaterType));1059 fieldIndex++;1060 // tslint:disable-next-line: max-line-length1061 newMesg.setField(new Field('WaterDensity', 5, FitFieldType.float32, 1, 0, 'kg/m^3', false, ProfileType.Float32));1062 fieldIndex++;1063 // tslint:disable-next-line: max-line-length1064 newMesg.setField(new Field('Po2Warn', 6, FitFieldType.uint8, 100, 0, 'percent', false, ProfileType.Uint8));1065 fieldIndex++;1066 // tslint:disable-next-line: max-line-length1067 newMesg.setField(new Field('Po2Critical', 7, FitFieldType.uint8, 100, 0, 'percent', false, ProfileType.Uint8));1068 fieldIndex++;1069 // tslint:disable-next-line: max-line-length1070 newMesg.setField(new Field('Po2Deco', 8, FitFieldType.uint8, 100, 0, 'percent', false, ProfileType.Uint8));1071 fieldIndex++;1072 // tslint:disable-next-line: max-line-length1073 newMesg.setField(new Field('SafetyStopEnabled', 9, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));1074 fieldIndex++;1075 // tslint:disable-next-line: max-line-length1076 newMesg.setField(new Field('BottomDepth', 10, FitFieldType.float32, 1, 0, '', false, ProfileType.Float32));1077 fieldIndex++;1078 // tslint:disable-next-line: max-line-length1079 newMesg.setField(new Field('BottomTime', 11, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));1080 fieldIndex++;1081 // tslint:disable-next-line: max-line-length1082 newMesg.setField(new Field('ApneaCountdownEnabled', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));1083 fieldIndex++;1084 // tslint:disable-next-line: max-line-length1085 newMesg.setField(new Field('ApneaCountdownTime', 13, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));1086 fieldIndex++;1087 // tslint:disable-next-line: max-line-length1088 newMesg.setField(new Field('BacklightMode', 14, FitFieldType.enum, 1, 0, '', false, ProfileType.DiveBacklightMode));1089 fieldIndex++;1090 // tslint:disable-next-line: max-line-length1091 newMesg.setField(new Field('BacklightBrightness', 15, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1092 fieldIndex++;1093 // tslint:disable-next-line: max-line-length1094 newMesg.setField(new Field('BacklightTimeout', 16, FitFieldType.uint8, 1, 0, '', false, ProfileType.BacklightTimeout));1095 fieldIndex++;1096 // tslint:disable-next-line: max-line-length1097 newMesg.setField(new Field('RepeatDiveInterval', 17, FitFieldType.uint16, 1, 0, 's', false, ProfileType.Uint16));1098 fieldIndex++;1099 // tslint:disable-next-line: max-line-length1100 newMesg.setField(new Field('SafetyStopTime', 18, FitFieldType.uint16, 1, 0, 's', false, ProfileType.Uint16));1101 fieldIndex++;1102 // tslint:disable-next-line: max-line-length1103 newMesg.setField(new Field('HeartRateSourceType', 19, FitFieldType.enum, 1, 0, '', false, ProfileType.SourceType));1104 fieldIndex++;1105 // tslint:disable-next-line: max-line-length1106 newMesg.setField(new Field('HeartRateSource', 20, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1107 subfieldIndex = 0;1108 // tslint:disable-next-line: max-line-length1109 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('HeartRateAntplusDeviceType', 2, 1, 0, ''));1110 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(19, 1);1111 subfieldIndex++;1112 // tslint:disable-next-line: max-line-length1113 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('HeartRateLocalDeviceType', 2, 1, 0, ''));1114 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(19, 5);1115 subfieldIndex++;1116 fieldIndex++;1117 return newMesg;1118 }1119 private static createDiveAlarmMesg(): Mesg {1120 const newMesg: Mesg = new Mesg('DiveAlarm', MesgNum.diveAlarm);1121 // tslint:disable-next-line: max-line-length1122 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1123 // tslint:disable-next-line: max-line-length1124 newMesg.setField(new Field('Depth', 0, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));1125 // tslint:disable-next-line: max-line-length1126 newMesg.setField(new Field('Time', 1, FitFieldType.sint32, 1, 0, 's', false, ProfileType.Sint32));1127 // tslint:disable-next-line: max-line-length1128 newMesg.setField(new Field('Enabled', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));1129 // tslint:disable-next-line: max-line-length1130 newMesg.setField(new Field('AlarmType', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.DiveAlarmType));1131 // tslint:disable-next-line: max-line-length1132 newMesg.setField(new Field('Sound', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Tone));1133 // tslint:disable-next-line: max-line-length1134 newMesg.setField(new Field('DiveTypes', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));1135 return newMesg;1136 }1137 private static createDiveGasMesg(): Mesg {1138 const newMesg: Mesg = new Mesg('DiveGas', MesgNum.diveGas);1139 // tslint:disable-next-line: max-line-length1140 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1141 // tslint:disable-next-line: max-line-length1142 newMesg.setField(new Field('HeliumContent', 0, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));1143 // tslint:disable-next-line: max-line-length1144 newMesg.setField(new Field('OxygenContent', 1, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));1145 // tslint:disable-next-line: max-line-length1146 newMesg.setField(new Field('Status', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.DiveGasStatus));1147 return newMesg;1148 }1149 private static createGoalMesg(): Mesg {1150 const newMesg: Mesg = new Mesg('Goal', MesgNum.goal);1151 // tslint:disable-next-line: max-line-length1152 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1153 // tslint:disable-next-line: max-line-length1154 newMesg.setField(new Field('Sport', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));1155 // tslint:disable-next-line: max-line-length1156 newMesg.setField(new Field('SubSport', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));1157 // tslint:disable-next-line: max-line-length1158 newMesg.setField(new Field('StartDate', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1159 // tslint:disable-next-line: max-line-length1160 newMesg.setField(new Field('EndDate', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1161 // tslint:disable-next-line: max-line-length1162 newMesg.setField(new Field('Type', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Goal));1163 // tslint:disable-next-line: max-line-length1164 newMesg.setField(new Field('Value', 5, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));1165 // tslint:disable-next-line: max-line-length1166 newMesg.setField(new Field('Repeat', 6, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));1167 // tslint:disable-next-line: max-line-length1168 newMesg.setField(new Field('TargetValue', 7, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));1169 // tslint:disable-next-line: max-line-length1170 newMesg.setField(new Field('Recurrence', 8, FitFieldType.enum, 1, 0, '', false, ProfileType.GoalRecurrence));1171 // tslint:disable-next-line: max-line-length1172 newMesg.setField(new Field('RecurrenceValue', 9, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1173 // tslint:disable-next-line: max-line-length1174 newMesg.setField(new Field('Enabled', 10, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));1175 // tslint:disable-next-line: max-line-length1176 newMesg.setField(new Field('Source', 11, FitFieldType.enum, 1, 0, '', false, ProfileType.GoalSource));1177 return newMesg;1178 }1179 private static createActivityMesg(): Mesg {1180 const newMesg: Mesg = new Mesg('Activity', MesgNum.activity);1181 // tslint:disable-next-line: max-line-length1182 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1183 // tslint:disable-next-line: max-line-length1184 newMesg.setField(new Field('TotalTimerTime', 0, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1185 // tslint:disable-next-line: max-line-length1186 newMesg.setField(new Field('NumSessions', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1187 // tslint:disable-next-line: max-line-length1188 newMesg.setField(new Field('Type', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.Activity));1189 // tslint:disable-next-line: max-line-length1190 newMesg.setField(new Field('Event', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.Event));1191 // tslint:disable-next-line: max-line-length1192 newMesg.setField(new Field('EventType', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.EventType));1193 // tslint:disable-next-line: max-line-length1194 newMesg.setField(new Field('LocalTimestamp', 5, FitFieldType.uint32, 1, 0, '', false, ProfileType.LocalDateTime));1195 // tslint:disable-next-line: max-line-length1196 newMesg.setField(new Field('EventGroup', 6, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1197 return newMesg;1198 }1199 private static createSessionMesg(): Mesg {1200 let fieldIndex: number;1201 let subfieldIndex: number;1202 const newMesg: Mesg = new Mesg('Session', MesgNum.session);1203 fieldIndex = 0;1204 // tslint:disable-next-line: max-line-length1205 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1206 fieldIndex++;1207 // tslint:disable-next-line: max-line-length1208 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));1209 fieldIndex++;1210 // tslint:disable-next-line: max-line-length1211 newMesg.setField(new Field('Event', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Event));1212 fieldIndex++;1213 // tslint:disable-next-line: max-line-length1214 newMesg.setField(new Field('EventType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.EventType));1215 fieldIndex++;1216 // tslint:disable-next-line: max-line-length1217 newMesg.setField(new Field('StartTime', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1218 fieldIndex++;1219 // tslint:disable-next-line: max-line-length1220 newMesg.setField(new Field('StartPositionLat', 3, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1221 fieldIndex++;1222 // tslint:disable-next-line: max-line-length1223 newMesg.setField(new Field('StartPositionLong', 4, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1224 fieldIndex++;1225 // tslint:disable-next-line: max-line-length1226 newMesg.setField(new Field('Sport', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));1227 fieldIndex++;1228 // tslint:disable-next-line: max-line-length1229 newMesg.setField(new Field('SubSport', 6, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));1230 fieldIndex++;1231 // tslint:disable-next-line: max-line-length1232 newMesg.setField(new Field('TotalElapsedTime', 7, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1233 fieldIndex++;1234 // tslint:disable-next-line: max-line-length1235 newMesg.setField(new Field('TotalTimerTime', 8, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1236 fieldIndex++;1237 // tslint:disable-next-line: max-line-length1238 newMesg.setField(new Field('TotalDistance', 9, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));1239 fieldIndex++;1240 // tslint:disable-next-line: max-line-length1241 newMesg.setField(new Field('TotalCycles', 10, FitFieldType.uint32, 1, 0, 'cycles', false, ProfileType.Uint32));1242 subfieldIndex = 0;1243 // tslint:disable-next-line: max-line-length1244 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TotalStrides', 134, 1, 0, 'strides'));1245 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 1);1246 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 11);1247 subfieldIndex++;1248 fieldIndex++;1249 // tslint:disable-next-line: max-line-length1250 newMesg.setField(new Field('TotalCalories', 11, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));1251 fieldIndex++;1252 // tslint:disable-next-line: max-line-length1253 newMesg.setField(new Field('TotalFatCalories', 13, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));1254 fieldIndex++;1255 // tslint:disable-next-line: max-line-length1256 newMesg.setField(new Field('AvgSpeed', 14, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1257 // tslint:disable-next-line: max-line-length1258 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(124, false, 16, 1000, 0)); // enhanced_avg_speed1259 fieldIndex++;1260 // tslint:disable-next-line: max-line-length1261 newMesg.setField(new Field('MaxSpeed', 15, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1262 // tslint:disable-next-line: max-line-length1263 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(125, false, 16, 1000, 0)); // enhanced_max_speed1264 fieldIndex++;1265 // tslint:disable-next-line: max-line-length1266 newMesg.setField(new Field('AvgHeartRate', 16, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));1267 fieldIndex++;1268 // tslint:disable-next-line: max-line-length1269 newMesg.setField(new Field('MaxHeartRate', 17, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));1270 fieldIndex++;1271 // tslint:disable-next-line: max-line-length1272 newMesg.setField(new Field('AvgCadence', 18, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1273 subfieldIndex = 0;1274 // tslint:disable-next-line: max-line-length1275 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('AvgRunningCadence', 2, 1, 0, 'strides/min'));1276 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 1);1277 subfieldIndex++;1278 fieldIndex++;1279 // tslint:disable-next-line: max-line-length1280 newMesg.setField(new Field('MaxCadence', 19, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1281 subfieldIndex = 0;1282 // tslint:disable-next-line: max-line-length1283 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('MaxRunningCadence', 2, 1, 0, 'strides/min'));1284 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 1);1285 subfieldIndex++;1286 fieldIndex++;1287 // tslint:disable-next-line: max-line-length1288 newMesg.setField(new Field('AvgPower', 20, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1289 fieldIndex++;1290 // tslint:disable-next-line: max-line-length1291 newMesg.setField(new Field('MaxPower', 21, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1292 fieldIndex++;1293 // tslint:disable-next-line: max-line-length1294 newMesg.setField(new Field('TotalAscent', 22, FitFieldType.uint16, 1, 0, 'm', false, ProfileType.Uint16));1295 fieldIndex++;1296 // tslint:disable-next-line: max-line-length1297 newMesg.setField(new Field('TotalDescent', 23, FitFieldType.uint16, 1, 0, 'm', false, ProfileType.Uint16));1298 fieldIndex++;1299 // tslint:disable-next-line: max-line-length1300 newMesg.setField(new Field('TotalTrainingEffect', 24, FitFieldType.uint8, 10, 0, '', false, ProfileType.Uint8));1301 fieldIndex++;1302 // tslint:disable-next-line: max-line-length1303 newMesg.setField(new Field('FirstLapIndex', 25, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1304 fieldIndex++;1305 // tslint:disable-next-line: max-line-length1306 newMesg.setField(new Field('NumLaps', 26, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1307 fieldIndex++;1308 // tslint:disable-next-line: max-line-length1309 newMesg.setField(new Field('EventGroup', 27, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1310 fieldIndex++;1311 // tslint:disable-next-line: max-line-length1312 newMesg.setField(new Field('Trigger', 28, FitFieldType.enum, 1, 0, '', false, ProfileType.SessionTrigger));1313 fieldIndex++;1314 // tslint:disable-next-line: max-line-length1315 newMesg.setField(new Field('NecLat', 29, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1316 fieldIndex++;1317 // tslint:disable-next-line: max-line-length1318 newMesg.setField(new Field('NecLong', 30, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1319 fieldIndex++;1320 // tslint:disable-next-line: max-line-length1321 newMesg.setField(new Field('SwcLat', 31, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1322 fieldIndex++;1323 // tslint:disable-next-line: max-line-length1324 newMesg.setField(new Field('SwcLong', 32, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1325 fieldIndex++;1326 // tslint:disable-next-line: max-line-length1327 newMesg.setField(new Field('NormalizedPower', 34, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1328 fieldIndex++;1329 // tslint:disable-next-line: max-line-length1330 newMesg.setField(new Field('TrainingStressScore', 35, FitFieldType.uint16, 10, 0, 'tss', false, ProfileType.Uint16));1331 fieldIndex++;1332 // tslint:disable-next-line: max-line-length1333 newMesg.setField(new Field('IntensityFactor', 36, FitFieldType.uint16, 1000, 0, 'if', false, ProfileType.Uint16));1334 fieldIndex++;1335 // tslint:disable-next-line: max-line-length1336 newMesg.setField(new Field('LeftRightBalance', 37, FitFieldType.uint16, 1, 0, '', false, ProfileType.LeftRightBalance100));1337 fieldIndex++;1338 // tslint:disable-next-line: max-line-length1339 newMesg.setField(new Field('AvgStrokeCount', 41, FitFieldType.uint32, 10, 0, 'strokes/lap', false, ProfileType.Uint32));1340 fieldIndex++;1341 // tslint:disable-next-line: max-line-length1342 newMesg.setField(new Field('AvgStrokeDistance', 42, FitFieldType.uint16, 100, 0, 'm', false, ProfileType.Uint16));1343 fieldIndex++;1344 // tslint:disable-next-line: max-line-length1345 newMesg.setField(new Field('SwimStroke', 43, FitFieldType.enum, 1, 0, 'swim_stroke', false, ProfileType.SwimStroke));1346 fieldIndex++;1347 // tslint:disable-next-line: max-line-length1348 newMesg.setField(new Field('PoolLength', 44, FitFieldType.uint16, 100, 0, 'm', false, ProfileType.Uint16));1349 fieldIndex++;1350 // tslint:disable-next-line: max-line-length1351 newMesg.setField(new Field('ThresholdPower', 45, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1352 fieldIndex++;1353 // tslint:disable-next-line: max-line-length1354 newMesg.setField(new Field('PoolLengthUnit', 46, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));1355 fieldIndex++;1356 // tslint:disable-next-line: max-line-length1357 newMesg.setField(new Field('NumActiveLengths', 47, FitFieldType.uint16, 1, 0, 'lengths', false, ProfileType.Uint16));1358 fieldIndex++;1359 // tslint:disable-next-line: max-line-length1360 newMesg.setField(new Field('TotalWork', 48, FitFieldType.uint32, 1, 0, 'J', false, ProfileType.Uint32));1361 fieldIndex++;1362 // tslint:disable-next-line: max-line-length1363 newMesg.setField(new Field('AvgAltitude', 49, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1364 // tslint:disable-next-line: max-line-length1365 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(126, false, 16, 5, 500)); // enhanced_avg_altitude1366 fieldIndex++;1367 // tslint:disable-next-line: max-line-length1368 newMesg.setField(new Field('MaxAltitude', 50, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1369 // tslint:disable-next-line: max-line-length1370 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(128, false, 16, 5, 500)); // enhanced_max_altitude1371 fieldIndex++;1372 // tslint:disable-next-line: max-line-length1373 newMesg.setField(new Field('GpsAccuracy', 51, FitFieldType.uint8, 1, 0, 'm', false, ProfileType.Uint8));1374 fieldIndex++;1375 // tslint:disable-next-line: max-line-length1376 newMesg.setField(new Field('AvgGrade', 52, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1377 fieldIndex++;1378 // tslint:disable-next-line: max-line-length1379 newMesg.setField(new Field('AvgPosGrade', 53, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1380 fieldIndex++;1381 // tslint:disable-next-line: max-line-length1382 newMesg.setField(new Field('AvgNegGrade', 54, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1383 fieldIndex++;1384 // tslint:disable-next-line: max-line-length1385 newMesg.setField(new Field('MaxPosGrade', 55, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1386 fieldIndex++;1387 // tslint:disable-next-line: max-line-length1388 newMesg.setField(new Field('MaxNegGrade', 56, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1389 fieldIndex++;1390 // tslint:disable-next-line: max-line-length1391 newMesg.setField(new Field('AvgTemperature', 57, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));1392 fieldIndex++;1393 // tslint:disable-next-line: max-line-length1394 newMesg.setField(new Field('MaxTemperature', 58, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));1395 fieldIndex++;1396 // tslint:disable-next-line: max-line-length1397 newMesg.setField(new Field('TotalMovingTime', 59, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1398 fieldIndex++;1399 // tslint:disable-next-line: max-line-length1400 newMesg.setField(new Field('AvgPosVerticalSpeed', 60, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1401 fieldIndex++;1402 // tslint:disable-next-line: max-line-length1403 newMesg.setField(new Field('AvgNegVerticalSpeed', 61, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1404 fieldIndex++;1405 // tslint:disable-next-line: max-line-length1406 newMesg.setField(new Field('MaxPosVerticalSpeed', 62, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1407 fieldIndex++;1408 // tslint:disable-next-line: max-line-length1409 newMesg.setField(new Field('MaxNegVerticalSpeed', 63, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1410 fieldIndex++;1411 // tslint:disable-next-line: max-line-length1412 newMesg.setField(new Field('MinHeartRate', 64, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));1413 fieldIndex++;1414 // tslint:disable-next-line: max-line-length1415 newMesg.setField(new Field('TimeInHrZone', 65, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1416 fieldIndex++;1417 // tslint:disable-next-line: max-line-length1418 newMesg.setField(new Field('TimeInSpeedZone', 66, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1419 fieldIndex++;1420 // tslint:disable-next-line: max-line-length1421 newMesg.setField(new Field('TimeInCadenceZone', 67, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1422 fieldIndex++;1423 // tslint:disable-next-line: max-line-length1424 newMesg.setField(new Field('TimeInPowerZone', 68, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1425 fieldIndex++;1426 // tslint:disable-next-line: max-line-length1427 newMesg.setField(new Field('AvgLapTime', 69, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1428 fieldIndex++;1429 // tslint:disable-next-line: max-line-length1430 newMesg.setField(new Field('BestLapIndex', 70, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1431 fieldIndex++;1432 // tslint:disable-next-line: max-line-length1433 newMesg.setField(new Field('MinAltitude', 71, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1434 // tslint:disable-next-line: max-line-length1435 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(127, false, 16, 5, 500)); // enhanced_min_altitude1436 fieldIndex++;1437 // tslint:disable-next-line: max-line-length1438 newMesg.setField(new Field('PlayerScore', 82, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1439 fieldIndex++;1440 // tslint:disable-next-line: max-line-length1441 newMesg.setField(new Field('OpponentScore', 83, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1442 fieldIndex++;1443 // tslint:disable-next-line: max-line-length1444 newMesg.setField(new Field('OpponentName', 84, FitFieldType.string, 1, 0, '', false, ProfileType.String));1445 fieldIndex++;1446 // tslint:disable-next-line: max-line-length1447 newMesg.setField(new Field('StrokeCount', 85, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));1448 fieldIndex++;1449 // tslint:disable-next-line: max-line-length1450 newMesg.setField(new Field('ZoneCount', 86, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));1451 fieldIndex++;1452 // tslint:disable-next-line: max-line-length1453 newMesg.setField(new Field('MaxBallSpeed', 87, FitFieldType.uint16, 100, 0, 'm/s', false, ProfileType.Uint16));1454 fieldIndex++;1455 // tslint:disable-next-line: max-line-length1456 newMesg.setField(new Field('AvgBallSpeed', 88, FitFieldType.uint16, 100, 0, 'm/s', false, ProfileType.Uint16));1457 fieldIndex++;1458 // tslint:disable-next-line: max-line-length1459 newMesg.setField(new Field('AvgVerticalOscillation', 89, FitFieldType.uint16, 10, 0, 'mm', false, ProfileType.Uint16));1460 fieldIndex++;1461 // tslint:disable-next-line: max-line-length1462 newMesg.setField(new Field('AvgStanceTimePercent', 90, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));1463 fieldIndex++;1464 // tslint:disable-next-line: max-line-length1465 newMesg.setField(new Field('AvgStanceTime', 91, FitFieldType.uint16, 10, 0, 'ms', false, ProfileType.Uint16));1466 fieldIndex++;1467 // tslint:disable-next-line: max-line-length1468 newMesg.setField(new Field('AvgFractionalCadence', 92, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));1469 fieldIndex++;1470 // tslint:disable-next-line: max-line-length1471 newMesg.setField(new Field('MaxFractionalCadence', 93, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));1472 fieldIndex++;1473 // tslint:disable-next-line: max-line-length1474 newMesg.setField(new Field('TotalFractionalCycles', 94, FitFieldType.uint8, 128, 0, 'cycles', false, ProfileType.Uint8));1475 fieldIndex++;1476 // tslint:disable-next-line: max-line-length1477 newMesg.setField(new Field('AvgTotalHemoglobinConc', 95, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));1478 fieldIndex++;1479 // tslint:disable-next-line: max-line-length1480 newMesg.setField(new Field('MinTotalHemoglobinConc', 96, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));1481 fieldIndex++;1482 // tslint:disable-next-line: max-line-length1483 newMesg.setField(new Field('MaxTotalHemoglobinConc', 97, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));1484 fieldIndex++;1485 // tslint:disable-next-line: max-line-length1486 newMesg.setField(new Field('AvgSaturatedHemoglobinPercent', 98, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));1487 fieldIndex++;1488 // tslint:disable-next-line: max-line-length1489 newMesg.setField(new Field('MinSaturatedHemoglobinPercent', 99, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));1490 fieldIndex++;1491 // tslint:disable-next-line: max-line-length1492 newMesg.setField(new Field('MaxSaturatedHemoglobinPercent', 100, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));1493 fieldIndex++;1494 // tslint:disable-next-line: max-line-length1495 newMesg.setField(new Field('AvgLeftTorqueEffectiveness', 101, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1496 fieldIndex++;1497 // tslint:disable-next-line: max-line-length1498 newMesg.setField(new Field('AvgRightTorqueEffectiveness', 102, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1499 fieldIndex++;1500 // tslint:disable-next-line: max-line-length1501 newMesg.setField(new Field('AvgLeftPedalSmoothness', 103, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1502 fieldIndex++;1503 // tslint:disable-next-line: max-line-length1504 newMesg.setField(new Field('AvgRightPedalSmoothness', 104, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1505 fieldIndex++;1506 // tslint:disable-next-line: max-line-length1507 newMesg.setField(new Field('AvgCombinedPedalSmoothness', 105, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1508 fieldIndex++;1509 // tslint:disable-next-line: max-line-length1510 newMesg.setField(new Field('SportIndex', 111, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1511 fieldIndex++;1512 // tslint:disable-next-line: max-line-length1513 newMesg.setField(new Field('TimeStanding', 112, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1514 fieldIndex++;1515 // tslint:disable-next-line: max-line-length1516 newMesg.setField(new Field('StandCount', 113, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1517 fieldIndex++;1518 // tslint:disable-next-line: max-line-length1519 newMesg.setField(new Field('AvgLeftPco', 114, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));1520 fieldIndex++;1521 // tslint:disable-next-line: max-line-length1522 newMesg.setField(new Field('AvgRightPco', 115, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));1523 fieldIndex++;1524 // tslint:disable-next-line: max-line-length1525 newMesg.setField(new Field('AvgLeftPowerPhase', 116, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1526 fieldIndex++;1527 // tslint:disable-next-line: max-line-length1528 newMesg.setField(new Field('AvgLeftPowerPhasePeak', 117, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1529 fieldIndex++;1530 // tslint:disable-next-line: max-line-length1531 newMesg.setField(new Field('AvgRightPowerPhase', 118, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1532 fieldIndex++;1533 // tslint:disable-next-line: max-line-length1534 newMesg.setField(new Field('AvgRightPowerPhasePeak', 119, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1535 fieldIndex++;1536 // tslint:disable-next-line: max-line-length1537 newMesg.setField(new Field('AvgPowerPosition', 120, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1538 fieldIndex++;1539 // tslint:disable-next-line: max-line-length1540 newMesg.setField(new Field('MaxPowerPosition', 121, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1541 fieldIndex++;1542 // tslint:disable-next-line: max-line-length1543 newMesg.setField(new Field('AvgCadencePosition', 122, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1544 fieldIndex++;1545 // tslint:disable-next-line: max-line-length1546 newMesg.setField(new Field('MaxCadencePosition', 123, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1547 fieldIndex++;1548 // tslint:disable-next-line: max-line-length1549 newMesg.setField(new Field('EnhancedAvgSpeed', 124, FitFieldType.uint32, 1000, 0, 'm/s', false, ProfileType.Uint32));1550 fieldIndex++;1551 // tslint:disable-next-line: max-line-length1552 newMesg.setField(new Field('EnhancedMaxSpeed', 125, FitFieldType.uint32, 1000, 0, 'm/s', false, ProfileType.Uint32));1553 fieldIndex++;1554 // tslint:disable-next-line: max-line-length1555 newMesg.setField(new Field('EnhancedAvgAltitude', 126, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));1556 fieldIndex++;1557 // tslint:disable-next-line: max-line-length1558 newMesg.setField(new Field('EnhancedMinAltitude', 127, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));1559 fieldIndex++;1560 // tslint:disable-next-line: max-line-length1561 newMesg.setField(new Field('EnhancedMaxAltitude', 128, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));1562 fieldIndex++;1563 // tslint:disable-next-line: max-line-length1564 newMesg.setField(new Field('AvgLevMotorPower', 129, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1565 fieldIndex++;1566 // tslint:disable-next-line: max-line-length1567 newMesg.setField(new Field('MaxLevMotorPower', 130, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1568 fieldIndex++;1569 // tslint:disable-next-line: max-line-length1570 newMesg.setField(new Field('LevBatteryConsumption', 131, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1571 fieldIndex++;1572 // tslint:disable-next-line: max-line-length1573 newMesg.setField(new Field('AvgVerticalRatio', 132, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));1574 fieldIndex++;1575 // tslint:disable-next-line: max-line-length1576 newMesg.setField(new Field('AvgStanceTimeBalance', 133, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));1577 fieldIndex++;1578 // tslint:disable-next-line: max-line-length1579 newMesg.setField(new Field('AvgStepLength', 134, FitFieldType.uint16, 10, 0, 'mm', false, ProfileType.Uint16));1580 fieldIndex++;1581 // tslint:disable-next-line: max-line-length1582 newMesg.setField(new Field('TotalAnaerobicTrainingEffect', 137, FitFieldType.uint8, 10, 0, '', false, ProfileType.Uint8));1583 fieldIndex++;1584 // tslint:disable-next-line: max-line-length1585 newMesg.setField(new Field('AvgVam', 139, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1586 fieldIndex++;1587 return newMesg;1588 }1589 private static createLapMesg(): Mesg {1590 let fieldIndex: number;1591 let subfieldIndex: number;1592 const newMesg: Mesg = new Mesg('Lap', MesgNum.lap);1593 fieldIndex = 0;1594 // tslint:disable-next-line: max-line-length1595 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1596 fieldIndex++;1597 // tslint:disable-next-line: max-line-length1598 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));1599 fieldIndex++;1600 // tslint:disable-next-line: max-line-length1601 newMesg.setField(new Field('Event', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Event));1602 fieldIndex++;1603 // tslint:disable-next-line: max-line-length1604 newMesg.setField(new Field('EventType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.EventType));1605 fieldIndex++;1606 // tslint:disable-next-line: max-line-length1607 newMesg.setField(new Field('StartTime', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1608 fieldIndex++;1609 // tslint:disable-next-line: max-line-length1610 newMesg.setField(new Field('StartPositionLat', 3, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1611 fieldIndex++;1612 // tslint:disable-next-line: max-line-length1613 newMesg.setField(new Field('StartPositionLong', 4, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1614 fieldIndex++;1615 // tslint:disable-next-line: max-line-length1616 newMesg.setField(new Field('EndPositionLat', 5, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1617 fieldIndex++;1618 // tslint:disable-next-line: max-line-length1619 newMesg.setField(new Field('EndPositionLong', 6, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1620 fieldIndex++;1621 // tslint:disable-next-line: max-line-length1622 newMesg.setField(new Field('TotalElapsedTime', 7, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1623 fieldIndex++;1624 // tslint:disable-next-line: max-line-length1625 newMesg.setField(new Field('TotalTimerTime', 8, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1626 fieldIndex++;1627 // tslint:disable-next-line: max-line-length1628 newMesg.setField(new Field('TotalDistance', 9, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));1629 fieldIndex++;1630 // tslint:disable-next-line: max-line-length1631 newMesg.setField(new Field('TotalCycles', 10, FitFieldType.uint32, 1, 0, 'cycles', false, ProfileType.Uint32));1632 subfieldIndex = 0;1633 // tslint:disable-next-line: max-line-length1634 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TotalStrides', 134, 1, 0, 'strides'));1635 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(25, 1);1636 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(25, 11);1637 subfieldIndex++;1638 fieldIndex++;1639 // tslint:disable-next-line: max-line-length1640 newMesg.setField(new Field('TotalCalories', 11, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));1641 fieldIndex++;1642 // tslint:disable-next-line: max-line-length1643 newMesg.setField(new Field('TotalFatCalories', 12, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));1644 fieldIndex++;1645 // tslint:disable-next-line: max-line-length1646 newMesg.setField(new Field('AvgSpeed', 13, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1647 // tslint:disable-next-line: max-line-length1648 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(110, false, 16, 1000, 0)); // enhanced_avg_speed1649 fieldIndex++;1650 // tslint:disable-next-line: max-line-length1651 newMesg.setField(new Field('MaxSpeed', 14, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1652 // tslint:disable-next-line: max-line-length1653 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(111, false, 16, 1000, 0)); // enhanced_max_speed1654 fieldIndex++;1655 // tslint:disable-next-line: max-line-length1656 newMesg.setField(new Field('AvgHeartRate', 15, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));1657 fieldIndex++;1658 // tslint:disable-next-line: max-line-length1659 newMesg.setField(new Field('MaxHeartRate', 16, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));1660 fieldIndex++;1661 // tslint:disable-next-line: max-line-length1662 newMesg.setField(new Field('AvgCadence', 17, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1663 subfieldIndex = 0;1664 // tslint:disable-next-line: max-line-length1665 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('AvgRunningCadence', 2, 1, 0, 'strides/min'));1666 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(25, 1);1667 subfieldIndex++;1668 fieldIndex++;1669 // tslint:disable-next-line: max-line-length1670 newMesg.setField(new Field('MaxCadence', 18, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1671 subfieldIndex = 0;1672 // tslint:disable-next-line: max-line-length1673 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('MaxRunningCadence', 2, 1, 0, 'strides/min'));1674 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(25, 1);1675 subfieldIndex++;1676 fieldIndex++;1677 // tslint:disable-next-line: max-line-length1678 newMesg.setField(new Field('AvgPower', 19, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1679 fieldIndex++;1680 // tslint:disable-next-line: max-line-length1681 newMesg.setField(new Field('MaxPower', 20, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1682 fieldIndex++;1683 // tslint:disable-next-line: max-line-length1684 newMesg.setField(new Field('TotalAscent', 21, FitFieldType.uint16, 1, 0, 'm', false, ProfileType.Uint16));1685 fieldIndex++;1686 // tslint:disable-next-line: max-line-length1687 newMesg.setField(new Field('TotalDescent', 22, FitFieldType.uint16, 1, 0, 'm', false, ProfileType.Uint16));1688 fieldIndex++;1689 // tslint:disable-next-line: max-line-length1690 newMesg.setField(new Field('Intensity', 23, FitFieldType.enum, 1, 0, '', false, ProfileType.Intensity));1691 fieldIndex++;1692 // tslint:disable-next-line: max-line-length1693 newMesg.setField(new Field('LapTrigger', 24, FitFieldType.enum, 1, 0, '', false, ProfileType.LapTrigger));1694 fieldIndex++;1695 // tslint:disable-next-line: max-line-length1696 newMesg.setField(new Field('Sport', 25, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));1697 fieldIndex++;1698 // tslint:disable-next-line: max-line-length1699 newMesg.setField(new Field('EventGroup', 26, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1700 fieldIndex++;1701 // tslint:disable-next-line: max-line-length1702 newMesg.setField(new Field('NumLengths', 32, FitFieldType.uint16, 1, 0, 'lengths', false, ProfileType.Uint16));1703 fieldIndex++;1704 // tslint:disable-next-line: max-line-length1705 newMesg.setField(new Field('NormalizedPower', 33, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1706 fieldIndex++;1707 // tslint:disable-next-line: max-line-length1708 newMesg.setField(new Field('LeftRightBalance', 34, FitFieldType.uint16, 1, 0, '', false, ProfileType.LeftRightBalance100));1709 fieldIndex++;1710 // tslint:disable-next-line: max-line-length1711 newMesg.setField(new Field('FirstLengthIndex', 35, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1712 fieldIndex++;1713 // tslint:disable-next-line: max-line-length1714 newMesg.setField(new Field('AvgStrokeDistance', 37, FitFieldType.uint16, 100, 0, 'm', false, ProfileType.Uint16));1715 fieldIndex++;1716 // tslint:disable-next-line: max-line-length1717 newMesg.setField(new Field('SwimStroke', 38, FitFieldType.enum, 1, 0, '', false, ProfileType.SwimStroke));1718 fieldIndex++;1719 // tslint:disable-next-line: max-line-length1720 newMesg.setField(new Field('SubSport', 39, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));1721 fieldIndex++;1722 // tslint:disable-next-line: max-line-length1723 newMesg.setField(new Field('NumActiveLengths', 40, FitFieldType.uint16, 1, 0, 'lengths', false, ProfileType.Uint16));1724 fieldIndex++;1725 // tslint:disable-next-line: max-line-length1726 newMesg.setField(new Field('TotalWork', 41, FitFieldType.uint32, 1, 0, 'J', false, ProfileType.Uint32));1727 fieldIndex++;1728 // tslint:disable-next-line: max-line-length1729 newMesg.setField(new Field('AvgAltitude', 42, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1730 // tslint:disable-next-line: max-line-length1731 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(112, false, 16, 5, 500)); // enhanced_avg_altitude1732 fieldIndex++;1733 // tslint:disable-next-line: max-line-length1734 newMesg.setField(new Field('MaxAltitude', 43, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1735 // tslint:disable-next-line: max-line-length1736 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(114, false, 16, 5, 500)); // enhanced_max_altitude1737 fieldIndex++;1738 // tslint:disable-next-line: max-line-length1739 newMesg.setField(new Field('GpsAccuracy', 44, FitFieldType.uint8, 1, 0, 'm', false, ProfileType.Uint8));1740 fieldIndex++;1741 // tslint:disable-next-line: max-line-length1742 newMesg.setField(new Field('AvgGrade', 45, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1743 fieldIndex++;1744 // tslint:disable-next-line: max-line-length1745 newMesg.setField(new Field('AvgPosGrade', 46, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1746 fieldIndex++;1747 // tslint:disable-next-line: max-line-length1748 newMesg.setField(new Field('AvgNegGrade', 47, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1749 fieldIndex++;1750 // tslint:disable-next-line: max-line-length1751 newMesg.setField(new Field('MaxPosGrade', 48, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1752 fieldIndex++;1753 // tslint:disable-next-line: max-line-length1754 newMesg.setField(new Field('MaxNegGrade', 49, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));1755 fieldIndex++;1756 // tslint:disable-next-line: max-line-length1757 newMesg.setField(new Field('AvgTemperature', 50, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));1758 fieldIndex++;1759 // tslint:disable-next-line: max-line-length1760 newMesg.setField(new Field('MaxTemperature', 51, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));1761 fieldIndex++;1762 // tslint:disable-next-line: max-line-length1763 newMesg.setField(new Field('TotalMovingTime', 52, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1764 fieldIndex++;1765 // tslint:disable-next-line: max-line-length1766 newMesg.setField(new Field('AvgPosVerticalSpeed', 53, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1767 fieldIndex++;1768 // tslint:disable-next-line: max-line-length1769 newMesg.setField(new Field('AvgNegVerticalSpeed', 54, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1770 fieldIndex++;1771 // tslint:disable-next-line: max-line-length1772 newMesg.setField(new Field('MaxPosVerticalSpeed', 55, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1773 fieldIndex++;1774 // tslint:disable-next-line: max-line-length1775 newMesg.setField(new Field('MaxNegVerticalSpeed', 56, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));1776 fieldIndex++;1777 // tslint:disable-next-line: max-line-length1778 newMesg.setField(new Field('TimeInHrZone', 57, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1779 fieldIndex++;1780 // tslint:disable-next-line: max-line-length1781 newMesg.setField(new Field('TimeInSpeedZone', 58, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1782 fieldIndex++;1783 // tslint:disable-next-line: max-line-length1784 newMesg.setField(new Field('TimeInCadenceZone', 59, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1785 fieldIndex++;1786 // tslint:disable-next-line: max-line-length1787 newMesg.setField(new Field('TimeInPowerZone', 60, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1788 fieldIndex++;1789 // tslint:disable-next-line: max-line-length1790 newMesg.setField(new Field('RepetitionNum', 61, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1791 fieldIndex++;1792 // tslint:disable-next-line: max-line-length1793 newMesg.setField(new Field('MinAltitude', 62, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1794 // tslint:disable-next-line: max-line-length1795 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(113, false, 16, 5, 500)); // enhanced_min_altitude1796 fieldIndex++;1797 // tslint:disable-next-line: max-line-length1798 newMesg.setField(new Field('MinHeartRate', 63, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));1799 fieldIndex++;1800 // tslint:disable-next-line: max-line-length1801 newMesg.setField(new Field('WktStepIndex', 71, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1802 fieldIndex++;1803 // tslint:disable-next-line: max-line-length1804 newMesg.setField(new Field('OpponentScore', 74, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1805 fieldIndex++;1806 // tslint:disable-next-line: max-line-length1807 newMesg.setField(new Field('StrokeCount', 75, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));1808 fieldIndex++;1809 // tslint:disable-next-line: max-line-length1810 newMesg.setField(new Field('ZoneCount', 76, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));1811 fieldIndex++;1812 // tslint:disable-next-line: max-line-length1813 newMesg.setField(new Field('AvgVerticalOscillation', 77, FitFieldType.uint16, 10, 0, 'mm', false, ProfileType.Uint16));1814 fieldIndex++;1815 // tslint:disable-next-line: max-line-length1816 newMesg.setField(new Field('AvgStanceTimePercent', 78, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));1817 fieldIndex++;1818 // tslint:disable-next-line: max-line-length1819 newMesg.setField(new Field('AvgStanceTime', 79, FitFieldType.uint16, 10, 0, 'ms', false, ProfileType.Uint16));1820 fieldIndex++;1821 // tslint:disable-next-line: max-line-length1822 newMesg.setField(new Field('AvgFractionalCadence', 80, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));1823 fieldIndex++;1824 // tslint:disable-next-line: max-line-length1825 newMesg.setField(new Field('MaxFractionalCadence', 81, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));1826 fieldIndex++;1827 // tslint:disable-next-line: max-line-length1828 newMesg.setField(new Field('TotalFractionalCycles', 82, FitFieldType.uint8, 128, 0, 'cycles', false, ProfileType.Uint8));1829 fieldIndex++;1830 // tslint:disable-next-line: max-line-length1831 newMesg.setField(new Field('PlayerScore', 83, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1832 fieldIndex++;1833 // tslint:disable-next-line: max-line-length1834 newMesg.setField(new Field('AvgTotalHemoglobinConc', 84, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));1835 fieldIndex++;1836 // tslint:disable-next-line: max-line-length1837 newMesg.setField(new Field('MinTotalHemoglobinConc', 85, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));1838 fieldIndex++;1839 // tslint:disable-next-line: max-line-length1840 newMesg.setField(new Field('MaxTotalHemoglobinConc', 86, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));1841 fieldIndex++;1842 // tslint:disable-next-line: max-line-length1843 newMesg.setField(new Field('AvgSaturatedHemoglobinPercent', 87, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));1844 fieldIndex++;1845 // tslint:disable-next-line: max-line-length1846 newMesg.setField(new Field('MinSaturatedHemoglobinPercent', 88, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));1847 fieldIndex++;1848 // tslint:disable-next-line: max-line-length1849 newMesg.setField(new Field('MaxSaturatedHemoglobinPercent', 89, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));1850 fieldIndex++;1851 // tslint:disable-next-line: max-line-length1852 newMesg.setField(new Field('AvgLeftTorqueEffectiveness', 91, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1853 fieldIndex++;1854 // tslint:disable-next-line: max-line-length1855 newMesg.setField(new Field('AvgRightTorqueEffectiveness', 92, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1856 fieldIndex++;1857 // tslint:disable-next-line: max-line-length1858 newMesg.setField(new Field('AvgLeftPedalSmoothness', 93, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1859 fieldIndex++;1860 // tslint:disable-next-line: max-line-length1861 newMesg.setField(new Field('AvgRightPedalSmoothness', 94, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1862 fieldIndex++;1863 // tslint:disable-next-line: max-line-length1864 newMesg.setField(new Field('AvgCombinedPedalSmoothness', 95, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1865 fieldIndex++;1866 // tslint:disable-next-line: max-line-length1867 newMesg.setField(new Field('TimeStanding', 98, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1868 fieldIndex++;1869 // tslint:disable-next-line: max-line-length1870 newMesg.setField(new Field('StandCount', 99, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1871 fieldIndex++;1872 // tslint:disable-next-line: max-line-length1873 newMesg.setField(new Field('AvgLeftPco', 100, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));1874 fieldIndex++;1875 // tslint:disable-next-line: max-line-length1876 newMesg.setField(new Field('AvgRightPco', 101, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));1877 fieldIndex++;1878 // tslint:disable-next-line: max-line-length1879 newMesg.setField(new Field('AvgLeftPowerPhase', 102, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1880 fieldIndex++;1881 // tslint:disable-next-line: max-line-length1882 newMesg.setField(new Field('AvgLeftPowerPhasePeak', 103, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1883 fieldIndex++;1884 // tslint:disable-next-line: max-line-length1885 newMesg.setField(new Field('AvgRightPowerPhase', 104, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1886 fieldIndex++;1887 // tslint:disable-next-line: max-line-length1888 newMesg.setField(new Field('AvgRightPowerPhasePeak', 105, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));1889 fieldIndex++;1890 // tslint:disable-next-line: max-line-length1891 newMesg.setField(new Field('AvgPowerPosition', 106, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1892 fieldIndex++;1893 // tslint:disable-next-line: max-line-length1894 newMesg.setField(new Field('MaxPowerPosition', 107, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1895 fieldIndex++;1896 // tslint:disable-next-line: max-line-length1897 newMesg.setField(new Field('AvgCadencePosition', 108, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1898 fieldIndex++;1899 // tslint:disable-next-line: max-line-length1900 newMesg.setField(new Field('MaxCadencePosition', 109, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));1901 fieldIndex++;1902 // tslint:disable-next-line: max-line-length1903 newMesg.setField(new Field('EnhancedAvgSpeed', 110, FitFieldType.uint32, 1000, 0, 'm/s', false, ProfileType.Uint32));1904 fieldIndex++;1905 // tslint:disable-next-line: max-line-length1906 newMesg.setField(new Field('EnhancedMaxSpeed', 111, FitFieldType.uint32, 1000, 0, 'm/s', false, ProfileType.Uint32));1907 fieldIndex++;1908 // tslint:disable-next-line: max-line-length1909 newMesg.setField(new Field('EnhancedAvgAltitude', 112, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));1910 fieldIndex++;1911 // tslint:disable-next-line: max-line-length1912 newMesg.setField(new Field('EnhancedMinAltitude', 113, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));1913 fieldIndex++;1914 // tslint:disable-next-line: max-line-length1915 newMesg.setField(new Field('EnhancedMaxAltitude', 114, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));1916 fieldIndex++;1917 // tslint:disable-next-line: max-line-length1918 newMesg.setField(new Field('AvgLevMotorPower', 115, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1919 fieldIndex++;1920 // tslint:disable-next-line: max-line-length1921 newMesg.setField(new Field('MaxLevMotorPower', 116, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));1922 fieldIndex++;1923 // tslint:disable-next-line: max-line-length1924 newMesg.setField(new Field('LevBatteryConsumption', 117, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));1925 fieldIndex++;1926 // tslint:disable-next-line: max-line-length1927 newMesg.setField(new Field('AvgVerticalRatio', 118, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));1928 fieldIndex++;1929 // tslint:disable-next-line: max-line-length1930 newMesg.setField(new Field('AvgStanceTimeBalance', 119, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));1931 fieldIndex++;1932 // tslint:disable-next-line: max-line-length1933 newMesg.setField(new Field('AvgStepLength', 120, FitFieldType.uint16, 10, 0, 'mm', false, ProfileType.Uint16));1934 fieldIndex++;1935 // tslint:disable-next-line: max-line-length1936 newMesg.setField(new Field('AvgVam', 121, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1937 fieldIndex++;1938 return newMesg;1939 }1940 private static createLengthMesg(): Mesg {1941 const newMesg: Mesg = new Mesg('Length', MesgNum.Length);1942 // tslint:disable-next-line: max-line-length1943 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));1944 // tslint:disable-next-line: max-line-length1945 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1946 // tslint:disable-next-line: max-line-length1947 newMesg.setField(new Field('Event', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Event));1948 // tslint:disable-next-line: max-line-length1949 newMesg.setField(new Field('EventType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.EventType));1950 // tslint:disable-next-line: max-line-length1951 newMesg.setField(new Field('StartTime', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));1952 // tslint:disable-next-line: max-line-length1953 newMesg.setField(new Field('TotalElapsedTime', 3, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1954 // tslint:disable-next-line: max-line-length1955 newMesg.setField(new Field('TotalTimerTime', 4, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));1956 // tslint:disable-next-line: max-line-length1957 newMesg.setField(new Field('TotalStrokes', 5, FitFieldType.uint16, 1, 0, 'strokes', false, ProfileType.Uint16));1958 // tslint:disable-next-line: max-line-length1959 newMesg.setField(new Field('AvgSpeed', 6, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));1960 // tslint:disable-next-line: max-line-length1961 newMesg.setField(new Field('SwimStroke', 7, FitFieldType.enum, 1, 0, 'swim_stroke', false, ProfileType.SwimStroke));1962 // tslint:disable-next-line: max-line-length1963 newMesg.setField(new Field('AvgSwimmingCadence', 9, FitFieldType.uint8, 1, 0, 'strokes/min', false, ProfileType.Uint8));1964 // tslint:disable-next-line: max-line-length1965 newMesg.setField(new Field('EventGroup', 10, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));1966 // tslint:disable-next-line: max-line-length1967 newMesg.setField(new Field('TotalCalories', 11, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));1968 // tslint:disable-next-line: max-line-length1969 newMesg.setField(new Field('LengthType', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.LengthType));1970 // tslint:disable-next-line: max-line-length1971 newMesg.setField(new Field('PlayerScore', 18, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1972 // tslint:disable-next-line: max-line-length1973 newMesg.setField(new Field('OpponentScore', 19, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));1974 // tslint:disable-next-line: max-line-length1975 newMesg.setField(new Field('StrokeCount', 20, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));1976 // tslint:disable-next-line: max-line-length1977 newMesg.setField(new Field('ZoneCount', 21, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));1978 return newMesg;1979 }1980 private static createRecordMesg(): Mesg {1981 let fieldIndex: number;1982 const newMesg: Mesg = new Mesg('Record', MesgNum.record);1983 fieldIndex = 0;1984 // tslint:disable-next-line: max-line-length1985 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));1986 fieldIndex++;1987 // tslint:disable-next-line: max-line-length1988 newMesg.setField(new Field('PositionLat', 0, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1989 fieldIndex++;1990 // tslint:disable-next-line: max-line-length1991 newMesg.setField(new Field('PositionLong', 1, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));1992 fieldIndex++;1993 // tslint:disable-next-line: max-line-length1994 newMesg.setField(new Field('Altitude', 2, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));1995 // tslint:disable-next-line: max-line-length1996 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(78, false, 16, 5, 500)); // enhanced_altitude1997 fieldIndex++;1998 // tslint:disable-next-line: max-line-length1999 newMesg.setField(new Field('HeartRate', 3, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));2000 fieldIndex++;2001 // tslint:disable-next-line: max-line-length2002 newMesg.setField(new Field('Cadence', 4, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));2003 fieldIndex++;2004 // tslint:disable-next-line: max-line-length2005 newMesg.setField(new Field('Distance', 5, FitFieldType.uint32, 100, 0, 'm', true, ProfileType.Uint32));2006 fieldIndex++;2007 // tslint:disable-next-line: max-line-length2008 newMesg.setField(new Field('Speed', 6, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));2009 // tslint:disable-next-line: max-line-length2010 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(73, false, 16, 1000, 0)); // enhanced_speed2011 fieldIndex++;2012 // tslint:disable-next-line: max-line-length2013 newMesg.setField(new Field('Power', 7, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));2014 fieldIndex++;2015 // tslint:disable-next-line: max-line-length2016 newMesg.setField(new Field('CompressedSpeedDistance', 8, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));2017 // tslint:disable-next-line: max-line-length2018 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(6, false, 12, 100, 0)); // speed2019 // tslint:disable-next-line: max-line-length2020 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(5, true, 12, 16, 0)); // distance2021 fieldIndex++;2022 // tslint:disable-next-line: max-line-length2023 newMesg.setField(new Field('Grade', 9, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));2024 fieldIndex++;2025 // tslint:disable-next-line: max-line-length2026 newMesg.setField(new Field('Resistance', 10, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2027 fieldIndex++;2028 // tslint:disable-next-line: max-line-length2029 newMesg.setField(new Field('TimeFromCourse', 11, FitFieldType.sint32, 1000, 0, 's', false, ProfileType.Sint32));2030 fieldIndex++;2031 // tslint:disable-next-line: max-line-length2032 newMesg.setField(new Field('CycleLength', 12, FitFieldType.uint8, 100, 0, 'm', false, ProfileType.Uint8));2033 fieldIndex++;2034 // tslint:disable-next-line: max-line-length2035 newMesg.setField(new Field('Temperature', 13, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));2036 fieldIndex++;2037 // tslint:disable-next-line: max-line-length2038 newMesg.setField(new Field('Speed1s', 17, FitFieldType.uint8, 16, 0, 'm/s', false, ProfileType.Uint8));2039 fieldIndex++;2040 // tslint:disable-next-line: max-line-length2041 newMesg.setField(new Field('Cycles', 18, FitFieldType.uint8, 1, 0, 'cycles', false, ProfileType.Uint8));2042 // tslint:disable-next-line: max-line-length2043 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(19, true, 8, 1, 0)); // total_cycles2044 fieldIndex++;2045 // tslint:disable-next-line: max-line-length2046 newMesg.setField(new Field('TotalCycles', 19, FitFieldType.uint32, 1, 0, 'cycles', true, ProfileType.Uint32));2047 fieldIndex++;2048 // tslint:disable-next-line: max-line-length2049 newMesg.setField(new Field('CompressedAccumulatedPower', 28, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));2050 // tslint:disable-next-line: max-line-length2051 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(29, true, 16, 1, 0)); // accumulated_power2052 fieldIndex++;2053 // tslint:disable-next-line: max-line-length2054 newMesg.setField(new Field('AccumulatedPower', 29, FitFieldType.uint32, 1, 0, 'watts', true, ProfileType.Uint32));2055 fieldIndex++;2056 // tslint:disable-next-line: max-line-length2057 newMesg.setField(new Field('LeftRightBalance', 30, FitFieldType.uint8, 1, 0, '', false, ProfileType.LeftRightBalance));2058 fieldIndex++;2059 // tslint:disable-next-line: max-line-length2060 newMesg.setField(new Field('GpsAccuracy', 31, FitFieldType.uint8, 1, 0, 'm', false, ProfileType.Uint8));2061 fieldIndex++;2062 // tslint:disable-next-line: max-line-length2063 newMesg.setField(new Field('VerticalSpeed', 32, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));2064 fieldIndex++;2065 // tslint:disable-next-line: max-line-length2066 newMesg.setField(new Field('Calories', 33, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));2067 fieldIndex++;2068 // tslint:disable-next-line: max-line-length2069 newMesg.setField(new Field('VerticalOscillation', 39, FitFieldType.uint16, 10, 0, 'mm', false, ProfileType.Uint16));2070 fieldIndex++;2071 // tslint:disable-next-line: max-line-length2072 newMesg.setField(new Field('StanceTimePercent', 40, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));2073 fieldIndex++;2074 // tslint:disable-next-line: max-line-length2075 newMesg.setField(new Field('StanceTime', 41, FitFieldType.uint16, 10, 0, 'ms', false, ProfileType.Uint16));2076 fieldIndex++;2077 // tslint:disable-next-line: max-line-length2078 newMesg.setField(new Field('ActivityType', 42, FitFieldType.enum, 1, 0, '', false, ProfileType.ActivityType));2079 fieldIndex++;2080 // tslint:disable-next-line: max-line-length2081 newMesg.setField(new Field('LeftTorqueEffectiveness', 43, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));2082 fieldIndex++;2083 // tslint:disable-next-line: max-line-length2084 newMesg.setField(new Field('RightTorqueEffectiveness', 44, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));2085 fieldIndex++;2086 // tslint:disable-next-line: max-line-length2087 newMesg.setField(new Field('LeftPedalSmoothness', 45, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));2088 fieldIndex++;2089 // tslint:disable-next-line: max-line-length2090 newMesg.setField(new Field('RightPedalSmoothness', 46, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));2091 fieldIndex++;2092 // tslint:disable-next-line: max-line-length2093 newMesg.setField(new Field('CombinedPedalSmoothness', 47, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));2094 fieldIndex++;2095 // tslint:disable-next-line: max-line-length2096 newMesg.setField(new Field('Time128', 48, FitFieldType.uint8, 128, 0, 's', false, ProfileType.Uint8));2097 fieldIndex++;2098 // tslint:disable-next-line: max-line-length2099 newMesg.setField(new Field('StrokeType', 49, FitFieldType.enum, 1, 0, '', false, ProfileType.StrokeType));2100 fieldIndex++;2101 // tslint:disable-next-line: max-line-length2102 newMesg.setField(new Field('Zone', 50, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2103 fieldIndex++;2104 // tslint:disable-next-line: max-line-length2105 newMesg.setField(new Field('BallSpeed', 51, FitFieldType.uint16, 100, 0, 'm/s', false, ProfileType.Uint16));2106 fieldIndex++;2107 // tslint:disable-next-line: max-line-length2108 newMesg.setField(new Field('Cadence256', 52, FitFieldType.uint16, 256, 0, 'rpm', false, ProfileType.Uint16));2109 fieldIndex++;2110 // tslint:disable-next-line: max-line-length2111 newMesg.setField(new Field('FractionalCadence', 53, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));2112 fieldIndex++;2113 // tslint:disable-next-line: max-line-length2114 newMesg.setField(new Field('TotalHemoglobinConc', 54, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));2115 fieldIndex++;2116 // tslint:disable-next-line: max-line-length2117 newMesg.setField(new Field('TotalHemoglobinConcMin', 55, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));2118 fieldIndex++;2119 // tslint:disable-next-line: max-line-length2120 newMesg.setField(new Field('TotalHemoglobinConcMax', 56, FitFieldType.uint16, 100, 0, 'g/dL', false, ProfileType.Uint16));2121 fieldIndex++;2122 // tslint:disable-next-line: max-line-length2123 newMesg.setField(new Field('SaturatedHemoglobinPercent', 57, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));2124 fieldIndex++;2125 // tslint:disable-next-line: max-line-length2126 newMesg.setField(new Field('SaturatedHemoglobinPercentMin', 58, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));2127 fieldIndex++;2128 // tslint:disable-next-line: max-line-length2129 newMesg.setField(new Field('SaturatedHemoglobinPercentMax', 59, FitFieldType.uint16, 10, 0, '%', false, ProfileType.Uint16));2130 fieldIndex++;2131 // tslint:disable-next-line: max-line-length2132 newMesg.setField(new Field('DeviceIndex', 62, FitFieldType.uint8, 1, 0, '', false, ProfileType.DeviceIndex));2133 fieldIndex++;2134 // tslint:disable-next-line: max-line-length2135 newMesg.setField(new Field('LeftPco', 67, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));2136 fieldIndex++;2137 // tslint:disable-next-line: max-line-length2138 newMesg.setField(new Field('RightPco', 68, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));2139 fieldIndex++;2140 // tslint:disable-next-line: max-line-length2141 newMesg.setField(new Field('LeftPowerPhase', 69, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));2142 fieldIndex++;2143 // tslint:disable-next-line: max-line-length2144 newMesg.setField(new Field('LeftPowerPhasePeak', 70, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));2145 fieldIndex++;2146 // tslint:disable-next-line: max-line-length2147 newMesg.setField(new Field('RightPowerPhase', 71, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));2148 fieldIndex++;2149 // tslint:disable-next-line: max-line-length2150 newMesg.setField(new Field('RightPowerPhasePeak', 72, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));2151 fieldIndex++;2152 // tslint:disable-next-line: max-line-length2153 newMesg.setField(new Field('EnhancedSpeed', 73, FitFieldType.uint32, 1000, 0, 'm/s', false, ProfileType.Uint32));2154 fieldIndex++;2155 // tslint:disable-next-line: max-line-length2156 newMesg.setField(new Field('EnhancedAltitude', 78, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));2157 fieldIndex++;2158 // tslint:disable-next-line: max-line-length2159 newMesg.setField(new Field('BatterySoc', 81, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));2160 fieldIndex++;2161 // tslint:disable-next-line: max-line-length2162 newMesg.setField(new Field('MotorPower', 82, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));2163 fieldIndex++;2164 // tslint:disable-next-line: max-line-length2165 newMesg.setField(new Field('VerticalRatio', 83, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));2166 fieldIndex++;2167 // tslint:disable-next-line: max-line-length2168 newMesg.setField(new Field('StanceTimeBalance', 84, FitFieldType.uint16, 100, 0, 'percent', false, ProfileType.Uint16));2169 fieldIndex++;2170 // tslint:disable-next-line: max-line-length2171 newMesg.setField(new Field('StepLength', 85, FitFieldType.uint16, 10, 0, 'mm', false, ProfileType.Uint16));2172 fieldIndex++;2173 // tslint:disable-next-line: max-line-length2174 newMesg.setField(new Field('AbsolutePressure', 91, FitFieldType.uint32, 1, 0, 'Pa', false, ProfileType.Uint32));2175 fieldIndex++;2176 // tslint:disable-next-line: max-line-length2177 newMesg.setField(new Field('Depth', 92, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));2178 fieldIndex++;2179 // tslint:disable-next-line: max-line-length2180 newMesg.setField(new Field('NextStopDepth', 93, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));2181 fieldIndex++;2182 // tslint:disable-next-line: max-line-length2183 newMesg.setField(new Field('NextStopTime', 94, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));2184 fieldIndex++;2185 // tslint:disable-next-line: max-line-length2186 newMesg.setField(new Field('TimeToSurface', 95, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));2187 fieldIndex++;2188 // tslint:disable-next-line: max-line-length2189 newMesg.setField(new Field('NdlTime', 96, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));2190 fieldIndex++;2191 // tslint:disable-next-line: max-line-length2192 newMesg.setField(new Field('CnsLoad', 97, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));2193 fieldIndex++;2194 // tslint:disable-next-line: max-line-length2195 newMesg.setField(new Field('N2Load', 98, FitFieldType.uint16, 1, 0, 'percent', false, ProfileType.Uint16));2196 fieldIndex++;2197 return newMesg;2198 }2199 private static createEventMesg(): Mesg {2200 let fieldIndex: number;2201 let subfieldIndex: number;2202 const newMesg: Mesg = new Mesg('Event', MesgNum.event);2203 fieldIndex = 0;2204 // tslint:disable-next-line: max-line-length2205 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2206 fieldIndex++;2207 // tslint:disable-next-line: max-line-length2208 newMesg.setField(new Field('Event', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Event));2209 fieldIndex++;2210 // tslint:disable-next-line: max-line-length2211 newMesg.setField(new Field('EventType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.EventType));2212 fieldIndex++;2213 // tslint:disable-next-line: max-line-length2214 newMesg.setField(new Field('Data16', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2215 // tslint:disable-next-line: max-line-length2216 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(3, false, 16, 1, 0)); // data2217 fieldIndex++;2218 // tslint:disable-next-line: max-line-length2219 newMesg.setField(new Field('Data', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2220 subfieldIndex = 0;2221 // tslint:disable-next-line: max-line-length2222 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TimerTrigger', 0, 1, 0, ''));2223 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 0);2224 subfieldIndex++;2225 // tslint:disable-next-line: max-line-length2226 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CoursePointIndex', 132, 1, 0, ''));2227 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 10);2228 subfieldIndex++;2229 // tslint:disable-next-line: max-line-length2230 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('BatteryLevel', 132, 1000, 0, 'V'));2231 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 11);2232 subfieldIndex++;2233 // tslint:disable-next-line: max-line-length2234 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('VirtualPartnerSpeed', 132, 1000, 0, 'm/s'));2235 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 12);2236 subfieldIndex++;2237 // tslint:disable-next-line: max-line-length2238 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('HrHighAlert', 2, 1, 0, 'bpm'));2239 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 13);2240 subfieldIndex++;2241 // tslint:disable-next-line: max-line-length2242 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('HrLowAlert', 2, 1, 0, 'bpm'));2243 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 14);2244 subfieldIndex++;2245 // tslint:disable-next-line: max-line-length2246 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('SpeedHighAlert', 134, 1000, 0, 'm/s'));2247 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 15);2248 subfieldIndex++;2249 // tslint:disable-next-line: max-line-length2250 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('SpeedLowAlert', 134, 1000, 0, 'm/s'));2251 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 16);2252 subfieldIndex++;2253 // tslint:disable-next-line: max-line-length2254 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CadHighAlert', 132, 1, 0, 'rpm'));2255 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 17);2256 subfieldIndex++;2257 // tslint:disable-next-line: max-line-length2258 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CadLowAlert', 132, 1, 0, 'rpm'));2259 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 18);2260 subfieldIndex++;2261 // tslint:disable-next-line: max-line-length2262 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('PowerHighAlert', 132, 1, 0, 'watts'));2263 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 19);2264 subfieldIndex++;2265 // tslint:disable-next-line: max-line-length2266 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('PowerLowAlert', 132, 1, 0, 'watts'));2267 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 20);2268 subfieldIndex++;2269 // tslint:disable-next-line: max-line-length2270 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TimeDurationAlert', 134, 1000, 0, 's'));2271 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 23);2272 subfieldIndex++;2273 // tslint:disable-next-line: max-line-length2274 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DistanceDurationAlert', 134, 100, 0, 'm'));2275 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 24);2276 subfieldIndex++;2277 // tslint:disable-next-line: max-line-length2278 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CalorieDurationAlert', 134, 1, 0, 'calories'));2279 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 25);2280 subfieldIndex++;2281 // tslint:disable-next-line: max-line-length2282 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('FitnessEquipmentState', 0, 1, 0, ''));2283 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 27);2284 subfieldIndex++;2285 // tslint:disable-next-line: max-line-length2286 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('SportPoint', 134, 1, 0, ''));2287 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 33);2288 // tslint:disable-next-line: max-line-length2289 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addComponent(new FieldComponent(7, false, 16, 1, 0)); // score2290 // tslint:disable-next-line: max-line-length2291 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addComponent(new FieldComponent(8, false, 16, 1, 0)); // opponent_score2292 subfieldIndex++;2293 // tslint:disable-next-line: max-line-length2294 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GearChangeData', 134, 1, 0, ''));2295 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 42);2296 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 43);2297 // tslint:disable-next-line: max-line-length2298 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addComponent(new FieldComponent(11, false, 8, 1, 0)); // rear_gear_num2299 // tslint:disable-next-line: max-line-length2300 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addComponent(new FieldComponent(12, false, 8, 1, 0)); // rear_gear2301 // tslint:disable-next-line: max-line-length2302 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addComponent(new FieldComponent(9, false, 8, 1, 0)); // front_gear_num2303 // tslint:disable-next-line: max-line-length2304 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addComponent(new FieldComponent(10, false, 8, 1, 0)); // front_gear2305 subfieldIndex++;2306 // tslint:disable-next-line: max-line-length2307 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RiderPosition', 0, 1, 0, ''));2308 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 44);2309 subfieldIndex++;2310 // tslint:disable-next-line: max-line-length2311 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CommTimeout', 132, 1, 0, ''));2312 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 47);2313 subfieldIndex++;2314 fieldIndex++;2315 // tslint:disable-next-line: max-line-length2316 newMesg.setField(new Field('EventGroup', 4, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2317 fieldIndex++;2318 // tslint:disable-next-line: max-line-length2319 newMesg.setField(new Field('Score', 7, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2320 fieldIndex++;2321 // tslint:disable-next-line: max-line-length2322 newMesg.setField(new Field('OpponentScore', 8, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2323 fieldIndex++;2324 // tslint:disable-next-line: max-line-length2325 newMesg.setField(new Field('FrontGearNum', 9, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));2326 fieldIndex++;2327 // tslint:disable-next-line: max-line-length2328 newMesg.setField(new Field('FrontGear', 10, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));2329 fieldIndex++;2330 // tslint:disable-next-line: max-line-length2331 newMesg.setField(new Field('RearGearNum', 11, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));2332 fieldIndex++;2333 // tslint:disable-next-line: max-line-length2334 newMesg.setField(new Field('RearGear', 12, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));2335 fieldIndex++;2336 // tslint:disable-next-line: max-line-length2337 newMesg.setField(new Field('DeviceIndex', 13, FitFieldType.uint8, 1, 0, '', false, ProfileType.DeviceIndex));2338 fieldIndex++;2339 return newMesg;2340 }2341 private static createDeviceInfoMesg(): Mesg {2342 let fieldIndex: number;2343 let subfieldIndex: number;2344 const newMesg: Mesg = new Mesg('DeviceInfo', MesgNum.deviceInfo);2345 fieldIndex = 0;2346 // tslint:disable-next-line: max-line-length2347 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2348 fieldIndex++;2349 // tslint:disable-next-line: max-line-length2350 newMesg.setField(new Field('DeviceIndex', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.DeviceIndex));2351 fieldIndex++;2352 // tslint:disable-next-line: max-line-length2353 newMesg.setField(new Field('DeviceType', 1, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2354 subfieldIndex = 0;2355 // tslint:disable-next-line: max-line-length2356 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('AntplusDeviceType', 2, 1, 0, ''));2357 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(25, 1);2358 subfieldIndex++;2359 // tslint:disable-next-line: max-line-length2360 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('AntDeviceType', 2, 1, 0, ''));2361 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(25, 0);2362 subfieldIndex++;2363 fieldIndex++;2364 // tslint:disable-next-line: max-line-length2365 newMesg.setField(new Field('Manufacturer', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));2366 fieldIndex++;2367 // tslint:disable-next-line: max-line-length2368 newMesg.setField(new Field('SerialNumber', 3, FitFieldType.uint32z, 1, 0, '', false, ProfileType.Uint32z));2369 fieldIndex++;2370 // tslint:disable-next-line: max-line-length2371 newMesg.setField(new Field('Product', 4, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2372 subfieldIndex = 0;2373 // tslint:disable-next-line: max-line-length2374 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('FaveroProduct', 132, 1, 0, ''));2375 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 263);2376 subfieldIndex++;2377 // tslint:disable-next-line: max-line-length2378 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GarminProduct', 132, 1, 0, ''));2379 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 1);2380 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 15);2381 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(2, 13);2382 subfieldIndex++;2383 fieldIndex++;2384 // tslint:disable-next-line: max-line-length2385 newMesg.setField(new Field('SoftwareVersion', 5, FitFieldType.uint16, 100, 0, '', false, ProfileType.Uint16));2386 fieldIndex++;2387 // tslint:disable-next-line: max-line-length2388 newMesg.setField(new Field('HardwareVersion', 6, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2389 fieldIndex++;2390 // tslint:disable-next-line: max-line-length2391 newMesg.setField(new Field('CumOperatingTime', 7, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));2392 fieldIndex++;2393 // tslint:disable-next-line: max-line-length2394 newMesg.setField(new Field('BatteryVoltage', 10, FitFieldType.uint16, 256, 0, 'V', false, ProfileType.Uint16));2395 fieldIndex++;2396 // tslint:disable-next-line: max-line-length2397 newMesg.setField(new Field('BatteryStatus', 11, FitFieldType.uint8, 1, 0, '', false, ProfileType.BatteryStatus));2398 fieldIndex++;2399 // tslint:disable-next-line: max-line-length2400 newMesg.setField(new Field('SensorPosition', 18, FitFieldType.enum, 1, 0, '', false, ProfileType.BodyLocation));2401 fieldIndex++;2402 // tslint:disable-next-line: max-line-length2403 newMesg.setField(new Field('Descriptor', 19, FitFieldType.string, 1, 0, '', false, ProfileType.String));2404 fieldIndex++;2405 // tslint:disable-next-line: max-line-length2406 newMesg.setField(new Field('AntTransmissionType', 20, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));2407 fieldIndex++;2408 // tslint:disable-next-line: max-line-length2409 newMesg.setField(new Field('AntDeviceNumber', 21, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));2410 fieldIndex++;2411 // tslint:disable-next-line: max-line-length2412 newMesg.setField(new Field('AntNetwork', 22, FitFieldType.enum, 1, 0, '', false, ProfileType.AntNetwork));2413 fieldIndex++;2414 // tslint:disable-next-line: max-line-length2415 newMesg.setField(new Field('SourceType', 25, FitFieldType.enum, 1, 0, '', false, ProfileType.SourceType));2416 fieldIndex++;2417 // tslint:disable-next-line: max-line-length2418 newMesg.setField(new Field('ProductName', 27, FitFieldType.string, 1, 0, '', false, ProfileType.String));2419 fieldIndex++;2420 return newMesg;2421 }2422 private static createTrainingFileMesg(): Mesg {2423 let fieldIndex: number;2424 let subfieldIndex: number;2425 const newMesg: Mesg = new Mesg('TrainingFile', MesgNum.trainingFile);2426 fieldIndex = 0;2427 // tslint:disable-next-line: max-line-length2428 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2429 fieldIndex++;2430 // tslint:disable-next-line: max-line-length2431 newMesg.setField(new Field('Type', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.File));2432 fieldIndex++;2433 // tslint:disable-next-line: max-line-length2434 newMesg.setField(new Field('Manufacturer', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));2435 fieldIndex++;2436 // tslint:disable-next-line: max-line-length2437 newMesg.setField(new Field('Product', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2438 subfieldIndex = 0;2439 // tslint:disable-next-line: max-line-length2440 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('FaveroProduct', 132, 1, 0, ''));2441 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 263);2442 subfieldIndex++;2443 // tslint:disable-next-line: max-line-length2444 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GarminProduct', 132, 1, 0, ''));2445 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 1);2446 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 15);2447 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 13);2448 subfieldIndex++;2449 fieldIndex++;2450 // tslint:disable-next-line: max-line-length2451 newMesg.setField(new Field('SerialNumber', 3, FitFieldType.uint32z, 1, 0, '', false, ProfileType.Uint32z));2452 fieldIndex++;2453 // tslint:disable-next-line: max-line-length2454 newMesg.setField(new Field('TimeCreated', 4, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2455 fieldIndex++;2456 return newMesg;2457 }2458 private static createHrvMesg(): Mesg {2459 const newMesg: Mesg = new Mesg('Hrv', MesgNum.hrv);2460 // tslint:disable-next-line: max-line-length2461 newMesg.setField(new Field('Time', 0, FitFieldType.uint16, 1000, 0, 's', false, ProfileType.Uint16));2462 return newMesg;2463 }2464 private static createWeatherConditionsMesg(): Mesg {2465 const newMesg: Mesg = new Mesg('WeatherConditions', MesgNum.weatherConditions);2466 // tslint:disable-next-line: max-line-length2467 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2468 // tslint:disable-next-line: max-line-length2469 newMesg.setField(new Field('WeatherReport', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.WeatherReport));2470 // tslint:disable-next-line: max-line-length2471 newMesg.setField(new Field('Temperature', 1, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));2472 // tslint:disable-next-line: max-line-length2473 newMesg.setField(new Field('Condition', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.WeatherStatus));2474 // tslint:disable-next-line: max-line-length2475 newMesg.setField(new Field('WindDirection', 3, FitFieldType.uint16, 1, 0, 'degrees', false, ProfileType.Uint16));2476 // tslint:disable-next-line: max-line-length2477 newMesg.setField(new Field('WindSpeed', 4, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));2478 // tslint:disable-next-line: max-line-length2479 newMesg.setField(new Field('PrecipitationProbability', 5, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2480 // tslint:disable-next-line: max-line-length2481 newMesg.setField(new Field('TemperatureFeelsLike', 6, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));2482 // tslint:disable-next-line: max-line-length2483 newMesg.setField(new Field('RelativeHumidity', 7, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2484 // tslint:disable-next-line: max-line-length2485 newMesg.setField(new Field('Location', 8, FitFieldType.string, 1, 0, '', false, ProfileType.String));2486 // tslint:disable-next-line: max-line-length2487 newMesg.setField(new Field('ObservedAtTime', 9, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2488 // tslint:disable-next-line: max-line-length2489 newMesg.setField(new Field('ObservedLocationLat', 10, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2490 // tslint:disable-next-line: max-line-length2491 newMesg.setField(new Field('ObservedLocationLong', 11, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2492 // tslint:disable-next-line: max-line-length2493 newMesg.setField(new Field('DayOfWeek', 12, FitFieldType.enum, 1, 0, '', false, ProfileType.DayOfWeek));2494 // tslint:disable-next-line: max-line-length2495 newMesg.setField(new Field('HighTemperature', 13, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));2496 // tslint:disable-next-line: max-line-length2497 newMesg.setField(new Field('LowTemperature', 14, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));2498 return newMesg;2499 }2500 private static createWeatherAlertMesg(): Mesg {2501 const newMesg: Mesg = new Mesg('WeatherAlert', MesgNum.weatherAlert);2502 // tslint:disable-next-line: max-line-length2503 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2504 // tslint:disable-next-line: max-line-length2505 newMesg.setField(new Field('ReportId', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));2506 // tslint:disable-next-line: max-line-length2507 newMesg.setField(new Field('IssueTime', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2508 // tslint:disable-next-line: max-line-length2509 newMesg.setField(new Field('ExpireTime', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2510 // tslint:disable-next-line: max-line-length2511 newMesg.setField(new Field('Severity', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.WeatherSeverity));2512 // tslint:disable-next-line: max-line-length2513 newMesg.setField(new Field('Type', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.WeatherSevereType));2514 return newMesg;2515 }2516 private static createGpsMetadataMesg(): Mesg {2517 const newMesg: Mesg = new Mesg('GpsMetadata', MesgNum.gpsMetadata);2518 // tslint:disable-next-line: max-line-length2519 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2520 // tslint:disable-next-line: max-line-length2521 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2522 // tslint:disable-next-line: max-line-length2523 newMesg.setField(new Field('PositionLat', 1, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2524 // tslint:disable-next-line: max-line-length2525 newMesg.setField(new Field('PositionLong', 2, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2526 // tslint:disable-next-line: max-line-length2527 newMesg.setField(new Field('EnhancedAltitude', 3, FitFieldType.uint32, 5, 500, 'm', false, ProfileType.Uint32));2528 // tslint:disable-next-line: max-line-length2529 newMesg.setField(new Field('EnhancedSpeed', 4, FitFieldType.uint32, 1000, 0, 'm/s', false, ProfileType.Uint32));2530 // tslint:disable-next-line: max-line-length2531 newMesg.setField(new Field('Heading', 5, FitFieldType.uint16, 100, 0, 'degrees', false, ProfileType.Uint16));2532 // tslint:disable-next-line: max-line-length2533 newMesg.setField(new Field('UtcTimestamp', 6, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2534 // tslint:disable-next-line: max-line-length2535 newMesg.setField(new Field('Velocity', 7, FitFieldType.sint16, 100, 0, 'm/s', false, ProfileType.Sint16));2536 return newMesg;2537 }2538 private static createCameraEventMesg(): Mesg {2539 const newMesg: Mesg = new Mesg('CameraEvent', MesgNum.cameraEvent);2540 // tslint:disable-next-line: max-line-length2541 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2542 // tslint:disable-next-line: max-line-length2543 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2544 // tslint:disable-next-line: max-line-length2545 newMesg.setField(new Field('CameraEventType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.CameraEventType));2546 // tslint:disable-next-line: max-line-length2547 newMesg.setField(new Field('CameraFileUuid', 2, FitFieldType.string, 1, 0, '', false, ProfileType.String));2548 // tslint:disable-next-line: max-line-length2549 newMesg.setField(new Field('CameraOrientation', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.CameraOrientationType));2550 return newMesg;2551 }2552 private static createGyroscopeDataMesg(): Mesg {2553 const newMesg: Mesg = new Mesg('GyroscopeData', MesgNum.gyroscopeData);2554 // tslint:disable-next-line: max-line-length2555 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2556 // tslint:disable-next-line: max-line-length2557 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2558 // tslint:disable-next-line: max-line-length2559 newMesg.setField(new Field('SampleTimeOffset', 1, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2560 // tslint:disable-next-line: max-line-length2561 newMesg.setField(new Field('GyroX', 2, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2562 // tslint:disable-next-line: max-line-length2563 newMesg.setField(new Field('GyroY', 3, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2564 // tslint:disable-next-line: max-line-length2565 newMesg.setField(new Field('GyroZ', 4, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2566 // tslint:disable-next-line: max-line-length2567 newMesg.setField(new Field('CalibratedGyroX', 5, FitFieldType.float32, 1, 0, 'deg/s', false, ProfileType.Float32));2568 // tslint:disable-next-line: max-line-length2569 newMesg.setField(new Field('CalibratedGyroY', 6, FitFieldType.float32, 1, 0, 'deg/s', false, ProfileType.Float32));2570 // tslint:disable-next-line: max-line-length2571 newMesg.setField(new Field('CalibratedGyroZ', 7, FitFieldType.float32, 1, 0, 'deg/s', false, ProfileType.Float32));2572 return newMesg;2573 }2574 private static createAccelerometerDataMesg(): Mesg {2575 const newMesg: Mesg = new Mesg('AccelerometerData', MesgNum.accelerometerData);2576 // tslint:disable-next-line: max-line-length2577 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2578 // tslint:disable-next-line: max-line-length2579 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2580 // tslint:disable-next-line: max-line-length2581 newMesg.setField(new Field('SampleTimeOffset', 1, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2582 // tslint:disable-next-line: max-line-length2583 newMesg.setField(new Field('AccelX', 2, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2584 // tslint:disable-next-line: max-line-length2585 newMesg.setField(new Field('AccelY', 3, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2586 // tslint:disable-next-line: max-line-length2587 newMesg.setField(new Field('AccelZ', 4, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2588 // tslint:disable-next-line: max-line-length2589 newMesg.setField(new Field('CalibratedAccelX', 5, FitFieldType.float32, 1, 0, 'g', false, ProfileType.Float32));2590 // tslint:disable-next-line: max-line-length2591 newMesg.setField(new Field('CalibratedAccelY', 6, FitFieldType.float32, 1, 0, 'g', false, ProfileType.Float32));2592 // tslint:disable-next-line: max-line-length2593 newMesg.setField(new Field('CalibratedAccelZ', 7, FitFieldType.float32, 1, 0, 'g', false, ProfileType.Float32));2594 // tslint:disable-next-line: max-line-length2595 newMesg.setField(new Field('CompressedCalibratedAccelX', 8, FitFieldType.sint16, 1, 0, 'mG', false, ProfileType.Sint16));2596 // tslint:disable-next-line: max-line-length2597 newMesg.setField(new Field('CompressedCalibratedAccelY', 9, FitFieldType.sint16, 1, 0, 'mG', false, ProfileType.Sint16));2598 // tslint:disable-next-line: max-line-length2599 newMesg.setField(new Field('CompressedCalibratedAccelZ', 10, FitFieldType.sint16, 1, 0, 'mG', false, ProfileType.Sint16));2600 return newMesg;2601 }2602 private static createMagnetometerDataMesg(): Mesg {2603 const newMesg: Mesg = new Mesg('MagnetometerData', MesgNum.magnetometerData);2604 // tslint:disable-next-line: max-line-length2605 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2606 // tslint:disable-next-line: max-line-length2607 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2608 // tslint:disable-next-line: max-line-length2609 newMesg.setField(new Field('SampleTimeOffset', 1, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2610 // tslint:disable-next-line: max-line-length2611 newMesg.setField(new Field('MagX', 2, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2612 // tslint:disable-next-line: max-line-length2613 newMesg.setField(new Field('MagY', 3, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2614 // tslint:disable-next-line: max-line-length2615 newMesg.setField(new Field('MagZ', 4, FitFieldType.uint16, 1, 0, 'counts', false, ProfileType.Uint16));2616 // tslint:disable-next-line: max-line-length2617 newMesg.setField(new Field('CalibratedMagX', 5, FitFieldType.float32, 1, 0, 'G', false, ProfileType.Float32));2618 // tslint:disable-next-line: max-line-length2619 newMesg.setField(new Field('CalibratedMagY', 6, FitFieldType.float32, 1, 0, 'G', false, ProfileType.Float32));2620 // tslint:disable-next-line: max-line-length2621 newMesg.setField(new Field('CalibratedMagZ', 7, FitFieldType.float32, 1, 0, 'G', false, ProfileType.Float32));2622 return newMesg;2623 }2624 private static createBarometerDataMesg(): Mesg {2625 const newMesg: Mesg = new Mesg('BarometerData', MesgNum.barometerData);2626 // tslint:disable-next-line: max-line-length2627 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2628 // tslint:disable-next-line: max-line-length2629 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2630 // tslint:disable-next-line: max-line-length2631 newMesg.setField(new Field('SampleTimeOffset', 1, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2632 // tslint:disable-next-line: max-line-length2633 newMesg.setField(new Field('BaroPres', 2, FitFieldType.uint32, 1, 0, 'Pa', false, ProfileType.Uint32));2634 return newMesg;2635 }2636 private static createThreeDSensorCalibrationMesg(): Mesg {2637 let fieldIndex: number;2638 let subfieldIndex: number;2639 const newMesg: Mesg = new Mesg('ThreeDSensorCalibration', MesgNum.threeDSensorCalibration);2640 fieldIndex = 0;2641 // tslint:disable-next-line: max-line-length2642 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2643 fieldIndex++;2644 // tslint:disable-next-line: max-line-length2645 newMesg.setField(new Field('SensorType', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.SensorType));2646 fieldIndex++;2647 // tslint:disable-next-line: max-line-length2648 newMesg.setField(new Field('CalibrationFactor', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2649 subfieldIndex = 0;2650 // tslint:disable-next-line: max-line-length2651 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('AccelCalFactor', 134, 1, 0, 'g'));2652 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 0);2653 subfieldIndex++;2654 // tslint:disable-next-line: max-line-length2655 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GyroCalFactor', 134, 1, 0, 'deg/s'));2656 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 1);2657 subfieldIndex++;2658 fieldIndex++;2659 // tslint:disable-next-line: max-line-length2660 newMesg.setField(new Field('CalibrationDivisor', 2, FitFieldType.uint32, 1, 0, 'counts', false, ProfileType.Uint32));2661 fieldIndex++;2662 // tslint:disable-next-line: max-line-length2663 newMesg.setField(new Field('LevelShift', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2664 fieldIndex++;2665 // tslint:disable-next-line: max-line-length2666 newMesg.setField(new Field('OffsetCal', 4, FitFieldType.sint32, 1, 0, '', false, ProfileType.Sint32));2667 fieldIndex++;2668 // tslint:disable-next-line: max-line-length2669 newMesg.setField(new Field('OrientationMatrix', 5, FitFieldType.sint32, 65535, 0, '', false, ProfileType.Sint32));2670 fieldIndex++;2671 return newMesg;2672 }2673 private static createOneDSensorCalibrationMesg(): Mesg {2674 let fieldIndex: number;2675 let subfieldIndex: number;2676 const newMesg: Mesg = new Mesg('OneDSensorCalibration', MesgNum.oneDSensorCalibration);2677 fieldIndex = 0;2678 // tslint:disable-next-line: max-line-length2679 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2680 fieldIndex++;2681 // tslint:disable-next-line: max-line-length2682 newMesg.setField(new Field('SensorType', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.SensorType));2683 fieldIndex++;2684 // tslint:disable-next-line: max-line-length2685 newMesg.setField(new Field('CalibrationFactor', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2686 subfieldIndex = 0;2687 // tslint:disable-next-line: max-line-length2688 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('BaroCalFactor', 134, 1, 0, 'Pa'));2689 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 3);2690 subfieldIndex++;2691 fieldIndex++;2692 // tslint:disable-next-line: max-line-length2693 newMesg.setField(new Field('CalibrationDivisor', 2, FitFieldType.uint32, 1, 0, 'counts', false, ProfileType.Uint32));2694 fieldIndex++;2695 // tslint:disable-next-line: max-line-length2696 newMesg.setField(new Field('LevelShift', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2697 fieldIndex++;2698 // tslint:disable-next-line: max-line-length2699 newMesg.setField(new Field('OffsetCal', 4, FitFieldType.sint32, 1, 0, '', false, ProfileType.Sint32));2700 fieldIndex++;2701 return newMesg;2702 }2703 private static createVideoFrameMesg(): Mesg {2704 const newMesg: Mesg = new Mesg('VideoFrame', MesgNum.videoFrame);2705 // tslint:disable-next-line: max-line-length2706 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2707 // tslint:disable-next-line: max-line-length2708 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2709 // tslint:disable-next-line: max-line-length2710 newMesg.setField(new Field('FrameNumber', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2711 return newMesg;2712 }2713 private static createObdiiDataMesg(): Mesg {2714 const newMesg: Mesg = new Mesg('ObdiiData', MesgNum.obdiiData);2715 // tslint:disable-next-line: max-line-length2716 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2717 // tslint:disable-next-line: max-line-length2718 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2719 // tslint:disable-next-line: max-line-length2720 newMesg.setField(new Field('TimeOffset', 1, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2721 // tslint:disable-next-line: max-line-length2722 newMesg.setField(new Field('Pid', 2, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));2723 // tslint:disable-next-line: max-line-length2724 newMesg.setField(new Field('RawData', 3, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));2725 // tslint:disable-next-line: max-line-length2726 newMesg.setField(new Field('PidDataSize', 4, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2727 // tslint:disable-next-line: max-line-length2728 newMesg.setField(new Field('SystemTime', 5, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2729 // tslint:disable-next-line: max-line-length2730 newMesg.setField(new Field('StartTimestamp', 6, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2731 // tslint:disable-next-line: max-line-length2732 newMesg.setField(new Field('StartTimestampMs', 7, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2733 return newMesg;2734 }2735 private static createNmeaSentenceMesg(): Mesg {2736 const newMesg: Mesg = new Mesg('NmeaSentence', MesgNum.nmeaSentence);2737 // tslint:disable-next-line: max-line-length2738 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2739 // tslint:disable-next-line: max-line-length2740 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2741 // tslint:disable-next-line: max-line-length2742 newMesg.setField(new Field('Sentence', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));2743 return newMesg;2744 }2745 private static createAviationAttitudeMesg(): Mesg {2746 const newMesg: Mesg = new Mesg('AviationAttitude', MesgNum.aviationAttitude);2747 // tslint:disable-next-line: max-line-length2748 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2749 // tslint:disable-next-line: max-line-length2750 newMesg.setField(new Field('TimestampMs', 0, FitFieldType.uint16, 1, 0, 'ms', false, ProfileType.Uint16));2751 // tslint:disable-next-line: max-line-length2752 newMesg.setField(new Field('SystemTime', 1, FitFieldType.uint32, 1, 0, 'ms', false, ProfileType.Uint32));2753 // tslint:disable-next-line: max-line-length2754 newMesg.setField(new Field('Pitch', 2, FitFieldType.sint16, 10430.38, 0, 'radians', false, ProfileType.Sint16));2755 // tslint:disable-next-line: max-line-length2756 newMesg.setField(new Field('Roll', 3, FitFieldType.sint16, 10430.38, 0, 'radians', false, ProfileType.Sint16));2757 // tslint:disable-next-line: max-line-length2758 newMesg.setField(new Field('AccelLateral', 4, FitFieldType.sint16, 100, 0, 'm/s^2', false, ProfileType.Sint16));2759 // tslint:disable-next-line: max-line-length2760 newMesg.setField(new Field('AccelNormal', 5, FitFieldType.sint16, 100, 0, 'm/s^2', false, ProfileType.Sint16));2761 // tslint:disable-next-line: max-line-length2762 newMesg.setField(new Field('TurnRate', 6, FitFieldType.sint16, 1024, 0, 'radians/second', false, ProfileType.Sint16));2763 // tslint:disable-next-line: max-line-length2764 newMesg.setField(new Field('Stage', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.AttitudeStage));2765 // tslint:disable-next-line: max-line-length2766 newMesg.setField(new Field('AttitudeStageComplete', 8, FitFieldType.uint8, 1, 0, '%', false, ProfileType.Uint8));2767 // tslint:disable-next-line: max-line-length2768 newMesg.setField(new Field('Track', 9, FitFieldType.uint16, 10430.38, 0, 'radians', false, ProfileType.Uint16));2769 // tslint:disable-next-line: max-line-length2770 newMesg.setField(new Field('Validity', 10, FitFieldType.uint16, 1, 0, '', false, ProfileType.AttitudeValidity));2771 return newMesg;2772 }2773 private static createVideoMesg(): Mesg {2774 const newMesg: Mesg = new Mesg('Video', MesgNum.video);2775 // tslint:disable-next-line: max-line-length2776 newMesg.setField(new Field('Url', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));2777 // tslint:disable-next-line: max-line-length2778 newMesg.setField(new Field('HostingProvider', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));2779 // tslint:disable-next-line: max-line-length2780 newMesg.setField(new Field('Duration', 2, FitFieldType.uint32, 1, 0, 'ms', false, ProfileType.Uint32));2781 return newMesg;2782 }2783 private static createVideoTitleMesg(): Mesg {2784 const newMesg: Mesg = new Mesg('VideoTitle', MesgNum.videoTitle);2785 // tslint:disable-next-line: max-line-length2786 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2787 // tslint:disable-next-line: max-line-length2788 newMesg.setField(new Field('MessageCount', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2789 // tslint:disable-next-line: max-line-length2790 newMesg.setField(new Field('Text', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));2791 return newMesg;2792 }2793 private static createVideoDescriptionMesg(): Mesg {2794 const newMesg: Mesg = new Mesg('VideoDescription', MesgNum.videoDescription);2795 // tslint:disable-next-line: max-line-length2796 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2797 // tslint:disable-next-line: max-line-length2798 newMesg.setField(new Field('MessageCount', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2799 // tslint:disable-next-line: max-line-length2800 newMesg.setField(new Field('Text', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));2801 return newMesg;2802 }2803 private static createVideoClipMesg(): Mesg {2804 const newMesg: Mesg = new Mesg('VideoClip', MesgNum.videoClip);2805 // tslint:disable-next-line: max-line-length2806 newMesg.setField(new Field('ClipNumber', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2807 // tslint:disable-next-line: max-line-length2808 newMesg.setField(new Field('StartTimestamp', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2809 // tslint:disable-next-line: max-line-length2810 newMesg.setField(new Field('StartTimestampMs', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2811 // tslint:disable-next-line: max-line-length2812 newMesg.setField(new Field('EndTimestamp', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2813 // tslint:disable-next-line: max-line-length2814 newMesg.setField(new Field('EndTimestampMs', 4, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2815 // tslint:disable-next-line: max-line-length2816 newMesg.setField(new Field('ClipStart', 6, FitFieldType.uint32, 1, 0, 'ms', false, ProfileType.Uint32));2817 // tslint:disable-next-line: max-line-length2818 newMesg.setField(new Field('ClipEnd', 7, FitFieldType.uint32, 1, 0, 'ms', false, ProfileType.Uint32));2819 return newMesg;2820 }2821 private static createSetMesg(): Mesg {2822 const newMesg: Mesg = new Mesg('Set', MesgNum.set);2823 // tslint:disable-next-line: max-line-length2824 newMesg.setField(new Field('Timestamp', 254, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2825 // tslint:disable-next-line: max-line-length2826 newMesg.setField(new Field('Duration', 0, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));2827 // tslint:disable-next-line: max-line-length2828 newMesg.setField(new Field('Repetitions', 3, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2829 // tslint:disable-next-line: max-line-length2830 newMesg.setField(new Field('Weight', 4, FitFieldType.uint16, 16, 0, 'kg', false, ProfileType.Uint16));2831 // tslint:disable-next-line: max-line-length2832 newMesg.setField(new Field('SetType', 5, FitFieldType.uint8, 1, 0, '', false, ProfileType.SetType));2833 // tslint:disable-next-line: max-line-length2834 newMesg.setField(new Field('StartTime', 6, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2835 // tslint:disable-next-line: max-line-length2836 newMesg.setField(new Field('Category', 7, FitFieldType.uint16, 1, 0, '', false, ProfileType.ExerciseCategory));2837 // tslint:disable-next-line: max-line-length2838 newMesg.setField(new Field('CategorySubtype', 8, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));2839 // tslint:disable-next-line: max-line-length2840 newMesg.setField(new Field('WeightDisplayUnit', 9, FitFieldType.uint16, 1, 0, '', false, ProfileType.FitBaseUnit));2841 // tslint:disable-next-line: max-line-length2842 newMesg.setField(new Field('MessageIndex', 10, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2843 // tslint:disable-next-line: max-line-length2844 newMesg.setField(new Field('WktStepIndex', 11, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2845 return newMesg;2846 }2847 private static createCourseMesg(): Mesg {2848 const newMesg: Mesg = new Mesg('Course', MesgNum.course);2849 // tslint:disable-next-line: max-line-length2850 newMesg.setField(new Field('Sport', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));2851 // tslint:disable-next-line: max-line-length2852 newMesg.setField(new Field('Name', 5, FitFieldType.string, 1, 0, '', false, ProfileType.String));2853 // tslint:disable-next-line: max-line-length2854 newMesg.setField(new Field('Capabilities', 6, FitFieldType.uint32z, 1, 0, '', false, ProfileType.CourseCapabilities));2855 // tslint:disable-next-line: max-line-length2856 newMesg.setField(new Field('SubSport', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));2857 return newMesg;2858 }2859 private static createCoursePointMesg(): Mesg {2860 const newMesg: Mesg = new Mesg('CoursePoint', MesgNum.coursePoint);2861 // tslint:disable-next-line: max-line-length2862 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2863 // tslint:disable-next-line: max-line-length2864 newMesg.setField(new Field('Timestamp', 1, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2865 // tslint:disable-next-line: max-line-length2866 newMesg.setField(new Field('PositionLat', 2, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2867 // tslint:disable-next-line: max-line-length2868 newMesg.setField(new Field('PositionLong', 3, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2869 // tslint:disable-next-line: max-line-length2870 newMesg.setField(new Field('Distance', 4, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));2871 // tslint:disable-next-line: max-line-length2872 newMesg.setField(new Field('Type', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.CoursePoint));2873 // tslint:disable-next-line: max-line-length2874 newMesg.setField(new Field('Name', 6, FitFieldType.string, 1, 0, '', false, ProfileType.String));2875 // tslint:disable-next-line: max-line-length2876 newMesg.setField(new Field('Favorite', 8, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));2877 return newMesg;2878 }2879 private static createSegmentIdMesg(): Mesg {2880 const newMesg: Mesg = new Mesg('SegmentId', MesgNum.segmentId);2881 // tslint:disable-next-line: max-line-length2882 newMesg.setField(new Field('Name', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));2883 // tslint:disable-next-line: max-line-length2884 newMesg.setField(new Field('Uuid', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));2885 // tslint:disable-next-line: max-line-length2886 newMesg.setField(new Field('Sport', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));2887 // tslint:disable-next-line: max-line-length2888 newMesg.setField(new Field('Enabled', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));2889 // tslint:disable-next-line: max-line-length2890 newMesg.setField(new Field('UserProfilePrimaryKey', 4, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2891 // tslint:disable-next-line: max-line-length2892 newMesg.setField(new Field('DeviceId', 5, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2893 // tslint:disable-next-line: max-line-length2894 newMesg.setField(new Field('DefaultRaceLeader', 6, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));2895 // tslint:disable-next-line: max-line-length2896 newMesg.setField(new Field('DeleteStatus', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.SegmentDeleteStatus));2897 // tslint:disable-next-line: max-line-length2898 newMesg.setField(new Field('SelectionType', 8, FitFieldType.enum, 1, 0, '', false, ProfileType.SegmentSelectionType));2899 return newMesg;2900 }2901 private static createSegmentLeaderboardEntryMesg(): Mesg {2902 const newMesg: Mesg = new Mesg('SegmentLeaderboardEntry', MesgNum.segmentLeaderboardEntry);2903 // tslint:disable-next-line: max-line-length2904 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2905 // tslint:disable-next-line: max-line-length2906 newMesg.setField(new Field('Name', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));2907 // tslint:disable-next-line: max-line-length2908 newMesg.setField(new Field('Type', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.SegmentLeaderboardType));2909 // tslint:disable-next-line: max-line-length2910 newMesg.setField(new Field('GroupPrimaryKey', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2911 // tslint:disable-next-line: max-line-length2912 newMesg.setField(new Field('ActivityId', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));2913 // tslint:disable-next-line: max-line-length2914 newMesg.setField(new Field('SegmentTime', 4, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));2915 // tslint:disable-next-line: max-line-length2916 newMesg.setField(new Field('ActivityIdString', 5, FitFieldType.string, 1, 0, '', false, ProfileType.String));2917 return newMesg;2918 }2919 private static createSegmentPointMesg(): Mesg {2920 const newMesg: Mesg = new Mesg('SegmentPoint', MesgNum.segmentPoint);2921 // tslint:disable-next-line: max-line-length2922 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2923 // tslint:disable-next-line: max-line-length2924 newMesg.setField(new Field('PositionLat', 1, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2925 // tslint:disable-next-line: max-line-length2926 newMesg.setField(new Field('PositionLong', 2, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2927 // tslint:disable-next-line: max-line-length2928 newMesg.setField(new Field('Distance', 3, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));2929 // tslint:disable-next-line: max-line-length2930 newMesg.setField(new Field('Altitude', 4, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));2931 // tslint:disable-next-line: max-line-length2932 newMesg.setField(new Field('LeaderTime', 5, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));2933 return newMesg;2934 }2935 private static createSegmentLapMesg(): Mesg {2936 let fieldIndex: number;2937 let subfieldIndex: number;2938 const newMesg: Mesg = new Mesg('SegmentLap', MesgNum.segmentLap);2939 fieldIndex = 0;2940 // tslint:disable-next-line: max-line-length2941 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));2942 fieldIndex++;2943 // tslint:disable-next-line: max-line-length2944 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));2945 fieldIndex++;2946 // tslint:disable-next-line: max-line-length2947 newMesg.setField(new Field('Event', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Event));2948 fieldIndex++;2949 // tslint:disable-next-line: max-line-length2950 newMesg.setField(new Field('EventType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.EventType));2951 fieldIndex++;2952 // tslint:disable-next-line: max-line-length2953 newMesg.setField(new Field('StartTime', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));2954 fieldIndex++;2955 // tslint:disable-next-line: max-line-length2956 newMesg.setField(new Field('StartPositionLat', 3, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2957 fieldIndex++;2958 // tslint:disable-next-line: max-line-length2959 newMesg.setField(new Field('StartPositionLong', 4, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2960 fieldIndex++;2961 // tslint:disable-next-line: max-line-length2962 newMesg.setField(new Field('EndPositionLat', 5, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2963 fieldIndex++;2964 // tslint:disable-next-line: max-line-length2965 newMesg.setField(new Field('EndPositionLong', 6, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));2966 fieldIndex++;2967 // tslint:disable-next-line: max-line-length2968 newMesg.setField(new Field('TotalElapsedTime', 7, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));2969 fieldIndex++;2970 // tslint:disable-next-line: max-line-length2971 newMesg.setField(new Field('TotalTimerTime', 8, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));2972 fieldIndex++;2973 // tslint:disable-next-line: max-line-length2974 newMesg.setField(new Field('TotalDistance', 9, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));2975 fieldIndex++;2976 // tslint:disable-next-line: max-line-length2977 newMesg.setField(new Field('TotalCycles', 10, FitFieldType.uint32, 1, 0, 'cycles', false, ProfileType.Uint32));2978 subfieldIndex = 0;2979 // tslint:disable-next-line: max-line-length2980 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TotalStrokes', 134, 1, 0, 'strokes'));2981 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(23, 2);2982 subfieldIndex++;2983 fieldIndex++;2984 // tslint:disable-next-line: max-line-length2985 newMesg.setField(new Field('TotalCalories', 11, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));2986 fieldIndex++;2987 // tslint:disable-next-line: max-line-length2988 newMesg.setField(new Field('TotalFatCalories', 12, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));2989 fieldIndex++;2990 // tslint:disable-next-line: max-line-length2991 newMesg.setField(new Field('AvgSpeed', 13, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));2992 fieldIndex++;2993 // tslint:disable-next-line: max-line-length2994 newMesg.setField(new Field('MaxSpeed', 14, FitFieldType.uint16, 1000, 0, 'm/s', false, ProfileType.Uint16));2995 fieldIndex++;2996 // tslint:disable-next-line: max-line-length2997 newMesg.setField(new Field('AvgHeartRate', 15, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));2998 fieldIndex++;2999 // tslint:disable-next-line: max-line-length3000 newMesg.setField(new Field('MaxHeartRate', 16, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));3001 fieldIndex++;3002 // tslint:disable-next-line: max-line-length3003 newMesg.setField(new Field('AvgCadence', 17, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));3004 fieldIndex++;3005 // tslint:disable-next-line: max-line-length3006 newMesg.setField(new Field('MaxCadence', 18, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));3007 fieldIndex++;3008 // tslint:disable-next-line: max-line-length3009 newMesg.setField(new Field('AvgPower', 19, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));3010 fieldIndex++;3011 // tslint:disable-next-line: max-line-length3012 newMesg.setField(new Field('MaxPower', 20, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));3013 fieldIndex++;3014 // tslint:disable-next-line: max-line-length3015 newMesg.setField(new Field('TotalAscent', 21, FitFieldType.uint16, 1, 0, 'm', false, ProfileType.Uint16));3016 fieldIndex++;3017 // tslint:disable-next-line: max-line-length3018 newMesg.setField(new Field('TotalDescent', 22, FitFieldType.uint16, 1, 0, 'm', false, ProfileType.Uint16));3019 fieldIndex++;3020 // tslint:disable-next-line: max-line-length3021 newMesg.setField(new Field('Sport', 23, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));3022 fieldIndex++;3023 // tslint:disable-next-line: max-line-length3024 newMesg.setField(new Field('EventGroup', 24, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3025 fieldIndex++;3026 // tslint:disable-next-line: max-line-length3027 newMesg.setField(new Field('NecLat', 25, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));3028 fieldIndex++;3029 // tslint:disable-next-line: max-line-length3030 newMesg.setField(new Field('NecLong', 26, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));3031 fieldIndex++;3032 // tslint:disable-next-line: max-line-length3033 newMesg.setField(new Field('SwcLat', 27, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));3034 fieldIndex++;3035 // tslint:disable-next-line: max-line-length3036 newMesg.setField(new Field('SwcLong', 28, FitFieldType.sint32, 1, 0, 'semicircles', false, ProfileType.Sint32));3037 fieldIndex++;3038 // tslint:disable-next-line: max-line-length3039 newMesg.setField(new Field('Name', 29, FitFieldType.string, 1, 0, '', false, ProfileType.String));3040 fieldIndex++;3041 // tslint:disable-next-line: max-line-length3042 newMesg.setField(new Field('NormalizedPower', 30, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));3043 fieldIndex++;3044 // tslint:disable-next-line: max-line-length3045 newMesg.setField(new Field('LeftRightBalance', 31, FitFieldType.uint16, 1, 0, '', false, ProfileType.LeftRightBalance100));3046 fieldIndex++;3047 // tslint:disable-next-line: max-line-length3048 newMesg.setField(new Field('SubSport', 32, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));3049 fieldIndex++;3050 // tslint:disable-next-line: max-line-length3051 newMesg.setField(new Field('TotalWork', 33, FitFieldType.uint32, 1, 0, 'J', false, ProfileType.Uint32));3052 fieldIndex++;3053 // tslint:disable-next-line: max-line-length3054 newMesg.setField(new Field('AvgAltitude', 34, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));3055 fieldIndex++;3056 // tslint:disable-next-line: max-line-length3057 newMesg.setField(new Field('MaxAltitude', 35, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));3058 fieldIndex++;3059 // tslint:disable-next-line: max-line-length3060 newMesg.setField(new Field('GpsAccuracy', 36, FitFieldType.uint8, 1, 0, 'm', false, ProfileType.Uint8));3061 fieldIndex++;3062 // tslint:disable-next-line: max-line-length3063 newMesg.setField(new Field('AvgGrade', 37, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));3064 fieldIndex++;3065 // tslint:disable-next-line: max-line-length3066 newMesg.setField(new Field('AvgPosGrade', 38, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));3067 fieldIndex++;3068 // tslint:disable-next-line: max-line-length3069 newMesg.setField(new Field('AvgNegGrade', 39, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));3070 fieldIndex++;3071 // tslint:disable-next-line: max-line-length3072 newMesg.setField(new Field('MaxPosGrade', 40, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));3073 fieldIndex++;3074 // tslint:disable-next-line: max-line-length3075 newMesg.setField(new Field('MaxNegGrade', 41, FitFieldType.sint16, 100, 0, '%', false, ProfileType.Sint16));3076 fieldIndex++;3077 // tslint:disable-next-line: max-line-length3078 newMesg.setField(new Field('AvgTemperature', 42, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));3079 fieldIndex++;3080 // tslint:disable-next-line: max-line-length3081 newMesg.setField(new Field('MaxTemperature', 43, FitFieldType.sint8, 1, 0, 'C', false, ProfileType.Sint8));3082 fieldIndex++;3083 // tslint:disable-next-line: max-line-length3084 newMesg.setField(new Field('TotalMovingTime', 44, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3085 fieldIndex++;3086 // tslint:disable-next-line: max-line-length3087 newMesg.setField(new Field('AvgPosVerticalSpeed', 45, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));3088 fieldIndex++;3089 // tslint:disable-next-line: max-line-length3090 newMesg.setField(new Field('AvgNegVerticalSpeed', 46, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));3091 fieldIndex++;3092 // tslint:disable-next-line: max-line-length3093 newMesg.setField(new Field('MaxPosVerticalSpeed', 47, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));3094 fieldIndex++;3095 // tslint:disable-next-line: max-line-length3096 newMesg.setField(new Field('MaxNegVerticalSpeed', 48, FitFieldType.sint16, 1000, 0, 'm/s', false, ProfileType.Sint16));3097 fieldIndex++;3098 // tslint:disable-next-line: max-line-length3099 newMesg.setField(new Field('TimeInHrZone', 49, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3100 fieldIndex++;3101 // tslint:disable-next-line: max-line-length3102 newMesg.setField(new Field('TimeInSpeedZone', 50, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3103 fieldIndex++;3104 // tslint:disable-next-line: max-line-length3105 newMesg.setField(new Field('TimeInCadenceZone', 51, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3106 fieldIndex++;3107 // tslint:disable-next-line: max-line-length3108 newMesg.setField(new Field('TimeInPowerZone', 52, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3109 fieldIndex++;3110 // tslint:disable-next-line: max-line-length3111 newMesg.setField(new Field('RepetitionNum', 53, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3112 fieldIndex++;3113 // tslint:disable-next-line: max-line-length3114 newMesg.setField(new Field('MinAltitude', 54, FitFieldType.uint16, 5, 500, 'm', false, ProfileType.Uint16));3115 fieldIndex++;3116 // tslint:disable-next-line: max-line-length3117 newMesg.setField(new Field('MinHeartRate', 55, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));3118 fieldIndex++;3119 // tslint:disable-next-line: max-line-length3120 newMesg.setField(new Field('ActiveTime', 56, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3121 fieldIndex++;3122 // tslint:disable-next-line: max-line-length3123 newMesg.setField(new Field('WktStepIndex', 57, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3124 fieldIndex++;3125 // tslint:disable-next-line: max-line-length3126 newMesg.setField(new Field('SportEvent', 58, FitFieldType.enum, 1, 0, '', false, ProfileType.SportEvent));3127 fieldIndex++;3128 // tslint:disable-next-line: max-line-length3129 newMesg.setField(new Field('AvgLeftTorqueEffectiveness', 59, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));3130 fieldIndex++;3131 // tslint:disable-next-line: max-line-length3132 newMesg.setField(new Field('AvgRightTorqueEffectiveness', 60, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));3133 fieldIndex++;3134 // tslint:disable-next-line: max-line-length3135 newMesg.setField(new Field('AvgLeftPedalSmoothness', 61, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));3136 fieldIndex++;3137 // tslint:disable-next-line: max-line-length3138 newMesg.setField(new Field('AvgRightPedalSmoothness', 62, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));3139 fieldIndex++;3140 // tslint:disable-next-line: max-line-length3141 newMesg.setField(new Field('AvgCombinedPedalSmoothness', 63, FitFieldType.uint8, 2, 0, 'percent', false, ProfileType.Uint8));3142 fieldIndex++;3143 // tslint:disable-next-line: max-line-length3144 newMesg.setField(new Field('Status', 64, FitFieldType.enum, 1, 0, '', false, ProfileType.SegmentLapStatus));3145 fieldIndex++;3146 // tslint:disable-next-line: max-line-length3147 newMesg.setField(new Field('Uuid', 65, FitFieldType.string, 1, 0, '', false, ProfileType.String));3148 fieldIndex++;3149 // tslint:disable-next-line: max-line-length3150 newMesg.setField(new Field('AvgFractionalCadence', 66, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));3151 fieldIndex++;3152 // tslint:disable-next-line: max-line-length3153 newMesg.setField(new Field('MaxFractionalCadence', 67, FitFieldType.uint8, 128, 0, 'rpm', false, ProfileType.Uint8));3154 fieldIndex++;3155 // tslint:disable-next-line: max-line-length3156 newMesg.setField(new Field('TotalFractionalCycles', 68, FitFieldType.uint8, 128, 0, 'cycles', false, ProfileType.Uint8));3157 fieldIndex++;3158 // tslint:disable-next-line: max-line-length3159 newMesg.setField(new Field('FrontGearShiftCount', 69, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3160 fieldIndex++;3161 // tslint:disable-next-line: max-line-length3162 newMesg.setField(new Field('RearGearShiftCount', 70, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3163 fieldIndex++;3164 // tslint:disable-next-line: max-line-length3165 newMesg.setField(new Field('TimeStanding', 71, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3166 fieldIndex++;3167 // tslint:disable-next-line: max-line-length3168 newMesg.setField(new Field('StandCount', 72, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3169 fieldIndex++;3170 // tslint:disable-next-line: max-line-length3171 newMesg.setField(new Field('AvgLeftPco', 73, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));3172 fieldIndex++;3173 // tslint:disable-next-line: max-line-length3174 newMesg.setField(new Field('AvgRightPco', 74, FitFieldType.sint8, 1, 0, 'mm', false, ProfileType.Sint8));3175 fieldIndex++;3176 // tslint:disable-next-line: max-line-length3177 newMesg.setField(new Field('AvgLeftPowerPhase', 75, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));3178 fieldIndex++;3179 // tslint:disable-next-line: max-line-length3180 newMesg.setField(new Field('AvgLeftPowerPhasePeak', 76, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));3181 fieldIndex++;3182 // tslint:disable-next-line: max-line-length3183 newMesg.setField(new Field('AvgRightPowerPhase', 77, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));3184 fieldIndex++;3185 // tslint:disable-next-line: max-line-length3186 newMesg.setField(new Field('AvgRightPowerPhasePeak', 78, FitFieldType.uint8, 0.7111111, 0, 'degrees', false, ProfileType.Uint8));3187 fieldIndex++;3188 // tslint:disable-next-line: max-line-length3189 newMesg.setField(new Field('AvgPowerPosition', 79, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));3190 fieldIndex++;3191 // tslint:disable-next-line: max-line-length3192 newMesg.setField(new Field('MaxPowerPosition', 80, FitFieldType.uint16, 1, 0, 'watts', false, ProfileType.Uint16));3193 fieldIndex++;3194 // tslint:disable-next-line: max-line-length3195 newMesg.setField(new Field('AvgCadencePosition', 81, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));3196 fieldIndex++;3197 // tslint:disable-next-line: max-line-length3198 newMesg.setField(new Field('MaxCadencePosition', 82, FitFieldType.uint8, 1, 0, 'rpm', false, ProfileType.Uint8));3199 fieldIndex++;3200 // tslint:disable-next-line: max-line-length3201 newMesg.setField(new Field('Manufacturer', 83, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));3202 fieldIndex++;3203 return newMesg;3204 }3205 private static createSegmentFileMesg(): Mesg {3206 const newMesg: Mesg = new Mesg('SegmentFile', MesgNum.segmentFile);3207 // tslint:disable-next-line: max-line-length3208 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3209 // tslint:disable-next-line: max-line-length3210 newMesg.setField(new Field('FileUuid', 1, FitFieldType.string, 1, 0, '', false, ProfileType.String));3211 // tslint:disable-next-line: max-line-length3212 newMesg.setField(new Field('Enabled', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));3213 // tslint:disable-next-line: max-line-length3214 newMesg.setField(new Field('UserProfilePrimaryKey', 4, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3215 // tslint:disable-next-line: max-line-length3216 newMesg.setField(new Field('LeaderType', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.SegmentLeaderboardType));3217 // tslint:disable-next-line: max-line-length3218 newMesg.setField(new Field('LeaderGroupPrimaryKey', 8, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3219 // tslint:disable-next-line: max-line-length3220 newMesg.setField(new Field('LeaderActivityId', 9, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3221 // tslint:disable-next-line: max-line-length3222 newMesg.setField(new Field('LeaderActivityIdString', 10, FitFieldType.string, 1, 0, '', false, ProfileType.String));3223 // tslint:disable-next-line: max-line-length3224 newMesg.setField(new Field('DefaultRaceLeader', 11, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3225 return newMesg;3226 }3227 private static createWorkoutMesg(): Mesg {3228 const newMesg: Mesg = new Mesg('Workout', MesgNum.workout);3229 // tslint:disable-next-line: max-line-length3230 newMesg.setField(new Field('Sport', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));3231 // tslint:disable-next-line: max-line-length3232 newMesg.setField(new Field('Capabilities', 5, FitFieldType.uint32z, 1, 0, '', false, ProfileType.WorkoutCapabilities));3233 // tslint:disable-next-line: max-line-length3234 newMesg.setField(new Field('NumValidSteps', 6, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3235 // tslint:disable-next-line: max-line-length3236 newMesg.setField(new Field('WktName', 8, FitFieldType.string, 1, 0, '', false, ProfileType.String));3237 // tslint:disable-next-line: max-line-length3238 newMesg.setField(new Field('SubSport', 11, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));3239 // tslint:disable-next-line: max-line-length3240 newMesg.setField(new Field('PoolLength', 14, FitFieldType.uint16, 100, 0, 'm', false, ProfileType.Uint16));3241 // tslint:disable-next-line: max-line-length3242 newMesg.setField(new Field('PoolLengthUnit', 15, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));3243 return newMesg;3244 }3245 private static createWorkoutSessionMesg(): Mesg {3246 const newMesg: Mesg = new Mesg('WorkoutSession', MesgNum.workoutSession);3247 // tslint:disable-next-line: max-line-length3248 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3249 // tslint:disable-next-line: max-line-length3250 newMesg.setField(new Field('Sport', 0, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));3251 // tslint:disable-next-line: max-line-length3252 newMesg.setField(new Field('SubSport', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.SubSport));3253 // tslint:disable-next-line: max-line-length3254 newMesg.setField(new Field('NumValidSteps', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3255 // tslint:disable-next-line: max-line-length3256 newMesg.setField(new Field('FirstStepIndex', 3, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3257 // tslint:disable-next-line: max-line-length3258 newMesg.setField(new Field('PoolLength', 4, FitFieldType.uint16, 100, 0, 'm', false, ProfileType.Uint16));3259 // tslint:disable-next-line: max-line-length3260 newMesg.setField(new Field('PoolLengthUnit', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.DisplayMeasure));3261 return newMesg;3262 }3263 private static createWorkoutStepMesg(): Mesg {3264 let fieldIndex: number;3265 let subfieldIndex: number;3266 const newMesg: Mesg = new Mesg('WorkoutStep', MesgNum.workoutStep);3267 fieldIndex = 0;3268 // tslint:disable-next-line: max-line-length3269 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3270 fieldIndex++;3271 // tslint:disable-next-line: max-line-length3272 newMesg.setField(new Field('WktStepName', 0, FitFieldType.string, 1, 0, '', false, ProfileType.String));3273 fieldIndex++;3274 // tslint:disable-next-line: max-line-length3275 newMesg.setField(new Field('DurationType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.WktStepDuration));3276 fieldIndex++;3277 // tslint:disable-next-line: max-line-length3278 newMesg.setField(new Field('DurationValue', 2, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3279 subfieldIndex = 0;3280 // tslint:disable-next-line: max-line-length3281 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationTime', 134, 1000, 0, 's'));3282 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 0);3283 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 28);3284 subfieldIndex++;3285 // tslint:disable-next-line: max-line-length3286 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationDistance', 134, 100, 0, 'm'));3287 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 1);3288 subfieldIndex++;3289 // tslint:disable-next-line: max-line-length3290 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationHr', 134, 1, 0, '% or bpm'));3291 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 2);3292 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 3);3293 subfieldIndex++;3294 // tslint:disable-next-line: max-line-length3295 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationCalories', 134, 1, 0, 'calories'));3296 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 4);3297 subfieldIndex++;3298 // tslint:disable-next-line: max-line-length3299 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationStep', 134, 1, 0, ''));3300 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 6);3301 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 7);3302 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 8);3303 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 9);3304 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 10);3305 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 11);3306 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 12);3307 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 13);3308 subfieldIndex++;3309 // tslint:disable-next-line: max-line-length3310 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationPower', 134, 1, 0, '% or watts'));3311 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 14);3312 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 15);3313 subfieldIndex++;3314 // tslint:disable-next-line: max-line-length3315 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('DurationReps', 134, 1, 0, ''));3316 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 29);3317 subfieldIndex++;3318 fieldIndex++;3319 // tslint:disable-next-line: max-line-length3320 newMesg.setField(new Field('TargetType', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.WktStepTarget));3321 fieldIndex++;3322 // tslint:disable-next-line: max-line-length3323 newMesg.setField(new Field('TargetValue', 4, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3324 subfieldIndex = 0;3325 // tslint:disable-next-line: max-line-length3326 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TargetSpeedZone', 134, 1, 0, ''));3327 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 0);3328 subfieldIndex++;3329 // tslint:disable-next-line: max-line-length3330 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TargetHrZone', 134, 1, 0, ''));3331 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 1);3332 subfieldIndex++;3333 // tslint:disable-next-line: max-line-length3334 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TargetCadenceZone', 134, 1, 0, ''));3335 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 3);3336 subfieldIndex++;3337 // tslint:disable-next-line: max-line-length3338 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TargetPowerZone', 134, 1, 0, ''));3339 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 4);3340 subfieldIndex++;3341 // tslint:disable-next-line: max-line-length3342 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RepeatSteps', 134, 1, 0, ''));3343 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 6);3344 subfieldIndex++;3345 // tslint:disable-next-line: max-line-length3346 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RepeatTime', 134, 1000, 0, 's'));3347 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 7);3348 subfieldIndex++;3349 // tslint:disable-next-line: max-line-length3350 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RepeatDistance', 134, 100, 0, 'm'));3351 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 8);3352 subfieldIndex++;3353 // tslint:disable-next-line: max-line-length3354 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RepeatCalories', 134, 1, 0, 'calories'));3355 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 9);3356 subfieldIndex++;3357 // tslint:disable-next-line: max-line-length3358 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RepeatHr', 134, 1, 0, '% or bpm'));3359 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 10);3360 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 11);3361 subfieldIndex++;3362 // tslint:disable-next-line: max-line-length3363 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('RepeatPower', 134, 1, 0, '% or watts'));3364 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 12);3365 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(1, 13);3366 subfieldIndex++;3367 // tslint:disable-next-line: max-line-length3368 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('TargetStrokeType', 0, 1, 0, ''));3369 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 11);3370 subfieldIndex++;3371 fieldIndex++;3372 // tslint:disable-next-line: max-line-length3373 newMesg.setField(new Field('CustomTargetValueLow', 5, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3374 subfieldIndex = 0;3375 // tslint:disable-next-line: max-line-length3376 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetSpeedLow', 134, 1000, 0, 'm/s'));3377 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 0);3378 subfieldIndex++;3379 // tslint:disable-next-line: max-line-length3380 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetHeartRateLow', 134, 1, 0, '% or bpm'));3381 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 1);3382 subfieldIndex++;3383 // tslint:disable-next-line: max-line-length3384 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetCadenceLow', 134, 1, 0, 'rpm'));3385 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 3);3386 subfieldIndex++;3387 // tslint:disable-next-line: max-line-length3388 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetPowerLow', 134, 1, 0, '% or watts'));3389 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 4);3390 subfieldIndex++;3391 fieldIndex++;3392 // tslint:disable-next-line: max-line-length3393 newMesg.setField(new Field('CustomTargetValueHigh', 6, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3394 subfieldIndex = 0;3395 // tslint:disable-next-line: max-line-length3396 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetSpeedHigh', 134, 1000, 0, 'm/s'));3397 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 0);3398 subfieldIndex++;3399 // tslint:disable-next-line: max-line-length3400 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetHeartRateHigh', 134, 1, 0, '% or bpm'));3401 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 1);3402 subfieldIndex++;3403 // tslint:disable-next-line: max-line-length3404 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetCadenceHigh', 134, 1, 0, 'rpm'));3405 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 3);3406 subfieldIndex++;3407 // tslint:disable-next-line: max-line-length3408 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('CustomTargetPowerHigh', 134, 1, 0, '% or watts'));3409 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(3, 4);3410 subfieldIndex++;3411 fieldIndex++;3412 // tslint:disable-next-line: max-line-length3413 newMesg.setField(new Field('Intensity', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.Intensity));3414 fieldIndex++;3415 // tslint:disable-next-line: max-line-length3416 newMesg.setField(new Field('Notes', 8, FitFieldType.string, 1, 0, '', false, ProfileType.String));3417 fieldIndex++;3418 // tslint:disable-next-line: max-line-length3419 newMesg.setField(new Field('Equipment', 9, FitFieldType.enum, 1, 0, '', false, ProfileType.WorkoutEquipment));3420 fieldIndex++;3421 // tslint:disable-next-line: max-line-length3422 newMesg.setField(new Field('ExerciseCategory', 10, FitFieldType.uint16, 1, 0, '', false, ProfileType.ExerciseCategory));3423 fieldIndex++;3424 // tslint:disable-next-line: max-line-length3425 newMesg.setField(new Field('ExerciseName', 11, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3426 fieldIndex++;3427 // tslint:disable-next-line: max-line-length3428 newMesg.setField(new Field('ExerciseWeight', 12, FitFieldType.uint16, 100, 0, 'kg', false, ProfileType.Uint16));3429 fieldIndex++;3430 // tslint:disable-next-line: max-line-length3431 newMesg.setField(new Field('WeightDisplayUnit', 13, FitFieldType.uint16, 1, 0, '', false, ProfileType.FitBaseUnit));3432 fieldIndex++;3433 return newMesg;3434 }3435 private static createExerciseTitleMesg(): Mesg {3436 const newMesg: Mesg = new Mesg('ExerciseTitle', MesgNum.exerciseTitle);3437 // tslint:disable-next-line: max-line-length3438 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3439 // tslint:disable-next-line: max-line-length3440 newMesg.setField(new Field('ExerciseCategory', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.ExerciseCategory));3441 // tslint:disable-next-line: max-line-length3442 newMesg.setField(new Field('ExerciseName', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3443 // tslint:disable-next-line: max-line-length3444 newMesg.setField(new Field('WktStepName', 2, FitFieldType.string, 1, 0, '', false, ProfileType.String));3445 return newMesg;3446 }3447 private static createScheduleMesg(): Mesg {3448 let fieldIndex: number;3449 let subfieldIndex: number;3450 const newMesg: Mesg = new Mesg('Schedule', MesgNum.schedule);3451 fieldIndex = 0;3452 // tslint:disable-next-line: max-line-length3453 newMesg.setField(new Field('Manufacturer', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));3454 fieldIndex++;3455 // tslint:disable-next-line: max-line-length3456 newMesg.setField(new Field('Product', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3457 subfieldIndex = 0;3458 // tslint:disable-next-line: max-line-length3459 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('FaveroProduct', 132, 1, 0, ''));3460 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 263);3461 subfieldIndex++;3462 // tslint:disable-next-line: max-line-length3463 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('GarminProduct', 132, 1, 0, ''));3464 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 1);3465 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 15);3466 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(0, 13);3467 subfieldIndex++;3468 fieldIndex++;3469 // tslint:disable-next-line: max-line-length3470 newMesg.setField(new Field('SerialNumber', 2, FitFieldType.uint32z, 1, 0, '', false, ProfileType.Uint32z));3471 fieldIndex++;3472 // tslint:disable-next-line: max-line-length3473 newMesg.setField(new Field('TimeCreated', 3, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));3474 fieldIndex++;3475 // tslint:disable-next-line: max-line-length3476 newMesg.setField(new Field('Completed', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));3477 fieldIndex++;3478 // tslint:disable-next-line: max-line-length3479 newMesg.setField(new Field('Type', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.Schedule));3480 fieldIndex++;3481 // tslint:disable-next-line: max-line-length3482 newMesg.setField(new Field('ScheduledTime', 6, FitFieldType.uint32, 1, 0, '', false, ProfileType.LocalDateTime));3483 fieldIndex++;3484 return newMesg;3485 }3486 private static createTotalsMesg(): Mesg {3487 const newMesg: Mesg = new Mesg('Totals', MesgNum.totals);3488 // tslint:disable-next-line: max-line-length3489 newMesg.setField(new Field('MessageIndex', 254, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3490 // tslint:disable-next-line: max-line-length3491 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3492 // tslint:disable-next-line: max-line-length3493 newMesg.setField(new Field('TimerTime', 0, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));3494 // tslint:disable-next-line: max-line-length3495 newMesg.setField(new Field('Distance', 1, FitFieldType.uint32, 1, 0, 'm', false, ProfileType.Uint32));3496 // tslint:disable-next-line: max-line-length3497 newMesg.setField(new Field('Calories', 2, FitFieldType.uint32, 1, 0, 'kcal', false, ProfileType.Uint32));3498 // tslint:disable-next-line: max-line-length3499 newMesg.setField(new Field('Sport', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.Sport));3500 // tslint:disable-next-line: max-line-length3501 newMesg.setField(new Field('ElapsedTime', 4, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));3502 // tslint:disable-next-line: max-line-length3503 newMesg.setField(new Field('Sessions', 5, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3504 // tslint:disable-next-line: max-line-length3505 newMesg.setField(new Field('ActiveTime', 6, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));3506 // tslint:disable-next-line: max-line-length3507 newMesg.setField(new Field('SportIndex', 9, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3508 return newMesg;3509 }3510 private static createWeightScaleMesg(): Mesg {3511 const newMesg: Mesg = new Mesg('WeightScale', MesgNum.weightScale);3512 // tslint:disable-next-line: max-line-length3513 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3514 // tslint:disable-next-line: max-line-length3515 newMesg.setField(new Field('Weight', 0, FitFieldType.uint16, 100, 0, 'kg', false, ProfileType.Weight));3516 // tslint:disable-next-line: max-line-length3517 newMesg.setField(new Field('PercentFat', 1, FitFieldType.uint16, 100, 0, '%', false, ProfileType.Uint16));3518 // tslint:disable-next-line: max-line-length3519 newMesg.setField(new Field('PercentHydration', 2, FitFieldType.uint16, 100, 0, '%', false, ProfileType.Uint16));3520 // tslint:disable-next-line: max-line-length3521 newMesg.setField(new Field('VisceralFatMass', 3, FitFieldType.uint16, 100, 0, 'kg', false, ProfileType.Uint16));3522 // tslint:disable-next-line: max-line-length3523 newMesg.setField(new Field('BoneMass', 4, FitFieldType.uint16, 100, 0, 'kg', false, ProfileType.Uint16));3524 // tslint:disable-next-line: max-line-length3525 newMesg.setField(new Field('MuscleMass', 5, FitFieldType.uint16, 100, 0, 'kg', false, ProfileType.Uint16));3526 // tslint:disable-next-line: max-line-length3527 newMesg.setField(new Field('BasalMet', 7, FitFieldType.uint16, 4, 0, 'kcal/day', false, ProfileType.Uint16));3528 // tslint:disable-next-line: max-line-length3529 newMesg.setField(new Field('PhysiqueRating', 8, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3530 // tslint:disable-next-line: max-line-length3531 newMesg.setField(new Field('ActiveMet', 9, FitFieldType.uint16, 4, 0, 'kcal/day', false, ProfileType.Uint16));3532 // tslint:disable-next-line: max-line-length3533 newMesg.setField(new Field('MetabolicAge', 10, FitFieldType.uint8, 1, 0, 'years', false, ProfileType.Uint8));3534 // tslint:disable-next-line: max-line-length3535 newMesg.setField(new Field('VisceralFatRating', 11, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3536 // tslint:disable-next-line: max-line-length3537 newMesg.setField(new Field('UserProfileIndex', 12, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3538 return newMesg;3539 }3540 private static createBloodPressureMesg(): Mesg {3541 const newMesg: Mesg = new Mesg('BloodPressure', MesgNum.bloodPressure);3542 // tslint:disable-next-line: max-line-length3543 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3544 // tslint:disable-next-line: max-line-length3545 newMesg.setField(new Field('SystolicPressure', 0, FitFieldType.uint16, 1, 0, 'mmHg', false, ProfileType.Uint16));3546 // tslint:disable-next-line: max-line-length3547 newMesg.setField(new Field('DiastolicPressure', 1, FitFieldType.uint16, 1, 0, 'mmHg', false, ProfileType.Uint16));3548 // tslint:disable-next-line: max-line-length3549 newMesg.setField(new Field('MeanArterialPressure', 2, FitFieldType.uint16, 1, 0, 'mmHg', false, ProfileType.Uint16));3550 // tslint:disable-next-line: max-line-length3551 newMesg.setField(new Field('Map3SampleMean', 3, FitFieldType.uint16, 1, 0, 'mmHg', false, ProfileType.Uint16));3552 // tslint:disable-next-line: max-line-length3553 newMesg.setField(new Field('MapMorningValues', 4, FitFieldType.uint16, 1, 0, 'mmHg', false, ProfileType.Uint16));3554 // tslint:disable-next-line: max-line-length3555 newMesg.setField(new Field('MapEveningValues', 5, FitFieldType.uint16, 1, 0, 'mmHg', false, ProfileType.Uint16));3556 // tslint:disable-next-line: max-line-length3557 newMesg.setField(new Field('HeartRate', 6, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));3558 // tslint:disable-next-line: max-line-length3559 newMesg.setField(new Field('HeartRateType', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.HrType));3560 // tslint:disable-next-line: max-line-length3561 newMesg.setField(new Field('Status', 8, FitFieldType.enum, 1, 0, '', false, ProfileType.BpStatus));3562 // tslint:disable-next-line: max-line-length3563 newMesg.setField(new Field('UserProfileIndex', 9, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3564 return newMesg;3565 }3566 private static createMonitoringInfoMesg(): Mesg {3567 const newMesg: Mesg = new Mesg('MonitoringInfo', MesgNum.monitoringInfo);3568 // tslint:disable-next-line: max-line-length3569 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3570 // tslint:disable-next-line: max-line-length3571 newMesg.setField(new Field('LocalTimestamp', 0, FitFieldType.uint32, 1, 0, 's', false, ProfileType.LocalDateTime));3572 // tslint:disable-next-line: max-line-length3573 newMesg.setField(new Field('ActivityType', 1, FitFieldType.enum, 1, 0, '', false, ProfileType.ActivityType));3574 // tslint:disable-next-line: max-line-length3575 newMesg.setField(new Field('CyclesToDistance', 3, FitFieldType.uint16, 5000, 0, 'm/cycle', false, ProfileType.Uint16));3576 // tslint:disable-next-line: max-line-length3577 newMesg.setField(new Field('CyclesToCalories', 4, FitFieldType.uint16, 5000, 0, 'kcal/cycle', false, ProfileType.Uint16));3578 // tslint:disable-next-line: max-line-length3579 newMesg.setField(new Field('RestingMetabolicRate', 5, FitFieldType.uint16, 1, 0, 'kcal / day', false, ProfileType.Uint16));3580 return newMesg;3581 }3582 private static createMonitoringMesg(): Mesg {3583 let fieldIndex: number;3584 let subfieldIndex: number;3585 const newMesg: Mesg = new Mesg('Monitoring', MesgNum.monitoring);3586 fieldIndex = 0;3587 // tslint:disable-next-line: max-line-length3588 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3589 fieldIndex++;3590 // tslint:disable-next-line: max-line-length3591 newMesg.setField(new Field('DeviceIndex', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.DeviceIndex));3592 fieldIndex++;3593 // tslint:disable-next-line: max-line-length3594 newMesg.setField(new Field('Calories', 1, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));3595 fieldIndex++;3596 // tslint:disable-next-line: max-line-length3597 newMesg.setField(new Field('Distance', 2, FitFieldType.uint32, 100, 0, 'm', false, ProfileType.Uint32));3598 fieldIndex++;3599 // tslint:disable-next-line: max-line-length3600 newMesg.setField(new Field('Cycles', 3, FitFieldType.uint32, 2, 0, 'cycles', false, ProfileType.Uint32));3601 subfieldIndex = 0;3602 // tslint:disable-next-line: max-line-length3603 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('Steps', 134, 1, 0, 'steps'));3604 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 6);3605 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 1);3606 subfieldIndex++;3607 // tslint:disable-next-line: max-line-length3608 newMesg.FieldsList[fieldIndex].subfields.push(new Subfield('Strokes', 134, 2, 0, 'strokes'));3609 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 2);3610 newMesg.FieldsList[fieldIndex].subfields[subfieldIndex].addMap(5, 5);3611 subfieldIndex++;3612 fieldIndex++;3613 // tslint:disable-next-line: max-line-length3614 newMesg.setField(new Field('ActiveTime', 4, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));3615 fieldIndex++;3616 // tslint:disable-next-line: max-line-length3617 newMesg.setField(new Field('ActivityType', 5, FitFieldType.enum, 1, 0, '', false, ProfileType.ActivityType));3618 fieldIndex++;3619 // tslint:disable-next-line: max-line-length3620 newMesg.setField(new Field('ActivitySubtype', 6, FitFieldType.enum, 1, 0, '', false, ProfileType.ActivitySubtype));3621 fieldIndex++;3622 // tslint:disable-next-line: max-line-length3623 newMesg.setField(new Field('ActivityLevel', 7, FitFieldType.enum, 1, 0, '', false, ProfileType.ActivityLevel));3624 fieldIndex++;3625 // tslint:disable-next-line: max-line-length3626 newMesg.setField(new Field('Distance16', 8, FitFieldType.uint16, 1, 0, '100 * m', false, ProfileType.Uint16));3627 fieldIndex++;3628 // tslint:disable-next-line: max-line-length3629 newMesg.setField(new Field('Cycles16', 9, FitFieldType.uint16, 1, 0, '2 * cycles (steps)', false, ProfileType.Uint16));3630 fieldIndex++;3631 // tslint:disable-next-line: max-line-length3632 newMesg.setField(new Field('ActiveTime16', 10, FitFieldType.uint16, 1, 0, 's', false, ProfileType.Uint16));3633 fieldIndex++;3634 // tslint:disable-next-line: max-line-length3635 newMesg.setField(new Field('LocalTimestamp', 11, FitFieldType.uint32, 1, 0, '', false, ProfileType.LocalDateTime));3636 fieldIndex++;3637 // tslint:disable-next-line: max-line-length3638 newMesg.setField(new Field('Temperature', 12, FitFieldType.sint16, 100, 0, 'C', false, ProfileType.Sint16));3639 fieldIndex++;3640 // tslint:disable-next-line: max-line-length3641 newMesg.setField(new Field('TemperatureMin', 14, FitFieldType.sint16, 100, 0, 'C', false, ProfileType.Sint16));3642 fieldIndex++;3643 // tslint:disable-next-line: max-line-length3644 newMesg.setField(new Field('TemperatureMax', 15, FitFieldType.sint16, 100, 0, 'C', false, ProfileType.Sint16));3645 fieldIndex++;3646 // tslint:disable-next-line: max-line-length3647 newMesg.setField(new Field('ActivityTime', 16, FitFieldType.uint16, 1, 0, 'minutes', false, ProfileType.Uint16));3648 fieldIndex++;3649 // tslint:disable-next-line: max-line-length3650 newMesg.setField(new Field('ActiveCalories', 19, FitFieldType.uint16, 1, 0, 'kcal', false, ProfileType.Uint16));3651 fieldIndex++;3652 // tslint:disable-next-line: max-line-length3653 newMesg.setField(new Field('CurrentActivityTypeIntensity', 24, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3654 // tslint:disable-next-line: max-line-length3655 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(5, false, 5, 1, 0)); // activity_type3656 // tslint:disable-next-line: max-line-length3657 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(28, false, 3, 1, 0)); // intensity3658 fieldIndex++;3659 // tslint:disable-next-line: max-line-length3660 newMesg.setField(new Field('TimestampMin8', 25, FitFieldType.uint8, 1, 0, 'min', false, ProfileType.Uint8));3661 fieldIndex++;3662 // tslint:disable-next-line: max-line-length3663 newMesg.setField(new Field('Timestamp16', 26, FitFieldType.uint16, 1, 0, 's', false, ProfileType.Uint16));3664 fieldIndex++;3665 // tslint:disable-next-line: max-line-length3666 newMesg.setField(new Field('HeartRate', 27, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));3667 fieldIndex++;3668 // tslint:disable-next-line: max-line-length3669 newMesg.setField(new Field('Intensity', 28, FitFieldType.uint8, 10, 0, '', false, ProfileType.Uint8));3670 fieldIndex++;3671 // tslint:disable-next-line: max-line-length3672 newMesg.setField(new Field('DurationMin', 29, FitFieldType.uint16, 1, 0, 'min', false, ProfileType.Uint16));3673 fieldIndex++;3674 // tslint:disable-next-line: max-line-length3675 newMesg.setField(new Field('Duration', 30, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));3676 fieldIndex++;3677 // tslint:disable-next-line: max-line-length3678 newMesg.setField(new Field('Ascent', 31, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));3679 fieldIndex++;3680 // tslint:disable-next-line: max-line-length3681 newMesg.setField(new Field('Descent', 32, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));3682 fieldIndex++;3683 // tslint:disable-next-line: max-line-length3684 newMesg.setField(new Field('ModerateActivityMinutes', 33, FitFieldType.uint16, 1, 0, 'minutes', false, ProfileType.Uint16));3685 fieldIndex++;3686 // tslint:disable-next-line: max-line-length3687 newMesg.setField(new Field('VigorousActivityMinutes', 34, FitFieldType.uint16, 1, 0, 'minutes', false, ProfileType.Uint16));3688 fieldIndex++;3689 return newMesg;3690 }3691 private static createHrMesg(): Mesg {3692 let fieldIndex: number;3693 const newMesg: Mesg = new Mesg('Hr', MesgNum.hr);3694 fieldIndex = 0;3695 // tslint:disable-next-line: max-line-length3696 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, '', false, ProfileType.DateTime));3697 fieldIndex++;3698 // tslint:disable-next-line: max-line-length3699 newMesg.setField(new Field('FractionalTimestamp', 0, FitFieldType.uint16, 32768, 0, 's', false, ProfileType.Uint16));3700 fieldIndex++;3701 // tslint:disable-next-line: max-line-length3702 newMesg.setField(new Field('Time256', 1, FitFieldType.uint8, 256, 0, 's', false, ProfileType.Uint8));3703 // tslint:disable-next-line: max-line-length3704 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(0, false, 8, 256, 0)); // fractional_timestamp3705 fieldIndex++;3706 // tslint:disable-next-line: max-line-length3707 newMesg.setField(new Field('FilteredBpm', 6, FitFieldType.uint8, 1, 0, 'bpm', false, ProfileType.Uint8));3708 fieldIndex++;3709 // tslint:disable-next-line: max-line-length3710 newMesg.setField(new Field('EventTimestamp', 9, FitFieldType.uint32, 1024, 0, 's', true, ProfileType.Uint32));3711 fieldIndex++;3712 // tslint:disable-next-line: max-line-length3713 newMesg.setField(new Field('EventTimestamp12', 10, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3714 // tslint:disable-next-line: max-line-length3715 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3716 // tslint:disable-next-line: max-line-length3717 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3718 // tslint:disable-next-line: max-line-length3719 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3720 // tslint:disable-next-line: max-line-length3721 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3722 // tslint:disable-next-line: max-line-length3723 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3724 // tslint:disable-next-line: max-line-length3725 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3726 // tslint:disable-next-line: max-line-length3727 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3728 // tslint:disable-next-line: max-line-length3729 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3730 // tslint:disable-next-line: max-line-length3731 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3732 // tslint:disable-next-line: max-line-length3733 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp3734 fieldIndex++;3735 return newMesg;3736 }3737 private static createStressLevelMesg(): Mesg {3738 const newMesg: Mesg = new Mesg('StressLevel', MesgNum.stressLevel);3739 // tslint:disable-next-line: max-line-length3740 newMesg.setField(new Field('StressLevelValue', 0, FitFieldType.sint16, 1, 0, '', false, ProfileType.Sint16));3741 // tslint:disable-next-line: max-line-length3742 newMesg.setField(new Field('StressLevelTime', 1, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3743 return newMesg;3744 }3745 private static createMemoGlobMesg(): Mesg {3746 const newMesg: Mesg = new Mesg('MemoGlob', MesgNum.memoGlob);3747 // tslint:disable-next-line: max-line-length3748 newMesg.setField(new Field('PartIndex', 250, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3749 // tslint:disable-next-line: max-line-length3750 newMesg.setField(new Field('Memo', 0, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3751 // tslint:disable-next-line: max-line-length3752 newMesg.setField(new Field('MessageNumber', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.Uint16));3753 // tslint:disable-next-line: max-line-length3754 newMesg.setField(new Field('MessageIndex', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3755 return newMesg;3756 }3757 private static createAntChannelIdMesg(): Mesg {3758 const newMesg: Mesg = new Mesg('AntChannelId', MesgNum.antChannelId);3759 // tslint:disable-next-line: max-line-length3760 newMesg.setField(new Field('ChannelNumber', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3761 // tslint:disable-next-line: max-line-length3762 newMesg.setField(new Field('DeviceType', 1, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));3763 // tslint:disable-next-line: max-line-length3764 newMesg.setField(new Field('DeviceNumber', 2, FitFieldType.uint16z, 1, 0, '', false, ProfileType.Uint16z));3765 // tslint:disable-next-line: max-line-length3766 newMesg.setField(new Field('TransmissionType', 3, FitFieldType.uint8z, 1, 0, '', false, ProfileType.Uint8z));3767 // tslint:disable-next-line: max-line-length3768 newMesg.setField(new Field('DeviceIndex', 4, FitFieldType.uint8, 1, 0, '', false, ProfileType.DeviceIndex));3769 return newMesg;3770 }3771 private static createAntRxMesg(): Mesg {3772 let fieldIndex: number;3773 const newMesg: Mesg = new Mesg('AntRx', MesgNum.antRx);3774 fieldIndex = 0;3775 // tslint:disable-next-line: max-line-length3776 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3777 fieldIndex++;3778 // tslint:disable-next-line: max-line-length3779 newMesg.setField(new Field('FractionalTimestamp', 0, FitFieldType.uint16, 32768, 0, 's', false, ProfileType.Uint16));3780 fieldIndex++;3781 // tslint:disable-next-line: max-line-length3782 newMesg.setField(new Field('MesgId', 1, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3783 fieldIndex++;3784 // tslint:disable-next-line: max-line-length3785 newMesg.setField(new Field('MesgData', 2, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3786 // tslint:disable-next-line: max-line-length3787 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(3, false, 8, 1, 0)); // channel_number3788 // tslint:disable-next-line: max-line-length3789 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3790 // tslint:disable-next-line: max-line-length3791 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3792 // tslint:disable-next-line: max-line-length3793 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3794 // tslint:disable-next-line: max-line-length3795 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3796 // tslint:disable-next-line: max-line-length3797 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3798 // tslint:disable-next-line: max-line-length3799 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3800 // tslint:disable-next-line: max-line-length3801 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3802 // tslint:disable-next-line: max-line-length3803 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3804 fieldIndex++;3805 // tslint:disable-next-line: max-line-length3806 newMesg.setField(new Field('ChannelNumber', 3, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3807 fieldIndex++;3808 // tslint:disable-next-line: max-line-length3809 newMesg.setField(new Field('Data', 4, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3810 fieldIndex++;3811 return newMesg;3812 }3813 private static createAntTxMesg(): Mesg {3814 let fieldIndex: number;3815 const newMesg: Mesg = new Mesg('AntTx', MesgNum.antTx);3816 fieldIndex = 0;3817 // tslint:disable-next-line: max-line-length3818 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3819 fieldIndex++;3820 // tslint:disable-next-line: max-line-length3821 newMesg.setField(new Field('FractionalTimestamp', 0, FitFieldType.uint16, 32768, 0, 's', false, ProfileType.Uint16));3822 fieldIndex++;3823 // tslint:disable-next-line: max-line-length3824 newMesg.setField(new Field('MesgId', 1, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3825 fieldIndex++;3826 // tslint:disable-next-line: max-line-length3827 newMesg.setField(new Field('MesgData', 2, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3828 // tslint:disable-next-line: max-line-length3829 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(3, false, 8, 1, 0)); // channel_number3830 // tslint:disable-next-line: max-line-length3831 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3832 // tslint:disable-next-line: max-line-length3833 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3834 // tslint:disable-next-line: max-line-length3835 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3836 // tslint:disable-next-line: max-line-length3837 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3838 // tslint:disable-next-line: max-line-length3839 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3840 // tslint:disable-next-line: max-line-length3841 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3842 // tslint:disable-next-line: max-line-length3843 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3844 // tslint:disable-next-line: max-line-length3845 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(4, false, 8, 1, 0)); // data3846 fieldIndex++;3847 // tslint:disable-next-line: max-line-length3848 newMesg.setField(new Field('ChannelNumber', 3, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3849 fieldIndex++;3850 // tslint:disable-next-line: max-line-length3851 newMesg.setField(new Field('Data', 4, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3852 fieldIndex++;3853 return newMesg;3854 }3855 private static createExdScreenConfigurationMesg(): Mesg {3856 const newMesg: Mesg = new Mesg('ExdScreenConfiguration', MesgNum.exdScreenConfiguration);3857 // tslint:disable-next-line: max-line-length3858 newMesg.setField(new Field('ScreenIndex', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3859 // tslint:disable-next-line: max-line-length3860 newMesg.setField(new Field('FieldCount', 1, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3861 // tslint:disable-next-line: max-line-length3862 newMesg.setField(new Field('Layout', 2, FitFieldType.enum, 1, 0, '', false, ProfileType.ExdLayout));3863 // tslint:disable-next-line: max-line-length3864 newMesg.setField(new Field('ScreenEnabled', 3, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));3865 return newMesg;3866 }3867 private static createExdDataFieldConfigurationMesg(): Mesg {3868 let fieldIndex: number;3869 const newMesg: Mesg =3870 new Mesg('ExdDataFieldConfiguration', MesgNum.exdDataFieldConfiguration);3871 fieldIndex = 0;3872 // tslint:disable-next-line: max-line-length3873 newMesg.setField(new Field('ScreenIndex', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3874 fieldIndex++;3875 // tslint:disable-next-line: max-line-length3876 newMesg.setField(new Field('ConceptField', 1, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3877 // tslint:disable-next-line: max-line-length3878 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(2, false, 4, 1, 0)); // field_id3879 // tslint:disable-next-line: max-line-length3880 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(3, false, 4, 1, 0)); // concept_count3881 fieldIndex++;3882 // tslint:disable-next-line: max-line-length3883 newMesg.setField(new Field('FieldId', 2, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3884 fieldIndex++;3885 // tslint:disable-next-line: max-line-length3886 newMesg.setField(new Field('ConceptCount', 3, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3887 fieldIndex++;3888 // tslint:disable-next-line: max-line-length3889 newMesg.setField(new Field('DisplayType', 4, FitFieldType.enum, 1, 0, '', false, ProfileType.ExdDisplayType));3890 fieldIndex++;3891 // tslint:disable-next-line: max-line-length3892 newMesg.setField(new Field('Title', 5, FitFieldType.string, 1, 0, '', false, ProfileType.String));3893 fieldIndex++;3894 return newMesg;3895 }3896 private static createExdDataConceptConfigurationMesg(): Mesg {3897 let fieldIndex: number;3898 const newMesg: Mesg =3899 new Mesg('ExdDataConceptConfiguration', MesgNum.exdDataConceptConfiguration);3900 fieldIndex = 0;3901 // tslint:disable-next-line: max-line-length3902 newMesg.setField(new Field('ScreenIndex', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3903 fieldIndex++;3904 // tslint:disable-next-line: max-line-length3905 newMesg.setField(new Field('ConceptField', 1, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3906 // tslint:disable-next-line: max-line-length3907 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(2, false, 4, 1, 0)); // field_id3908 // tslint:disable-next-line: max-line-length3909 newMesg.FieldsList[fieldIndex].components.push(new FieldComponent(3, false, 4, 1, 0)); // concept_index3910 fieldIndex++;3911 // tslint:disable-next-line: max-line-length3912 newMesg.setField(new Field('FieldId', 2, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3913 fieldIndex++;3914 // tslint:disable-next-line: max-line-length3915 newMesg.setField(new Field('ConceptIndex', 3, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3916 fieldIndex++;3917 // tslint:disable-next-line: max-line-length3918 newMesg.setField(new Field('DataPage', 4, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3919 fieldIndex++;3920 // tslint:disable-next-line: max-line-length3921 newMesg.setField(new Field('ConceptKey', 5, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3922 fieldIndex++;3923 // tslint:disable-next-line: max-line-length3924 newMesg.setField(new Field('Scaling', 6, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3925 fieldIndex++;3926 // tslint:disable-next-line: max-line-length3927 newMesg.setField(new Field('DataUnits', 8, FitFieldType.enum, 1, 0, '', false, ProfileType.ExdDataUnits));3928 fieldIndex++;3929 // tslint:disable-next-line: max-line-length3930 newMesg.setField(new Field('Qualifier', 9, FitFieldType.enum, 1, 0, '', false, ProfileType.ExdQualifiers));3931 fieldIndex++;3932 // tslint:disable-next-line: max-line-length3933 newMesg.setField(new Field('Descriptor', 10, FitFieldType.enum, 1, 0, '', false, ProfileType.ExdDescriptors));3934 fieldIndex++;3935 // tslint:disable-next-line: max-line-length3936 newMesg.setField(new Field('IsSigned', 11, FitFieldType.enum, 1, 0, '', false, ProfileType.Bool));3937 fieldIndex++;3938 return newMesg;3939 }3940 private static createFieldDescriptionMesg(): Mesg {3941 const newMesg: Mesg = new Mesg('FieldDescription', MesgNum.fieldDescription);3942 // tslint:disable-next-line: max-line-length3943 newMesg.setField(new Field('DeveloperDataIndex', 0, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3944 // tslint:disable-next-line: max-line-length3945 newMesg.setField(new Field('FieldDefinitionNumber', 1, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3946 // tslint:disable-next-line: max-line-length3947 newMesg.setField(new Field('FitBaseTypeId', 2, FitFieldType.uint8, 1, 0, '', false, ProfileType.FitBaseType));3948 // tslint:disable-next-line: max-line-length3949 newMesg.setField(new Field('FieldName', 3, FitFieldType.string, 1, 0, '', false, ProfileType.String));3950 // tslint:disable-next-line: max-line-length3951 newMesg.setField(new Field('Array', 4, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3952 // tslint:disable-next-line: max-line-length3953 newMesg.setField(new Field('Components', 5, FitFieldType.string, 1, 0, '', false, ProfileType.String));3954 // tslint:disable-next-line: max-line-length3955 newMesg.setField(new Field('Scale', 6, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3956 // tslint:disable-next-line: max-line-length3957 newMesg.setField(new Field('Offset', 7, FitFieldType.sint8, 1, 0, '', false, ProfileType.Sint8));3958 // tslint:disable-next-line: max-line-length3959 newMesg.setField(new Field('Units', 8, FitFieldType.string, 1, 0, '', false, ProfileType.String));3960 // tslint:disable-next-line: max-line-length3961 newMesg.setField(new Field('Bits', 9, FitFieldType.string, 1, 0, '', false, ProfileType.String));3962 // tslint:disable-next-line: max-line-length3963 newMesg.setField(new Field('Accumulate', 10, FitFieldType.string, 1, 0, '', false, ProfileType.String));3964 // tslint:disable-next-line: max-line-length3965 newMesg.setField(new Field('FitBaseUnitId', 13, FitFieldType.uint16, 1, 0, '', false, ProfileType.FitBaseUnit));3966 // tslint:disable-next-line: max-line-length3967 newMesg.setField(new Field('NativeMesgNum', 14, FitFieldType.uint16, 1, 0, '', false, ProfileType.MesgNum));3968 // tslint:disable-next-line: max-line-length3969 newMesg.setField(new Field('NativeFieldNum', 15, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3970 return newMesg;3971 }3972 private static createDeveloperDataIdMesg(): Mesg {3973 const newMesg: Mesg = new Mesg('DeveloperDataId', MesgNum.developerDataId);3974 // tslint:disable-next-line: max-line-length3975 newMesg.setField(new Field('DeveloperId', 0, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3976 // tslint:disable-next-line: max-line-length3977 newMesg.setField(new Field('ApplicationId', 1, FitFieldType.byte, 1, 0, '', false, ProfileType.Byte));3978 // tslint:disable-next-line: max-line-length3979 newMesg.setField(new Field('ManufacturerId', 2, FitFieldType.uint16, 1, 0, '', false, ProfileType.Manufacturer));3980 // tslint:disable-next-line: max-line-length3981 newMesg.setField(new Field('DeveloperDataIndex', 3, FitFieldType.uint8, 1, 0, '', false, ProfileType.Uint8));3982 // tslint:disable-next-line: max-line-length3983 newMesg.setField(new Field('ApplicationVersion', 4, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));3984 return newMesg;3985 }3986 private static createDiveSummaryMesg(): Mesg {3987 const newMesg: Mesg = new Mesg('DiveSummary', MesgNum.diveSummary);3988 // tslint:disable-next-line: max-line-length3989 newMesg.setField(new Field('Timestamp', 253, FitFieldType.uint32, 1, 0, 's', false, ProfileType.DateTime));3990 // tslint:disable-next-line: max-line-length3991 newMesg.setField(new Field('ReferenceMesg', 0, FitFieldType.uint16, 1, 0, '', false, ProfileType.MesgNum));3992 // tslint:disable-next-line: max-line-length3993 newMesg.setField(new Field('ReferenceIndex', 1, FitFieldType.uint16, 1, 0, '', false, ProfileType.MessageIndex));3994 // tslint:disable-next-line: max-line-length3995 newMesg.setField(new Field('AvgDepth', 2, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));3996 // tslint:disable-next-line: max-line-length3997 newMesg.setField(new Field('MaxDepth', 3, FitFieldType.uint32, 1000, 0, 'm', false, ProfileType.Uint32));3998 // tslint:disable-next-line: max-line-length3999 newMesg.setField(new Field('SurfaceInterval', 4, FitFieldType.uint32, 1, 0, 's', false, ProfileType.Uint32));4000 // tslint:disable-next-line: max-line-length4001 newMesg.setField(new Field('StartCns', 5, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));4002 // tslint:disable-next-line: max-line-length4003 newMesg.setField(new Field('EndCns', 6, FitFieldType.uint8, 1, 0, 'percent', false, ProfileType.Uint8));4004 // tslint:disable-next-line: max-line-length4005 newMesg.setField(new Field('StartN2', 7, FitFieldType.uint16, 1, 0, 'percent', false, ProfileType.Uint16));4006 // tslint:disable-next-line: max-line-length4007 newMesg.setField(new Field('EndN2', 8, FitFieldType.uint16, 1, 0, 'percent', false, ProfileType.Uint16));4008 // tslint:disable-next-line: max-line-length4009 newMesg.setField(new Field('O2Toxicity', 9, FitFieldType.uint16, 1, 0, 'OTUs', false, ProfileType.Uint16));4010 // tslint:disable-next-line: max-line-length4011 newMesg.setField(new Field('DiveNumber', 10, FitFieldType.uint32, 1, 0, '', false, ProfileType.Uint32));4012 // tslint:disable-next-line: max-line-length4013 newMesg.setField(new Field('BottomTime', 11, FitFieldType.uint32, 1000, 0, 's', false, ProfileType.Uint32));4014 return newMesg;4015 }4016 private static createPadMesg(): Mesg {4017 const newMesg: Mesg = new Mesg('Pad', MesgNum.pad);4018 return newMesg;4019 }4020 //#endregion...
action.js
Source:action.js
1$(document).ready(function(){2 ini();3 $("#action").change(function(){4 var act = $(this).children("option:selected").val();5 6 switch(act){7 case "1":8 ini();9 setfield("strtable","table","");10 break;11 case "2":12 ini();13 $("#msg").text("This should be done just before transfer to drdata because it could cause miss behaviors to actions.");14 setfield("strtable","table","");15 setfield("string","string"," : Enter a new name for the table");16 break;17 case "3":18 ini();19 setfield("strtable","table","");20 break;21 case "4":22 ini();23 setfield("strtable","table","");24 break;25 case "5":26 ini();27 setfield("strtable","table"," : No need to give a new name. It will be named with the prefix 'copy'. You will be able to rename it later");28 break;29 case "6":30 ini();31 setfield("strtable","table","");32 setfield("string","newfield"," : Enter a name for the new field");33 break;34 case "7":35 ini();36 setfield("strtable","table","");37 setfield("strfield","field","");38 setfield("string","newname"," : Enter a new name for the field");39 break;40 case "8":41 ini();42 setfield("strtable","table","");43 setfield("strfield","column","");44 break;45 case "9":46 ini();47 $("#msg").text("To duplicate a column you need to identify the column that you want to duplicate, named the new column.");48 setfield("strtable","table","");49 setfield("strfield","column","");50 setfield("string","newcolumn"," : The chosen strfield will be duplicate with all his data. Enter a name for the new column.");51 break;52 case "10":53 ini();54 $("#msg").text("To split a column you need to identify the column that you want to work with, named the new column. You will need to set how much left and right caracters you want to keep.");55 setfield("strtable","table","");56 setfield("strfield","column","");57 setfield("left","left"," : a number representing the length you want to keep from the left",false);58 setfield("right","right"," : a number representing the length you want to keep from the right",false);59 setfield("string","newcolumn"," : enter a name for the new column");60 break;61 case "11":62 ini();63 $("#msg").text("To move a column you need to identify the column that you want to move, and the table where you want to move it. Noticed that if your column contains more records than the table receiving it. It will be truncate.");64 setfield("strtable","table","");65 setfield("strfield","column","");66 setfield("totable","totable","");67 break;68 case "12":69 ini();70 setfield("strtable","table","");71 setfield("strfield","column"," : Where column *operator value. Operator could be anything in the list");72 setfield("operator","operator","");73 setfield("value","value"," : The value that will be use by the operator for comparison",false);74 setfield("unique","unique"," : A field name that contains only unique value. Usually begin with id_ ");75 break;76 case "13":77 ini();78 setfield("strtable","table","");79 break;80 case "14":81 ini();82 setfield("string","string"," : Enter a name for the new table.");83 break;84 case "15":85 ini();86 setfield("strtable","table","");87 setfield("strfield","column","");88 setfield("value","start"," : beginning value");89 break;90 case "16":91 ini();92 $("#msg").text("Reassign key values of a column in a slave table against new values in the master table. First you will need to duplicate a column in the master table and renumber it.");93 setfield("strtable","Master","");94 setfield("strfield","Master old key"," : This column contains original keys");95 setfield("totable","Slave"," : Slave table that will have multiple key value from master table");96 setfield("tofield","Slave key"," : Column to match the master old key and then change it for new key");97 setfield("unique","Master new key"," : Do you forget to duplicate a column ? This duplicate column contains new values.");98 break;99 case "17":100 ini();101 $("#msg").text("To move a column you need to identify the column that you want to move, and the table where you want to move it. You also need to match the keys.");102 setfield("strtable","table"," : The table that has the column you want to move");103 setfield("strfield","column"," : This column to be move");104 setfield("totable","totable"," : The table that will receive the column");105 setfield("tofield","tofield"," : Match keys of the table that will receive the column");106 setfield("unique","unique"," : Unique key of the table that has the column you want to move");107 break;108 case "18":109 ini();110 $("#msg").text("First duplicate a column. Allow me to manually tell it what the key for the column is? example: phonetype1=\"H\" means that phone1 should move to the HomePhone column");111 setfield("strtable","table"," : The table that has the column you want to copy");112 setfield("strfield","column"," : This column to be copy to another");113 setfield("totable","totable"," : The table that will receive the column. It can be the same table.");114 setfield("tofield","tofield"," : The column that will receive the copy. It should already be created.");115 setfield("string","where"," : The field that will serve for matching condition");116 setfield("operator","operator","");117 setfield("value","value"," : The value that will serve for matching condition",false);118 break;119 case "19":120 //Concat columns121 ini();122 $("#msg").text("First add a column to receive the concatanation. Concat two or more columns of the table.");123 setfield("strtable","table"," : The table that has columns you want to concat");124 setfield("strfield","column"," : This column to receive the concatening");125 setfield("string","filter"," : separate wanted fields with a comma ex: Addr1,City,State");126 setfield("value","value"," : Set a result delimiter, if empty it will be a space by default",false);127 break;128 case "20":129 //Date corrector130 ini();131 $("#msg").text("To fix a column choose a column and identify the format. It will transform as YYYY-MM-DD");132 setfield("strtable","table"," : The table that has date column you want to fix");133 setfield("strfield","column"," : This date column to be corrected");134 setfield("operator","format"," : Identify the current format of the date you want to change.");135 break;136 case "21":137 //Find and Replace138 ini();139 $("#msg").text("Find and replace a text in a column");140 setfield("strtable","table"," : The table that has date column you want to search");141 setfield("strfield","column"," : Search this column");142 setfield("string","filter"," : Text to search",false);143 setfield("value","text"," : Replace by this text");144 break;145 case "22":146 // Merge rows147 ini();148 $("#msg").text("Merge rows to a column in the first row by matching keys.");149 setfield("strtable","table"," : The table that has rows you want to merge");150 setfield("strfield","multiple"," : Multiple keys matching rows");151 setfield("string","line"," : The field that will serve for sorting");152 setfield("unique","concatenation"," : The column that will receive the concat text. First row of all. Other rows will be deleted.");153 break;154 case "23":155 ini();156 $("#msg").text("To split a column you need to identify the column that you want to work with, named the new column. You will need to set a research string.");157 setfield("strtable","table","");158 setfield("strfield","column","");159 setfield("string","newcolumn"," : enter a name for the new column");160 setfield("value","needle"," : needle, the research string.",false);161 break;162 case "24":163 ini();164 $("#msg").text("Copy text \"Self\" into this field when PatientNumber=Family; copy text \"Other\" into this field when PatientNumber<>Family");165 setfield("strtable","table"," : The table that has the column which will receive the copy text");166 setfield("strfield","column"," : This column to receive the copy text");167 setfield("left","text"," : This text will be copied");168 setfield("string","where"," : The field that will serve for matching condition");169 setfield("operator","operator","");170 setfield("value","value"," : The value that will serve for matching condition",false);171 break;172 case "25":173 ini();174 $("#msg").text("Copy data from table to another table by matching keys columns [left] and [right].");175 setfield("strtable","table"," : The table that has the column to be copy");176 setfield("strfield","column"," : This column to be copy");177 setfield("totable","totable"," : The table that will receive the column");178 setfield("tofield","tofield"," : This column to receive the copy text");179 setfield("left","left"," : Left keyname field to match");180 setfield("right","right"," : Right keyname field to match");181 setfield("string","where"," : The field that will serve for matching condition");182 setfield("operator","operator"," : You can use the 'LIKE' operator to search a string into the field.");183 setfield("value","value"," : The value that will serve for matching condition",false);184 break;185 case "26":186 ini();187 $("#msg").text("Load a batch of big data.");188 setfield("strtable","table","");189 setfield("value","index"," : Index of the last record for the batch. ex. 10000",false);190 break;191 case "27":192 ini();193 $("#msg").text("Direct export to mysql. Be careful, if the table not exists it will create it with all the fields and records.");194 setfield("strtable","table","");195 break;196 case "28":197 ini();198 $("#msg").text("Save a batch of big data.");199 setfield("strtable","table","");200 setfield("value","index"," : Index of the last record for the batch. ex. 10000",false);201 break;202 case "29":203 //Time corrector204 ini();205 $("#msg").text("To fix a column choose a time column and identify the format. It will transform as HH:MM:SS");206 setfield("strtable","table"," : The table that has time column you want to fix");207 setfield("strfield","column"," : This time column to be corrected");208 setfield("operator","format"," : Identify the current format of the time you want to change.",false);209 break;210 case "30":211 ini();212 $("#msg").text("Save as a .csv file");213 setfield("strtable","table","");214 setfield("value","append"," : Default is FALSE. Write TRUE is you want to append.",false);215 break;216 case "31":217 ini();218 $("#msg").text("Load a .csv file");219 setfield("strtable","table","");220 break;221 default:222 ini();223 }224 });225 226 function setfield(field,label="",help="",required="")227 {228 $("#div"+field).show();229 $("#"+field).css( "display", "block" ); 230 $("#"+field).attr("required",required);231 $("#lbl"+field).text(label);232 $("#help"+field).text(help);233 }234 function ini()235 {236 $("#strtable").css( "display", "none" );237 $("#strfield").css( "display", "none" );238 $("#totable").css( "display", "none" );239 $("#tofield").css( "display", "none" );240 $("#left").css( "display", "none" );241 $("#right").css( "display", "none" );242 $("#string").css( "display", "none" );243 $("#operator").css( "display", "none" );244 $("#value").css( "display", "none" );245 $("#unique").css( "display", "none" );246 247 $("#helpstrtable").text("");248 $("#helpstrfield").text("");249 $("#helptotable").text("");250 $("#helptofield").text("");251 $("#helpleft").text("");252 $("#helpright").text("");253 $("#helpstring").text("");254 $("#helpoperator").text("");255 $("#helpvalue").text("");256 $("#helpunique").text("");257 258 $("#lblstrtable").text("");259 $("#lblstrfield").text("");260 $("#lbltotable").text("");261 $("#lbltofield").text("");262 $("#lblleft").text("");263 $("#lblright").text("");264 $("#lblstring").text("");265 $("#lbloperator").text("");266 $("#lblvalue").text("");267 $("#lblunique").text("");268 269 $("#strtable").removeAttr("required");270 $("#strfield").removeAttr("required");271 $("#totable").removeAttr("required");272 $("#tofield").removeAttr("required");273 $("#left").removeAttr("required");274 $("#right").removeAttr("required");275 $("#string").removeAttr("required");276 $("#operator").removeAttr("required");277 $("#value").removeAttr("required");278 $("#unique").removeAttr("required");279 280 $("#divstrtable").hide();281 $("#divstrfield").hide();282 $("#divtotable").hide();283 $("#divtofield").hide();284 $("#divleft").hide();285 $("#divright").hide();286 $("#divstring").hide();287 $("#divoperator").hide();288 $("#divvalue").hide();289 $("#divunique").hide();290 291 $("#msg").text("Message is not set for this action.");292 }...
Using AI Code Generation
1function setField(field, value) {2 var storybookRoot = document.querySelector('storybook-root');3 storybookRoot.setField(field, value);4}5function getField(field) {6 var storybookRoot = document.querySelector('storybook-root');7 return storybookRoot.getField(field);8}9function getField(field) {10 var storybookRoot = document.querySelector('storybook-root');11 return storybookRoot.getField(field);12}13function getField(field) {14 var storybookRoot = document.querySelector('storybook-root');15 return storybookRoot.getField(field);16}17function getField(field) {18 var storybookRoot = document.querySelector('storybook-root');19 return storybookRoot.getField(field);20}21function getField(field) {22 var storybookRoot = document.querySelector('storybook-root');23 return storybookRoot.getField(field);24}25function getField(field) {26 var storybookRoot = document.querySelector('storybook-root');27 return storybookRoot.getField(field);28}29function getField(field) {30 var storybookRoot = document.querySelector('storybook-root');31 return storybookRoot.getField(field);32}33function getField(field) {34 var storybookRoot = document.querySelector('storybook-root');35 return storybookRoot.getField(field);36}37function getField(field) {38 var storybookRoot = document.querySelector('storybook-root');39 return storybookRoot.getField(field);40}41function getField(field) {42 var storybookRoot = document.querySelector('storybook-root');43 return storybookRoot.getField(field);44}45function getField(field) {46 var storybookRoot = document.querySelector('storybook-root');47 return storybookRoot.getField(field);48}49function getField(field) {50 var storybookRoot = document.querySelector('storybook-root');51 return storybookRoot.getField(field);52}53function getField(field) {
Using AI Code Generation
1const root = document.querySelector('storybook-root');2root.setField('title', 'New Title');3const root = document.querySelector('storybook-root');4root.setField('title', 'New Title');5const root = document.querySelector('storybook-root');6root.setField('title', 'New Title');7const root = document.querySelector('storybook-root');8root.setField('title', 'New Title');9const root = document.querySelector('storybook-root');10root.setField('title', 'New Title');11const root = document.querySelector('storybook-root');12root.setField('title', 'New Title');13const root = document.querySelector('storybook-root');14root.setField('title', 'New Title');15const root = document.querySelector('storybook-root');16root.setField('title', 'New Title');17const root = document.querySelector('storybook-root');18root.setField('title', 'New Title');19const root = document.querySelector('storybook-root');20root.setField('title', 'New Title');21const root = document.querySelector('storybook-root');22root.setField('title', 'New Title');23const root = document.querySelector('storybook-root');24root.setField('title', 'New Title');25const root = document.querySelector('storybook-root');26root.setField('title', 'New Title');27const root = document.querySelector('storybook-root');28root.setField('title', 'New Title
Using AI Code Generation
1import { setField } from 'storybook-root';2const myStory = () => {3 setField('myField', 'myValue');4 return <div>My Story</div>;5};6export default myStory;7import { getStorybookRoot } from 'storybook-root';8const StorybookRoot = getStorybookRoot();9const { setField } = StorybookRoot;10setField('myField', 'myValue');
Using AI Code Generation
1import { setField } from 'storybook-root';2setField('name', 'value');3import { setField } from 'storybook-root';4global.setField = setField;5import '@storybook/addon-actions/register';6import 'storybook-root';7import { addDecorator } from '@storybook/react';8import { withA11y } from '@storybook/addon-a11y';9import { withKnobs } from '@storybook/addon-knobs';10import { withTests } from '@storybook/addon-jest';11import { withContexts } from '@storybook/addon-contexts/react';12import { withInfo } from '@storybook/addon-info';13import { withPerformance } from 'storybook-addon-performance';14import { withConsole } from '@storybook/addon-console';15import { withViewport } from '@storybook/addon-viewport';16import { withTests as withTestsAddon } from '@storybook/addon-jest';17import { withA11y as withA11yAddon } from '@storybook/addon-a11y';18import { withKnobs as withKnobsAddon } from '@storybook/addon-knobs';19import { withInfo as withInfoAddon } from '@storybook/addon-info';20import { withPerformance as withPerformanceAddon } from 'storybook-addon-performance';21import { withConsole as withConsoleAddon } from '@storybook/addon-console';22import { withViewport as withViewportAddon } from '@storybook/addon-viewport';23import { withContexts as withContextsAddon } from '@storybook/addon-contexts/react';24import { withTests as withTestsDecorator } from '@storybook/addon-jest';25import { withA11y as withA11yDecorator } from '@storybook/addon-a11y';26import { withKnobs as withKnobsDecorator } from '@storybook/addon-knobs';27import { withInfo as withInfoDecorator } from '@storybook/addon-info';28import { withPerformance as withPerformanceDecorator } from 'storybook-addon-performance';29import { withConsole as withConsoleDecorator } from '@storybook/addon-console';30import { withViewport as withViewportDecorator } from '@storybook/addon-viewport';31import { withContexts as withContexts
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!