| 1 | /*
|
|---|
| 2 | * bncrawuploadcaster.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Aug 26, 2025
|
|---|
| 5 | * Author: stuerze
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | /* -------------------------------------------------------------------------
|
|---|
| 9 | * BKG NTRIP Server
|
|---|
| 10 | * -------------------------------------------------------------------------
|
|---|
| 11 | *
|
|---|
| 12 | * Class: bncRawUploadCaster
|
|---|
| 13 | *
|
|---|
| 14 | * Purpose: Connection to NTRIP Caster for Ephemeris
|
|---|
| 15 | *
|
|---|
| 16 | * Author: L. Mervart
|
|---|
| 17 | *
|
|---|
| 18 | * Created: 03-Apr-2011
|
|---|
| 19 | *
|
|---|
| 20 | * Changes:
|
|---|
| 21 | *
|
|---|
| 22 | * -----------------------------------------------------------------------*/
|
|---|
| 23 |
|
|---|
| 24 | #include <iostream>
|
|---|
| 25 | #include <math.h>
|
|---|
| 26 | #include "bncrawuploadcaster.h"
|
|---|
| 27 | #include "bncsettings.h"
|
|---|
| 28 |
|
|---|
| 29 | using namespace std;
|
|---|
| 30 |
|
|---|
| 31 | // Constructor
|
|---|
| 32 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 33 | bncRawUploadCaster::bncRawUploadCaster() {
|
|---|
| 34 | bncSettings settings;
|
|---|
| 35 |
|
|---|
| 36 | // List of upload casters
|
|---|
| 37 | // ----------------------
|
|---|
| 38 | int iRow = -1;
|
|---|
| 39 | QListIterator<QString> it(settings.value("uploadRawMountpointsOut").toStringList());
|
|---|
| 40 | while (it.hasNext()) {
|
|---|
| 41 | QStringList hlp = it.next().split(",");
|
|---|
| 42 | if (hlp.size() > 5) {
|
|---|
| 43 | ++iRow;
|
|---|
| 44 | QString sourceMount = hlp[0];
|
|---|
| 45 | int outPort = hlp[2].toInt();
|
|---|
| 46 | bncUploadCaster* newCaster = new bncUploadCaster(hlp[3], hlp[1], outPort,
|
|---|
| 47 | hlp[4], hlp[5],
|
|---|
| 48 | hlp[6], iRow, 0);
|
|---|
| 49 |
|
|---|
| 50 | connect(newCaster, SIGNAL(newBytes(QByteArray,double)),
|
|---|
| 51 | this, SIGNAL(newBytes(QByteArray,double)));
|
|---|
| 52 |
|
|---|
| 53 | newCaster->start();
|
|---|
| 54 | _casters[sourceMount] = newCaster;
|
|---|
| 55 | }
|
|---|
| 56 | }
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | // Destructor
|
|---|
| 60 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 61 | bncRawUploadCaster::~bncRawUploadCaster() {
|
|---|
| 62 | QMapIterator<QString,bncUploadCaster*>it(_casters);
|
|---|
| 63 | while (it.hasNext()) {
|
|---|
| 64 | it.next();
|
|---|
| 65 | it.value()->deleteSafely();
|
|---|
| 66 | }
|
|---|
| 67 | _casters.clear();
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | // Output into the raw upload socket
|
|---|
| 71 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 72 | void bncRawUploadCaster::slotNewRawData(QByteArray staID, QByteArray data) {
|
|---|
| 73 |
|
|---|
| 74 | if (_casters.contains(QString(staID))) {
|
|---|
| 75 | _casters[QString(staID)]->setOutBuffer(data);
|
|---|
| 76 | }
|
|---|
| 77 | }
|
|---|