mirror of
https://github.com/fenix-soft/fmeteo.git
synced 2025-03-12 14:30:04 +01:00
rf5 v1.1
This commit is contained in:
parent
7bb84712a1
commit
e4f5fbbcbf
46
tools/rf5
46
tools/rf5
@ -1,35 +1,39 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# read and print video forecast 5 data
|
# read and print video forecast 5 data
|
||||||
# V.1.0
|
# V.1.1
|
||||||
|
|
||||||
|
|
||||||
forecast5() {
|
forecast5() {
|
||||||
|
echo " "
|
||||||
|
echo "┌---------------------------------------------------------------┐"
|
||||||
|
echo "┊ OFFLINE FORECAST WEATHER 5 DAY DATA ┊"
|
||||||
|
echo "└---------------------------------------------------------------┘"
|
||||||
|
|
||||||
for ((i=0; i<6; i++)); do
|
for ((i=0; i<6; i++)); do
|
||||||
|
|
||||||
# exstract forecast 5 data to jason file
|
# exstract forecast 5 data to jason file
|
||||||
|
|
||||||
city_name=`cat meteonow.txt | jq -r '.list[0]|.name'`
|
city_name=`cat meteonow.json | jq -r '.list[0]|.name'`
|
||||||
L=`cat meteonow.txt | jq -r '.list[0]|.sys[]'`
|
L=`cat meteonow.json | jq -r '.list[0]|.sys[]'`
|
||||||
Lat=`cat meteonow.txt | jq -r '.list[0]|.coord.lat'`
|
Lat=`cat meteonow.json | jq -r '.list[0]|.coord.lat'`
|
||||||
Lon=`cat meteonow.txt | jq -r '.list[0]|.coord.lon'`
|
Lon=`cat meteonow.json | jq -r '.list[0]|.coord.lon'`
|
||||||
data_X=`cat meteo5.txt | jq -r '.list['$i']|.dt'`
|
data_X=`cat meteo5.json | jq -r '.list['$i']|.dt'`
|
||||||
data_U=`date -d @$data_X`
|
data_U=`date -d @$data_X`
|
||||||
Wcond_n=`cat meteo5.txt | jq -r '.list['$i']|.weather[].main'`
|
Wcond_n=`cat meteo5.json | jq -r '.list['$i']|.weather[].main'`
|
||||||
Wcond_nd=`cat meteo5.txt | jq -r '.list['$i']|.weather[].description'`
|
Wcond_nd=`cat meteo5.json | jq -r '.list['$i']|.weather[].description'`
|
||||||
Tmax=`cat meteo5.txt | jq -r '.list['$i']|.temp.max'`
|
Tmax=`cat meteo5.json | jq -r '.list['$i']|.temp.max'`
|
||||||
Tmin=`cat meteo5.txt | jq -r '.list['$i']|.temp.min'`
|
Tmin=`cat meteo5.json | jq -r '.list['$i']|.temp.min'`
|
||||||
TM=`cat meteo5.txt | jq -r '.list['$i']|.temp.morn'`
|
TM=`cat meteo5.json | jq -r '.list['$i']|.temp.morn'`
|
||||||
TE=`cat meteo5.txt | jq -r '.list['$i']|.temp.eve'`
|
TE=`cat meteo5.json | jq -r '.list['$i']|.temp.eve'`
|
||||||
TN=`cat meteo5.txt | jq -r '.list['$i']|.temp.night'`
|
TN=`cat meteo5.json | jq -r '.list['$i']|.temp.night'`
|
||||||
TD=`cat meteo5.txt | jq -r '.list['$i']|.temp.day'`
|
TD=`cat meteo5.json | jq -r '.list['$i']|.temp.day'`
|
||||||
Hm=`cat meteo5.txt | jq -r '.list['$i']|.humidity'`
|
Hm=`cat meteo5.json | jq -r '.list['$i']|.humidity'`
|
||||||
PrS=`cat meteo5.txt | jq -r '.list['$i']|.pressure'`
|
PrS=`cat meteo5.json | jq -r '.list['$i']|.pressure'`
|
||||||
#ClD=`cat meteo5.txt | jq -r '.list['$i']|.clouds'`
|
#ClD=`cat meteo5.json | jq -r '.list['$i']|.clouds'`
|
||||||
R=`cat meteo5.txt | jq -r '.list['$i']|.rain'`
|
R=`cat meteo5.json | jq -r '.list['$i']|.rain'`
|
||||||
S=`cat meteo5.txt | jq -r '.list['$i']|.snow'`
|
S=`cat meteo5.json | jq -r '.list['$i']|.snow'`
|
||||||
Ws=`cat meteo5.txt | jq -r '.list['$i']|.speed'`
|
Ws=`cat meteo5.json | jq -r '.list['$i']|.speed'`
|
||||||
Wsd=`cat meteo5.txt | jq -r '.list['$i']|.deg'`
|
Wsd=`cat meteo5.json | jq -r '.list['$i']|.deg'`
|
||||||
|
|
||||||
# convert m/s to Km/s
|
# convert m/s to Km/s
|
||||||
WsKM=$(echo "3.6"*$Ws | bc)
|
WsKM=$(echo "3.6"*$Ws | bc)
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
# rf5:
|
# rf5:
|
||||||
|
|
||||||
**rf5**: read and print on video the forecast 5 **jason data** (meteo5.txt) generated to fmeteo.
|
**rf5**: read and print on video the forecast 5 **jason data** (meteo5.json) generated to fmeteo.
|
||||||
|
|
||||||
The script is a utility to test a future implementation on fmeteo, or read the **old** forecast 5 data, offline.
|
The script is a utility to test a future implementation on fmeteo, or read the **old** forecast 5 data, offline.
|
||||||
|
|
||||||
|
|
||||||
# use:
|
# use:
|
||||||
|
|
||||||
For use this, put or copy the script, in the same directory of fmeteo and run it.
|
For use this, put or copy the script, in the same directory of fmeteo and run it.
|
||||||
|
|
||||||
|
rf5
|
||||||
|
|
||||||
|
or if we are a terminal that does not support xserver we can use a pager to display the data page by page:
|
||||||
|
|
||||||
|
rf5 | less
|
||||||
|
|
||||||
|
use space or the arrow to go forward or back, "q" to exit
|
@ -1,3 +1,7 @@
|
|||||||
|
# V.1.1
|
||||||
|
- fix data for fmeteo V1.5 change
|
||||||
|
- add fmeteo print style
|
||||||
|
|
||||||
# V.1.0
|
# V.1.0
|
||||||
|
|
||||||
- initial relase
|
- initial relase
|
@ -1 +1 @@
|
|||||||
V.1.0
|
V.1.1
|
Loading…
x
Reference in New Issue
Block a user