summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncHeartRateDataModel.h
blob: c160915c8d1c1f0cb3e1d39c64b7321cce7ed8ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
//
//  IDOSyncHeartRateDataModel.h
//  IDOBluetoothInternal
//
//  Created by 何东阳 on 2019/8/6.
//  Copyright © 2019 何东阳. All rights reserved.
//

#import <Foundation/Foundation.h>
#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
#else
#import "IDOBluetoothBaseModel.h"
#endif

@interface IDOSyncHrDataItemInfoBluetoothModel : IDOBluetoothBaseModel

/**
 子时间偏移量 (单位:分钟) | Total time offset (unit: minute)
 */
@property (nonatomic,assign) NSInteger offset;

/**
 心率值 | Heart rate value
 */
@property (nonatomic,assign) NSInteger data;

/**
 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
 */
@property (nonatomic,copy) NSString * dateStr;

/**
 序列号 | Serial number
 */
@property (nonatomic,assign) NSInteger  serialNumber;

@end

@interface IDOSyncHrDataInfoBluetoothModel : IDOBluetoothBaseModel

/**
 心率数据包数量 | Heart Rate Packets
 */
@property (nonatomic,assign) NSInteger  itemsCount;

/**
 总时间偏移量 (单位:分钟) | Total time offset (unit: minute)
 */
@property (nonatomic,assign) NSUInteger minuteOffset;

/**
 静态心率 | Static heart rate
 */
@property (nonatomic,assign) NSUInteger silentHeartRate;

/**
 燃烧脂肪阀值 | Burning fat threshold
 */
@property (nonatomic,assign) NSUInteger burnFatThreshold;

/**
 肌肉锻炼阀值 | Muscle exercise threshold
 */
@property (nonatomic,assign) NSUInteger aerobicThreshold;

/**
 极限阀值 | Limit threshold
 */
@property (nonatomic,assign) NSUInteger limitThreshold;

/**
 脂肪燃烧时长 (单位 :分钟) | Fat burning time (unit: minute)
 */
@property (nonatomic,assign) NSUInteger burnFatMins;

/**
 肌肉锻炼时长 (单位 :分钟) | Muscle training time (unit: minute)
 */
@property (nonatomic,assign) NSUInteger aerobicMins;

/**
 极限运动时长 (单位 :分钟) | Extreme Sports Duration (Unit: Minutes)
 */
@property (nonatomic,assign) NSUInteger limitMins;

/**
 用户最大心率 | User maximum heart rate
 */
@property (nonatomic,assign) NSUInteger userMaxHr;

/**
 热身运动阈值 | warm up threshold
 */
@property (nonatomic,assign) NSUInteger warmUpThreshold;

/**
 热身运动时间 (单位 :分钟) | warm up mins
 */
@property (nonatomic,assign) NSUInteger warmUpMins;

/**
 无氧运动阈值 | anaerobic threshold
 */
@property (nonatomic,assign) NSUInteger anaerobicThreshold;

/**
 无氧运动时间 (单位 :分钟) | anaerobic mins
 */
@property (nonatomic,assign) NSUInteger anaerobicMins;

/**
 年份 | Year
 */
@property (nonatomic,assign) NSInteger year;

/**
 月份 | Month
 */
@property (nonatomic,assign) NSInteger month;

/**
 日期 | Date
 */
@property (nonatomic,assign) NSInteger day;

/**
 * 心率集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
 * Heart rate collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly
 * converted into model collections. You need to query itemModel to assign current attributes.
 */
@property (nonatomic,copy) NSArray <IDOSyncHrDataItemInfoBluetoothModel *>* heartRates;

/**
 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
 */
@property (nonatomic,copy) NSString * dateStr;

@end

@interface IDOSyncSecHrDataItemInfoBluetoothModel : IDOBluetoothBaseModel
/**
 子时间偏移量 (单位:秒钟) | Total time offset (unit: second)
 */
