Changeset 11185 in ntrip for trunk/BNC/src
- Timestamp:
- Nov 9, 2026, 12:15:48 PM (12 hours ago)
- Location:
- trunk/BNC/src
- Files:
-
- 39 edited
-
RTCM3/RTCM3Decoder.cpp (modified) (45 diffs)
-
RTCM3/RTCM3Decoder.h (modified) (2 diffs)
-
RTCM3/RTCM3coDecoder.cpp (modified) (9 diffs)
-
RTCM3/RTCM3coDecoder.h (modified) (2 diffs)
-
bnccaster.cpp (modified) (9 diffs)
-
bnccaster.h (modified) (2 diffs)
-
bnccore.cpp (modified) (9 diffs)
-
bnccore.h (modified) (2 diffs)
-
bnccredentials.cpp (modified) (6 diffs)
-
bncephuser.cpp (modified) (1 diff)
-
bncgetthread.cpp (modified) (22 diffs)
-
bncgetthread.h (modified) (1 diff)
-
bnchelp.html (modified) (7 diffs)
-
bnclog.cpp (modified) (7 diffs)
-
bnclog.h (modified) (4 diffs)
-
bncmain.cpp (modified) (4 diffs)
-
bncnetquery.h (modified) (3 diffs)
-
bncnetqueryrtp.cpp (modified) (2 diffs)
-
bncnetquerys.cpp (modified) (2 diffs)
-
bncnetqueryudp0.cpp (modified) (1 diff)
-
bncnetqueryv0.cpp (modified) (3 diffs)
-
bncnetqueryv1.cpp (modified) (7 diffs)
-
bncnetqueryv2.cpp (modified) (5 diffs)
-
bncrawfile.cpp (modified) (1 diff)
-
bncsettings.cpp (modified) (1 diff)
-
bncwindow.cpp (modified) (8 diffs)
-
bncwindow.h (modified) (1 diff)
-
combination/bnccomb.cpp (modified) (24 diffs)
-
combination/bnccomb.h (modified) (2 diffs)
-
latencychecker.cpp (modified) (1 diff)
-
pppMain.cpp (modified) (1 diff)
-
pppRun.cpp (modified) (4 diffs)
-
pppThread.cpp (modified) (2 diffs)
-
pppThread.h (modified) (2 diffs)
-
ssrQc.cpp (modified) (4 diffs)
-
ssrQc.h (modified) (2 diffs)
-
upload/bncrtnetuploadcaster.cpp (modified) (4 diffs)
-
upload/bncuploadcaster.cpp (modified) (8 diffs)
-
upload/bncuploadcaster.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r11141 r11185 916 916 else if ((type % 10) < 4) { 917 917 #ifdef BNC_DEBUG_OBS 918 emit(new Message(QString("%1: Block %2 contain partial data! Ignored!")919 .arg(_staID).arg(type).toLatin1(), true)); 918 emit(newLogRecord(t_logRecord::debugMessage("obs", QString("%1: Block %2 contain partial data! Ignored!") 919 .arg(_staID).arg(type).toLatin1()), true)); 920 920 #endif 921 921 } … … 1077 1077 if (i < 1 || i > 63 ) { 1078 1078 #ifdef BNC_DEBUG_BCE 1079 emit(new Message(QString("%1: Block %2 (G) PRN# is out of range: %3!")1079 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (G) PRN# is out of range: %3!") 1080 1080 .arg(_staID) 1081 1081 .arg(1019,4) 1082 .arg(i).toLatin1(), true)); 1082 .arg(i).toLatin1()), true)); 1083 1083 #endif 1084 1084 return false; … … 1089 1089 if (week < 0 || week > 1023) { 1090 1090 #ifdef BNC_DEBUG_BCE 1091 emit(new Message(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")1091 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!") 1092 1092 .arg(_staID) 1093 1093 .arg(1019,4) 1094 1094 .arg(eph._prn.toString().c_str()) 1095 .arg(week).toLatin1(), true)); 1095 .arg(week).toLatin1()), true)); 1096 1096 #endif 1097 1097 return false; … … 1106 1106 if (i < 0 || i > 604784) { 1107 1107 #ifdef BNC_DEBUG_BCE 1108 emit(new Message(QString("%1: Block %2 (%3) TOC is out of range: %4!")1108 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!") 1109 1109 .arg(_staID) 1110 1110 .arg(1019,4) 1111 1111 .arg(eph._prn.toString().c_str()) 1112 .arg(i).toLatin1(), true)); 1112 .arg(i).toLatin1()), true)); 1113 1113 #endif 1114 1114 return false; … … 1128 1128 if (eph._sqrt_A < 1000.0) { 1129 1129 #ifdef BNC_DEBUG_BCE 1130 emit(new Message(QString("%1: Block %2 (%3) SQRT_A %4 m!")1130 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!") 1131 1131 .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str()) 1132 .arg(eph._sqrt_A,10,'F',3).toLatin1(), true)); 1132 .arg(eph._sqrt_A,10,'F',3).toLatin1()), true)); 1133 1133 #endif 1134 1134 return false; … … 1138 1138 if (i < 0 || i > 604784) { 1139 1139 #ifdef BNC_DEBUG_BCE 1140 emit(new Message(QString("%1: Block %2 (%3) TOE is out of range: %4!")1140 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!") 1141 1141 .arg(_staID) 1142 1142 .arg(1019,4) 1143 1143 .arg(eph._prn.toString().c_str()) 1144 .arg(i).toLatin1(), true)); 1144 .arg(i).toLatin1()), true)); 1145 1145 #endif 1146 1146 return false; … … 1197 1197 if (sv < 1 || sv > 63) { 1198 1198 #ifdef BNC_DEBUG_BCE 1199 emit(new Message(QString("%1: Block %2 (R): SLOT# is unknown (0) or out of range: %3!")1199 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (R): SLOT# is unknown (0) or out of range: %3!") 1200 1200 .arg(_staID) 1201 1201 .arg(1020,4) 1202 .arg(sv).toLatin1(), true)); 1202 .arg(sv).toLatin1()), true)); 1203 1203 #endif 1204 1204 return false; … … 1210 1210 if (i < 0 || i > 20) { 1211 1211 #ifdef BNC_DEBUG_BCE 1212 emit(new Message(QString("%1: Block %2 (%3): FRQ CHN# is out of range: %4")1212 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): FRQ CHN# is out of range: %4") 1213 1213 .arg(_staID) 1214 1214 .arg(1020,4) 1215 1215 .arg(eph._prn.toString().c_str()) 1216 .arg(i).toLatin1(), true)); 1216 .arg(i).toLatin1()), true)); 1217 1217 #endif 1218 1218 return false; … … 1226 1226 if (i < 0 || i > 23) { 1227 1227 #ifdef BNC_DEBUG_BCE 1228 emit(new Message(QString("%1: Block %2 (%3): T_k (bits 11-7) is out of range: %4")1228 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_k (bits 11-7) is out of range: %4") 1229 1229 .arg(_staID) 1230 1230 .arg(1020,4) 1231 1231 .arg(eph._prn.toString().c_str()) 1232 .arg(i).toLatin1(), true)); 1232 .arg(i).toLatin1()), true)); 1233 1233 #endif 1234 1234 return false; … … 1238 1238 if (i < 0 || i > 59) { 1239 1239 #ifdef BNC_DEBUG_BCE 1240 emit(new Message(QString("%1: Block %2 (%3): T_k (bits 6-1) is out of range: %4")1240 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_k (bits 6-1) is out of range: %4") 1241 1241 .arg(_staID) 1242 1242 .arg(1020,4) 1243 1243 .arg(eph._prn.toString().c_str()) 1244 .arg(i).toLatin1(), true)); 1244 .arg(i).toLatin1()), true)); 1245 1245 #endif 1246 1246 return false; … … 1250 1250 if (i < 0 || i > 1) { 1251 1251 #ifdef BNC_DEBUG_BCE 1252 emit(new Message(QString("%1: Block %2 (%3): T_k (bit 0) is out of range: %4")1252 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_k (bit 0) is out of range: %4") 1253 1253 .arg(_staID) 1254 1254 .arg(1020,4) 1255 1255 .arg(eph._prn.toString().c_str()) 1256 .arg(i).toLatin1(), true)); 1256 .arg(i).toLatin1()), true)); 1257 1257 #endif 1258 1258 return false; … … 1269 1269 if (i < 15 || i > 1425) { 1270 1270 #ifdef BNC_DEBUG_BCE 1271 emit(new Message(QString("%1: Block %2 (%3): T_b is out of range: %4")1271 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_b is out of range: %4") 1272 1272 .arg(_staID) 1273 1273 .arg(1020,4) 1274 1274 .arg(eph._prn.toString().c_str()) 1275 .arg(i).toLatin1(), true)); 1275 .arg(i).toLatin1()), true)); 1276 1276 #endif 1277 1277 return false; … … 1300 1300 if (eph._M_NT == 0.0) { 1301 1301 #ifdef BNC_DEBUG_BCE 1302 emit(new Message(QString("%1: Block %2 (%3): NT = %4: missing data!")1303 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).arg(eph._M_NT,4).toLatin1(), true)); 1302 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): NT = %4: missing data!") 1303 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).arg(eph._M_NT,4).toLatin1()), true)); 1304 1304 #endif 1305 1305 return false; … … 1309 1309 if (eph._additional_data_availability == 0.0) { 1310 1310 #ifdef BNC_DEBUG_BCE 1311 emit(new Message(QString("%1: Block %2 (%3): ADD = %4: missing data!")1311 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): ADD = %4: missing data!") 1312 1312 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()) 1313 .arg(eph._additional_data_availability).toLatin1(), true)); 1313 .arg(eph._additional_data_availability).toLatin1()), true)); 1314 1314 #endif 1315 1315 return false; … … 1331 1331 if (eph._xv.Rows(1,3).NormFrobenius() < 1.0) { 1332 1332 #ifdef BNC_DEBUG_BCE 1333 emit(new Message(QString("%1: Block %2 (%3): zero position!")1334 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1(), true)); 1333 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): zero position!") 1334 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1()), true)); 1335 1335 #endif 1336 1336 return false; … … 1341 1341 if (eph._xv.Rows(4,6).NormFrobenius() < 1.0) { 1342 1342 #ifdef BNC_DEBUG_BCE 1343 emit(new Message(QString("%1: Block %2 (%3): zero velocity!")1344 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1(), true)); 1343 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): zero velocity!") 1344 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1()), true)); 1345 1345 #endif 1346 1346 return false; … … 1386 1386 if (i < 1 || i > 10 ) { 1387 1387 #ifdef BNC_DEBUG_BCE 1388 emit(new Message(QString("%1: Block %2 (J) SAT ID is out of range: %3!")1388 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (J) SAT ID is out of range: %3!") 1389 1389 .arg(_staID) 1390 1390 .arg(1044,4) 1391 .arg(i).toLatin1(), true)); 1391 .arg(i).toLatin1()), true)); 1392 1392 #endif 1393 1393 return false; … … 1400 1400 if (i < 0 || i > 604784) { 1401 1401 #ifdef BNC_DEBUG_BCE 1402 emit(new Message(QString("%1: Block %2 (%3) TOC is out of range: %4!")1402 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!") 1403 1403 .arg(_staID) 1404 1404 .arg(1044,4) 1405 1405 .arg(eph._prn.toString().c_str()) 1406 .arg(i).toLatin1(), true)); 1406 .arg(i).toLatin1()), true)); 1407 1407 #endif 1408 1408 return false; … … 1423 1423 if (eph._sqrt_A < 1000.0) { 1424 1424 #ifdef BNC_DEBUG_BCE 1425 emit(new Message(QString("%1: Block %2 (%3) SQRT_A %4 m!")1425 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!") 1426 1426 .arg(_staID).arg(1044,4).arg(eph._prn.toString().c_str()) 1427 .arg(eph._sqrt_A,10,'F',3).toLatin1(), true)); 1427 .arg(eph._sqrt_A,10,'F',3).toLatin1()), true)); 1428 1428 #endif 1429 1429 return false; … … 1433 1433 if (i < 0 || i > 604784) { 1434 1434 #ifdef BNC_DEBUG_BCE 1435 emit(new Message(QString("%1: Block %2 (%3) TOE is out of range: %4!")1435 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!") 1436 1436 .arg(_staID) 1437 1437 .arg(1044,4) 1438 1438 .arg(eph._prn.toString().c_str()) 1439 .arg(i).toLatin1(), true)); 1439 .arg(i).toLatin1()), true)); 1440 1440 #endif 1441 1441 return false; … … 1457 1457 if (week < 0 || week > 1023) { 1458 1458 #ifdef BNC_DEBUG_BCE 1459 emit(new Message(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")1459 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!") 1460 1460 .arg(_staID) 1461 1461 .arg(1044,4) 1462 1462 .arg(eph._prn.toString().c_str()) 1463 .arg(week).toLatin1(), true)); 1463 .arg(week).toLatin1()), true)); 1464 1464 #endif 1465 1465 return false; … … 1507 1507 if (i < 1 || i > 63 ) { 1508 1508 #ifdef BNC_DEBUG_BCE 1509 emit(new Message(QString("%1: Block %2 (I) PRN# is out of range: %3!")1509 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (I) PRN# is out of range: %3!") 1510 1510 .arg(_staID) 1511 1511 .arg(1041,4) 1512 .arg(i).toLatin1(), true)); 1512 .arg(i).toLatin1()), true)); 1513 1513 #endif 1514 1514 return false; … … 1519 1519 if (week < 0 || week > 1023) { 1520 1520 #ifdef BNC_DEBUG_BCE 1521 emit(new Message(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")1521 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!") 1522 1522 .arg(_staID) 1523 1523 .arg(1041,4) 1524 1524 .arg(eph._prn.toString().c_str()) 1525 .arg(week).toLatin1(), true)); 1525 .arg(week).toLatin1()), true)); 1526 1526 #endif 1527 1527 return false; … … 1536 1536 if (i < 0 || i > 1048560) { 1537 1537 #ifdef BNC_DEBUG_BCE 1538 emit(new Message(QString("%1: Block %2 (%3) TOC is out of range: %4!")1538 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!") 1539 1539 .arg(_staID) 1540 1540 .arg(1041,4) 1541 1541 .arg(eph._prn.toString().c_str()) 1542 .arg(i).toLatin1(), true)); 1542 .arg(i).toLatin1()), true)); 1543 1543 #endif 1544 1544 return false; … … 1577 1577 if (i < 0 || i > 1048560) { 1578 1578 #ifdef BNC_DEBUG_BCE 1579 emit(new Message(QString("%1: Block %2 (%3) TOE is out of range: %4!")1579 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!") 1580 1580 .arg(_staID) 1581 1581 .arg(1041,4) 1582 1582 .arg(eph._prn.toString().c_str()) 1583 .arg(i).toLatin1(), true)); 1583 .arg(i).toLatin1()), true)); 1584 1584 #endif 1585 1585 return false; … … 1598 1598 if (eph._sqrt_A < 1000.0) { 1599 1599 #ifdef BNC_DEBUG_BCE 1600 emit(new Message(QString("%1: Block %2 (%3) SQRT_A %4 m!")1600 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!") 1601 1601 .arg(_staID).arg(1041,4).arg(eph._prn.toString().c_str()) 1602 .arg(eph._sqrt_A,10,'F',3).toLatin1(), true)); 1602 .arg(eph._sqrt_A,10,'F',3).toLatin1()), true)); 1603 1603 #endif 1604 1604 return false; … … 1642 1642 if (i < 0 || i > 38 ) { 1643 1643 #ifdef BNC_DEBUG_BCE 1644 emit(new Message(QString("%1: Block %2 (S) PRN# is out of range: %3!")1644 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (S) PRN# is out of range: %3!") 1645 1645 .arg(_staID) 1646 1646 .arg(1043,4) 1647 .arg(i).toLatin1(), true)); 1647 .arg(i).toLatin1()), true)); 1648 1648 #endif 1649 1649 return false; … … 1656 1656 if (i < 0 || i > 86384) { 1657 1657 #ifdef BNC_DEBUG_BCE 1658 emit(new Message(QString("%1: Block %2 (%3) TOC is out of range: %4!")1658 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!") 1659 1659 .arg(_staID) 1660 1660 .arg(1043,4) 1661 1661 .arg(eph._prn.toString().c_str()) 1662 .arg(i).toLatin1(), true)); 1662 .arg(i).toLatin1()), true)); 1663 1663 #endif 1664 1664 return false; … … 1685 1685 if (pos.NormFrobenius() < 1.0) { 1686 1686 #ifdef BNC_DEBUG_BCE 1687 emit(new Message(QString("%1: Block %2 (%3): zero position!")1688 .arg(_staID).arg(1043,4).arg(eph._prn.toString().c_str()).toLatin1(), true)); 1687 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): zero position!") 1688 .arg(_staID).arg(1043,4).arg(eph._prn.toString().c_str()).toLatin1()), true)); 1689 1689 #endif 1690 1690 return false; … … 1720 1720 size -= 6; /* header + crc */ 1721 1721 GETBITS(i, 12) 1722 #ifdef BNC_DEBUG_BCE 1723 const int mnum = i; // message number for the debug messages 1724 #endif 1722 1725 1723 1726 if ((i == 1046 && size == 61) || … … 1732 1735 if (i < 1 || i > 36 ) { // max. constellation within I/NAV / F/NAV frames is 36 1733 1736 #ifdef BNC_DEBUG_BCE 1734 emit(new Message(QString("%1: Block %2 (E) PRN# is out of range: %3!")1737 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (E) PRN# is out of range: %3!") 1735 1738 .arg(_staID) 1736 1739 .arg(mnum,4) 1737 .arg(i).toLatin1(), true)); 1740 .arg(i).toLatin1()), true)); 1738 1741 #endif 1739 1742 return false; … … 1745 1748 if (week < 0 || week > 4095) { 1746 1749 #ifdef BNC_DEBUG_BCE 1747 emit(new Message(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")1750 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!") 1748 1751 .arg(_staID) 1749 1752 .arg(mnum,4) 1750 1753 .arg(eph._prn.toString().c_str()) 1751 .arg(week).toLatin1(), true)); 1754 .arg(week).toLatin1()), true)); 1752 1755 #endif 1753 1756 return false; … … 1767 1770 if (i < 0 || i > 604740) { 1768 1771 #ifdef BNC_DEBUG_BCE 1769 emit(new Message(QString("%1: Block %2 (%3) TOC is out of range: %4!")1772 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!") 1770 1773 .arg(_staID) 1771 1774 .arg(mnum,4) 1772 1775 .arg(eph._prn.toString().c_str()) 1773 .arg(i).toLatin1(), true)); 1776 .arg(i).toLatin1()), true)); 1774 1777 #endif 1775 1778 return false; … … 1789 1792 if (i < 0 || i > 604740) { 1790 1793 #ifdef BNC_DEBUG_BCE 1791 emit(new Message(QString("%1: Block %2 (%3) TOE is out of range: %4!")1794 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!") 1792 1795 .arg(_staID) 1793 1796 .arg(mnum,4) 1794 1797 .arg(eph._prn.toString().c_str()) 1795 .arg(i).toLatin1(), true)); 1798 .arg(i).toLatin1()), true)); 1796 1799 #endif 1797 1800 return false; … … 1820 1823 if (eph._E5b_HS != eph._E1B_HS) { 1821 1824 #ifdef BNC_DEBUG_BCE 1822 emit(new Message(QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!")1825 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!") 1823 1826 .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str()) 1824 .arg(eph._E5b_HS).arg(eph._E1B_HS).toLatin1(), true)); 1827 .arg(eph._E5b_HS).arg(eph._E1B_HS).toLatin1()), true)); 1825 1828 #endif 1826 1829 return false; … … 1829 1832 (eph._BGD_1_5B == 0.0 && fabs(eph._BGD_1_5A) > 1e-9)) { 1830 1833 #ifdef BNC_DEBUG_BCE 1831 emit(new Message(QString("%1: Block %2 (%3) BGD_1_5a = %4 BGD_1_5b = %5: inconsistent BGD!")1834 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) BGD_1_5a = %4 BGD_1_5b = %5: inconsistent BGD!") 1832 1835 .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str()) 1833 .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toLatin1(), true)); 1836 .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toLatin1()), true)); 1834 1837 #endif 1835 1838 return false; … … 1852 1855 if (eph._sqrt_A < 1000.0) { 1853 1856 #ifdef BNC_DEBUG_BCE 1854 emit(new Message(QString("%1: Block %2 (%3) SQRT_A %4 m!")1857 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!") 1855 1858 .arg(_staID).arg(eph._inav? 1046 : 1045,4).arg(eph._prn.toString().c_str()) 1856 .arg(eph._sqrt_A,10,'F',3).toLatin1(), true)); 1859 .arg(eph._sqrt_A,10,'F',3).toLatin1()), true)); 1857 1860 #endif 1858 1861 return false; … … 1886 1889 if (i < 1 || i > 63 ) { 1887 1890 #ifdef BNC_DEBUG_BCE 1888 emit(new Message(QString("%1: Block %2 (C) PRN# is out of range: %3!")1891 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (C) PRN# is out of range: %3!") 1889 1892 .arg(_staID) 1890 1893 .arg(1042,4) 1891 .arg(i).toLatin1(), true)); 1894 .arg(i).toLatin1()), true)); 1892 1895 #endif 1893 1896 return false; … … 1899 1902 if (week < 0 || week > 8191) { 1900 1903 #ifdef BNC_DEBUG_BCE 1901 emit(new Message(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")1904 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!") 1902 1905 .arg(_staID) 1903 1906 .arg(1042,4) 1904 1907 .arg(eph._prn.toString().c_str()) 1905 .arg(week).toLatin1(), true)); 1908 .arg(week).toLatin1()), true)); 1906 1909 #endif 1907 1910 return false; … … 1922 1925 if (i < 0 || i > 604792) { 1923 1926 #ifdef BNC_DEBUG_BCE 1924 emit(new Message(QString("%1: Block %2 (%3) TOC is out of range: %4!")1927 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!") 1925 1928 .arg(_staID) 1926 1929 .arg(1042,4) 1927 1930 .arg(eph._prn.toString().c_str()) 1928 .arg(i).toLatin1(), true)); 1931 .arg(i).toLatin1()), true)); 1929 1932 #endif 1930 1933 return false; … … 1944 1947 if (eph._sqrt_A < 1000.0) { 1945 1948 #ifdef BNC_DEBUG_BCE 1946 emit(new Message(QString("%1: Block %2 (%3) SQRT_A %4 m!")1949 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!") 1947 1950 .arg(_staID).arg(1042,4).arg(eph._prn.toString().c_str()) 1948 .arg(eph._sqrt_A,10,'F',3).toLatin1(), true)); 1951 .arg(eph._sqrt_A,10,'F',3).toLatin1()), true)); 1949 1952 #endif 1950 1953 return false; … … 1954 1957 if (i < 0 || i > 604792) { 1955 1958 #ifdef BNC_DEBUG_BCE 1956 emit(new Message(QString("%1: Block %2 (%3) TOE is out of range: %4!")1959 emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!") 1957 1960 .arg(_staID) 1958 1961 .arg(1042,4) 1959 1962 .arg(eph._prn.toString().c_str()) 1960 .arg(i).toLatin1(), true)); 1963 .arg(i).toLatin1()), true)); 1961 1964 #endif 1962 1965 return false; … … 2329 2332 case 1003: 2330 2333 #ifdef BNC_DEBUG_OBS 2331 emit(new Message(QString("%1: Block %2 contain partial data! Ignored!")2332 .arg(_staID).arg(id).toLatin1(), true)); 2334 emit(newLogRecord(t_logRecord::debugMessage("obs", QString("%1: Block %2 contain partial data! Ignored!") 2335 .arg(_staID).arg(id).toLatin1()), true)); 2333 2336 #endif 2334 2337 break; /* no use decoding partial data ATM, remove break when data can be used */ … … 2341 2344 case 1011: 2342 2345 #ifdef BNC_DEBUG_OBS 2343 emit(new Message(QString("%1: Block %2 contain partial data! Ignored!")2344 .arg(_staID).arg(id).toLatin1(), true)); 2346 emit(newLogRecord(t_logRecord::debugMessage("obs", QString("%1: Block %2 contain partial data! Ignored!") 2347 .arg(_staID).arg(id).toLatin1()), true)); 2345 2348 #endif 2346 2349 break; /* no use decoding partial data ATM, remove break when data can be used */ … … 2491 2494 if (!_prnOutOfRangeLogged.contains(prnStr)) { 2492 2495 _prnOutOfRangeLogged.insert(prnStr); 2493 emit new Message(QString("%1: satellite %2 outside the range supported by BNC - not usable for processing")2494 .arg(_staID).arg(prnStr).toLatin1(), true); 2496 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: satellite %2 outside the range supported by BNC - not usable for processing") 2497 .arg(_staID).arg(prnStr).toLatin1()), true); 2495 2498 } 2496 2499 } -
trunk/BNC/src/RTCM3/RTCM3Decoder.h
r11057 r11185 35 35 #include "bncrawfile.h" 36 36 #include "ephemeris.h" 37 #include "bnclog.h" 37 38 38 39 class RTCM3Decoder : public QObject, public GPSDecoder { … … 54 55 signals: 55 56 void newMessage(QByteArray msg,bool showOnScreen); 57 void newLogRecord(t_logRecord rec, bool showOnScreen); 56 58 void newGPSEph(t_ephGPS eph); 57 59 void newGlonassEph(t_ephGlo eph); -
trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp
r11115 r11185 96 96 BNC_CORE, SIGNAL(providerIDChanged(QString)), conType); 97 97 98 connect(this, SIGNAL(newMessage(QByteArray,bool)),99 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));98 BNC_CORE->connectMessages(this, "ssr"); 99 BNC_CORE->connectLogRecords(this, "ssr"); 100 100 101 101 reset(); … … 300 300 } 301 301 else { 302 emit new Message("RTCM3coDecoder: _lastTime invalid: " + _staID.toLatin1(), true);302 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "RTCM3coDecoder: _lastTime invalid: " + _staID.toLatin1()), true); 303 303 retCode = failure; 304 304 } … … 962 962 963 963 if (alreadySet && different) { 964 emit new Message("RTCM3coDecoder: SSR Provider or Service changed " + newProviderIDStr.toLatin1() + _staID.toLatin1(), true);964 emit newLogRecord(t_logRecord::message(t_logRecord::info, "RTCM3coDecoder: SSR Provider or Service changed " + newProviderIDStr.toLatin1() + _staID.toLatin1()), true); 965 965 emit providerIDChanged(_staID); 966 966 } … … 1104 1104 1105 1105 if (corrIsOutOfRange) { 1106 emit new Message("RTCM3coDecoder: Correction " + ssrParStr.toLatin1()1106 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "RTCM3coDecoder: Correction " + ssrParStr.toLatin1() 1107 1107 + " (" + ssrParValue.toLatin1() + ") " 1108 + "is out of range " + _staID.toLatin1(), true); 1108 + "is out of range " + _staID.toLatin1()), true); 1109 1109 } 1110 1110 … … 1241 1241 warned = currentTime; 1242 1242 if (secOfWeek) { 1243 emit new Message(_staID.toLatin1() + ": IGS-SSR GLONASS epoch time erroneously encoded "1243 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID.toLatin1() + ": IGS-SSR GLONASS epoch time erroneously encoded " 1244 1244 "(UTC seconds of week instead of GPS seconds of week, IGS SSR v1.00 IDF003) " 1245 "detected and converted - the SSR encoder should be corrected", true); 1245 "detected and converted - the SSR encoder should be corrected"), true); 1246 1246 } 1247 1247 else { 1248 emit new Message(_staID.toLatin1() + ": IGS-SSR GLONASS epoch time in outdated convention "1248 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID.toLatin1() + ": IGS-SSR GLONASS epoch time in outdated convention " 1249 1249 "(UTC seconds of day instead of GPS seconds of week, IGS SSR v1.00 IDF003) " 1250 "detected and converted - the SSR encoder should be updated", true); 1250 "detected and converted - the SSR encoder should be updated"), true); 1251 1251 } 1252 1252 } … … 1281 1281 if (!warned.valid() || currentTime - warned >= 3600.0) { 1282 1282 warned = currentTime; 1283 emit new Message(_staID.toLatin1() + ": IGS-SSR BDS epoch time in outdated convention "1283 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID.toLatin1() + ": IGS-SSR BDS epoch time in outdated convention " 1284 1284 "(BDT instead of GPS seconds of week, IGS SSR v1.00 IDF003) " 1285 "detected and converted - the SSR encoder should be updated", true); 1285 "detected and converted - the SSR encoder should be updated"), true); 1286 1286 } 1287 1287 } … … 1344 1344 if (!warned.valid() || currentTime - warned >= 3600.0) { 1345 1345 warned = currentTime; 1346 emit new Message(QString("%1: %2 SSR epoch time %3 %4 differs by %5 s from the GPS SSR epoch time "1346 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: %2 SSR epoch time %3 %4 differs by %5 s from the GPS SSR epoch time " 1347 1347 "of the stream - erroneously encoded?") 1348 1348 .arg(_staID).arg(epoSys) 1349 1349 .arg(QString::fromStdString(_lastTime.datestr())) 1350 1350 .arg(QString::fromStdString(_lastTime.timestr(0))) 1351 .arg(_lastTime - _lastGpsEpoch, 0, 'f', 0).toLatin1(), true); 1351 .arg(_lastTime - _lastGpsEpoch, 0, 'f', 0).toLatin1()), true); 1352 1352 } 1353 1353 } … … 1380 1380 if (!_prnOutOfRangeLogged.contains(prnStr)) { 1381 1381 _prnOutOfRangeLogged.insert(prnStr); 1382 emit new Message(QString("%1: satellite %2 outside the range supported by BNC - not usable for processing")1383 .arg(_staID).arg(prnStr).toLatin1(), true); 1382 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: satellite %2 outside the range supported by BNC - not usable for processing") 1383 .arg(_staID).arg(prnStr).toLatin1()), true); 1384 1384 } 1385 1385 } … … 1421 1421 if (!_antennaIODLogged.contains(key)) { 1422 1422 _antennaIODLogged.insert(key); 1423 emit new Message(QString("%1: GNSS %2 Satellite Antenna IOD switches back %3 -> %4"1423 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: GNSS %2 Satellite Antenna IOD switches back %3 -> %4" 1424 1424 " - messages of one GNSS must use the same IOD") 1425 .arg(_staID).arg(sys).arg(_antennaIODCur[s]).arg(iod).toLatin1(), true); 1425 .arg(_staID).arg(sys).arg(_antennaIODCur[s]).arg(iod).toLatin1()), true); 1426 1426 } 1427 1427 } -
trunk/BNC/src/RTCM3/RTCM3coDecoder.h
r11074 r11185 31 31 #include <QMap> 32 32 #include <QSet> 33 #include "bnclog.h" 33 34 #include "GPSDecoder.h" 34 35 #include "../RTCM3/clock_and_orbit/clock_orbit_igs.h" … … 68 69 void newSatAntennas(QList<t_satAntenna>); 69 70 void newMessage(QByteArray msg, bool showOnScreen); 71 void newLogRecord(t_logRecord rec, bool showOnScreen); 70 72 void providerIDChanged(QString staID); 71 73 -
trunk/BNC/src/bnccaster.cpp
r11021 r11185 64 64 bncSettings settings; 65 65 66 connect(this, SIGNAL(newMessage(QByteArray,bool)),67 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));66 BNC_CORE->connectMessages(this, "bnc"); 67 BNC_CORE->connectLogRecords(this, "bnc"); 68 68 69 69 _outFile = 0; … … 81 81 + QByteArray::number(port) + ": " 82 82 + _server->errorString(); 83 emit new Message(message.toLatin1(), true);83 emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true); 84 84 } 85 85 connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection())); … … 99 99 + QByteArray::number(uPort) + ": " 100 100 + _uServer->errorString(); 101 emit new Message(message.toLatin1(), true);101 emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true); 102 102 } 103 103 connect(_uServer, SIGNAL(newConnection()), this, SLOT(slotNewUConnection())); … … 128 128 + QByteArray::number(_miscPort) + ": " 129 129 + _miscServer->errorString(); 130 emit new Message(message.toLatin1(), true);130 emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true); 131 131 } 132 132 connect(_miscServer, SIGNAL(newConnection()), this, SLOT(slotNewMiscConnection())); … … 235 235 if ( !settings.value("outFile").toString().isEmpty() || 236 236 !settings.value("outPort").toString().isEmpty() ) { 237 emit ( newMessage(QString("%1: Old or erroneous observation epoch %2 thrown away from %3")237 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: Old or erroneous observation epoch %2 thrown away from %3") 238 238 .arg(staID.data()) 239 239 .arg(string(obs._time).c_str()) 240 240 .arg(obs._prn.toString().c_str()) 241 .toLatin1() , true));241 .toLatin1()), true); 242 242 } 243 243 } … … 262 262 void bncCaster::slotNewConnection() { 263 263 _sockets->push_back( _server->nextPendingConnection() ); 264 emit ( newMessage(QString("New client connection on sync port: # %1")265 .arg(_sockets->size()).toLatin1() , true));264 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on sync port: # %1") 265 .arg(_sockets->size()).toLatin1()), true); 266 266 } 267 267 268 268 void bncCaster::slotNewUConnection() { 269 269 _uSockets->push_back( _uServer->nextPendingConnection() ); 270 emit ( newMessage(QString("New client connection on usync port: # %1")271 .arg(_uSockets->size()).toLatin1() , true));270 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on usync port: # %1") 271 .arg(_uSockets->size()).toLatin1()), true); 272 272 } 273 273 … … 318 318 } 319 319 _staIDs.removeAll(staID); 320 emit( newMessage( 321 QString("Decoding %1 stream(s)").arg(_staIDs.size()).toLatin1(), true) ); 320 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("Decoding %1 stream(s)").arg(_staIDs.size()).toLatin1()), true); 322 321 if (_staIDs.size() == 0) { 323 322 emit getThreadsFinished(); … … 482 481 483 482 emit mountPointsRead(_threads); 484 emit (newMessage(QString("Configuration read: " + BNC_CORE->confFileName() + ", %1 stream(s)").arg(_threads.count()).toLatin1(), true));483 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("Configuration read: " + BNC_CORE->confFileName() + ", %1 stream(s)").arg(_threads.count()).toLatin1()), true); 485 484 486 485 // (Re-) Start the configuration timer … … 586 585 void bncCaster::slotNewMiscConnection() { 587 586 _miscSockets->push_back( _miscServer->nextPendingConnection() ); 588 emit ( newMessage(QString("New client connection on Miscellaneous Output Port: # %1")589 .arg(_miscSockets->size()).toLatin1() , true));587 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on Miscellaneous Output Port: # %1") 588 .arg(_miscSockets->size()).toLatin1()), true); 590 589 } 591 590 -
trunk/BNC/src/bnccaster.h
r11021 r11185 32 32 #include <QNetworkProxy> 33 33 34 #include "bnclog.h" 34 35 #include "satObs.h" 35 36 #include "upload/bncrawuploadcaster.h" … … 56 57 void getThreadsFinished(); 57 58 void newMessage(QByteArray msg, bool showOnScreen); 59 void newLogRecord(t_logRecord rec, bool showOnScreen); 58 60 void newObs(QByteArray staID, QList<t_satObs> obsList); 59 61 -
trunk/BNC/src/bnccore.cpp
r11179 r11185 73 73 _logFileStructured = 0; 74 74 _logFormatStructured = t_logRecord::json; 75 _logLevelStructured = t_logRecord::debug; 75 76 _rawFile = 0; 76 77 _caster = 0; … … 149 150 } 150 151 slotLogRecord(t_logRecord::fromMessage(msg), showOnScreen); 152 } 153 154 // Write a Program Message of a component with an explicit level 155 //////////////////////////////////////////////////////////////////////////// 156 void t_bncCore::message(const QByteArray& msg, bool showOnScreen, const QByteArray& component, 157 t_logRecord::e_level level) { 158 if (msg.isEmpty()) { 159 return; 160 } 161 slotLogRecord(t_logRecord::message(level, msg, component), showOnScreen); 162 } 163 164 // Write a Program Message of a component 165 //////////////////////////////////////////////////////////////////////////// 166 void t_bncCore::message(const QByteArray& msg, bool showOnScreen, const QByteArray& component) { 167 if (msg.isEmpty()) { 168 return; 169 } 170 slotLogRecord(t_logRecord::fromMessage(msg, component), showOnScreen); 151 171 } 152 172 … … 199 219 _logFormatStructured = t_logRecord::formatFromString( 200 220 settings.value("logFormatStructured").toString()); 221 _logLevelStructured = t_logRecord::levelFromString( 222 settings.value("logLevelStructured").toString()); 201 223 _logFileStructured = new QFile(structName + "_" + currDate.toString("yyMMdd")); 202 224 if (!_logFileStructured->open(append ? (QIODevice::WriteOnly | QIODevice::Append) … … 219 241 } 220 242 221 if (_logFileStructured) { 243 if (_logFileStructured && rec._level >= _logLevelStructured) { 222 244 _logFileStructured->write(rec.encode(_logFormatStructured, currDateTime) + "\n"); 223 245 _logFileStructured->flush(); … … 232 254 #ifdef BNC_DEBUG_BCE 233 255 if (eph->checkState() == t_eph::unhealthy) { 234 messagePrivate(t_logRecord:: fromMessage(QString("%1: UNHEALTHY %2:%3")256 messagePrivate(t_logRecord::debugMessage("bce", QString("%1: UNHEALTHY %2:%3") 235 257 .arg(eph->receptStaID()) 236 258 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) … … 238 260 } 239 261 if (eph->checkState() == t_eph::bad) { 240 messagePrivate(t_logRecord:: fromMessage(QString("%1: WRONG %2:%3")262 messagePrivate(t_logRecord::debugMessage("bce", QString("%1: WRONG %2:%3") 241 263 .arg(eph->receptStaID()) 242 264 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) … … 244 266 } 245 267 if (eph->checkState() == t_eph::outdated) { 246 messagePrivate(t_logRecord:: fromMessage(QString("%1: OUTDATED %2:%3")268 messagePrivate(t_logRecord::debugMessage("bce", QString("%1: OUTDATED %2:%3") 247 269 .arg(eph->receptStaID()) 248 270 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) … … 633 655 + QByteArray::number(_portEph) + ": " 634 656 + _serverEph->errorString(); 635 slot Message(message.toLatin1(), true);657 slotLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1(), "bnc"), true); 636 658 } 637 659 connect(_serverEph, SIGNAL(newConnection()), this, SLOT(slotNewConnectionEph())); … … 653 675 + QByteArray::number(_portCorr) + ": " 654 676 + _serverCorr->errorString(); 655 slot Message(message.toLatin1(), true);677 slotLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1(), "bnc"), true); 656 678 } 657 679 connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr())); -
trunk/BNC/src/bnccore.h
r11179 r11185 86 86 int sigintReceived; 87 87 88 // Plain text message of a component (structured logfile, see bnclog.h), 89 // level from keywords of the text or explicit 90 void message(const QByteArray& msg, bool showOnScreen, const QByteArray& component); 91 void message(const QByteArray& msg, bool showOnScreen, const QByteArray& component, 92 t_logRecord::e_level level); 93 94 // Messages of an object with a signal newMessage(QByteArray,bool) as records 95 // of the given component; same connection type as a connection to slotMessage 96 template<class T> void connectMessages(T* sender, const char* component) { 97 QByteArray comp(component); 98 connect(sender, &T::newMessage, this, [this, comp](QByteArray msg, bool showOnScreen) { 99 message(msg, showOnScreen, comp); 100 }); 101 } 102 103 // Records of an object with a signal newLogRecord(t_logRecord,bool); an empty 104 // component is set to the given one 105 template<class T> void connectLogRecords(T* sender, const char* component) { 106 QByteArray comp(component); 107 connect(sender, &T::newLogRecord, this, [this, comp](t_logRecord rec, bool showOnScreen) { 108 if (rec._component.isEmpty()) { 109 rec._component = comp; 110 } 111 slotLogRecord(rec, showOnScreen); 112 }); 113 } 114 88 115 QMap<int, bncTableItem*> _uploadTableItems; 89 116 QMap<int, bncTableItem*> _uploadEphTableItems; … … 163 190 QFile* _logFileStructured; 164 191 t_logRecord::e_format _logFormatStructured; 192 t_logRecord::e_level _logLevelStructured; 165 193 QMutex _mutex; 166 194 QMutex _mutexMessage; -
trunk/BNC/src/bnccredentials.cpp
r11160 r11185 51 51 52 52 // Log a message once per key 53 void message(const QString& key, const QString& msg) { 53 void message(const QString& key, const QString& msg, t_logRecord::e_level level) { 54 54 if (!_reported.contains(key)) { 55 55 _reported.insert(key); 56 BNC_CORE-> slotMessage(msg.toLatin1(), true);56 BNC_CORE->message(msg.toLatin1(), true, "ntrip", level); 57 57 } 58 58 } … … 180 180 message(fileName + QString(":%1").arg(lineNumbers[iLine]), 181 181 QString("Credentials file %1, line %2: not <host> [<port>] <user> <password>, ignored") 182 .arg(fileName).arg(lineNumbers[iLine])); 182 .arg(fileName).arg(lineNumbers[iLine]), t_logRecord::warning); 183 183 } 184 184 } … … 205 205 file.refused = true; 206 206 message("perm:" + fileName, 207 QString("Credentials file %1 is readable for other users, not used (chmod 600)").arg(fileName)); 207 QString("Credentials file %1 is readable for other users, not used (chmod 600)").arg(fileName), 208 t_logRecord::warning); 208 209 return file; 209 210 } … … 212 213 QFile inp(fileName); 213 214 if (!inp.open(QIODevice::ReadOnly | QIODevice::Text)) { 214 message("open:" + fileName, QString("Cannot read credentials file %1").arg(fileName)); 215 message("open:" + fileName, QString("Cannot read credentials file %1").arg(fileName), 216 t_logRecord::error); 215 217 return file; 216 218 } … … 332 334 message("config:" + account, 333 335 QString("%1: password in the configuration file, it can be moved to a credentials file " 334 "(option 'credentialsFile', default ~/.netrc)").arg(account)); 336 "(option 'credentialsFile', default ~/.netrc)").arg(account), 337 t_logRecord::info); 335 338 } 336 339 return; … … 342 345 QMutexLocker locker(&_mutex); 343 346 message("none:" + account, QString("%1: no password in the configuration file nor in %2") 344 .arg(account).arg(fileNames().join(", "))); 345 } 346 } 347 .arg(account).arg(fileNames().join(", ")), t_logRecord::warning); 348 } 349 } -
trunk/BNC/src/bncephuser.cpp
r11140 r11185 75 75 Qt::SkipEmptyParts); 76 76 if (!_ephMounts.isEmpty()) { 77 BNC_CORE-> slotMessage((user.trimmed() + ": ephemerides of " + _ephMounts.join(", ") + " only").toLatin1(), true);77 BNC_CORE->message((user.trimmed() + ": ephemerides of " + _ephMounts.join(", ") + " only").toLatin1(), true, "bce", t_logRecord::info); 78 78 } 79 79 } -
trunk/BNC/src/bncgetthread.cpp
r11179 r11185 129 129 setTerminationEnabled(true); 130 130 131 connect(this, SIGNAL(newMessage(QByteArray,bool)), 132 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 133 connect(this, SIGNAL(newLogRecord(t_logRecord,bool)), 134 BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool))); 135 t_logRecord::registerStation(_staID); 131 BNC_CORE->connectMessages(this, "stream"); 132 BNC_CORE->connectLogRecords(this, "stream"); 133 t_logRecord::registerStream(_staID); 136 134 137 135 _isToBeDeleted = false; … … 162 160 + QByteArray::number(nmeaPort) + ": " 163 161 + _nmeaServer->errorString(); 164 emit new Message(message.toLatin1(), true);162 emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true); 165 163 } 166 164 else { … … 264 262 msleep(100); //sleep 0.1 sec 265 263 if (!_serialPort->isOpen()) { 266 emit (newMessage(_staID + ": Cannot open serial port " + portString.toLatin1()267 + ": " + _serialPort->errorString().toLatin1() , true));264 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + ": Cannot open serial port " + portString.toLatin1() 265 + ": " + _serialPort->errorString().toLatin1()), true); 268 266 delete _serialPort; 269 267 _serialPort = 0; 270 268 } 271 269 else { 272 emit (newMessage(_staID + ": Serial port " + portString.toLatin1()273 + "is connected: " + _serialPort->errorString().toLatin1() , true));270 emit newLogRecord(t_logRecord::message(t_logRecord::info, _staID + ": Serial port " + portString.toLatin1() 271 + "is connected: " + _serialPort->errorString().toLatin1()), true); 274 272 connect(_serialPort, SIGNAL(readyRead()), this, SLOT(slotSerialReadyRead())); 275 273 } … … 343 341 connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)), 344 342 this, SIGNAL(newMessage(QByteArray,bool))); 343 connect((RTCM3Decoder*) newDecoder, SIGNAL(newLogRecord(t_logRecord,bool)), 344 this, SIGNAL(newLogRecord(t_logRecord,bool))); 345 345 } else if (_format == "ZERO") { 346 346 emitFormat(": Forward data in original format", "ZERO"); … … 355 355 _decoder = new bncRtnetDecoder(); 356 356 } else { 357 emit (newMessage(_staID + ": Unknown data format " + _format + ". Please change the format entry to ZERO or ZERO2FILE to forward unchanged data.", true));357 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + ": Unknown data format " + _format + ". Please change the format entry to ZERO or ZERO2FILE to forward unchanged data."), true); 358 358 _isToBeDeleted = true; 359 359 return failure; … … 449 449 try { 450 450 if (_isToBeDeleted) { 451 emit (newMessage(_staID + ": is to be deleted", true));451 emit newLogRecord(t_logRecord::message(t_logRecord::info, _staID + ": is to be deleted"), true); 452 452 QThread::exit(4); 453 453 this->deleteLater(); … … 484 484 _format = _rawFile->format(); 485 485 _staID = _rawFile->staID(); 486 t_logRecord::registerSt ation(_staID);486 t_logRecord::registerStream(_staID); 487 487 488 488 QCoreApplication::processEvents(); 489 489 490 490 if (data.isEmpty() || BNC_CORE->sigintReceived) { 491 emit (newMessage("No more data or SIGINT/SIGTERM received", true));491 emit newLogRecord(t_logRecord::message(t_logRecord::info, "No more data or SIGINT/SIGTERM received"), true); 492 492 // pass on data the decoders still hold back (last epoch) 493 493 QMapIterator<QString, GPSDecoder*> itFlush(_decodersRaw); … … 652 652 QString prn(obs._prn.toString().c_str()); 653 653 QString type = QString("%1").arg(obs._type); 654 emit (newMessage(_staID + " (" + prn.toLatin1() + ")" + ": Wrong observation epoch(s)" + "( MT: " + type.toLatin1() + ")", false));654 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID + " (" + prn.toLatin1() + ")" + ": Wrong observation epoch(s)" + "( MT: " + type.toLatin1() + ")"), false); 655 655 continue; 656 656 } … … 666 666 bncTime oldTime = it.value(); 667 667 if (obsTime < oldTime) { 668 emit (newMessage(_staID + ": old observation " + prn.toLatin1(), false));668 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID + ": old observation " + prn.toLatin1()), false); 669 669 continue; 670 670 } else if (obsTime == oldTime) { 671 emit (newMessage(_staID + ": observation coming more than once " + prn.toLatin1(), false));671 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID + ": observation coming more than once " + prn.toLatin1()), false); 672 672 continue; 673 673 } … … 691 691 } 692 692 catch (Exception& exc) { 693 emit (newMessage(_staID + " " + exc.what(), true));693 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " " + exc.what()), true); 694 694 _isToBeDeleted = true; 695 695 } 696 696 catch (std::exception& exc) { 697 emit (newMessage(_staID + " " + exc.what(), true));697 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " " + exc.what()), true); 698 698 _isToBeDeleted = true; 699 699 } 700 700 catch (const string& error) { 701 emit (newMessage(_staID + " ERROR: " + error.c_str(), true));701 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " ERROR: " + error.c_str()), true); 702 702 _isToBeDeleted = true; 703 703 } 704 704 catch (const char* error) { 705 emit (newMessage(_staID + " ERROR: " + error, true));705 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " ERROR: " + error), true); 706 706 _isToBeDeleted = true; 707 707 } 708 708 catch (QString error) { 709 emit (newMessage(_staID + " ERROR: " + error.toStdString().c_str(), true));709 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " ERROR: " + error.toStdString().c_str()), true); 710 710 _isToBeDeleted = true; 711 711 } 712 712 catch (...) { 713 emit (newMessage(_staID + " bncGetThread: unknown exception", true));713 emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " bncGetThread: unknown exception"), true); 714 714 _isToBeDeleted = true; 715 715 } … … 838 838 QString type = QString("%1 ").arg(decoder()->_typeList[ii]._type); 839 839 QString size = (decoder()->_typeList[ii]._size) ? QString("(size %1)").arg(decoder()->_typeList[ii]._size) : ""; 840 emit(newMessage(_staID + ": Received message type " + type.toLatin1() + size.toLatin1(), true)); 840 t_logRecord rec(t_logRecord::info, "stream", "stream_content", _staID, 841 _staID + ": Received message type " + type.toLatin1() + size.toLatin1()); 842 rec.add("message_type", int(decoder()->_typeList[ii]._type)); 843 if (decoder()->_typeList[ii]._size) { 844 rec.add("size", int(decoder()->_typeList[ii]._size)); 845 } 846 emit newLogRecord(rec, true); 841 847 } 842 848 … … 908 914 str << " " << rnxTypes[iType]; 909 915 } 910 emit (newMessage(_staID + ": Observation Types: " + msg.toLatin1(), true));916 emitContent(_staID + ": Observation Types: " + msg.toLatin1(), true); 911 917 } 912 918 } … … 916 922 for (int ii = 0; ii < decoder()->_antType.size(); ii++) { 917 923 QString ant1 = QString(": Antenna Descriptor: %1 ").arg(decoder()->_antType[ii]._descriptor); 918 emit (newMessage(_staID + ant1.toLatin1(), true));924 emitContent(_staID + ant1.toLatin1(), true); 919 925 if (strlen(decoder()->_antType[ii]._serialnumber)) { 920 926 QString ant2 = QString(": Antenna Serial Number: %1 ").arg(decoder()->_antType[ii]._serialnumber); 921 emit (newMessage(_staID + ant2.toLatin1(), true));927 emitContent(_staID + ant2.toLatin1(), true); 922 928 } 923 929 } … … 936 942 ant2 = QString("%1 ").arg(decoder()->_antList[ii]._yy, 0, 'f', 4).toLatin1(); 937 943 ant3 = QString("%1 ").arg(decoder()->_antList[ii]._zz, 0, 'f', 4).toLatin1(); 938 emit (newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));939 emit (newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));940 emit (newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));944 emitContent(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true); 945 emitContent(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true); 946 emitContent(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true); 941 947 double hh = 0.0; 942 948 if (decoder()->_antList[ii]._height_f) { 943 949 hh = decoder()->_antList[ii]._height; 944 950 QByteArray ant4 = QString("%1 ").arg(hh, 0, 'f', 4).toLatin1(); 945 emit (newMessage(946 _staID + ": Antenna height above marker " + ant4 + "m", true) );951 emitContent( 952 _staID + ": Antenna height above marker " + ant4 + "m", true); 947 953 } 948 954 emit(newAntCrd(_staID, decoder()->_antList[ii]._xx, … … 956 962 QString rec2 = QString(": Receiver Firmware Version: %1 ").arg(decoder()->_recType[ii]._firmware); 957 963 QString rec3 = QString(": Receiver Serial Number: %1 ").arg(decoder()->_recType[ii]._serialnumber); 958 emit (newMessage(_staID + rec1.toLatin1(), true));959 emit (newMessage(_staID + rec2.toLatin1(), true));960 emit (newMessage(_staID + rec3.toLatin1(), true));964 emitContent(_staID + rec1.toLatin1(), true); 965 emitContent(_staID + rec2.toLatin1(), true); 966 emitContent(_staID + rec3.toLatin1(), true); 961 967 } 962 968 … … 973 979 if (!allFound) { 974 980 _gloSlots.sort(); 975 emit (newMessage(981 emitContent( 976 982 _staID + ": GLONASS Slot:Freq " + _gloSlots.join(" ").toLatin1(), 977 true) );983 true); 978 984 } 979 985 } … … 983 989 if (decoder()->_gloBiasInfo.changed()) { 984 990 QString gloCodePhaseBiases = decoder()->_gloBiasInfo.toString(); 985 emit (newMessage(_staID + gloCodePhaseBiases.toLatin1(), true));991 emitContent(_staID + gloCodePhaseBiases.toLatin1(), true); 986 992 decoder()->_gloBiasInfo.setChanged(false); 987 993 } … … 995 1001 QString coordinateEpoch = QString(": Service CRS Coordinate Epoch: %1 ").arg(decoder()->_serviceCrs[ii]._coordinateEpoch); 996 1002 //QString ce = QString(": CE: %1 ").arg(decoder()->_serviceCrs[ii]._CE); 997 emit (newMessage(_staID + servicecrsname.toLatin1(), true));998 emit (newMessage(_staID + coordinateEpoch.toLatin1(), true));999 //emit (newMessage(_staID + ce.toLatin1(), true));1003 emitContent(_staID + servicecrsname.toLatin1(), true); 1004 emitContent(_staID + coordinateEpoch.toLatin1(), true); 1005 //emitContent(_staID + ce.toLatin1(), true); 1000 1006 } 1001 1007 // RTCM CRS … … 1004 1010 QString anchor = QString(": RTCM CRS Anchor: %1 ").arg(decoder()->_rtcmCrs[ii]._anchor); 1005 1011 QString platenumber = QString(": RTCM CRS Plate Number: %1 ").arg(decoder()->_rtcmCrs[ii]._plateNumber); 1006 emit (newMessage(_staID + rtcmcrsname.toLatin1(), true));1007 emit (newMessage(_staID + anchor.toLatin1(), true));1008 emit (newMessage(_staID + platenumber.toLatin1(), true));1012 emitContent(_staID + rtcmcrsname.toLatin1(), true); 1013 emitContent(_staID + anchor.toLatin1(), true); 1014 emitContent(_staID + platenumber.toLatin1(), true); 1009 1015 for (int i = 0; i<decoder()->_rtcmCrs[ii]._databaseLinks.size(); i++) { 1010 1016 QString dblink = QString(": Database Link: %1 ").arg(decoder()->_rtcmCrs[ii]._databaseLinks[i]); 1011 emit (newMessage(_staID + dblink.toLatin1(), true));1017 emitContent(_staID + dblink.toLatin1(), true); 1012 1018 } 1013 1019 } … … 1030 1036 .arg(helmertPar._oxr).arg(helmertPar._oyr).arg(helmertPar._ozr); 1031 1037 QString parscale = QString(": MT1301 Helmert Par Scale: sc = %1, scr = %2").arg(helmertPar._sc).arg(helmertPar._scr); 1032 emit (newMessage(_staID + sourcename.toLatin1(), true));1033 emit (newMessage(_staID + targetname.toLatin1(), true));1034 emit (newMessage(_staID + sysidentnum.toLatin1(), true));1035 emit (newMessage(_staID + trafomessageind.toLatin1(), true));1036 emit (newMessage(_staID + epoch.toLatin1(), true));1037 emit (newMessage(_staID + partrans.toLatin1(), true));1038 emit (newMessage(_staID + parrot.toLatin1(), true));1039 emit (newMessage(_staID + parscale.toLatin1(), true));1038 emitContent(_staID + sourcename.toLatin1(), true); 1039 emitContent(_staID + targetname.toLatin1(), true); 1040 emitContent(_staID + sysidentnum.toLatin1(), true); 1041 emitContent(_staID + trafomessageind.toLatin1(), true); 1042 emitContent(_staID + epoch.toLatin1(), true); 1043 emitContent(_staID + partrans.toLatin1(), true); 1044 emitContent(_staID + parrot.toLatin1(), true); 1045 emitContent(_staID + parscale.toLatin1(), true); 1040 1046 } 1041 1047 } … … 1124 1130 void bncGetThread::slotNewNMEAConnection() { 1125 1131 _nmeaSockets->push_back(_nmeaServer->nextPendingConnection()); 1126 emit(newMessage( 1127 QString("New PPP client on port: # %1").arg(_nmeaSockets->size()).toLatin1(), 1128 true)); 1132 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New PPP client on port: # %1").arg(_nmeaSockets->size()).toLatin1()), true); 1129 1133 } 1130 1134 … … 1157 1161 emit newLogRecord(rec, true); 1158 1162 } 1163 1164 // Content of the stream found by the RTCM scan (miscScanRTCM) 1165 //////////////////////////////////////////////////////////////////////////// 1166 void bncGetThread::emitContent(const QByteArray& msg, bool showOnScreen) { 1167 emit newLogRecord(t_logRecord(t_logRecord::info, "stream", "stream_content", _staID, msg), 1168 showOnScreen); 1169 } -
trunk/BNC/src/bncgetthread.h
r11179 r11185 103 103 t_irc initDecoder(); 104 104 void emitFormat(const char* text, const char* decoder); 105 void emitContent(const QByteArray& msg, bool showOnScreen); 105 106 GPSDecoder* decoder(); 106 107 -
trunk/BNC/src/bnchelp.html
r11179 r11185 2789 2789 'json' for one JSON object per line (JSON Lines) or 'logfmt' for key=value pairs separated by blanks. As for the 2790 2790 logfile, the name is extended by '_YYMMDD'. The logfile itself remains unchanged, so existing scripts reading it 2791 keep working. Default is an empty option field, meaning that no structured logfile is written. 2791 keep working. Default is an empty option field, meaning that no structured logfile is written. 'Min. level' 2792 restricts the structured logfile to records of at least the selected level: 'debug' (default) writes all records, 2793 'info' leaves out the debug records, 'warning' writes warnings and errors, 'error' errors only. 2792 2794 </p> 2793 2795 <p> … … 2797 2799 <li>'time': time of the record in UTC, ISO 8601 with 'Z', e.g. '2025-11-17T13:49:40.000Z',</li> 2798 2800 <li>'gpst': the same time in GPS Time (as the time stamps of the logfile), e.g. '2025-11-17T13:49:58.000',</li> 2799 <li>'level': 'info', 'warning' or 'error',</li> 2800 <li>'component': the part of BNC writing the record, e.g. 'stream', 'ppp', or 'bnc' for general messages,</li> 2801 <li>'level': 'debug', 'info', 'warning' or 'error'; debug records exist only in BNC versions built with the 2802 defines BNC_DEBUG_BCE, BNC_DEBUG_OBS or BNC_DEBUG_CMB (src/src.pri),</li> 2803 <li>'component': the part of BNC writing the record: 'stream' (stream retrieval and decoding, latency, outages, 2804 RTCM scan, raw file input), 'ntrip' (Ntrip and UDP/RTP queries, credentials), 'obs' (observation decoding, 2805 debug), 'bce' (broadcast ephemerides), 'ssr' (SSR decoding), 'ppp', 'cmb' (combination), 'upload', 'ssrqc' 2806 (SSR QC), or 'bnc' for general messages,</li> 2801 2807 <li>'event': the kind of record, see below, or 'message' for general messages,</li> 2802 <li>'st ation': the streamorPPP station, if known,</li>2808 <li>'stream': the stream (mountpoint) or the PPP station, if known,</li> 2803 2809 <li>the fields of the event,</li> 2804 2810 <li>'msg': the text of the record in the logfile,</li> … … 2813 2819 <li>'stream_format': 'decoder' (RTCM2, RTCM3, ZERO, ZERO2FILE, RTNET) and 'format' (format entry of the stream),</li> 2814 2820 <li>'stream_timeout' (warning): data timeout, BNC reconnects,</li> 2821 <li>'stream_content': content of the stream found by the RTCM scan (see section <a href=#miscscan>2.12.3</a>), e.g. observation 2822 types, antenna and receiver descriptors, antenna coordinates, GLONASS slots, CRS and Helmert parameters; for the 2823 received message types with the fields 'message_type' and, if known, 'size' (bytes),</li> 2815 2824 <li>'stream_outage_begin' (warning), 'stream_corrupted_begin' (warning): 'since' (UTC); 2816 2825 'stream_outage_end', 'stream_corrupted_end': 'ended' and 'since' (UTC),</li> … … 2819 2828 </ul> 2820 2829 <p> 2821 All other messages are written with component 'bnc' and event 'message'. Their level is derived from keywords of 2822 the text ('error', 'fail', 'cannot', ... give 'error'; 'warning', 'outage', 'corrupt', 'timeout', 'wrong', 2823 'invalid', 'ignored', 'unknown', ... give 'warning'). Further events will follow; new keys may be added to a record 2830 All other messages are written with event 'message' and the component of their origin; the messages of the 2831 BNC_DEBUG_* defines with level 'debug'. The levels mean: 'error' - a function does not work (e.g. stream, 2832 upload or PPP not possible, a file cannot be read, BNC exits); 'warning' - a data or configuration problem, 2833 BNC continues (e.g. data dropped, reconnect, default used, AC or satellite excluded from the combination); 2834 'info' - status. Further events will follow; new keys may be added to a record 2824 2835 without changing its version, removed or renamed keys increase the version. 2825 2836 </p> … … 2828 2839 </p> 2829 2840 <pre><p style="font-family:Monospace"> 2830 {"time":"2025-11-17T13:48:51.000Z","gpst":"2025-11-17T13:49:09.000","level":"info","component":"stream","event":"stream_format","st ation":"BCEP00BKG0","decoder":"RTCM3","format":"RTCM_3.3","msg":"BCEP00BKG0: Get data in RTCM 3.x format","v":1}2831 {"time":"2025-11-17T13:49:40.000Z","gpst":"2025-11-17T13:49:58.000","level":"info","component":"ppp","event":"ppp_position","st ation":"WTZR00DEU0","epoch":"2025-11-17T13:49:10.000","x":4075580.2172,"y":931854.1555,"z":4801568.3403,"dn":0.0000,"de":0.0000,"du":0.0001,"trp0":2.1833,"trp":0.0019,"trp_stdev":0.0993,"num_sat":17,"hdop":0.59,"fixed":false,"fix_percent":0,"msg":"2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ...","v":1}2841 {"time":"2025-11-17T13:48:51.000Z","gpst":"2025-11-17T13:49:09.000","level":"info","component":"stream","event":"stream_format","stream":"BCEP00BKG0","decoder":"RTCM3","format":"RTCM_3.3","msg":"BCEP00BKG0: Get data in RTCM 3.x format","v":1} 2842 {"time":"2025-11-17T13:49:40.000Z","gpst":"2025-11-17T13:49:58.000","level":"info","component":"ppp","event":"ppp_position","stream":"WTZR00DEU0","epoch":"2025-11-17T13:49:10.000","x":4075580.2172,"y":931854.1555,"z":4801568.3403,"dn":0.0000,"de":0.0000,"du":0.0001,"trp0":2.1833,"trp":0.0019,"trp_stdev":0.0993,"num_sat":17,"hdop":0.59,"fixed":false,"fix_percent":0,"msg":"2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ...","v":1} 2832 2843 </pre> 2833 2844 </p> … … 2836 2847 </p> 2837 2848 <pre><p style="font-family:Monospace"> 2838 time=2025-11-17T13:48:51.000Z gpst=2025-11-17T13:49:09.000 level=info component=stream event=stream_format st ation=BCEP00BKG0 decoder=RTCM3 format=RTCM_3.3 msg="BCEP00BKG0: Get data in RTCM 3.x format" v=12839 time=2025-11-17T13:49:40.000Z gpst=2025-11-17T13:49:58.000 level=info component=ppp event=ppp_position st ation=WTZR00DEU0 epoch=2025-11-17T13:49:10.000 x=4075580.2172 y=931854.1555 z=4801568.3403 dn=0.0000 de=0.0000 du=0.0001 trp0=2.1833 trp=0.0019 trp_stdev=0.0993 num_sat=17 hdop=0.59 fixed=false fix_percent=0 msg="2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ..." v=12849 time=2025-11-17T13:48:51.000Z gpst=2025-11-17T13:49:09.000 level=info component=stream event=stream_format stream=BCEP00BKG0 decoder=RTCM3 format=RTCM_3.3 msg="BCEP00BKG0: Get data in RTCM 3.x format" v=1 2850 time=2025-11-17T13:49:40.000Z gpst=2025-11-17T13:49:58.000 level=info component=ppp event=ppp_position stream=WTZR00DEU0 epoch=2025-11-17T13:49:10.000 x=4075580.2172 y=931854.1555 z=4801568.3403 dn=0.0000 de=0.0000 du=0.0001 trp0=2.1833 trp=0.0019 trp_stdev=0.0993 num_sat=17 hdop=0.59 fixed=false fix_percent=0 msg="2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ..." v=1 2840 2851 </pre> 2841 2852 </p> … … 11148 11159 logFileStructured {Structured logfile in addition to the logfile, full path [character string]} 11149 11160 logFormatStructured {Format of the structured logfile [character string: json|logfmt]} 11161 logLevelStructured {Minimum level of the records in the structured logfile [character string: debug|info|warning|error]} 11150 11162 rnxAppend {Append files [integer number: 0=no,2=yes]} 11151 11163 onTheFlyInterval {Configuration reload interval [character string: no|1 day|1 hour|5 min|1 min]} -
trunk/BNC/src/bnclog.cpp
r11179 r11185 24 24 namespace { 25 25 26 QMutex st ationMutex;27 QSet<QByteArray> st ations;26 QMutex streamMutex; 27 QSet<QByteArray> streams; 28 28 29 29 // text as UTF-8 (BNC's messages are Latin-1) … … 97 97 // Envelope of a plain text message 98 98 //////////////////////////////////////////////////////////////////////////// 99 t_logRecord t_logRecord::fromMessage(const QByteArray& msg) { 100 t_logRecord rec(info, "bnc", "message", "", msg);101 102 // st ation: first token of the text, if it is a known station name99 t_logRecord t_logRecord::fromMessage(const QByteArray& msg, const QByteArray& component) { 100 t_logRecord rec(info, component, "message", "", msg); 101 102 // stream: first token of the text, if it is a known stream or PPP station 103 103 int end = 0; 104 104 while (end < msg.size() && msg[end] != ':' && msg[end] != ' ' && msg[end] != '(') { … … 107 107 if (end > 0) { 108 108 QByteArray token = msg.left(end); 109 QMutexLocker locker(&st ationMutex);110 if (st ations.contains(token)) {111 rec._st ation= token;109 QMutexLocker locker(&streamMutex); 110 if (streams.contains(token)) { 111 rec._stream = token; 112 112 } 113 113 } … … 136 136 } 137 137 138 // Plain text message with an explicit level 139 //////////////////////////////////////////////////////////////////////////// 140 t_logRecord t_logRecord::message(e_level level, const QByteArray& msg, 141 const QByteArray& component) { 142 t_logRecord rec = fromMessage(msg, component); 143 rec._level = level; 144 return rec; 145 } 146 147 // Message of a BNC_DEBUG_* build 148 //////////////////////////////////////////////////////////////////////////// 149 t_logRecord t_logRecord::debugMessage(const QByteArray& component, const QByteArray& msg) { 150 t_logRecord rec = fromMessage(msg, component); 151 rec._level = debug; 152 return rec; 153 } 154 138 155 // 139 156 //////////////////////////////////////////////////////////////////////////// … … 196 213 const char* t_logRecord::levelString(e_level level) { 197 214 switch (level) { 215 case debug: return "debug"; 198 216 case warning: return "warning"; 199 217 case error: return "error"; … … 210 228 // 211 229 //////////////////////////////////////////////////////////////////////////// 212 void t_logRecord::registerStation(const QByteArray& station) { 213 if (station.isEmpty()) { 230 t_logRecord::e_level t_logRecord::levelFromString(const QString& str) { 231 QString ss = str.trimmed().toLower(); 232 if (ss == "info") return info; 233 if (ss == "warning") return warning; 234 if (ss == "error") return error; 235 return debug; 236 } 237 238 // 239 //////////////////////////////////////////////////////////////////////////// 240 void t_logRecord::registerStream(const QByteArray& stream) { 241 if (stream.isEmpty()) { 214 242 return; 215 243 } 216 QMutexLocker locker(&st ationMutex);217 st ations.insert(station);244 QMutexLocker locker(&streamMutex); 245 streams.insert(stream); 218 246 } 219 247 … … 242 270 put("component", _component, true); 243 271 put("event", _event, true); 244 if (!_st ation.isEmpty()) {245 put("st ation", _station, true);272 if (!_stream.isEmpty()) { 273 put("stream", _stream, true); 246 274 } 247 275 all += _fields; -
trunk/BNC/src/bnclog.h
r11179 r11185 36 36 // logfile gets one line per record, JSON (JSON Lines) or logfmt: 37 37 // 38 // time gpst level component event [st ation] [fields ...] msg v38 // time gpst level component event [stream] [fields ...] msg v 39 39 // 40 40 // Messages that are still emitted as plain text (newMessage(QByteArray,bool)) 41 // become records with component "bnc" and event "message"; the station is 41 // become records with event "message" and the component of their sender 42 // (t_bncCore::connectMessages(), default "bnc"); the stream is 42 43 // taken from the text prefix if it is a known stream or PPP station, the 43 44 // level from keywords of the text (fromMessage()). … … 45 46 class t_logRecord { 46 47 public: 47 enum e_level {info, warning, error}; 48 enum e_level {debug, info, warning, error}; // increasing severity 48 49 enum e_format {json, logfmt}; 49 50 … … 53 54 t_logRecord() : _level(info) {} 54 55 t_logRecord(e_level level, const QByteArray& component, const QByteArray& event, 55 const QByteArray& st ation, const QByteArray& msg)56 : _level(level), _component(component), _event(event), _st ation(station), _msg(msg) {}56 const QByteArray& stream, const QByteArray& msg) 57 : _level(level), _component(component), _event(event), _stream(stream), _msg(msg) {} 57 58 58 59 // envelope of a plain text message 59 static t_logRecord fromMessage(const QByteArray& msg); 60 static t_logRecord fromMessage(const QByteArray& msg, const QByteArray& component = "bnc"); 61 62 // plain text message with an explicit level, event "message"; an empty 63 // component is filled by the connection (t_bncCore::connectLogRecords()) 64 static t_logRecord message(e_level level, const QByteArray& msg, 65 const QByteArray& component = QByteArray()); 66 67 // message of a BNC_DEBUG_* build: level debug, event "message" 68 static t_logRecord debugMessage(const QByteArray& component, const QByteArray& msg); 60 69 61 70 // fields in the order added; numbers are written with the C locale … … 70 79 71 80 static e_format formatFromString(const QString& str); 81 static e_level levelFromString(const QString& str); // default debug 72 82 static const char* levelString(e_level level); 73 83 74 // station names known for the prefix of plain text messages (thread safe) 75 static void registerStation(const QByteArray& station); 84 // stream (mountpoint) and PPP station names known for the prefix of plain 85 // text messages (thread safe) 86 static void registerStream(const QByteArray& stream); 76 87 77 88 e_level _level; 78 89 QByteArray _component; 79 90 QByteArray _event; 80 QByteArray _st ation;91 QByteArray _stream; 81 92 QByteArray _msg; 82 93 -
trunk/BNC/src/bncmain.cpp
r11179 r11185 149 149 " logFileStructured {Structured logfile in addition to the logfile, full path [character string]}\n" 150 150 " logFormatStructured {Format of the structured logfile [character string: json|logfmt]}\n" 151 " logLevelStructured {Minimum level of the records in the structured logfile [character string: debug|info|warning|error]}\n" 151 152 " rnxAppend {Append files [integer number: 0=no,2=yes]}\n" 152 153 " onTheFlyInterval {Configuration reload interval [character string: no|1 day|1 hour|5 min|1 min]}\n" … … 450 451 #endif 451 452 452 #ifdef Q_OS_MACX453 if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_8)454 {455 // fix Mac OS X 10.9 (mavericks) font issue456 // https://bugreports.qt-project.org/browse/QTBUG-32789457 QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");458 }459 #endif460 461 453 bool GUIenabled = interactive || displaySet; 462 454 QScopedPointer<QCoreApplication> app(createApplication(argc, argv, GUIenabled)); … … 575 567 BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), app->instance(), SLOT(quit())); 576 568 577 BNC_CORE-> slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);569 BNC_CORE->message("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true, "bnc", t_logRecord::info); 578 570 579 571 … … 586 578 caster->readMountPoints(); 587 579 if (caster->numStations() == 0) { 588 BNC_CORE-> slotMessage("bncMain: number of caster stations: 0 => exit", true);580 BNC_CORE->message("bncMain: number of caster stations: 0 => exit", true, "bnc", t_logRecord::error); 589 581 exit(3); 590 582 } -
trunk/BNC/src/bncnetquery.h
r9719 r11185 5 5 #include <QUrl> 6 6 7 #include "bnclog.h" 7 8 #include "bncconst.h" 8 9 #include "bnccore.h" … … 15 16 16 17 bncNetQuery() { 17 connect(this, SIGNAL(newMessage(QByteArray,bool)),18 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));18 BNC_CORE->connectMessages(this, "ntrip"); 19 BNC_CORE->connectLogRecords(this, "ntrip"); 19 20 } 20 21 virtual ~bncNetQuery() {} … … 34 35 signals: 35 36 void newMessage(QByteArray msg, bool showOnScreen); 37 void newLogRecord(t_logRecord rec, bool showOnScreen); 36 38 37 39 private slots: -
trunk/BNC/src/bncnetqueryrtp.cpp
r11130 r11185 231 231 while (!line.isEmpty() && ++nLines <= maxHeaderLines) { 232 232 if (line.indexOf("200 OK") != -1) { 233 emit new Message(_url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")234 + ": UDP connection established", true); 233 emit newLogRecord(t_logRecord::message(t_logRecord::info, _url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"") 234 + ": UDP connection established"), true); 235 235 slotKeepAlive(); 236 236 return; … … 248 248 _socket = 0; 249 249 _status = error; 250 emit new Message(_url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")251 + ": NetQuery, waiting for connect", true); 250 emit newLogRecord(t_logRecord::message(t_logRecord::info, _url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"") 251 + ": NetQuery, waiting for connect"), true); 252 252 } 253 253 -
trunk/BNC/src/bncnetquerys.cpp
r10778 r11185 191 191 192 192 if (!_serialPort->isOpen()) { 193 emit new Message(_url.path().toLatin1().replace(0,1,"") + ": Cannot open serial port " + _portString.toLatin1()194 + ": " + _serialPort->errorString().toLatin1(), true); 193 emit newLogRecord(t_logRecord::message(t_logRecord::error, _url.path().toLatin1().replace(0,1,"") + ": Cannot open serial port " + _portString.toLatin1() 194 + ": " + _serialPort->errorString().toLatin1()), true); 195 195 delete _serialPort; 196 196 _serialPort = 0; … … 199 199 } 200 200 else { 201 emit (newMessage(_url.path().toLatin1().replace(0,1,"") + ": Serial port " + _portString.toLatin1()202 + " is connected: " , true));201 emit newLogRecord(t_logRecord::message(t_logRecord::info, _url.path().toLatin1().replace(0,1,"") + ": Serial port " + _portString.toLatin1() 202 + " is connected: "), true); 203 203 _status = running; 204 204 } -
trunk/BNC/src/bncnetqueryudp0.cpp
r11128 r11185 100 100 _senders = QHostInfo::fromName(host).addresses(); 101 101 if (_senders.isEmpty()) { 102 emit new Message(url.path().toLatin1().replace(0,1,"") +103 ": Cannot resolve UDP sender " + host.toLatin1(), true); 102 emit newLogRecord(t_logRecord::message(t_logRecord::error, url.path().toLatin1().replace(0,1,"") + 103 ": Cannot resolve UDP sender " + host.toLatin1()), true); 104 104 _status = error; 105 105 return; -
trunk/BNC/src/bncnetqueryv0.cpp
r8204 r11185 67 67 _socket = 0; 68 68 _status = error; 69 emit new Message(_url.path().toLatin1() + " read timeout", true);69 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1() + " read timeout"), true); 70 70 return; 71 71 } … … 102 102 _socket = 0; 103 103 _status = error; 104 emit (newMessage(_url.path().toLatin1().replace(0,1,"")105 + ": Connect timeout, reconnecting" , true));104 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 105 + ": Connect timeout, reconnecting"), true); 106 106 return; 107 107 } … … 115 115 _socket = 0; 116 116 _status = error; 117 emit new Message(_url.path().toLatin1().replace(0,1,"")118 + ": Read timeout", true); 117 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 118 + ": Read timeout"), true); 119 119 return; 120 120 } -
trunk/BNC/src/bncnetqueryv1.cpp
r11130 r11185 91 91 _socket = 0; 92 92 _status = error; 93 emit new Message(_url.path().toLatin1().replace(0,1,"")94 + ": " + errStr.toLatin1(), true); 93 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 94 + ": " + errStr.toLatin1()), true); 95 95 return; 96 96 } … … 157 157 _socket = 0; 158 158 _status = error; 159 emit new Message(_url.path().toLatin1().replace(0,1,"")160 + ": Write timeout", true); 159 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 160 + ": Write timeout"), true); 161 161 return; 162 162 } … … 243 243 _socket = 0; 244 244 _status = error; 245 emit new Message(_url.path().toLatin1().replace(0,1,"")246 + ": Write timeout", true); 245 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 246 + ": Write timeout"), true); 247 247 return; 248 248 } … … 265 265 _socket = 0; 266 266 _status = error; 267 emit new Message(_url.path().toLatin1().replace(0,1,"")268 + ": Caster response header too long", true); 267 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 268 + ": Caster response header too long"), true); 269 269 return; 270 270 } … … 307 307 _socket = 0; 308 308 _status = error; 309 emit new Message(_url.path().toLatin1().replace(0,1,"")310 + ": Caster response header too long", true); 309 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 310 + ": Caster response header too long"), true); 311 311 return; 312 312 } … … 315 315 _socket = 0; 316 316 _status = error; 317 emit new Message(_url.path().toLatin1().replace(0,1,"")318 + ": Response timeout", true); 317 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 318 + ": Response timeout"), true); 319 319 return; 320 320 } … … 324 324 _socket = 0; 325 325 _status = error; 326 emit new Message(_url.path().toLatin1().replace(0,1,"")326 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 327 327 + ": Wrong caster response\n" 328 + response.join("").toLatin1(), true); 328 + response.join("").toLatin1()), true); 329 329 } 330 330 } -
trunk/BNC/src/bncnetqueryv2.cpp
r11126 r11185 43 43 if (_secure ) { 44 44 if (!QSslSocket::supportsSsl()) { 45 BNC_CORE-> slotMessage("No SSL support, install OpenSSL run-time libraries", true);45 BNC_CORE->message("No SSL support, install OpenSSL run-time libraries", true, "ntrip", t_logRecord::error); 46 46 stop(); 47 47 } … … 80 80 _status = error; 81 81 if (!_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray().isEmpty()) { 82 emit new Message(_url.path().toLatin1().replace(0,1,"") +82 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") + 83 83 ": NetQueryV2: server replied: " + 84 _reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray(), 85 true); 84 _reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()), true); 86 85 } else { 87 emit new Message(_url.path().toLatin1().replace(0,1,"") +86 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") + 88 87 ": NetQueryV2: server replied: " + 89 _reply->errorString().toLatin1(), 90 true); 88 _reply->errorString().toLatin1()), true); 91 89 } 92 90 } … … 100 98 void bncNetQueryV2::slotProxyAuthenticationRequired(const QNetworkProxy&, 101 99 QAuthenticator*) { 102 emit new Message("slotProxyAuthenticationRequired", true);100 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "slotProxyAuthenticationRequired"), true); 103 101 } 104 102 … … 240 238 if (timedOut) { 241 239 _status = error; 242 emit new Message(_url.path().toLatin1().replace(0,1,"")243 + ": Read timeout", true); 240 emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 241 + ": Read timeout"), true); 244 242 disconnect(_reply, SIGNAL(finished()), this, SLOT(slotFinished())); 245 243 _reply->abort(); … … 294 292 if (_sslIgnoreErrors) { 295 293 _reply->ignoreSslErrors(); 296 BNC_CORE-> slotMessage((msg + " (ignored as configured)").toLatin1(), true);294 BNC_CORE->message((msg + " (ignored as configured)").toLatin1(), true, "ntrip", t_logRecord::warning); 297 295 } 298 296 else { 299 BNC_CORE-> slotMessage(msg.toLatin1(), true);297 BNC_CORE->message(msg.toLatin1(), true, "ntrip", t_logRecord::error); 300 298 stop(); 301 299 } -
trunk/BNC/src/bncrawfile.cpp
r11128 r11185 149 149 int nBytes = lst.value(3).trimmed().toInt(&ok); 150 150 if (!ok || nBytes < 0 || nBytes > (1 << 24)) { 151 BNC_CORE-> slotMessage("Raw file: invalid chunk header: " + line.trimmed().left(80).toLatin1(), true);151 BNC_CORE->message("Raw file: invalid chunk header: " + line.trimmed().left(80).toLatin1(), true, "stream", t_logRecord::warning); 152 152 return data; 153 153 } -
trunk/BNC/src/bncsettings.cpp
r11179 r11185 80 80 setValue_p("logFileStructured", ""); 81 81 setValue_p("logFormatStructured", "json"); 82 setValue_p("logLevelStructured", "debug"); 82 83 setValue_p("rnxAppend", "0"); 83 84 setValue_p("onTheFlyInterval", "no"); -
trunk/BNC/src/bncwindow.cpp
r11179 r11185 207 207 _logFormatStructuredComboBox->setCurrentIndex(kLogFmt); 208 208 } 209 _logLevelStructuredComboBox = new QComboBox(); 210 _logLevelStructuredComboBox->setEditable(false); 211 _logLevelStructuredComboBox->addItems(QString("debug,info,warning,error").split(",")); 212 int kLogLev = _logLevelStructuredComboBox->findText(settings.value("logLevelStructured").toString()); 213 if (kLogLev != -1) { 214 _logLevelStructuredComboBox->setCurrentIndex(kLogLev); 215 } 209 216 _rawOutFileLineEdit = new QLineEdit(settings.value("rawOutFile").toString()); 210 217 _ephMountLineEdit = new QLineEdit(settings.value("ephMount").toString()); … … 855 862 gLayout->addWidget(_logFileLineEdit, 1, 1, 1, 20); 856 863 gLayout->addWidget(new QLabel("Structured logfile"), 2, 0); 857 gLayout->addWidget(_logFileStructuredLineEdit, 2, 1, 1, 15); 858 gLayout->addWidget(new QLabel(" Format"), 2, 16, Qt::AlignRight); 859 gLayout->addWidget(_logFormatStructuredComboBox, 2, 17, 1, 4); 864 gLayout->addWidget(_logFileStructuredLineEdit, 2, 1, 1, 10); 865 gLayout->addWidget(new QLabel(" Format"), 2, 11, Qt::AlignRight); 866 gLayout->addWidget(_logFormatStructuredComboBox, 2, 12, 1, 3); 867 gLayout->addWidget(new QLabel(" Min. level"), 2, 15, Qt::AlignRight); 868 gLayout->addWidget(_logLevelStructuredComboBox, 2, 16, 1, 5); 860 869 gLayout->addWidget(new QLabel("Append files"), 3, 0); 861 870 gLayout->addWidget(_rnxAppendCheckBox, 3, 1); … … 1580 1589 // ------------------ 1581 1590 _logFileLineEdit->setWhatsThis(tr("<p>Records of BNC's activities are shown in the 'Log' tab on the bottom of this window. They can be saved into a file when a valid path for that is specified in the 'Logfile (full path)' field.</p><p>The logfile name will automatically be extended by a string '_YYMMDD' carrying the current date. <i>[key: logFile]</i></p>")); 1582 _logFileStructuredLineEdit->setWhatsThis(tr("<p>In addition to the logfile, BNC can write the same records as a structured logfile for log processing tools: one record per line, either JSON (JSON Lines) or logfmt (key=value pairs separated by blanks). Each record carries the time in UTC ('time', ISO 8601 with 'Z') and in GPS time ('gpst'), a level (info, warning, error), the component (e.g. stream, ppp), the event (e.g. ppp_position, stream_outage_begin), the station if known, the event's fields, the text of the classic logfile ('msg') and the record version ('v').</p><p>Messages without own event are written with component 'bnc' and event 'message'; their level is derived from keywords of the text. The logfile itself remains unchanged.</p><p>The file name will automatically be extended by a string '_YYMMDD' carrying the current date. Default is an empty option field, meaning that no structured logfile is written. <i>[key: logFileStructured]</i></p>"));1591 _logFileStructuredLineEdit->setWhatsThis(tr("<p>In addition to the logfile, BNC can write the same records as a structured logfile for log processing tools: one record per line, either JSON (JSON Lines) or logfmt (key=value pairs separated by blanks). Each record carries the time in UTC ('time', ISO 8601 with 'Z') and in GPS time ('gpst'), a level (debug, info, warning, error), the component (e.g. stream, ppp, cmb), the event (e.g. ppp_position, stream_outage_begin), the stream (mountpoint) or PPP station if known, the event's fields, the text of the classic logfile ('msg') and the record version ('v').</p><p>Messages without own event are written with event 'message' and the component of their origin; their level is error (a function does not work), warning (data or configuration problem, BNC continues) or info (status). The logfile itself remains unchanged.</p><p>The file name will automatically be extended by a string '_YYMMDD' carrying the current date. Default is an empty option field, meaning that no structured logfile is written. <i>[key: logFileStructured]</i></p>")); 1583 1592 _logFormatStructuredComboBox->setWhatsThis(tr("<p>Select the format of the structured logfile: 'json' for one JSON object per line (JSON Lines), 'logfmt' for key=value pairs. Default is 'json'. <i>[key: logFormatStructured]</i></p>")); 1593 _logLevelStructuredComboBox->setWhatsThis(tr("<p>Select the minimum level of the records written into the structured logfile: 'debug' writes all records (debug records exist only in BNC versions built with the BNC_DEBUG_* defines), 'info' leaves out the debug records, 'warning' writes warnings and errors only, 'error' errors only. The logfile is not affected. Default is 'debug'. <i>[key: logLevelStructured]</i></p>")); 1584 1594 _rnxAppendCheckBox->setWhatsThis(tr("<p>When BNC is started, new files are created by default and file content already available under the same name will be overwritten. However, users might want to append already existing files following a regular restart or a crash of BNC or its platform.</p><p>Tick 'Append files' to continue with existing files and keep what has been recorded so far. <i>[key: rnxAppend]</i></p>")); 1585 1595 _onTheFlyComboBox->setWhatsThis(tr("<p>When operating BNC online in 'no window' mode, some configuration parameters can be changed on-the-fly without interrupting the running process. For that BNC rereads parts of its configuration in pre-defined intervals. The default entry is 'no' that means the reread function is switched of. <p></p>Select '1 min', '5 min', '1 hour', or '1 day' to force BNC to reread its configuration every full minute, five minutes, hour, or day and let in between edited configuration options become effective on-the-fly without terminating uninvolved threads.</p><p>Note that when operating BNC in window mode, on-the-fly changeable configuration options become effective immediately via button 'Save & Reread Configuration'. <i>[key: onTheFlyInterval]</i></p>")); … … 1897 1907 delete _logFileStructuredLineEdit; 1898 1908 delete _logFormatStructuredComboBox; 1909 delete _logLevelStructuredComboBox; 1899 1910 delete _rawOutFileLineEdit; 1900 1911 delete _ephMountLineEdit; … … 2432 2443 settings.setValue("logFileStructured", _logFileStructuredLineEdit->text()); 2433 2444 settings.setValue("logFormatStructured", _logFormatStructuredComboBox->currentText()); 2445 settings.setValue("logLevelStructured", _logLevelStructuredComboBox->currentText()); 2434 2446 settings.setValue("rnxAppend", _rnxAppendCheckBox->checkState()); 2435 2447 settings.setValue("onTheFlyInterval", _onTheFlyComboBox->currentText()); … … 2568 2580 //////////////////////////////////////////////////////////////////////////// 2569 2581 void bncWindow::slotGetThreadsFinished() { 2570 BNC_CORE-> slotMessage("All Get Threads Terminated", true);2582 BNC_CORE->message("All Get Threads Terminated", true, "bnc", t_logRecord::info); 2571 2583 delete _caster; _caster = 0; BNC_CORE->setCaster(0); 2572 2584 delete _casterEph; _casterEph = 0; … … 2638 2650 connect(_caster, SIGNAL(mountPointsRead(QList<bncGetThread*>)), this, SLOT(slotMountPointsRead(QList<bncGetThread*>))); 2639 2651 2640 BNC_CORE-> slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);2652 BNC_CORE->message("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true, "bnc", t_logRecord::info); 2641 2653 2642 2654 bncSettings settings; … … 2645 2657 // ------------- 2646 2658 if (!_rnxPathLineEdit->text().isEmpty()) 2647 BNC_CORE-> slotMessage("Panel 'RINEX Observations' active", true);2659 BNC_CORE->message("Panel 'RINEX Observations' active", true, "bnc", t_logRecord::info); 2648 2660 if (!_ephPathLineEdit->text().isEmpty()) 2649 BNC_CORE-> slotMessage("Panel 'RINEX Ephemeris' active", true);2661 BNC_CORE->message("Panel 'RINEX Ephemeris' active", true, "bnc", t_logRecord::info); 2650 2662 if (!_corrPathLineEdit->text().isEmpty()) 2651 BNC_CORE-> slotMessage("Panel 'Broadcast Corrections' active", true);2663 BNC_CORE->message("Panel 'Broadcast Corrections' active", true, "bnc", t_logRecord::info); 2652 2664 if (!_outPortLineEdit->text().isEmpty()) 2653 BNC_CORE-> slotMessage("Panel 'Feed Engine' active", true);2665 BNC_CORE->message("Panel 'Feed Engine' active", true, "bnc", t_logRecord::info); 2654 2666 if (!_serialMountPointLineEdit->text().isEmpty()) 2655 BNC_CORE-> slotMessage("Panel 'Serial Output' active", true);2667 BNC_CORE->message("Panel 'Serial Output' active", true, "bnc", t_logRecord::info); 2656 2668 if (!_adviseObsRateComboBox->currentText().isEmpty()) 2657 BNC_CORE-> slotMessage("Panel 'Outages' active", true);2669 BNC_CORE->message("Panel 'Outages' active", true, "bnc", t_logRecord::info); 2658 2670 if (!_miscMountLineEdit->text().isEmpty()) 2659 BNC_CORE-> slotMessage("Panel 'Miscellaneous' active", true);2671 BNC_CORE->message("Panel 'Miscellaneous' active", true, "bnc", t_logRecord::info); 2660 2672 if (_pppWidgets._dataSource->currentText() == "Real-Time Streams") 2661 BNC_CORE-> slotMessage("Panel 'PPP' active", true);2673 BNC_CORE->message("Panel 'PPP' active", true, "bnc", t_logRecord::info); 2662 2674 if (_cmbTable->rowCount() > 0) 2663 BNC_CORE-> slotMessage("Panel 'Combine Corrections' active", true);2675 BNC_CORE->message("Panel 'Combine Corrections' active", true, "bnc", t_logRecord::info); 2664 2676 if (_uploadTable->rowCount() > 0) 2665 BNC_CORE-> slotMessage("Panel 'Upload Corrections' active", true);2677 BNC_CORE->message("Panel 'Upload Corrections' active", true, "bnc", t_logRecord::info); 2666 2678 if (_uploadEphTable->rowCount() > 0) 2667 BNC_CORE-> slotMessage("Panel 'UploadEphemeris' active", true);2679 BNC_CORE->message("Panel 'UploadEphemeris' active", true, "bnc", t_logRecord::info); 2668 2680 2669 2681 QDir rnxdir(settings.value("rnxPath").toString()); 2670 if (!rnxdir.exists()) BNC_CORE-> slotMessage("Cannot find RINEX Observations directory", true);2682 if (!rnxdir.exists()) BNC_CORE->message("Cannot find RINEX Observations directory", true, "bnc", t_logRecord::error); 2671 2683 2672 2684 QString rnx_file = settings.value("rnxScript").toString(); 2673 2685 if (!rnx_file.isEmpty()) { 2674 2686 QFile rnxfile(settings.value("rnxScript").toString()); 2675 if (!rnxfile.exists()) BNC_CORE-> slotMessage("Cannot find RINEX Observations script", true);2687 if (!rnxfile.exists()) BNC_CORE->message("Cannot find RINEX Observations script", true, "bnc", t_logRecord::error); 2676 2688 } 2677 2689 2678 2690 QDir ephdir(settings.value("ephPath").toString()); 2679 if (!ephdir.exists()) BNC_CORE-> slotMessage("Cannot find RINEX Ephemeris directory", true);2691 if (!ephdir.exists()) BNC_CORE->message("Cannot find RINEX Ephemeris directory", true, "bnc", t_logRecord::error); 2680 2692 2681 2693 QDir corrdir(settings.value("corrPath").toString()); 2682 if (!corrdir.exists()) BNC_CORE-> slotMessage("Cannot find Broadcast Corrections directory", true);2694 if (!corrdir.exists()) BNC_CORE->message("Cannot find Broadcast Corrections directory", true, "bnc", t_logRecord::error); 2683 2695 2684 2696 QString advise_file = settings.value("adviseScript").toString(); 2685 2697 if (!advise_file.isEmpty()) { 2686 2698 QFile advisefile(settings.value("adviseScript").toString()); 2687 if (!advisefile.exists()) BNC_CORE-> slotMessage("Cannot find Outages script", true);2699 if (!advisefile.exists()) BNC_CORE->message("Cannot find Outages script", true, "bnc", t_logRecord::error); 2688 2700 } 2689 2701 -
trunk/BNC/src/bncwindow.h
r11179 r11185 186 186 QLineEdit* _logFileStructuredLineEdit; 187 187 QComboBox* _logFormatStructuredComboBox; 188 QComboBox* _logLevelStructuredComboBox; 188 189 QLineEdit* _rawOutFileLineEdit; 189 190 QLineEdit* _ephMountLineEdit; -
trunk/BNC/src/combination/bnccomb.cpp
r11158 r11185 209 209 _rtnetDecoder = new bncRtnetDecoder(); 210 210 211 connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 211 BNC_CORE->connectMessages(this, "cmb"); 212 BNC_CORE->connectLogRecords(this, "cmb"); 212 213 213 214 // Reference signals of the clocks 214 215 for (const QString& err : t_ssrRefSig::init()) { 215 emit new Message(("bncComb: " + err).toLatin1(), true);216 emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("bncComb: " + err).toLatin1()), true); 216 217 } 217 218 if (!t_ssrRefSig::allDefault()) { 218 emit new Message(("bncComb: reference signals of the clocks " + t_ssrRefSig::currentString()).toLatin1(), true);219 emit newLogRecord(t_logRecord::message(t_logRecord::info, ("bncComb: reference signals of the clocks " + t_ssrRefSig::currentString()).toLatin1()), true); 219 220 } 220 221 … … 278 279 _antex = new bncAntex(); 279 280 if (_antex->readFile(antexFileName) != success) { 280 emit new Message("bncComb: wrong ANTEX file", true);281 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: wrong ANTEX file"), true); 281 282 delete _antex; 282 283 _antex = 0; 283 284 } 284 285 else { 285 emit new Message("bncComb: " + _antex->info().toLatin1(), true);286 emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: " + _antex->info().toLatin1()), true); 286 287 } 287 288 } … … 302 303 it.value() = false; 303 304 } 304 emit new Message("bncComb: APC and CoM streams configured - combination in the CoM frame, "305 "orbits of the APC streams converted to CoM", true); 305 emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: APC and CoM streams configured - combination in the CoM frame, " 306 "orbits of the APC streams converted to CoM"), true); 306 307 } 307 308 else if (hasAPC && hasCoM) { 308 emit new Message("bncComb: APC and CoM streams configured, but no ANTEX file - only the streams "309 "with the reference point of the master AC are combined", true); 309 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: APC and CoM streams configured, but no ANTEX file - only the streams " 310 "with the reference point of the master AC are combined"), true); 310 311 } 311 312 if (!_antex && hasCoM) { 312 emit new Message("bncComb: CoM streams configured, but no ANTEX file - the combined orbits (INTERNAL) "313 "may refer to the CoM, while the PPP assumes the APC", true); 313 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: CoM streams configured, but no ANTEX file - the combined orbits (INTERNAL) " 314 "may refer to the CoM, while the PPP assumes the APC"), true); 314 315 } 315 316 … … 322 323 _bsx = new bncBiasSnx(); 323 324 if (_bsx->readFile(bsxFileName) != success) { 324 emit new Message("bncComb: wrong Bias SINEX file", true);325 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: wrong Bias SINEX file"), true); 325 326 delete _bsx; 326 327 _bsx = 0; … … 418 419 419 420 if (bsxFileName.isEmpty()) { 420 emit new Message("bncComb: no Bias SINEX file specified", true);421 emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: no Bias SINEX file specified"), true); 421 422 return; 422 423 } … … 425 426 } 426 427 if (_bsx->readFile(bsxFileName) != success) { 427 emit new Message("bncComb: wrong Bias SINEX file", true);428 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: wrong Bias SINEX file"), true); 428 429 delete _bsx; 429 430 _bsx = 0; 430 431 } 431 432 else { 432 emit new Message("bncComb: successfully read Bias SINEX file", true);433 emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: successfully read Bias SINEX file"), true); 433 434 } 434 435 … … 638 639 if (!warned.valid() || newClk._time - warned >= 3600.0) { 639 640 warned = newClk._time; 640 emit new Message("bncComb: " + acName.toLatin1() + " " + QByteArray(1, sys) + " not combined: its orbits refer to the " +641 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + acName.toLatin1() + " " + QByteArray(1, sys) + " not combined: its orbits refer to the " + 641 642 (isAPC ? "APC" : "CoM") + ", those of the master AC " + _masterOrbitAC[sys].toLatin1() + 642 643 " to the " + (isAPC ? "CoM" : "APC") + 643 " (an ANTEX file allows to combine both in the CoM frame)", true); 644 " (an ANTEX file allows to combine both in the CoM frame)"), true); 644 645 } 645 646 continue; … … 651 652 if (fabs(currentTime - newClk._time) > 60.0) { // future or very old data sets 652 653 #ifdef BNC_DEBUG_CMB 653 emit new Message("bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +654 emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() + 654 655 QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. current time" + 655 QString(" %1 ").arg(currentTime.timestr().c_str()).toLatin1(), true); 656 QString(" %1 ").arg(currentTime.timestr().c_str()).toLatin1()), true); 656 657 #endif 657 658 continue; … … 663 664 if (_resTime.valid() && newClk._time <= _resTime) { 664 665 #ifdef BNC_DEBUG_CMB 665 emit new Message("bncComb: old correction: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +666 emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: old correction: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() + 666 667 QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. last processing Epoch" + 667 QString(" %1 ").arg(_resTime.timestr().c_str()).toLatin1(), true); 668 QString(" %1 ").arg(_resTime.timestr().c_str()).toLatin1()), true); 668 669 #endif 669 670 continue; … … 780 781 + QString(" %1 -> %2 %3").arg(corr->_iod,3).arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4); 781 782 782 emit new Message(msg.toLatin1(), false);783 emit newLogRecord(t_logRecord::message(t_logRecord::info, msg.toLatin1()), false); 783 784 784 785 corr->_iod = lastEph->IOD(); … … 800 801 QString msg = _antexReloader.update(_antex, epoTime); 801 802 if (!msg.isEmpty()) { 802 emit new Message(("bncComb: " + msg).toLatin1(), true);803 emit newLogRecord(t_logRecord::message(t_logRecord::info, ("bncComb: " + msg).toLatin1()), true); 803 804 } 804 805 } … … 860 861 if (ephLast == 0) { 861 862 #ifdef BNC_DEBUG_CMB 862 emit new Message("bncComb: eph not found for " + prnStr.mid(0,3).toLatin1(), true);863 emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: eph not found for " + prnStr.mid(0,3).toLatin1()), true); 863 864 #endif 864 865 delete _newCorr; _newCorr = 0; … … 870 871 ephLast->checkState() == t_eph::unhealthy) { 871 872 #ifdef BNC_DEBUG_CMB 872 emit new Message("bncComb: ephLast not ok (checkState: " + ephLast->checkStateToString().toLatin1() + ") for " + prnStr.mid(0,3).toLatin1(), true);873 emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: ephLast not ok (checkState: " + ephLast->checkStateToString().toLatin1() + ") for " + prnStr.mid(0,3).toLatin1()), true); 873 874 #endif 874 875 delete _newCorr; _newCorr = 0; … … 888 889 else { 889 890 #ifdef BNC_DEBUG_CMB 890 emit new Message("bncComb: eph not found for " + prnStr.mid(0,3).toLatin1() +891 QString(" with IOD %1").arg(_newCorr->_iod).toLatin1(), true); 891 emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: eph not found for " + prnStr.mid(0,3).toLatin1() + 892 QString(" with IOD %1").arg(_newCorr->_iod).toLatin1()), true); 892 893 #endif 893 894 delete _newCorr; _newCorr = 0; … … 955 956 } 956 957 } 957 emit new Message("bncComb: " + acName.toLatin1() + " provides no code biases for the " +958 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + acName.toLatin1() + " provides no code biases for the " + 958 959 QByteArray(1, sys) + " reference signal(s)" + missing.toLatin1() + 959 960 " (e.g. " + prnStr.mid(0,3).toLatin1() + ") - these clocks are combined" 960 961 " without referring them to the reference signals and, as long as other ACs" 961 " provide referred clocks, excluded from the clock datum", false); 962 " provide referred clocks, excluded from the clock datum"), false); 962 963 } 963 964 } … … 1112 1113 out << "Missing Master, Epoch skipped" << "\n"; 1113 1114 _buffer.remove(sys); 1114 emit new Message(_log, false);1115 emit newLogRecord(t_logRecord::message(t_logRecord::info, _log), false); 1115 1116 return; 1116 1117 } … … 1411 1412 out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str() 1412 1413 << " " << msg << "\n"; 1413 emit new Message("bncComb: " + msg.toLatin1(), true);1414 emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: " + msg.toLatin1()), true); 1414 1415 resetSatOffsets(sys); 1415 1416 } … … 1440 1441 if (!warned.valid() || epoTime - warned >= 3600.0) { 1441 1442 warned = epoTime; 1442 emit new Message("bncComb: " + msg.toLatin1(), true);1443 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + msg.toLatin1()), true); 1443 1444 } 1444 1445 } … … 1471 1472 &corr->_attYaw) != success) { 1472 1473 if (_antex->warnNoSatEntry(corr->_prn, corr->_time)) { 1473 emit new Message("bncComb: no satellite antenna entry valid at " +1474 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: no satellite antenna entry valid at " + 1474 1475 QByteArray(corr->_time.datestr().c_str()) + " " + QByteArray(corr->_time.timestr().c_str()) + 1475 1476 " for " + corr->_prn.mid(0,3).toLatin1() + 1476 " in ANTEX file - APC orbit of " + AC->name.toLatin1() + " not converted to CoM, not combined", true); 1477 " in ANTEX file - APC orbit of " + AC->name.toLatin1() + " not converted to CoM, not combined"), true); 1477 1478 } 1478 1479 return failure; … … 1549 1550 .arg(stat.numEpo).arg(median, 0, 'f', 2); 1550 1551 out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str() << " " << msg << "\n"; 1551 emit new Message("bncComb: " + msg.toLatin1(), true);1552 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + msg.toLatin1()), true); 1552 1553 } 1553 1554 _outlierStat[sys].clear(); … … 1634 1635 double age = epoTime - corr->_eph->TOC(); 1635 1636 if (fabs(age) > 960.0) { 1636 emit new Message(QString().asprintf(1637 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString().asprintf( 1637 1638 "bncComb: skip %s, GLONASS eph age %.0fs", 1638 corr->_prn.mid(0,3).toLatin1().data(), age).toLatin1(), false); 1639 corr->_prn.mid(0,3).toLatin1().data(), age).toLatin1()), false); 1639 1640 delete corr; 1640 1641 it.remove(); … … 1700 1701 // converted between antenna phase center and center of mass 1701 1702 if (_antex->warnNoSatEntry(corr->_prn, epoTime)) { 1702 emit new Message("bncComb: no satellite antenna entry valid at " +1703 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: no satellite antenna entry valid at " + 1703 1704 QByteArray(epoTime.datestr().c_str()) + " " + QByteArray(epoTime.timestr().c_str()) + 1704 1705 " for " + corr->_prn.mid(0,3).toLatin1() + 1705 " in ANTEX file - ANTEX file outdated? Satellite not combined", true); 1706 " in ANTEX file - ANTEX file outdated? Satellite not combined"), true); 1706 1707 } 1707 1708 orbCorrections.pop_back(); … … 1717 1718 for (const QString& line : yawLogs) { 1718 1719 if (!line.contains(":att:")) { 1719 emit new Message(("bncComb: " + line.trimmed()).toLatin1(), false);1720 emit newLogRecord(t_logRecord::message(t_logRecord::info, ("bncComb: " + line.trimmed()).toLatin1()), false); 1720 1721 } 1721 1722 } … … 2318 2319 if (!warned.valid() || epoTime - warned >= 3600.0) { 2319 2320 warned = epoTime; 2320 emit new Message("bncComb: " + QByteArray(1, sys) + " " + msg.toLatin1(), false);2321 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + QByteArray(1, sys) + " " + msg.toLatin1()), false); 2321 2322 } 2322 2323 } -
trunk/BNC/src/combination/bnccomb.h
r11123 r11185 16 16 #include "bncephuser.h" 17 17 #include "satObs.h" 18 #include "bnclog.h" 18 19 #include "bncconst.h" 19 20 #include "bncoutf.h" … … 54 55 signals: 55 56 void newMessage(QByteArray msg, bool showOnScreen); 57 void newLogRecord(t_logRecord rec, bool showOnScreen); 56 58 void newOrbCorrections(QList<t_orbCorr>); 57 59 void newClkCorrections(QList<t_clkCorr>); -
trunk/BNC/src/latencychecker.cpp
r11179 r11185 60 60 _curLat = 0.0; 61 61 62 connect(this, SIGNAL(newMessage(QByteArray,bool)), 63 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 64 connect(this, SIGNAL(newLogRecord(t_logRecord,bool)), 65 BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool))); 62 BNC_CORE->connectMessages(this, "stream"); 63 BNC_CORE->connectLogRecords(this, "stream"); 66 64 67 65 bncSettings settings; -
trunk/BNC/src/pppMain.cpp
r11136 r11185 93 93 } 94 94 catch (t_except exc) { 95 BNC_CORE-> slotMessage(QByteArray::fromStdString(exc.what()), true);95 BNC_CORE->message(QByteArray::fromStdString(exc.what()), true, "ppp", t_logRecord::error); 96 96 _running = true; 97 97 stop(); -
trunk/BNC/src/pppRun.cpp
r11179 r11185 68 68 _opt = opt; 69 69 70 connect(this, SIGNAL(newMessage(QByteArray,bool)), 71 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 72 connect(this, SIGNAL(newLogRecord(t_logRecord,bool)), 73 BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool))); 74 t_logRecord::registerStation(QByteArray(_opt->_roverName.c_str())); 70 BNC_CORE->connectMessages(this, "ppp"); 71 BNC_CORE->connectLogRecords(this, "ppp"); 72 t_logRecord::registerStream(QByteArray(_opt->_roverName.c_str())); 75 73 76 74 connect(this, SIGNAL(newPosition(QByteArray, bncTime, QVector<double>)), … … 88 86 Qt::SkipEmptyParts); 89 87 if (!_ephMounts.isEmpty()) { 90 emit new Message(QByteArray(_opt->_roverName.c_str()) + ": PPP uses the ephemerides of "91 + _ephMounts.join(", ").toLatin1() + " only", true); 88 emit newLogRecord(t_logRecord::message(t_logRecord::info, QByteArray(_opt->_roverName.c_str()) + ": PPP uses the ephemerides of " 89 + _ephMounts.join(", ").toLatin1() + " only"), true); 92 90 } 93 91 … … 748 746 } 749 747 catch (const char* msg) { 750 emit new Message(QByteArray(msg), true);748 emit newLogRecord(t_logRecord::message(t_logRecord::error, QByteArray(msg)), true); 751 749 break; 752 750 } 753 751 catch (const string& msg) { 754 emit new Message(QByteArray(msg.c_str()), true);752 emit newLogRecord(t_logRecord::message(t_logRecord::error, QByteArray(msg.c_str())), true); 755 753 break; 756 754 } 757 755 catch (...) { 758 emit new Message("unknown exceptions in file " + file->name().toLatin1(), true);756 emit newLogRecord(t_logRecord::message(t_logRecord::error, "unknown exceptions in file " + file->name().toLatin1()), true); 759 757 break; 760 758 } … … 888 886 889 887 QString msg = "pppRun " + QString(_opt->_roverName.c_str()) + ": SSR Provider or Service changed: " + mountPoint; 890 emit new Message(msg.toLatin1(), true);888 emit newLogRecord(t_logRecord::message(t_logRecord::info, msg.toLatin1()), true); 891 889 892 890 _pppClient->reset(); -
trunk/BNC/src/pppThread.cpp
r11057 r11185 62 62 connect(this, SIGNAL(finished()), this, SLOT(deleteLater())); 63 63 64 connect(this, SIGNAL(newMessage(QByteArray,bool)),65 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));64 BNC_CORE->connectMessages(this, "ppp"); 65 BNC_CORE->connectLogRecords(this, "ppp"); 66 66 } 67 67 … … 89 89 _pppRun = 0; 90 90 _ready.release(); 91 emit new Message(QByteArray(exc.what().c_str()), true);91 emit newLogRecord(t_logRecord::message(t_logRecord::error, QByteArray(exc.what().c_str())), true); 92 92 } 93 93 } -
trunk/BNC/src/pppThread.h
r11057 r11185 6 6 #include <QtCore> 7 7 8 #include "bnclog.h" 8 9 #include "pppOptions.h" 9 10 #include "pppClient.h" … … 24 25 signals: 25 26 void newMessage(QByteArray msg, bool showOnScreen); 27 void newLogRecord(t_logRecord rec, bool showOnScreen); 26 28 27 29 private: -
trunk/BNC/src/ssrQc.cpp
r11148 r11185 145 145 } 146 146 147 connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 147 BNC_CORE->connectMessages(this, "ssrqc"); 148 BNC_CORE->connectLogRecords(this, "ssrqc"); 148 149 for (const QString& err : t_ssrRefSig::init()) { 149 emit new Message(("SSR QC: " + err).toLatin1(), true);150 emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("SSR QC: " + err).toLatin1()), true); 150 151 } 151 152 // reference code biases from a Bias SINEX file (optional) … … 160 161 } 161 162 else { 162 emit new Message(("SSR QC: wrong Bias SINEX file " + bsxFile).toLatin1(), true);163 emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("SSR QC: wrong Bias SINEX file " + bsxFile).toLatin1()), true); 163 164 delete _bsxRef; 164 165 _bsxRef = 0; … … 171 172 _antex = new bncAntex(); 172 173 if (_antex->readFile(antexFile) != success || _antex->numSatPrns() == 0) { 173 emit new Message(("SSR QC: wrong ANTEX file " + antexFile + " - no attitude check").toLatin1(), true);174 emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("SSR QC: wrong ANTEX file " + antexFile + " - no attitude check").toLatin1()), true); 174 175 delete _antex; 175 176 _antex = 0; … … 1758 1759 } 1759 1760 1760 emit new Message(QString("SSR QC: report %1 %2 of %3 stream(s) written to %4")1761 emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("SSR QC: report %1 %2 of %3 stream(s) written to %4") 1761 1762 .arg(QString::fromStdString(_intervalStart.datestr())) 1762 1763 .arg(QString::fromStdString(_intervalStart.timestr(0))) 1763 .arg(streams.size()).arg(_dirName).toLatin1(), false); 1764 .arg(streams.size()).arg(_dirName).toLatin1()), false); 1764 1765 1765 1766 _cmpStat.clear(); -
trunk/BNC/src/ssrQc.h
r11137 r11185 4 4 #include <QtCore> 5 5 #include <fstream> 6 #include "bnclog.h" 6 7 #include "bncephuser.h" 7 8 #include "bnctime.h" … … 35 36 signals: 36 37 void newMessage(QByteArray msg, bool showOnScreen); 38 void newLogRecord(t_logRecord rec, bool showOnScreen); 37 39 38 40 private: -
trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
r11179 r11185 330 330 331 331 if (lines.size() < 2) { 332 emit(newMessage( 333 "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1(), false)); 332 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1()), false); 334 333 return; 335 334 } … … 354 353 epoTime.set(year, month, day, hour, min, sec); 355 354 356 emit(newMessage( 357 "bncRtnetUploadCaster: decode " + QByteArray(epoTime.datestr().c_str()) 355 emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncRtnetUploadCaster: decode " + QByteArray(epoTime.datestr().c_str()) 358 356 + " " + QByteArray(epoTime.timestr().c_str()) + " " 359 + _casterID.toLatin1() , false));357 + _casterID.toLatin1()), false); 360 358 361 359 struct SsrCorr::ClockOrbit co; … … 697 695 in >> dummy; 698 696 } 699 emit (newMessage(" RTNET format error: "700 + lines[ii].toLatin1() , false));697 emit newLogRecord(t_logRecord::message(t_logRecord::error, " RTNET format error: " 698 + lines[ii].toLatin1()), false); 701 699 break; 702 700 } … … 1180 1178 1181 1179 if (corrIsOutOfRange(sd)) { 1182 emit (newMessage(QString("bncRtnetUploadCaster: SSR parameter is out of its defined range").toLatin1(), false));1180 emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("bncRtnetUploadCaster: SSR parameter is out of its defined range").toLatin1()), false); 1183 1181 return failure; 1184 1182 } -
trunk/BNC/src/upload/bncuploadcaster.cpp
r11153 r11185 63 63 _isToBeDeleted = false; 64 64 65 connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 65 BNC_CORE->connectMessages(this, "upload"); 66 BNC_CORE->connectLogRecords(this, "upload"); 66 67 67 68 if (BNC_CORE->_uploadTableItems.find(_iRow) != BNC_CORE->_uploadTableItems.end()) { … … 95 96 // no fallback to Ntrip Version 2: user name and password would be sent 96 97 // unencrypted although an encrypted connection was configured 97 emit (newMessage(_mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() +98 ": No SSL support, please install OpenSSL run-time libraries: no upload" , true));98 emit newLogRecord(t_logRecord::message(t_logRecord::error, _mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() + 99 ": No SSL support, please install OpenSSL run-time libraries: no upload"), true); 99 100 } else { 100 101 _secure = true; … … 137 138 void bncUploadCaster::slotProxyAuthenticationRequired(const QNetworkProxy&, 138 139 QAuthenticator*) { 139 emit new Message("slotProxyAuthenticationRequired", true);140 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "slotProxyAuthenticationRequired"), true); 140 141 } 141 142 … … 171 172 msg += " (ignored as configured)"; 172 173 } 173 emit (newMessage(_mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() + ": " + msg.toLatin1(), true));174 emit newLogRecord(t_logRecord::message((_sslIgnoreErrors ? t_logRecord::warning : t_logRecord::error), _mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() + ": " + msg.toLatin1()), true); 174 175 } 175 176 } … … 274 275 } else { 275 276 if (_ntripVersion == "1") { 276 emit (newMessage("No proxy support in Ntrip Version 1 upload!", true));277 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "No proxy support in Ntrip Version 1 upload!"), true); 277 278 delete _outSocket; _outSocket = 0; 278 279 return; … … 299 300 if (!statusOk(ans)) { 300 301 int l = ans.indexOf("\r\n", 0); 301 emit (newMessage("Proxy: Connection broken for " + _mountpoint.toLatin1() + "@" +302 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() + ": " + ans.left(l) , true));302 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Proxy: Connection broken for " + _mountpoint.toLatin1() + "@" + 303 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() + ": " + ans.left(l)), true); 303 304 delete _outSocket; _outSocket = 0; 304 305 return; 305 306 } else { 306 emit (newMessage("Proxy: Connection established for " + _mountpoint.toLatin1()+ "@" +307 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() , true));307 emit newLogRecord(t_logRecord::message(t_logRecord::info, "Proxy: Connection established for " + _mountpoint.toLatin1()+ "@" + 308 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true); 308 309 _sOpenTrial = 0; 309 310 _outSocket->setPeerVerifyName(_casterOutHost); 310 311 _outSocket->startClientEncryption(); 311 312 if (!_outSocket->waitForEncrypted(timeOut)) { 312 emit (newMessage("Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + "@"313 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + "@" 313 314 + _casterOutHost.toLatin1() + ":" 314 315 + QString("%1) ").arg(_casterOutPort).toLatin1() 315 + _outSocket->errorString().toLatin1() , true));316 + _outSocket->errorString().toLatin1()), true); 316 317 delete _outSocket; _outSocket = 0; 317 318 return; 318 319 } else { 319 emit (newMessage("Proxy: SSL handshake completed for " + _mountpoint.toLatin1() + "@" +320 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() , true));320 emit newLogRecord(t_logRecord::message(t_logRecord::info, "Proxy: SSL handshake completed for " + _mountpoint.toLatin1() + "@" + 321 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true); 321 322 } 322 323 } … … 347 348 delete _outSocket; _outSocket = 0; 348 349 int l = ans.indexOf("\r\n", 0); 349 emit (newMessage("Broadcaster: Connection broken for " + _mountpoint.toLatin1() + "@" +350 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Broadcaster: Connection broken for " + _mountpoint.toLatin1() + "@" + 350 351 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() + 351 ": " + ans.left(l) , true));352 } else { 353 emit (newMessage("Broadcaster: Connection opened for " + _mountpoint.toLatin1() + "@" +354 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() , true));352 ": " + ans.left(l)), true); 353 } else { 354 emit newLogRecord(t_logRecord::message(t_logRecord::info, "Broadcaster: Connection opened for " + _mountpoint.toLatin1() + "@" + 355 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true); 355 356 _sOpenTrial = 0; 356 357 } … … 364 365 _outSocket->connectToHostEncrypted(outHost, outPort); 365 366 if (!_outSocket->waitForEncrypted(timeOut)) { 366 emit(newMessage( 367 "Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@" 367 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@" 368 368 + outHost.toLatin1() + ":" 369 369 + QString("%1) ").arg(outPort).toLatin1() 370 + _outSocket->errorString().toLatin1() , true));370 + _outSocket->errorString().toLatin1()), true); 371 371 delete _outSocket; _outSocket = 0; 372 372 return false; 373 373 } else { 374 emit (newMessage("Broadcaster: SSL handshake completed for " + _mountpoint.toLatin1() + "@" +375 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() , true));374 emit newLogRecord(t_logRecord::message(t_logRecord::info, "Broadcaster: SSL handshake completed for " + _mountpoint.toLatin1() + "@" + 375 _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true); 376 376 } 377 377 } else { 378 378 _outSocket->connectToHost(outHost, outPort); 379 379 if (!_outSocket->waitForConnected(timeOut)) { 380 emit (newMessage("Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@"380 emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@" 381 381 + outHost.toLatin1() + ":" 382 382 + QString("%1) ").arg(outPort).toLatin1() 383 + _outSocket->errorString().toLatin1() , true));383 + _outSocket->errorString().toLatin1()), true); 384 384 delete _outSocket; _outSocket = 0; 385 385 return false; -
trunk/BNC/src/upload/bncuploadcaster.h
r11060 r11185 10 10 #include <QSslKey> 11 11 #include <iostream> 12 #include "bnclog.h" 12 13 13 14 … … 39 40 signals: 40 41 void newMessage(const QByteArray msg, bool showOnScreen); 42 void newLogRecord(t_logRecord rec, bool showOnScreen); 41 43 void newBytes(QByteArray staID, double nbyte); 42 44
Note:
See TracChangeset
for help on using the changeset viewer.
