iOS AILinkBleSDK - 蓝牙SDK
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ELUnitConvertTool.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // ELUnitChangeTool.h
  3. // Elink
  4. //
  5. // Created by steven wu on 2019/9/21.
  6. // Copyright © 2019 iot_iMac. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "ELWeightAlgorithmusModel.h"
  10. #import "ELHeightAlgorithmusModel.h"
  11. #import "ELSDKHeader.h"
  12. #define StLbSymbol WeightUnitST_LBDelimiter
  13. #define FeetSymbol ELHeightFeetSymbol
  14. #define InchSymbol ELHeightInchSymbol
  15. #define KG_LB_CONST ELWeightKG_LB_CONST
  16. #define ST_LB_CONST ELWeightST_LB_CONST
  17. #define INCH_CM_CONST ELHeight_INCH_CM_CONST
  18. #define FEET_INCH_CONST ELHeight_FEET_INCH_CONST
  19. @interface ELUnitConvertTool : NSObject
  20. /**
  21. Convert the integer returned by Bluetooth to the character string required for interface display, the display unit is the current user unit
  22.   @param weightInt AILink protocol integer returned by Bluetooth
  23.   @param unit kg / lb / st: lb / jin
  24.   @param point 1,2
  25.   @return The weight displayed on the interface, such as 5: 6.5 st: lb
  26. 将蓝牙返回的整数,转换为界面显示所需要的字符串,显示单位为当前用户单位
  27. // weightInt AILink协议蓝牙返回的整数
  28. // unit kg/lb/st:lb/jin
  29. // point 1,2
  30. // 界面显示的体重,如 5:6.5 st:lb
  31. */
  32. + (NSString *)getWeightShowStrWithTargetUnit:(ELDeviceWeightUnit)targetUnit bleWeightInt:(NSUInteger)weightInt bleWeightUnit:(ELDeviceWeightUnit)unit bleWeightPoint:(NSUInteger)point;
  33. + (NSString *)getHeightShowStrWithTargetUnit:(ELDeviceHeightUnit)targetUnit origHeightShow:(NSString *)origHeightShow origHeightUnit:(ELDeviceHeightUnit)origHeightUnit origHeightPoint:(NSUInteger)origHeightPoint;
  34. /**
  35. Display data returned from the server or converted from the original Bluetooth data: such as 5: 6.5, 56.2, etc., converted to kg for drawing or conversion
  36.   @param weightShow The data read directly from the database, or the AILink protocol Bluetooth returns to the interface 68.56 (kg) 120.6 (lb)
  37.   @param unit kg / lb / st: lb / jin
  38.   @param point 1,2
  39.   @return is converted to the value of kg (the number of kg used for drawing or conversion, rounded to 2 decimal places)
  40. 将服务器返回或者蓝牙原始数据转换来的显示数据:如5:6.5、56.2等数据转换为kg,用来画图或者换算
  41. // weightShow 从数据库中直接读出来的,或者AILink协议蓝牙返给界面的数据 68.56(kg) 120.6(lb)
  42. // unit kg/lb/st:lb/jin
  43. // point 1,2
  44. // 转换为kg的值(用于绘图或换算的kg数,一律四舍五入保留2位小数)
  45. */
  46. + (NSString *)getKgWithWeightShowStr:(NSString *)weightShow weightUnit:(ELDeviceWeightUnit)unit weightPoint:(NSUInteger)point;
  47. + (NSString *)getCmWithHeightShowStr:(NSString *)heightShow heightUnit:(ELDeviceHeightUnit)unit heightPoint:(NSUInteger)point;
  48. @end