@property (nonatomic,assign) NSInteger offset;

/**
 心率值 | Heart rate value
 */
@property (nonatomic,assign) NSInteger hrValue;

/**
 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
 */
@property (nonatomic,copy) NSString * dateStr;

/**
 序列号 | Serial number
 */
@property (nonatomic,assign) NSInteger  serialNumber;

@end

@interface IDOSyncSecHrDataInfoBluetoothModel : IDOBluetoothBaseModel
/**
 心率数据包数量 | Heart Rate Packets
 */
@property (nonatomic,assign) NSInteger  itemsCount;

/**
 总时间偏移量 (单位:秒钟) | Total time offset (unit: second)
 */
@property (nonatomic,assign) NSUInteger secondOffset;

/**
 静态心率 | Static heart rate
 */
@property (nonatomic,assign) NSUInteger silentHeartRate;

/**
 燃烧脂肪阀值 | Burning fat threshold
 */
@property (nonatomic,assign) NSUInteger burnFatThreshold;

/**
 肌肉锻炼阀值 | Muscle exercise threshold
 */
@property (nonatomic,assign) NSUInteger aerobicThreshold;

/**
 极限阀值 | Limit threshold
 */
@property (nonatomic,assign) NSUInteger limitThreshold;

/**
 脂肪燃烧时长 (单位 :分钟) | Fat burning time (unit: minute)
 */
@property (nonatomic,assign) NSUInteger burnFatMins;

/**
 肌肉锻炼时长 (单位 :分钟) | Muscle training time (unit: minute)
 */
@property (nonatomic,assign) NSUInteger aerobicMins;

/**
 极限运动时长 (单位 :分钟) | Extreme Sports Duration (Unit: Minutes)
 */
@property (nonatomic,assign) NSUInteger limitMins;

/**
 用户最大心率 | User maximum heart rate
 */
@property (nonatomic,assign) NSUInteger userMaxHr;

/**
 热身运动阈值 | warm up threshold
 */
@property (nonatomic,assign) NSUInteger warmUpThreshold;

/**
 热身运动时间 (单位 :分钟) | warm up mins
 */
@property (nonatomic,assign) NSUInteger warmUpMins;

/**
 无氧运动阈值 | anaerobic threshold
 */
@property (nonatomic,assign) NSUInteger anaerobicThreshold;

/**
 无氧运动阈值 (单位 :分钟) | anaerobic mins
 */
@property (nonatomic,assign) NSUInteger anaerobicMins;

/**
 年份 | Year
 */
@property (nonatomic,assign) NSInteger year;

/**
 月份 | Month
 */
@property (nonatomic,assign) NSInteger month;

/**
 日期 | Date
 */
@property (nonatomic,assign) NSInteger day;

/**
 * 心率集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
 * Heart rate collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly
 * converted into model collections. You need to query itemModel to assign current attributes.
 */
@property (nonatomic,copy) NSArray <IDOSyncSecHrDataItemInfoBluetoothModel *>* heartRates;

/**
 * 5分钟间隔心率集合和总心率时长 | Heart rate set at 5-minute intervals and total heart rate duration
 *  @{@"total_offset":@(0),@"heart_rates":@[@{@"offset":@(0),@"value":@(0)}...]};
 */
@property (nonatomic,copy) NSDictionary * minutesHrDic;

/**
 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
 */
@property (nonatomic,copy) NSString * dateStr;

@end


@interface IDOSyncHeartRateDataModel : NSObject

#pragma mark ======================== offset minunte ===============================
/**
 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
 * Query all data of the current device for 12 months in a certain year (If there is no data in the query month, an empty data object will be created,
 * and the data larger than the current month will not be accumulated)
 * @param year 年 (如 : 2018) | Year (eg: 2018)
 * @param macAddr mac 地址 | mac address
 * @param isQuery 是否查询items | is query items
 * @return 一年12个月的心率数据集合,其中IDOSyncHrDataInfoBluetoothModel对象是一天总心率数据模型
 * Heart rate data collection for 12 months a year, where the IDOSyncHrDataInfoBluetoothModel object is the total heart rate data model for the day
 */
