Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
TDLCloud
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WitCloud
TDLCloud
Commits
51f72f0f
Commit
51f72f0f
authored
Dec 21, 2018
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12.21-优化压力计算海拔数据
parent
26c0226c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
MapUtils.java
src/main/java/com/example/tdl/util/MapUtils.java
+7
-11
DataController.java
src/main/java/com/example/tdl/web/DataController.java
+3
-1
application.properties
src/main/resources/application.properties
+7
-7
No files found.
src/main/java/com/example/tdl/util/MapUtils.java
View file @
51f72f0f
package
com
.
example
.
tdl
.
util
;
import
java.text.DecimalFormat
;
public
class
MapUtils
{
private
static
double
EARTH_RADIUS
=
6371.393
;
...
...
@@ -60,17 +62,11 @@ public class MapUtils {
}
public
static
void
main
(
String
[]
args
)
{
double
f
=
44300
*(
1
-(
Math
.
pow
((
1016
/
1013.25
),
(
float
)
1
/
5.256
)));
double
h
=
44300
*(
1
-(
Math
.
pow
((
1012
/
1013.25
),
(
float
)
1
/
5.256
)));
double
f1
=
44300
*(
1
-(
Math
.
pow
((
795
/
1013.25
),
(
float
)
1
/
5.256
)));
double
f2
=
44300
*(
1
-(
Math
.
pow
((
616
/
1013.25
),
(
float
)
1
/
5.256
)));
double
f3
=
44300
*(
1
-(
Math
.
pow
((
1013
/
1013.25
),
(
float
)
1
/
5.256
)));
double
f4
=
44300
*(
1
-(
Math
.
pow
((
1013
/
1013.25
),
(
float
)
1
/
5.256
)));
double
f5
=
44300
*(
1
-(
Math
.
pow
((
1013
/
1013.25
),
(
float
)
1
/
5.256
)));
System
.
out
.
println
(
f
);
System
.
out
.
println
(
f1
);
System
.
out
.
println
(
h
);
DecimalFormat
df
=
new
DecimalFormat
(
"0.0000"
);
double
d
=
(
double
)
37
/
44300
;
System
.
out
.
println
(
"d:"
+
df
.
format
(
d
));
double
p
=
1013.25
*
Math
.
pow
((
1
-
Double
.
valueOf
(
df
.
format
(
d
))),
5.256
);
System
.
out
.
println
(
"pressure: "
+
p
);
}
...
...
src/main/java/com/example/tdl/web/DataController.java
View file @
51f72f0f
...
...
@@ -395,6 +395,7 @@ public class DataController {
if
(
queryResults
.
getResults
().
get
(
0
).
getSeries
()
!=
null
)
{
count
=
Double
.
valueOf
(
queryResults
.
getResults
().
get
(
0
).
getSeries
().
get
(
0
).
getValues
().
get
(
0
).
get
(
1
).
toString
()).
intValue
();
}
else
{
historyDataVo
.
setTDLSN
(
TDLSN
);
historyDataVoList
.
add
(
historyDataVo
);
continue
;
}
...
...
@@ -929,7 +930,8 @@ public class DataController {
HistoryData
altitudeData
=
new
HistoryData
();
altitudeData
.
setTime
(
time
);
//大气压力(kPa A) =101.325*(1-0.02257*海拔)^5.256
Double
height
=
44300
*(
1
-(
Math
.
pow
((
Double
.
parseDouble
(
df
.
format
(
Float
.
valueOf
(
press
)))/
1013.25
),
(
float
)
1
/
5.256
)));
// Double height = 44300*(1-(Math.pow((Double.parseDouble(df.format(Float.valueOf(press)))/1013.25), (float)1/5.256)));
Double
height
=
44300
*(
1
-(
Math
.
pow
((
Double
.
parseDouble
(
df
.
format
(
Float
.
valueOf
(
press
)-
10
f
))/
1013.25
),
(
float
)
1
/
5.256
)));
//气压临时减去10
altitudeData
.
setValue
(
df
.
format
(
height
).
toString
());
pressureDataList
.
add
(
pressureData
);
altitudeDataList
.
add
(
altitudeData
);
...
...
src/main/resources/application.properties
View file @
51f72f0f
...
...
@@ -40,14 +40,14 @@ logging.config=classpath:logback.xml
# Mqtt
#tdl.mqtt.url = ssl://192.168.1.11
#tdl.mqtt.port = 8883
#tdl.mqtt.username = ugen
#tdl.mqtt.password = ugen
tdl.mqtt.url
=
ssl://47.96.128.181
tdl.mqtt.url
=
ssl://192.168.1.11
tdl.mqtt.port
=
8883
tdl.mqtt.username
=
logistics
tdl.mqtt.password
=
logistics37774020
tdl.mqtt.username
=
ugen
tdl.mqtt.password
=
ugen
#tdl.mqtt.url = ssl://47.96.128.181
#tdl.mqtt.port = 8883
#tdl.mqtt.username = logistics
#tdl.mqtt.password = logistics37774020
tdl.mqtt.qos
=
1
tdl.mqtt.timeout
=
20
# SSL Keys
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment