Procházet zdrojové kódy

update demo UI and sdk version v2.1-20201029

tags/v2.4
elinkthings před 4 roky
rodič
revize
4bb9495fef

+ 32
- 19
AIFit-Demo/Base.lproj/Main.storyboard Zobrazit soubor

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="lGz-vQ-rIV">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="lGz-vQ-rIV">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -22,7 +20,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Kt-f7-SXj">
<rect key="frame" x="10" y="25" width="355" height="35"/>
<rect key="frame" x="10" y="5" width="355" height="35"/>
<color key="backgroundColor" red="0.81568627450980391" green="1" blue="0.88235294117647056" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="35" id="rKn-Ml-Igo"/>
@@ -33,14 +31,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bzc-dA-DuA" userLabel="隔栏--------">
<rect key="frame" x="0.0" y="70" width="375" height="5"/>
<rect key="frame" x="0.0" y="50" width="375" height="5"/>
<color key="backgroundColor" red="0.66666668650000005" green="0.66666668650000005" blue="0.66666668650000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="5" id="Tgt-tF-HS7"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="User Info -&gt;" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="78Y-KE-lWH">
<rect key="frame" x="10" y="80" width="90" height="30"/>
<rect key="frame" x="10" y="60" width="90" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="3zK-me-rOk"/>
<constraint firstAttribute="height" constant="30" id="Txo-Ni-992"/>
@@ -50,7 +48,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Unit:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gVu-AQ-2bu">
<rect key="frame" x="10" y="190" width="65" height="28"/>
<rect key="frame" x="10" y="170" width="65" height="28"/>
<constraints>
<constraint firstAttribute="width" constant="65" id="B19-2X-DQV"/>
<constraint firstAttribute="height" constant="28" id="sd6-bi-owp"/>
@@ -60,7 +58,7 @@
<nil key="highlightedColor"/>
</label>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="Zf3-rF-BZy">
<rect key="frame" x="83" y="190" width="276" height="29"/>
<rect key="frame" x="83" y="168.5" width="276" height="32"/>
<segments>
<segment title="KG"/>
<segment title="LB"/>
@@ -72,14 +70,14 @@
</connections>
</segmentedControl>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MRu-AK-Tza" userLabel="隔栏--------">
<rect key="frame" x="0.0" y="228" width="375" height="6"/>
<rect key="frame" x="0.0" y="208" width="375" height="6"/>
<color key="backgroundColor" red="0.66666668650000005" green="0.66666668650000005" blue="0.66666668650000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="6" id="4EE-XR-4yP"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="waM-g5-AjV">
<rect key="frame" x="0.0" y="240" width="375" height="427"/>
<rect key="frame" x="0.0" y="220" width="375" height="447"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tips" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xbU-hm-1Sk">
<rect key="frame" x="5" y="0.0" width="365" height="30"/>
@@ -91,7 +89,7 @@
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vMl-1e-9Hx">
<rect key="frame" x="0.0" y="30" width="375" height="387"/>
<rect key="frame" x="0.0" y="30" width="375" height="407"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
</subviews>
@@ -107,7 +105,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6kj-dC-o6z">
<rect key="frame" x="127.5" y="80" width="120" height="95.5"/>
<rect key="frame" x="127.5" y="60" width="120" height="95.5"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="kds-sZ-9g0"/>
</constraints>
@@ -121,11 +119,11 @@ adc:560</string>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b8T-HZ-nQw">
<rect key="frame" x="261" y="110" width="85" height="36"/>
<rect key="frame" x="259" y="60" width="100" height="36"/>
<color key="backgroundColor" red="0.81568627450980391" green="1" blue="0.88235294117647056" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="Fh4-K7-OYJ"/>
<constraint firstAttribute="width" constant="85" id="Tyc-9q-bhQ"/>
<constraint firstAttribute="width" constant="100" id="7U3-92-1Rg"/>
<constraint firstAttribute="height" constant="36" id="XdX-rU-8wF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="Edit User"/>
@@ -133,12 +131,27 @@ adc:560</string>
<action selector="editUser:" destination="lGz-vQ-rIV" eventType="touchUpInside" id="xiI-7j-PIm"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AC6-pg-HuU">
<rect key="frame" x="259" y="119.5" width="100" height="36"/>
<color key="backgroundColor" red="0.81568627449999997" green="1" blue="0.88235294119999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="TDZ-9A-76t"/>
<constraint firstAttribute="width" constant="100" id="nw2-0K-gzB"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<state key="normal" title="Get Offline History"/>
<connections>
<action selector="getOfflineHistory:" destination="lGz-vQ-rIV" eventType="touchUpInside" id="TGf-qU-nCH"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="bzc-dA-DuA" firstAttribute="leading" secondItem="NkZ-Gv-FdY" secondAttribute="leading" id="3Lt-dy-cm0"/>
<constraint firstAttribute="trailing" secondItem="b8T-HZ-nQw" secondAttribute="trailing" constant="16" id="3Nz-EU-lFt"/>
<constraint firstAttribute="trailing" secondItem="bzc-dA-DuA" secondAttribute="trailing" id="5lo-tb-HYQ"/>
<constraint firstItem="78Y-KE-lWH" firstAttribute="top" secondItem="bzc-dA-DuA" secondAttribute="bottom" constant="5" id="B0k-kZ-Qh3"/>
<constraint firstItem="AC6-pg-HuU" firstAttribute="bottom" secondItem="6kj-dC-o6z" secondAttribute="bottom" id="EL7-Oj-rr0"/>
<constraint firstItem="gVu-AQ-2bu" firstAttribute="top" secondItem="78Y-KE-lWH" secondAttribute="bottom" constant="80" id="EQV-SW-PC5"/>
<constraint firstItem="6kj-dC-o6z" firstAttribute="top" secondItem="78Y-KE-lWH" secondAttribute="top" id="GwU-eR-QsS"/>
<constraint firstAttribute="trailing" secondItem="5Kt-f7-SXj" secondAttribute="trailing" constant="10" id="KlA-QB-HSu"/>
@@ -147,10 +160,8 @@ adc:560</string>
<constraint firstAttribute="trailing" secondItem="MRu-AK-Tza" secondAttribute="trailing" id="QeK-C3-Lrf"/>
<constraint firstItem="Zf3-rF-BZy" firstAttribute="leading" secondItem="gVu-AQ-2bu" secondAttribute="trailing" constant="8" id="RCk-og-j5B"/>
<constraint firstItem="5Kt-f7-SXj" firstAttribute="leading" secondItem="NkZ-Gv-FdY" secondAttribute="leading" constant="10" id="Rla-9j-jdj"/>
<constraint firstAttribute="trailing" secondItem="b8T-HZ-nQw" secondAttribute="trailing" constant="29" id="S1e-8O-kNf"/>
<constraint firstItem="gVu-AQ-2bu" firstAttribute="leading" secondItem="78Y-KE-lWH" secondAttribute="leading" id="TLW-5V-lLv"/>
<constraint firstAttribute="trailing" secondItem="Zf3-rF-BZy" secondAttribute="trailing" constant="16" id="UZu-dr-qec"/>
<constraint firstItem="b8T-HZ-nQw" firstAttribute="centerY" secondItem="6kj-dC-o6z" secondAttribute="centerY" id="YgB-Rw-dQ4"/>
<constraint firstItem="Zf3-rF-BZy" firstAttribute="centerY" secondItem="gVu-AQ-2bu" secondAttribute="centerY" id="Z3a-qD-19b"/>
<constraint firstItem="waM-g5-AjV" firstAttribute="top" secondItem="MRu-AK-Tza" secondAttribute="bottom" constant="6" id="cFk-yZ-hTb"/>
<constraint firstItem="MRu-AK-Tza" firstAttribute="top" secondItem="gVu-AQ-2bu" secondAttribute="bottom" constant="10" id="cQ0-3t-WFB"/>
@@ -158,6 +169,8 @@ adc:560</string>
<constraint firstItem="MN7-HW-Fpp" firstAttribute="top" secondItem="waM-g5-AjV" secondAttribute="bottom" id="fVN-gd-61G"/>
<constraint firstItem="MRu-AK-Tza" firstAttribute="leading" secondItem="NkZ-Gv-FdY" secondAttribute="leading" id="jXP-c0-g9T"/>
<constraint firstItem="waM-g5-AjV" firstAttribute="leading" secondItem="NkZ-Gv-FdY" secondAttribute="leading" id="lVq-CY-oPR"/>
<constraint firstAttribute="trailing" secondItem="AC6-pg-HuU" secondAttribute="trailing" constant="16" id="loL-Ht-lA7"/>
<constraint firstItem="b8T-HZ-nQw" firstAttribute="top" secondItem="6kj-dC-o6z" secondAttribute="top" id="pAg-79-qZn"/>
<constraint firstItem="78Y-KE-lWH" firstAttribute="leading" secondItem="5Kt-f7-SXj" secondAttribute="leading" id="rSV-bQ-38y"/>
<constraint firstItem="5Kt-f7-SXj" firstAttribute="top" secondItem="lRu-BS-3Ti" secondAttribute="bottom" constant="5" id="sU1-UF-vn7"/>
<constraint firstAttribute="trailing" secondItem="waM-g5-AjV" secondAttribute="trailing" id="xLI-R1-Qbc"/>

