Skip to content

Commit ee840fa

Browse files
committed
add googletest, c++ wrap tiny ui test ok
1 parent 8180b79 commit ee840fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5717
-2196
lines changed

Data/conf.json

+83-29
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,94 @@
11
{
22
"typesets":[
3-
{"name":"length", "types":[
4-
{"name":"meter", "us":false, "func":""},
5-
{"name":"cmeter", "us":false},
6-
{"name":"kmeter", "us":false},
7-
{"name":"feet", "us":true},
8-
{"name":"inch", "us":true},
9-
{"name":"mile", "us":true},
10-
{"name":"yard", "us":true}
3+
{"name":"length", "base_unit":"meter","units":[
4+
{"name":"meter", "us":false, "func":"", "multiply":1.0},
5+
{"name":"cmeter", "us":false, "multiply":100},
6+
{"name":"kmeter", "us":false, "multiply":0.001},
7+
{"name":"feet", "us":true, "multiply":3.2808399},
8+
{"name":"inch", "us":true, "multiply":39.3700787},
9+
{"name":"mile", "us":true, "multiply":0.0006214},
10+
{"name":"yard", "us":true, "multiply":1.0936133}
1111
]},
12-
{"name":"mass", "types":[
13-
{"name":"gram", "us":false},
14-
{"name":"kgram", "us":false},
15-
{"name":"lb", "us":true},
16-
{"name":"oz", "us":true}
12+
{"name":"mass", "base_unit":"gram", "units":[
13+
{"name":"gram", "us":false, "multiply":1.0},
14+
{"name":"kgram", "us":false, "multiply":0.001},
15+
{"name":"lb", "us":true, "multiply":0.0022046},
16+
{"name":"oz", "us":true, "multiply":0.035274}
1717
]},
18-
{"name":"volume", "types":[
19-
{"name":"liter", "us":false, "func":""},
20-
{"name":"mliter", "us":false, "func":""},
21-
{"name":"gal", "us":true,"func":""}
18+
{"name":"volume", "base_unit":"liter", "units":[
19+
{"name":"liter", "us":false, "func":"", "multiply":1.0},
20+
{"name":"mliter", "us":false, "func":"", "multiply":1000},
21+
{"name":"gal", "us":true,"func":"", "multiply":0.2199692}
2222
]},
23-
{"name":"square", "types":[
24-
{"name":"sqmeter", "us":false, "func":""},
25-
{"name":"sqcmeter", "us":false, "func":""},
26-
{"name":"sqinch", "us":true, "func":""},
27-
{"name":"sqfeet", "us":true, "func":""}
23+
{"name":"square", "base_unit":"sqmeter", "units":[
24+
{"name":"sqmeter", "us":false, "func":"", "multiply":1.0},
25+
{"name":"sqcmeter", "us":false, "func":"", "multiply":10000},
26+
{"name":"sqinch", "us":true, "func":"", "multiply":1550.0031},
27+
{"name":"sqfeet", "us":true, "func":"", "multiply":10.7639104}
2828
]},
29-
{"name":"termperature", "types":[
30-
{"name":"celcius", "us":false,"func":""},
31-
{"name":"fahrenheit", "us":true, "func":""}
29+
{"name":"termperature", "base_unit":"celcius", "units":[
30+
{"name":"celcius", "us":false,"func":"", "multiply":1.0},
31+
{"name":"fahrenheit", "us":true, "func":"", "multiply":1.8, "offset":32}
3232
]},
33-
{"name":"exchange", "types":[
34-
{"name":"rmb", "us":false,"func":""},
35-
{"name":"dollor", "us":true,"func":""}
33+
{"name":"exchange", "base_unit":"rmb", "units":[
34+
{"name":"rmb", "us":false,"func":"", "multiply":1.0},
35+
{"name":"dollor", "us":true,"func":"", "multiply":6.5971}
3636
]}
37-
],
37+
],
38+
"font":{
39+
"exchange_info":10,
40+
"unit_name":12
41+
},
42+
"user":{
43+
"language":"ch",
44+
"start_counter":1,
45+
"exchange":{
46+
"exchange_ask":6.500,
47+
"exchange_bid":6.49,
48+
"exchange_rate":6.49,
49+
"exchange_date":"5/7/2016",
50+
"exchange_url":"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22USDCNY%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"
51+
},
52+
"select":{
53+
"length":"meter",
54+
"mass":"gram",
55+
"volume":"liter",
56+
"square":"sqmeter",
57+
"termperature":"celcius",
58+
"exchange":"rmb"
59+
}
60+
},
61+
"language":{
62+
"time_zone_bj":{"ch":"北京时间:", "us":"Beijing"},
63+
"time_zone_usw":{"ch":"美国西部时间:", "us":"west us:"},
64+
"time_zone_usm":{"ch":"美国中部时间:", "us":"middle us:"},
65+
"time_zone_use":{"ch":"美国东部时间:", "us":"east us:"},
66+
"date:":{"ch":" %m月%d日 %R", "us":" %b %d %R"},
67+
"exchange_info":{"ch":"%s的离岸汇率,汇卖价:%.04f,汇买价:%.04f",
68+
"us":"From Yahoo:%s Buying Rate:%.04f Selling Rate:%.04f"},
69+
"meter":{"ch":"", "us":"m"},
70+
"cmeter":{"ch":"厘米", "us":"cm"},
71+
"kmeter":{"ch":"公里", "us":"km"},
72+
"feet":{"ch":"英尺", "us":"ft"},
73+
"inch":{"ch":"英寸", "us":"inch"},
74+
"mile":{"ch":"英里", "us":"mile"},
75+
"yard":{"ch":"", "us":"yard"},
76+
"gram":{"ch":"", "us":"gram"},
77+
"kgram":{"ch":"千克", "us":"kg"},
78+
"lb":{"ch":"", "us":"lb"},
79+
"oz":{"ch":"盎司", "us":"oz"},
80+
"liter":{"ch":"", "us":"L"},
81+
"mliter":{"ch":"毫升", "us":"ml"},
82+
"gal":{"ch":"加仑", "us":"gal"},
83+
"sqmeter":{"ch":"平方米", "us":""},
84+
"sqcmeter":{"ch":"平方厘米", "us":"cm²"},
85+
"sqinch":{"ch":"平方英寸", "us":"inch²"},
86+
"sqfeet":{"ch":"平方英尺", "us":"ft²"},
87+
"celcius":{"ch":"摄氏度", "us":"°C"},
88+
"fahrenheit":{"ch":"华氏度", "us":"°F"},
89+
"rmb":{"ch":"", "us":"¥"},
90+
"dollor":{"ch":"美元", "us":"$"}
91+
},
3892
"start_counter":0,
3993
"long_type":1,
4094
"mass_type":11,

Data/help/cn.html

+8-14
Large diffs are not rendered by default.

Data/help/en.html

+5-10
Large diffs are not rendered by default.

Data/ui.json

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
11
{
22
"constraints":{
33
"first_line":[
4-
{"from":"line1","to":"","type_from":"height","type_to":"","multiplier":1,"offset":1},
5-
{"from":"line1","to":"self","type_from":"width","type_to":"width","multiplier":0.95,"offset":1},
6-
{"from":"line1","to":"self","type_from":"centerx","type_to":"centerx","multiplier":1,"offset":1},
7-
{"from":"line1","to":"lower_view","type_from":"top","type_to":"bottom","multiplier":1,"offset":20}
4+
{"from":"line1","to":"","type_from":"height","type_to":"","multiplier":1,"offset":0.5},
5+
{"from":"line1","to":"self","type_from":"width","type_to":"width","multiplier":0.93,"offset":0},
6+
{"from":"line1","to":"self","type_from":"centerx","type_to":"centerx","multiplier":1,"offset":0},
7+
{"from":"line1","to":"lower_view","type_from":"top","type_to":"bottom","multiplier":1,"offset":10}
88
],
99
"lines":[
1010
{"from":"line1","to":"line1","type_from":"height","type_to":"height","multiplier":1,"offset":0},
1111
{"from":"lines","to":"line1","type_from":"width","type_to":"width","multiplier":1,"offset":0},
1212
{"from":"lines","to":"self","type_from":"centerx","type_to":"centerx","multiplier":1,"offset":0},
13-
{"from":"lines","to":"lower_view","type_from":"top","type_to":"bottom","multiplier":1,"offset":20}
13+
{"from":"lines","to":"lower_view","type_from":"top","type_to":"bottom","multiplier":1,"offset":10}
1414
],
1515
"first_unit":[
1616
{"from":"first_unit","to":"","type_from":"height","type_to":"height","multiplier":1,"offset":21},
1717
{"from":"first_unit","to":"self","type_from":"top","type_to":"top","multiplier":1,"offset":20},
1818
{"from":"first_unit","to":"line1","type_from":"leading","type_to":"leading","multiplier":1,"offset":0},
19-
{"from":"first_unit","to":"self","type_from":"width","type_to":"width","multiplier":0.5,"offset":-43}
19+
{"from":"first_unit","to":"self","type_from":"width","type_to":"width","multiplier":0.5,"offset":-55}
2020
],
2121
"first_us_unit":[
2222
{"from":"first_us_unit","to":"first_unit","type_from":"width","type_to":"width","multiplier":1,"offset":0},
2323
{"from":"first_us_unit","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0},
2424
{"from":"first_us_unit","to":"first_unit","type_from":"top","type_to":"top","multiplier":1,"offset":0},
25-
{"from":"first_us_unit","to":"line1","type_from":"trailing","type_to":"trailing","multiplier":1,"offset":-41}
25+
{"from":"first_us_unit","to":"line1","type_from":"leading","type_to":"centerx","multiplier":1,"offset":0}
2626
],
2727
"line_unit_name":[
2828
{"from":"line_unit_name","to":"last_unit","type_from":"top","type_to":"top","multiplier":1,"offset":0},
2929
{"from":"line_unit_name","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0},
30-
{"from":"line_unit_name","to":"last_unit","type_from":"leading","type_to":"trailing","multiplier":1,"offset":0}
30+
{"from":"line_unit_name","to":"last_unit","type_from":"leading","type_to":"trailing","multiplier":1,"offset":0},
31+
{"from":"line_unit_name","to":"line1","type_from":"trailing","type_to":"centerx","multiplier":1,"offset":-1}
3132
],
3233
"line_us_unit_name":[
3334
{"from":"line_us_unit_name","to":"last_us_unit","type_from":"top","type_to":"top","multiplier":1,"offset":0},
35+
{"from":"line_us_unit_name","to":"line1","type_from":"trailing","type_to":"trailing","multiplier":1,"offset":-1},
3436
{"from":"line_us_unit_name","to":"last_us_unit","type_from":"leading","type_to":"trailing","multiplier":1,"offset":0},
35-
{"from":"line_us_unit_name","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0},
36-
{"from":"line_us_unit_name","to":"line1","type_from":"trailing","type_to":"trailing","multiplier":1,"offset":0}
37+
{"from":"line_us_unit_name","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0}
3738
],
3839
"line_unit":[
39-
{"from":"line2_unit","to":"last_unit","type_from":"top","type_to":"bottom","multiplier":1,"offset":20},
40+
{"from":"line2_unit","to":"last_unit","type_from":"top","type_to":"bottom","multiplier":1,"offset":10},
4041
{"from":"line2_unit","to":"first_unit","type_from":"leading","type_to":"leading","multiplier":1,"offset":0},
4142
{"from":"line2_unit","to":"first_unit","type_from":"width","type_to":"width","multiplier":1,"offset":0},
4243
{"from":"line2_unit","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0}
4344
],
4445
"line_us_unit":[
45-
{"from":"line_us_unit","to":"last_us_unit","type_from":"top","type_to":"bottom","multiplier":1,"offset":20},
46+
{"from":"line_us_unit","to":"last_us_unit","type_from":"top","type_to":"bottom","multiplier":1,"offset":10},
4647
{"from":"line_us_unit","to":"first_unit","type_from":"width","type_to":"width","multiplier":1,"offset":0},
4748
{"from":"line_us_unit","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0},
48-
{"from":"line_us_unit","to":"line1","type_from":"trailing","type_to":"trailing","multiplier":1,"offset":-41}
49+
{"from":"line_us_unit","to":"first_us_unit","type_from":"trailing","type_to":"trailing","multiplier":1,"offset":0}
4950
],
5051
"exchange_info":[
51-
{"from":"exchange_info","to":"last_unit","type_from":"top","type_to":"bottom","multiplier":1,"offset":20},
52+
{"from":"exchange_info","to":"last_unit","type_from":"top","type_to":"bottom","multiplier":1,"offset":10},
5253
{"from":"exchange_info","to":"first_unit","type_from":"height","type_to":"height","multiplier":1,"offset":0},
5354
{"from":"exchange_info","to":"first_unit","type_from":"leading","type_to":"leading","multiplier":1,"offset":0},
5455
{"from":"exchange_info","to":"line1","type_from":"width","type_to":"width","multiplier":1,"offset":0}
@@ -57,16 +58,16 @@
5758
"views":[
5859
{"id":"input_view","type":"base",
5960
"views":[
60-
{"id":"input_text","type":"input","frame":[0,0,0,30],"text_boarder":3,"placeholder":"Enter here"},
61-
{"id":"time_label","type":"label","frame":[0,0,150,12],"fontsize":12,"align":1}
61+
{"id":"input_text","type":"input","frame":[0,0,0,30],"text_boarder":3,"keyboardtype":"DecimalPad","numericText":true},
62+
{"id":"time_label","type":"label","frame":[0,0,150,12],"fontsize":11,"textalign":2}
6263
],
6364
"constraints":[
6465
{"from":"time_label","to":"self","type_from":"top","type_to":"top","multiplier":1,"offset":18},
6566
{"from":"time_label","to":"self","type_from":"centerx","type_to":"centerx","multiplier":1,"offset":0},
6667
{"from":"time_label","to":"","type_from":"width","type_to":"width","multiplier":0,"offset":150},
6768
{"from":"time_label","to":"","type_from":"height","type_to":"height","multiplier":0,"offset":12},
6869
{"from":"input_text","to":"self","type_from":"centerx","type_to":"centerx","multiplier":1,"offset":0},
69-
{"from":"input_text","to":"self","type_from":"width","type_to":"width","multiplier":0.95,"offset":0},
70+
{"from":"input_text","to":"self","type_from":"width","type_to":"width","multiplier":0.93,"offset":0},
7071
{"from":"input_text","to":"self","type_from":"bottom","type_to":"bottom","multiplier":1,"offset":-1}
7172
]},
7273
{

IOS/USNIT/AppDelegate.swift

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4545

4646
func applicationWillTerminate(application: UIApplication) {
4747
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48-
USNUsnitGen.instance()?.save()
4948
BreakpadController.sharedInstance().stop();
5049
}
5150

IOS/USNIT/Base.lproj/Main.storyboard

+3-3
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@
633633
<constraints>
634634
<constraint firstItem="3Ge-5W-mdR" firstAttribute="top" secondItem="lpC-Nb-gUV" secondAttribute="top" id="4DD-px-1Fu"/>
635635
<constraint firstAttribute="trailing" secondItem="3Ge-5W-mdR" secondAttribute="trailing" id="HHj-3s-f2d"/>
636-
<constraint firstAttribute="bottom" secondItem="3Ge-5W-mdR" secondAttribute="bottom" id="Q7U-SR-VL6"/>
637636
<constraint firstItem="3Ge-5W-mdR" firstAttribute="leading" secondItem="lpC-Nb-gUV" secondAttribute="leading" id="me3-Cb-7ZV"/>
638637
</constraints>
639638
</scrollView>
@@ -649,7 +648,9 @@
649648
<constraint firstItem="lpC-Nb-gUV" firstAttribute="centerX" secondItem="TIe-r9-M19" secondAttribute="centerX" id="yVg-Ox-Xkq"/>
650649
</constraints>
651650
</view>
652-
<tabBarItem key="tabBarItem" title="Item" id="FLZ-qW-vuy"/>
651+
<tabBarItem key="tabBarItem" title="↑↓" id="FLZ-qW-vuy">
652+
<offsetWrapper key="titlePositionAdjustment" horizontal="0.0" vertical="-10"/>
653+
</tabBarItem>
653654
<connections>
654655
<outlet property="viewInput" destination="khK-HE-Mhb" id="I2C-gp-qvd"/>
655656
<outlet property="viewSC" destination="lpC-Nb-gUV" id="mQ3-9g-JR6"/>
@@ -698,7 +699,6 @@
698699
</tabBar>
699700
<connections>
700701
<segue destination="ThI-eE-JlN" kind="relationship" relationship="viewControllers" id="F3s-be-uXO"/>
701-
<segue destination="9pv-A4-QxB" kind="relationship" relationship="viewControllers" id="u7Y-xg-7CH"/>
702702
<segue destination="2VT-ON-Jwa" kind="relationship" relationship="viewControllers" id="Q6b-JB-VGJ"/>
703703
</connections>
704704
</tabBarController>

IOS/USNIT/Info.plist

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.5</string>
20+
<string>1.1.6</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>1.1.5</string>
24+
<string>1.1.6</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>NSAppTransportSecurity</key>
2828
<dict>
2929
<key>NSAllowsArbitraryLoads</key>
3030
<true/>
3131
</dict>
32-
<key>UIFileSharingEnabled</key>
33-
<true/>
3432
<key>NSHumanReadableCopyright</key>
3533
<string>CopyRight © 2016-2017, li lin All rights reserved</string>
34+
<key>UIFileSharingEnabled</key>
35+
<true/>
3636
<key>UILaunchStoryboardName</key>
3737
<string>LaunchScreen</string>
3838
<key>UIMainStoryboardFile</key>

IOS/USNIT/NumInputDelegate.swift

-74
This file was deleted.

0 commit comments

Comments
 (0)