react-native-mytatva-rn-sdk 1.2.24 → 1.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,20 @@
130
130
  glucose.temperature = data.temperature;
131
131
  float algo_k = [[User_Defaults objectForKey:@"algo_k"] floatValue];
132
132
  float algo_r = [[User_Defaults objectForKey:@"algo_r"] floatValue];
133
+
134
+ NSString *dateString = data.receiveDateTime;
135
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
136
+ [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
137
+ [dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
138
+ NSDate *date = [dateFormatter dateFromString:dateString];
139
+ if (date) {
140
+ NSTimeInterval timeMillis = [date timeIntervalSince1970] * 1000; // Convert to milliseconds
141
+ NSLog(@"Milliseconds since epoch: %.0f", timeMillis);
142
+ NSNumber *numberFromTimeMillis = [NSNumber numberWithDouble:timeMillis]; // Wrap the NSTimeInterval into an NSNumber
143
+ } else {
144
+ NSLog(@"Invalid date string format");
145
+ }
146
+
133
147
 
134
148
  LatestData *d = nil;
135
149
  NSString *localName = data.device.advertise.localName;
@@ -137,13 +151,24 @@
137
151
  if (userBG > 0) {
138
152
  d = [[LatestData alloc] initWithParameters:glucose.dataId.intValue andIw:[glucose.operatingCurrent floatValue] andIb:[glucose.blankCurrent floatValue] andT:[glucose.temperature floatValue] andK0:algo_k andR:algo_r andDay:[data.day intValue] andHour:[data.hour intValue] andMinute:[data.minute intValue] andNewBgToGlucoseId:glucose.dataId.intValue andNewBgValue:userBG andName:localName];
139
153
  } else {
140
- d = [[LatestData alloc] initWithParameters:([glucose.dataId intValue]) andIw:[glucose.operatingCurrent floatValue] andIb:[glucose.blankCurrent floatValue] andT:[glucose.temperature floatValue] andK0:algo_k andR:algo_r andDay:[data.day intValue] andHour:[data.hour intValue] andMinute:[data.minute intValue] andName:localName];
154
+ d = [[LatestData alloc] initWithParameters:([glucose.dataId intValue]) andIw:[glucose.operatingCurrent floatValue] andIb:[glucose.blankCurrent floatValue] andT:[glucose.temperature floatValue] andK0:algo_k andR:algo_r andDay:[data.day intValue] andHour:[data.hour intValue] andMinute:[data.minute intValue] andName:localName ];
141
155
  }
142
156
  d.algorithm = AlgorithmType_CT4;
157
+
158
+
159
+
160
+ NSLog( @"sensorInfosensorInf %f", d.R);
161
+
162
+ NSLog( @"sensorInfosensorInfosensorInfosensorInfo %@", d.sensorInfo);
163
+
164
+ NSLog(@"算法入参dataId=%@, operatingCurrent=%@, blankCurrent=%@, temperature=%@, algo_k=%@, algo_r=%@, day=%@, hour=%@, minute=%@, localName=%@, algorithm=%@, year=%@, milles=%@", @(d.glucoseId), @(d.Iw), @(d.Ib), @(d.T), @(d.K0), @(d.R), @(d.day), @(d.hour), @(d.minute), d.name, @(d.algorithm), @(d.year), @(d.timeMillis));
165
+
166
+
167
+
143
168
 
144
- KLTLog(@"算法入参dataId=%@, operatingCurrent=%@, blankCurrent=%@, temperature=%@, algo_k=%@, algo_r=%@, day=%@, hour=%@, minute=%@, localName=%@, newBgValue=%@, algorithm=%@", @(d.glucoseId), @(d.Iw), @(d.Ib), @(d.T), @(d.K0), @(d.R), @(d.day), @(d.hour), @(d.minute), d.name, @(d.newBgValue), @(d.algorithm));
145
169
  CurrentGlucose *currentGlucose = [AlgorithmTools algorithmLatestGlucose:d];
146
170
 
171
+
147
172
  if (currentGlucose.errorCode == ERROR_CODE_ALGORITHM_DATA) {
148
173
  [self reloadQueryHistoryData];
149
174
 
@@ -153,11 +178,35 @@
153
178
  d = [[LatestData alloc] initWithParameters:([glucose.dataId intValue]) andIw:[glucose.operatingCurrent floatValue] andIb:[glucose.blankCurrent floatValue] andT:[glucose.temperature floatValue] andK0:algo_k andR:algo_r andDay:[data.day intValue] andHour:[data.hour intValue] andMinute:[data.minute intValue] andName:localName];
154
179
  }
155
180
  d.algorithm = AlgorithmType_CT4;
181
+
156
182
 
157
- KLTLog(@"ERROR_CODE_ALGORITHM_DATA:dataId=%@, operatingCurrent=%@, blankCurrent=%@, temperature=%@, algo_k=%@, algo_r=%@, day=%@, hour=%@, minute=%@, localName=%@, newBgValue=%@, algorithm=%@", @(d.glucoseId), @(d.Iw), @(d.Ib), @(d.T), @(d.K0), @(d.R), @(d.day), @(d.hour), @(d.minute), d.name, @(d.newBgValue), @(d.algorithm));
183
+ NSLog(@"ERROR_CODE_ALGORITHM_DATA:dataId=%@, operatingCurrent=%@, blankCurrent=%@, temperature=%@, algo_k=%@, algo_r=%@, day=%@, hour=%@, minute=%@, localName=%@, newBgValue=%@, algorithm=%@", @(d.glucoseId), @(d.Iw), @(d.Ib), @(d.T), @(d.K0), @(d.R), @(d.day), @(d.hour), @(d.minute), d.name, @(d.newBgValue), @(d.algorithm));
158
184
  currentGlucose = [AlgorithmTools algorithmLatestGlucose:d];
185
+
186
+ NSString *logString = [NSString stringWithFormat:@"glucoseId=%@, Iw=%@, Ib=%@, T=%@,dayCount=%@, hour=%@, minute=%@, milles=%@, GluMG=%@,BGCount=%@, BGICount=%@, errorCode=%@ trend=%@ calibrationStatus=%@, countdownDays=%@, countdownHours=%@, countdownMinutes=%@ ",
187
+ @(d.glucoseId),
188
+ @(d.Iw),
189
+ @(d.Ib),
190
+ @(d.T),
191
+ @(d.day),
192
+ @(d.hour),
193
+ @(d.minute),
194
+ @(d.timeMillis),
195
+ @(currentGlucose.GluMG),
196
+ @(currentGlucose.BGCount),
197
+ @(currentGlucose.BGICount),
198
+ @(currentGlucose.errorCode),
199
+ @(currentGlucose.trend),
200
+ @(currentGlucose.BGMG),
201
+ @(currentGlucose.countdownDays),
202
+ @(currentGlucose.countdownHours),
203
+ @(currentGlucose.countdownHours)
204
+
205
+ ];
206
+
159
207
  }
160
208
 
209
+
161
210
  glucose.errorCode = @(currentGlucose.errorCode);
162
211
  glucose.trend = @(currentGlucose.trend);
163
212
  /* glucose.glu 保存 ADC 算法结果 单位mmol */
@@ -172,11 +221,29 @@
172
221
  data.calibration = @(currentGlucose.BGMG);
173
222
  data.error = @(currentGlucose.errorCode);
174
223
  data.trend = @(currentGlucose.trend);
175
- data.countdownDays = @(currentGlucose.countdownDays);
176
- data.countdownHours = @(currentGlucose.countdownHours);
177
- data.countdownMinutes = @(currentGlucose.countdownMinutes);
178
224
 
179
- [Notification_Center postNotificationName:@"ErrorStatusFromTransmitter" object:data];
225
+ NSString *logString = [NSString stringWithFormat:@"glucoseId=%@, Iw=%@, Ib=%@, T=%@,dayCount=%@, hour=%@, minute=%@, milles=%@, GluMG=%@,BGCount=%@, BGICount=%@, errorCode=%@ trend=%@ calibrationStatus=%@, countdownDays=%@, countdownHours=%@, countdownMinutes=%@ ",
226
+ @(d.glucoseId),
227
+ @(d.Iw),
228
+ @(d.Ib),
229
+ @(d.T),
230
+ @(d.day),
231
+ @(d.hour),
232
+ @(d.minute),
233
+ @(d.timeMillis),
234
+ @(currentGlucose.GluMG),
235
+ @(currentGlucose.BGCount),
236
+ @(currentGlucose.BGICount),
237
+ @(currentGlucose.errorCode),
238
+ @(currentGlucose.trend),
239
+ @(currentGlucose.BGMG),
240
+ @(currentGlucose.countdownDays),
241
+ @(currentGlucose.countdownHours),
242
+ @(currentGlucose.countdownHours)
243
+
244
+ ];
245
+
246
+
180
247
  [self.appDelegate saveContext];
181
248
  return glucose;
182
249
  }