+ 26
- 13
AIFit-Demo/MainViewController.m Zobrazit soubor

@@ -166,7 +166,7 @@
[weakSelf syncWeighingUserToBle];
//If no need offline history function, do not call this method
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf syncOfflineUserListToBle];
});
@@ -175,6 +175,15 @@
}


- (IBAction)getOfflineHistory:(id)sender {
//request history (If no need offline history function, do not call this method)
[[WriteToBLEManager shareManager] requestOfflineHistory];
}



// click sync user button
- (void)syncWeighingUserToBle {
@@ -266,15 +275,10 @@
[self syncWeighingUserToBle];
});

//sync offline userlist(If no need offline history function, do not call this method)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self syncOfflineUserListToBle];
});
//request history (If no need offline history function, do not call this method)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[WriteToBLEManager shareManager] requestOfflineHistory];
});
// //sync offline userlist(If no need offline history function, do not call this method)
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self syncOfflineUserListToBle];
// });

break;
}
@@ -364,7 +368,7 @@
[self syncWeighingUserToBle];
// If no need offline history function, do not call this method
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self syncOfflineUserListToBle];
});
@@ -414,11 +418,20 @@
//If no need offline history function, do not implement this callback
- (void)AnalysisBLEDataManager:(AnalysisBLEDataManager *)analysisManager backOfflineHistorys:(NSMutableArray <UserInfoModel *> *)historysMutableArr {
_tipLB.text = [NSString stringWithFormat:@"Got %zd offline historys! check sdk log.",historysMutableArr.count];
// _tipLB.text = [NSString stringWithFormat:@"Got %zd offline historys! check sdk log.",historysMutableArr.count];
//
// for (UserInfoModel *info in historysMutableArr) {
// NSLog(@"---get offline history:\n %@",info);
// }
NSString *title = [NSString stringWithFormat:@"Got %zd offline historys!",historysMutableArr.count];
NSMutableString *strM = [NSMutableString string];
for (UserInfoModel *info in historysMutableArr) {
NSLog(@"---get offline history:\n %@",info);
[strM appendString:[NSString stringWithFormat:@"%@\n-----------------\n",info]];
}
[[[UIAlertView alloc] initWithTitle:title message:strM delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];

}


+ 0
- 2
InetBleSDK/Products/InetBleSDK.framework/Headers/AlgorithmSDK.h Zobrazit soubor

@@ -1,7 +1,5 @@
//
// Algorithm.h
// GreatBody
//
// Created by steven wu on 2019/6/25.
//


+ 2
- 5
InetBleSDK/Products/InetBleSDK.framework/Headers/BfsCalculateSDK.h Zobrazit soubor

@@ -1,9 +1,6 @@
//
// FRK_fatScalesSDK.h
// FRK_fatScalesSDK
//
// Created by zhang on 17/2/24.
// Copyright © 2017年 taolei. All rights reserved.
// BfsCalculateSDK
// Created by steven wu on 2019/6/25.
//

#import <Foundation/Foundation.h>

binární
InetBleSDK/Products/InetBleSDK.framework/InetBleSDK Zobrazit soubor


Načítá se…
Zrušit
Uložit