Skip to content

Commit 5e34ea2

Browse files
committed
Fix timer handling for non-frontend models (NMEA, N2K, ADSB, Export)
1 parent 9bcb855 commit 5e34ea2

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Source/DSP/Model.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,8 @@ namespace AIS
760760
{
761761
setName("NMEA input");
762762
device = dev;
763-
*device >> nmea >> output;
763+
Connection<RAW> &physical = timerOn ? (*device >> timer).out : device->out;
764+
physical >> nmea >> output;
764765
nmea.outGPS >> output_gps;
765766

766767
nmea.setStation(station);
@@ -816,7 +817,8 @@ namespace AIS
816817
setName("N2K input");
817818
n2k.setOwnMMSI(own_mmsi);
818819
device = dev;
819-
*device >> n2k >> output;
820+
Connection<RAW> &physical = timerOn ? (*device >> timer).out : device->out;
821+
physical >> n2k >> output;
820822
}
821823

822824
Setting &ModelN2K::Set(std::string option, std::string arg)
@@ -836,7 +838,8 @@ namespace AIS
836838
{
837839
setName("ADSB input");
838840
device = dev;
839-
*device >> model >> outputADSB;
841+
Connection<RAW> &physical = timerOn ? (*device >> timer).out : device->out;
842+
physical >> model >> outputADSB;
840843
}
841844

842845
Setting &ModelBaseStation::Set(std::string option, std::string arg)
@@ -857,7 +860,8 @@ namespace AIS
857860
{
858861
setName("ADSB input");
859862
device = dev;
860-
*device >> model >> outputADSB;
863+
Connection<RAW> &physical = timerOn ? (*device >> timer).out : device->out;
864+
physical >> model >> outputADSB;
861865
}
862866

863867
Setting &ModelBeast::Set(std::string option, std::string arg)
@@ -878,7 +882,8 @@ namespace AIS
878882
{
879883
setName("ADSB input");
880884
device = dev;
881-
*device >> model >> outputADSB;
885+
Connection<RAW> &physical = timerOn ? (*device >> timer).out : device->out;
886+
physical >> model >> outputADSB;
882887
}
883888

884889
Setting &ModelRAW1090::Set(std::string option, std::string arg)
@@ -908,14 +913,15 @@ namespace AIS
908913
return Model::Get();
909914
}
910915

911-
void ModelExport::buildModel(char, char, int sample_rate, bool, Device::Device *dev)
916+
void ModelExport::buildModel(char, char, int sample_rate, bool timerOn, Device::Device *dev)
912917
{
913918
setName("Export output");
914919
device = dev;
915920

916921
wav.setValue("rate", std::to_string(sample_rate));
917922

918-
*device >> wav;
923+
Connection<RAW> &physical = timerOn ? (*device >> timer).out : device->out;
924+
physical >> wav;
919925
}
920926

921927
}

0 commit comments

Comments
 (0)