@@ -267,7 +334,7 @@
267
334
  NSFetchRequest *request = [[NSFetchRequest alloc] init];
268
335
  NSPredicate *predicate;
269
336
  if (needUserBG) {
270
- predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@ && gluADC > 0 && gluADC != NIL AND isDelete == NIL",currentDevice.identifier, currentDevice.initialBeginDate];
337
+ predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@ && userBG > 0 && userBG != NIL AND isDelete == NIL",currentDevice.identifier, currentDevice.initialBeginDate];
271
338
  } else {
272
339
  predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@ AND isDelete == NIL",currentDevice.identifier, currentDevice.initialBeginDate];
273
340
  }
@@ -396,7 +463,7 @@
396
463
  ReceiveData *receiveModel = needUserBgs[i];
397
464
  bgToGlucoseIds[i] = receiveModel.glucoseId.intValue;
398
465
  bgValues[i] = roundf(receiveModel.userBG.floatValue * 18);
399
- KLTLog(@"newBgToGlucoseIds: bgToGlucoseIds=%@, userBG=%@", receiveModel.glucoseId, receiveModel.userBG);
466
+ NSLog(@"newBgToGlucoseIds: bgToGlucoseIds=%@, userBG=%@", receiveModel.glucoseId, receiveModel.userBG);
400
467
  }
401
468
  data.newBgToGlucoseIds = bgToGlucoseIds;
402
469
  data.newBgToGlucoseIdsCount = (int)numberOfUserBgs;
@@ -411,7 +478,7 @@
411
478
  data.R = algo_r;
412
479
 
413
480
  CurrentGlucose *currentGlucose = [AlgorithmTools algorithmGlucose:data];
414
- KLTLog(@"rerunADCAlgo: algorithm=%@, currentGlucose.errorCode = %@", @(data.algorithm), @(currentGlucose.errorCode));
481
+ NSLog(@"rerunADCAlgo: algorithm=%@, currentGlucose.errorCode = %@", @(data.algorithm), @(currentGlucose.errorCode));
415
482
  if (Iws != nil) {
416
483
  free(Iws);
417
484
  Iws = nil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-mytatva-rn-sdk",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "a package to inject data into visit health pwa",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",