Radiosonde RX now understands Meteomodem's M10 correctly

Updated binary
This commit is contained in:
furrtek
2017-10-27 18:54:50 +02:00
parent 6e7b2c751f
commit d47f292d3a
11 changed files with 157 additions and 47 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ public:
float lat,
float lon,
float angle,
const std::function<void(void)> on_close
const std::function<void(void)> on_close = nullptr
);
GeoMapView(NavigationView& nav,
int32_t altitude,
+1 -1
View File
@@ -297,7 +297,7 @@ ReceiversMenuView::ReceiversMenuView(NavigationView& nav) {
{ "POCSAG", ui::Color::green(), &bitmap_icon_pocsag, [&nav](){ nav.push<POCSAGAppView>(); } },
{ "SIGFOX", ui::Color::grey(), &bitmap_icon_fox, [&nav](){ nav.push<NotImplementedView>(); } }, // SIGFRXView
{ "LoRa", ui::Color::grey(), nullptr, [&nav](){ nav.push<NotImplementedView>(); } },
{ "Radiosondes", ui::Color::red(), &bitmap_icon_sonde, [&nav](){ nav.push<SondeView>(); } },
{ "Radiosondes", ui::Color::yellow(),&bitmap_icon_sonde, [&nav](){ nav.push<SondeView>(); } },
{ "SSTV", ui::Color::grey(), &bitmap_icon_sstv, [&nav](){ nav.push<NotImplementedView>(); } },
{ "TPMS: Cars", ui::Color::green(), &bitmap_icon_tpms, [&nav](){ nav.push<TPMSAppView>(); } },
});
+39 -15
View File
@@ -42,16 +42,22 @@ SondeView::SondeView(NavigationView& nav) {
baseband::run_image(portapack::spi_flash::image_tag_sonde);
add_children({
&field_frequency,
&text_debug,
&labels,
&field_rf_amp,
&field_lna,
&field_vga,
&rssi
&rssi,
&field_frequency,
&text_debug_a,
&text_debug_b,
&text_signature,
&text_sats,
&geopos,
&button_see_map
});
field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.set_value(target_frequency_);
field_frequency.set_step(10000);
field_frequency.on_change = [this](rf::Frequency f) {
set_target_frequency(f);
field_frequency.set_value(f);
@@ -65,8 +71,10 @@ SondeView::SondeView(NavigationView& nav) {
};
};
geopos.set_read_only(true);
radio::enable({
receiver_model.tuning_frequency(),
tuning_frequency(),
sampling_rate,
baseband_bandwidth,
rf::Direction::Receive,
@@ -74,9 +82,16 @@ SondeView::SondeView(NavigationView& nav) {
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga()),
});
set_target_frequency(402000000);
button_see_map.on_select = [this, &nav](Button&) {
nav.push<GeoMapView>(
"",
altitude,
latitude,
longitude,
0);
};
/*logger = std::make_unique<SondeLogger>();
if( logger ) {
logger->append(u"sonde.txt");
@@ -92,19 +107,28 @@ void SondeView::focus() {
field_vga.focus();
}
void SondeView::on_packet(const baseband::Packet& packet) {
std::string bin_string;
void SondeView::on_packet(const sonde::Packet& packet) {
const auto hex_formatted = packet.symbols_formatted();
for (size_t i = 0; i < 30; i++) {
bin_string += to_string_dec_uint(packet[i]);
}
text_debug_a.set(hex_formatted.data.substr(0, 30));
text_debug_b.set(hex_formatted.errors.substr(0, 30));
text_debug.set(bin_string);
text_signature.set(packet.signature());
text_sats.set(to_string_dec_uint(packet.visible_sats()));
altitude = packet.GPS_altitude();
latitude = packet.GPS_latitude();
longitude = packet.GPS_longitude();
geopos.set_altitude(altitude);
geopos.set_lat(latitude);
geopos.set_lon(longitude);
/*if( logger ) {
logger->on_packet(packet);
}*/
/*if( packet.crc_ok() ) {
}*/
}
+38 -7
View File
@@ -27,6 +27,7 @@
#include "ui_receiver.hpp"
#include "ui_rssi.hpp"
#include "ui_channel.hpp"
#include "ui_geomap.hpp"
#include "event_m0.hpp"
@@ -67,7 +68,16 @@ public:
private:
//std::unique_ptr<SondeLogger> logger { };
uint32_t target_frequency_ { };
uint32_t target_frequency_ { 402000000 };
int32_t altitude { 0 };
float latitude { 0 };
float longitude { 0 };
Labels labels {
{ { 3 * 8, 5 * 16 }, "Signature:", Color::light_grey() },
{ { 0 * 8, 6 * 16 }, "Visible sats:", Color::light_grey() },
//{ { 4 * 8, 7 * 16 }, "Altitude:", Color::light_grey() },
};
FrequencyField field_frequency {
{ 0 * 8, 0 * 8 },
@@ -88,23 +98,44 @@ private:
{ 21 * 8, 0, 6 * 8, 4 },
};
Text text_debug {
{ 0, 32, 240, 16 },
Text text_debug_a {
{ 0, 2 * 16, 240, 16 },
"Waiting for frame..."
};
Text text_debug_b {
{ 0, 3 * 16, 240, 16 },
"Waiting for frame..."
};
Text text_signature {
{ 13 * 8, 5 * 16, 240, 16 },
"..."
};
Text text_sats {
{ 13 * 8, 6 * 16, 240, 16 },
"..."
};
GeoPos geopos {
{ 0, 8 * 16 }
};
Button button_see_map {
{ 8 * 8, 12 * 16, 14 * 8, 3 * 16 },
"See on map"
};
MessageHandlerRegistration message_handler_packet {
Message::ID::SondePacket,
[this](Message* const p) {
const auto message = static_cast<const SondePacketMessage*>(p);
//const sonde::Packet packet { message->type, message->packet };
//this->on_packet(packet);
this->on_packet(message->packet);
const sonde::Packet packet { message->packet, message->type };
this->on_packet(packet);
}
};
//void on_packet(const sonde::Packet& packet);
void on_packet(const baseband::Packet& packet);
void on_packet(const sonde::Packet& packet);
void set_target_frequency(const uint32_t new_value);
uint32_t tuning_frequency() const;
};