/*
*
* This file is part of Maemo Mapper.
*
* Maemo Mapper is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maemo Mapper is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maemo Mapper. If not, see <http://www.gnu.org/licenses/>.
*
*
* Parts of this code have been ported from Xastir by Rob Williams (10 Aug 2008):
*
* * XASTIR, Amateur Station Tracking and Information Reporting
* Copyright (C) 1999,2000 Frank Giannandrea
* Copyright (C) 2000-2007 The Xastir Group
*
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef INCLUDE_APRS
#include "aprs_decode.h"
#include "data.h"
#include "aprs.h"
#include "types.h"
#include "math.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "hashtable.h"
#include "poi.h"
#include "display.h"
#include "aprs_message.h"
//#include "aprs_weather.h"
#include "defines.h"
#define WX_TYPE 'X'
float gust[60]; // High wind gust for each min. of last hour
int gust_write_ptr = 0;
int gust_read_ptr = 0;
int gust_last_write = 0;
float rain_base[24]; // hundredths of an inch
float rain_minute[60]; // Total rain for each min. of last hour, hundredths of an inch
int rain_check = 0; // Flag for re-checking rain_total each hour
int redraw_on_new_data; // Station redraw request
int wait_to_redraw; /* wait to redraw until system is up */
time_t posit_next_time;
/////////////
float rain_minute_total = 0.0; // Total for last hour, hundredths of an inch
int rain_minute_last_write = -1; // Write pointer for rain_minute[] array, set to an invalid number
float rain_00 = 0.0; // hundredths of an inch
float rain_24 = 0.0; // hundredths of an inch
int station_count; // number of stored stations
int station_count_save = 0; // old copy of above
AprsDataRow *n_first; // pointer to first element in name sorted station list
AprsDataRow *n_last; // pointer to last element in name sorted station list
AprsDataRow *t_oldest; // pointer to first element in time sorted station list (oldest)
AprsDataRow *t_newest; // pointer to last element in time sorted station list (newest)
time_t last_station_remove; // last time we did a check for station removing
time_t last_sec,curr_sec; // for comparing if seconds in time have changed
int next_time_sn; // time serial number for unique time index
int stations_heard = 0;
////////////
double cvt_m2len = 3.28084; // m to ft // from meter
double cvt_kn2len = 1.0; // knots to knots; // from knots
double cvt_mi2len = 0.8689607; // mph to knots / mi to nm; // from miles
double cvt_dm2len = 0.328084; // dm to ft // from decimeter
double cvt_hm2len = 0.0539957; // hm to nm; // from hectometer
int emergency_distance_check = 1;
float emergency_range = 280.0; // Default is 4hrs @ 70mph distance
int decoration_offset_x = 0;
int decoration_offset_y = 0;
int last_station_info_x = 0;
int last_station_info_y = 0;
int fcc_lookup_pushed = 0;
int rac_lookup_pushed = 0;
time_t last_object_check = 0; // Used to determine when to re-transmit objects/items
time_t last_emergency_time = 0;
char last_emergency_callsign[MAX_CALLSIGN+1];
int st_direct_timeout = 60 * 60; // 60 minutes.
// Used in search_station_name() function. Shortcuts into the
// station list based on the least-significant 7 bits of the first
// two letters of the callsign/object name.
AprsDataRow *station_shortcuts[16384];
// calculate every half hour, display in status line every 5 minutes
#define ALOHA_CALC_INTERVAL 1800
#define ALOHA_STATUS_INTERVAL 300
int process_emergency_packet_again = 0;
////////////
int altnet;
char altnet_call[MAX_CALLSIGN+1];
static struct hashtable *tactical_hash = NULL;
char echo_digis[6][MAX_CALLSIGN+1];
int tracked_stations = 0; // A count variable used in debug code only
int trail_segment_distance; // Segment missing if greater distance
int trail_segment_time; // Segment missing if above this time (mins)
int skip_dupe_checking;
void station_shortcuts_update_function(int hash_key_in, AprsDataRow *p_rem);
void delete_station_memory(AprsDataRow *p_del);
void decode_Peet_Bros(int from, unsigned char *data, AprsWeatherRow *weather, int type);
void decode_U2000_P(int from, unsigned char *data, AprsWeatherRow *weather);
void decode_U2000_L(int from, unsigned char *data, AprsWeatherRow *weather);
void init_weather(AprsWeatherRow *weather) { // clear weather data
weather->wx_sec_time = (time_t)0;
weather->wx_storm = 0;
weather->wx_time[0] = '\0';
weather->wx_course[0] = '\0';
weather->wx_speed[0] = '\0';
weather->wx_speed_sec_time = 0; // ??
weather->wx_gust[0] = '\0';
weather->wx_hurricane_radius[0] = '\0';
weather->wx_trop_storm_radius[0] = '\0';
weather->wx_whole_gale_radius[0] = '\0';
weather->wx_temp[0] = '\0';
weather->wx_rain[0] = '\0';
weather->wx_rain_total[0] = '\0';
weather->wx_snow[0] = '\0';
weather->wx_prec_24[0] = '\0';
weather->wx_prec_00[0] = '\0';
weather->wx_hum[0] = '\0';
weather->wx_baro[0] = '\0';
weather->wx_fuel_temp[0] = '\0';
weather->wx_fuel_moisture[0] = '\0';
weather->wx_type = '\0';
weather->wx_station[0] = '\0';
}
int tactical_keys_equal(void *key1, void *key2) {
if (strlen((char *)key1) == strlen((char *)key2)
&& strncmp((char *)key1,(char *)key2,strlen((char *)key1))==0) {
return(1);
}
else {
return(0);
}
}
// Multiply all the characters in the callsign, truncated to
// TACTICAL_HASH_SIZE
//
unsigned int tactical_hash_from_key(void *key) {
unsigned char *jj = key;
unsigned int tac_hash = 1;
while (*jj != '\0') {
tac_hash = tac_hash * (unsigned int)*jj++;
}
tac_hash = tac_hash % TACTICAL_HASH_SIZE;
return (tac_hash);
}
/* valid characters for APRS weather data fields */
int is_aprs_chr(char ch) {
if (g_ascii_isdigit(ch) || ch==' ' || ch=='.' || ch=='-')
return(1);
else
return(0);
}
//
// Search station record by callsign
// Returns a station with a call equal or after the searched one
//
// We use a doubly-linked list for the stations, so we can traverse
// in either direction. We also use a 14-bit hash table created
// from the first two letters of the call to dump us into the
// beginning of the correct area that may hold the callsign, which
// reduces search time quite a bit. We end up doing a linear search
// only through a small area of the linked list.
//
// DK7IN: I don't look at case, objects and internet names could
// have lower case.
//
int search_station_name(AprsDataRow **p_name, char *call, int exact) {
int kk;
int hash_key;
int result;
int ok = 1;
(*p_name) = n_first; // start of alphabet
if (call[0] == '\0') {
// If call we're searching for is empty, return n_first as
// the pointer.
return(0);
}
// We create the hash key out of the lower 7 bits of the first
// two characters, creating a 14-bit key (1 of 16384)
//
hash_key = (int)((call[0] & 0x7f) << 7);
hash_key = hash_key | (int)(call[1] & 0x7f);
没有合适的资源?快使用搜索试试~ 我知道了~
maemo-mapper-2.6.1.rar_GPS LINUX MAP_linux gps_maemo_maemo-mappe
共119个文件
h:27个
c:24个
in:13个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 175 浏览量
2022-09-14
17:43:02
上传
评论
收藏 910KB RAR 举报
温馨提示
maemo mapper文件,linux gps map code
资源推荐
资源详情
资源评论
收起资源包目录
maemo-mapper-2.6.1.rar_GPS LINUX MAP_linux gps_maemo_maemo-mappe (119个子文件)
output.0 307KB
traces.0 62KB
output.1 307KB
traces.1 49KB
configure.ac 7KB
configure.ac~ 7KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1023B
aprs_decode.c 293KB
maps.c 136KB
settings.c 130KB
poi.c 114KB
display.c 104KB
aprs_message.c 77KB
menu.c 71KB
aprs.c 64KB
path.c 61KB
aprs_kiss.c 37KB
gpx.c 34KB
aprs_display.c 32KB
main.c 29KB
util.c 28KB
gps.c 28KB
cmenu.c 26KB
input.c 24KB
gpsbt.c 23KB
gdk-pixbuf-rotate.c 18KB
data.c 14KB
hashtable.c 9KB
dbus-ifc.c 8KB
hashtable_itr.c 6KB
marshal.c 3KB
changelog 24KB
compat 2B
configure 306KB
control 3KB
copyright 1KB
depcomp 17KB
maemo-mapper.desktop 301B
config.guess 44KB
types.h 27KB
defines.h 13KB
data.h 12KB
hashtable.h 8KB
aprs.h 7KB
hashtable_itr.h 5KB
gpsbt.h 5KB
marshal.h 4KB
dbus-ifc.h 3KB
hashtable_private.h 3KB
gdk-pixbuf-rotate.h 3KB
display.h 2KB
maps.h 2KB
util.h 2KB
aprs_message.h 2KB
path.h 2KB
aprs_decode.h 2KB
poi.h 1KB
settings.h 1KB
gpx.h 1KB
menu.h 1KB
gps.h 1KB
main.h 1KB
aprs_display.h 1KB
input.h 999B
cmenu.h 993B
aprs_kiss.h 178B
maemomapper.xml.in 80KB
maemomapper.xml.in 77KB
maemomap.in 77KB
Makefile.in 60KB
Makefile.in 22KB
Makefile.in 21KB
Makefile.in 14KB
Makefile.in.in 7KB
config.h.in 2KB
POTFILES.in 236B
intltool-merge.in 0B
intltool-extract.in 0B
intltool-update.in 0B
install-sh 13KB
libtool 234KB
LICENSE 34KB
maemo-mapper.links 113B
aclocal.m4 60KB
missing 11KB
mkinstalldirs 3KB
allicons.png 8KB
allicon2.png 6KB
maemo-mapper.png 5KB
maemo-mapper-wait.png 5KB
maemo-mapper.png 3KB
maemo-mapper.png 2KB
ru_RU.po 46KB
fi_FI.po 44KB
bg_BG.po 43KB
it_IT.po 43KB
es_ES.po 43KB
共 119 条
- 1
- 2
资源评论
JaniceLu
- 粉丝: 78
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功