+ (NSArray <NSArray<__kindof IDOSyncHrDataInfoBluetoothModel *>*> *)queryOneYearHearRatesWithYear:(NSInteger)year
                                                                                          macAddr:(NSString *)macAddr
                                                                                     isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
 * which is larger than the data of the day)
 * @param year 年 (如 : 2018) | Year (eg: 2018)
 * @param month 月 (如 : 9) | Month (eg: 9)
 * @param macAddr mac 地址 | mac address
 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
 * Pointer to all date collections for the current query month (format: [10/01...10/31])
 * @param isQuery 是否查询items | is query items
 * @return 一个月的心率数据集合,其中IDOSyncHrDataInfoBluetoothModel对象是一天总心率数据模型
 * A one-month heart rate data collection, where the IDOSyncHrDataInfoBluetoothModel object is the total heart rate data model for the day
 */
+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryOneMonthHearRatesWithYear:(NSInteger)year
                                                                                  month:(NSInteger)month
                                                                                macAddr:(NSString *)macAddr
                                                                           datesOfMonth:(NSArray <NSString *>**)dates
                                                                           isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
 * and the data larger than the current day will not be accumulated)
 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
 * @param macAddr mac 地址 | mac address
 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
 * Pointer to all date collections for the current query week (format: [10/01...10/07])
 * @param isQuery 是否查询items | is query items
 * @return 一周的心率数据集合,其中IDOSyncHrDataInfoBluetoothModel对象是一天总心率数据模型
 * A week's heart rate data collection, where the IDOSyncHrDataInfoBluetoothModel object is the total heart rate data model for the day
 */
+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryOneWeekHearRatesWithWeekIndex:(NSInteger)weekIndex
                                                                               weekStartDay:(NSInteger)weekStartDay
                                                                                    macAddr:(NSString *)macAddr
                                                                                datesOfWeek:(NSArray <NSString *>**)dates
                                                                               isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询当前设备某天心率数据并有详情数据 | Query current heart rate data of the current device and have detailed data
 * @param macAddr mac 地址 | mac address
 * @param year  年份  | year
 * @param month 月份  | month
 * @param day   日期  | day
 * @return 一天心率数据的集合和详情数据集合 | Collection of day heart rate data and details data
 */
+ (NSArray<__kindof IDOSyncHrDataInfoBluetoothModel *> *)queryOneDayHearRatesDetailWithMac:(NSString *)macAddr
                                                                                       year:(NSInteger)year
                                                                                      month:(NSInteger)month
                                                                                        day:(NSInteger)day;

/**
 * @brief 查询所有心率数据 心率包个数大于0 | Query all heart rate data The number of heart rate packets is greater than 0
 * @param macAddr mac 地址 | mac address
 * @return 所有心率数据的集合 | Collection of all heart rate data and details data
 */
+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryAllHearRatesWithMac:(NSString *)macAddr;


/**
 * @brief 查询所有心率数据 心率包个数大于0 只包含静心心率和日期时间戳
 * Query all heart rate data The number of heart rate packets is greater than 0
 * Contains only meditation heart rate and date and time stamp
 * @param macAddr mac 地址 | mac address
 * @return 所有心率数据的集合 | Collection of all heart rate data
 */
+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryAllContractedHearRatesWithMac:(NSString *)macAddr;

#pragma mark ======================== offset second ===============================

/**
 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
 * Query all data of the current device for 12 months in a certain year (If there is no data in the query month, an empty data object will be created,
 * and the data larger than the current month will not be accumulated)
 * @param year 年 (如 : 2018) | Year (eg: 2018)
 * @param macAddr mac 地址 | mac address
 * @param isQuery 是否查询items | is query items
 * @return 一年12个月的秒钟心率数据集合,其中IDOSyncSecHrDataInfoBluetoothModel对象是一天总心率数据模型
 * second heart rate data collection for 12 months a year, where the IDOSyncSecHrDataInfoBluetoothModel object is the total heart rate data model for the day
 */
+ (NSArray <NSArray<__kindof IDOSyncSecHrDataInfoBluetoothModel *>*> *)queryOneYearSecHearRatesWithYear:(NSInteger)year
                                                                                                macAddr:(NSString *)macAddr
                                                                                           isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
 * which is larger than the data of the day)
 * @param year 年 (如 : 2018) | Year (eg: 2018)
 * @param month 月 (如 : 9) | Month (eg: 9)
 * @param macAddr mac 地址 | mac address
 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
 * Pointer to all date collections for the current query month (format: [10/01...10/31])
 * @param isQuery 是否查询items | is query items
 * @return 一个月的秒钟心率数据集合,其中IDOSyncSecHrDataInfoBluetoothModel对象是一天总心率数据模型
 * one-month second heart rate data collection, where the IDOSyncSecHrDataInfoBluetoothModel object is the total heart rate data model for the day
 */
+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryOneMonthSecHearRatesWithYear:(NSInteger)year
                                                                                         month:(NSInteger)month
                                                                                       macAddr:(NSString *)macAddr
                                                                                  datesOfMonth:(NSArray <NSString *>**)dates
                                                                                  isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
 * and the data larger than the current day will not be accumulated)
 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
 * @param macAddr mac 地址 | mac address
 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
 * Pointer to all date collections for the current query week (format: [10/01...10/07])
 * @param isQuery 是否查询items | is query items
 * @return 一周的秒钟心率数据集合,其中IDOSyncSecHrDataInfoBluetoothModel对象是一天总心率数据模型
 * one week second heart rate data collection, where the IDOSyncSecHrDataInfoBluetoothModel object is the total heart rate data model for the day
 */
+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryOneWeekSecHearRatesWithWeekIndex:(NSInteger)weekIndex
                                                                                     weekStartDay:(NSInteger)weekStartDay
                                                                                          macAddr:(NSString *)macAddr
                                                                                      datesOfWeek:(NSArray <NSString *>**)dates
                                                                                     isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询当前设备某天秒钟心率数据并有详情数据 | Query current day second heart rate data of the current device and have detailed data
 * @param macAddr mac 地址 | mac address
 * @param year  年份  | year
 * @param month 月份  | month
 * @param day   日期  | day
 * @param isQuery 是否查询items | is query items
 * @return 一天秒钟心率数据的集合和详情数据集合 | Collection of day second heart rate data and details data
 */
+ (NSArray<__kindof IDOSyncSecHrDataInfoBluetoothModel *> *)queryOneDaySecHearRatesDetailWithMac:(NSString *)macAddr
                                                                                    year:(NSInteger)year
                                                                                   month:(NSInteger)month
                                                                                     day:(NSInteger)day
                                                                            isQueryItems:(BOOL)isQuery;

/**
 * @brief 查询所有秒钟心率数据 心率包个数大于0 | Query all second heart rate data The number of heart rate packets is greater than 0
 * @param macAddr mac 地址 | mac address
 * @return 所有秒钟心率数据的集合 | Collection of all second heart rate data and details data
 */
+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryAllSecHearRatesWithMac:(NSString *)macAddr;

/**
 * @brief 查询所有秒钟心率数据 心率包个数大于0 只包含静心心率和日期时间戳
 * Query all second heart rate data The number of heart rate packets is greater than 0
 * Contains only meditation heart rate and date and time stamp
 * @param macAddr mac 地址 | mac address
 * @return 所有心率数据的集合 | Collection of all heart rate data
 */
+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryAllContractedSecHearRatesWithMac:(NSString *)macAddr;

@end