diff --git a/Plane.FormationCreator/Formation/RtcmManager.cs b/Plane.FormationCreator/Formation/RtcmManager.cs
index 9e77822..caccdc1 100644
--- a/Plane.FormationCreator/Formation/RtcmManager.cs
+++ b/Plane.FormationCreator/Formation/RtcmManager.cs
@@ -42,6 +42,23 @@ namespace Plane.FormationCreator.Formation
// rtcm发送类型0:直接发送,
// 1:1秒只发一种卫星,1秒发GPS,第2秒发北斗,第3秒发格洛纳斯,其他数据随来随发
+ /*
+ //F9P作为基站默认推荐的消息
+ RTCM 1005 固定 RTK 参考站 ARP
+ RTCM 1074 GPS MSM4
+ RTCM 1084 格洛纳斯 MSM4
+ RTCM 1094 伽利略 MSM4
+ RTCM 1124 北⽃ MSM4
+ RTCM 1230 GLONASS 码相偏差
+
+ RTCM 3.3 校正流的配置必须遵循以下指导:
+ • 所有观察消息必须以相同的速率⼴播。
+ • RTCM 3.3 校正流必须包含GLONASS 码相偏差消息(RTCM 1230) 或接收器天线描述消息(RTCM 1033),否则即使在RTK 固定模式下,GLONASS 模糊度也只能估计为浮动值。
+ • 静态参考站消息(RTCM 1005 或 RTCM 1006)不需要以与观测消息相同的速率⼴播,但是,流动站在收到有效参考站消息之前将⽆法计算其位置。
+ • 每个星座校正流应仅包含⼀种类型的观测消息。当使⽤多星座配置时,所有星座应使⽤相同类型的观测消息。混合 MSM4 和 MSM7 消息可能会导致多消息位设置不正确。
+ • 如果接收器配置为在多个端⼝上输出RTCM 消息,则它们必须全部具有相同的RTCM 配置,否则,MSM 多消息位可能⽆法正确设置。
+ */
+
private int _resendtocom = 1;
const int MSG_GPS = 1074;
const int MSG_GLONASS = 1084;
@@ -49,6 +66,7 @@ namespace Plane.FormationCreator.Formation
const int MSG_BasePos = 1005;
const int MSG_REV = 1033;
const int MSG_GLONASS_PHASE = 1230;
+ const int MSG_GALILEO = 1094;
public string rtcm_typename(int msgtype)
@@ -57,16 +75,16 @@ namespace Plane.FormationCreator.Formation
switch (msgtype)
{
case MSG_GPS:
- typename = "GPS";
+ typename = "GPS(G)";
break;
case MSG_GLONASS:
- typename = "GLONASS";
+ typename = "GLONASS(R)";
break;
case MSG_GLONASS_PHASE:
typename = "GLONASS相位差";
break;
case MSG_Beidou:
- typename = "北斗";
+ typename = "北斗(B)";
break;
//位置5秒发一次就可以了
case MSG_BasePos:
@@ -75,6 +93,9 @@ namespace Plane.FormationCreator.Formation
case MSG_REV: //这个没必要发
typename = "版本";
break;
+ case MSG_GALILEO: //这个没必要发-移动端默认配置不收这个卫星
+ typename = "伽利略(E)";
+ break;
}
return typename;
@@ -259,6 +280,7 @@ namespace Plane.FormationCreator.Formation
partRtcmInfos[i].Sys = obs[i].sys;
partRtcmInfos[i].Prn = obs[i].prn;
partRtcmInfos[i].Snr = obs[i].snr;
+ partRtcmInfos[i].Snr2 = obs[i].snr2;
}
}
@@ -405,6 +427,8 @@ namespace Plane.FormationCreator.Formation
DateTime unow = DateTime.UtcNow;
long last_send_pos = CurrentTimeMillis()- 5000;//5秒发一次就可以了
bool Ensend = false;
+ bool second_sended = false; //当前秒是否已发
+ int last_second = 0; //当前秒
//新版本打包发送模式
//await _commModuleManager.StartRtcmLoop();
Plane.Windows.Messages.Message.Show("RTCM发送开始............");
@@ -462,6 +486,7 @@ namespace Plane.FormationCreator.Formation
ubx_m8p.resetParser();
nmea.resetParser();
string msgshowname = rtcm_typename(seenmsg);
+ //Plane.Windows.Messages.Message.Show("--收到[" + seenmsg + "]:"+ msgshowname+" ,长度:"+ rtcm.length);
//广播数据直接发送不受小带宽数据选项影响
if (_enrecom)
{
@@ -489,6 +514,69 @@ namespace Plane.FormationCreator.Formation
//1秒内可能发送多个同一种类型的数据,看数据大小和原始频率
long curr_s = CurrentTimeMillis() / 1000;
int sendtype = (int)(curr_s % 3);
+ if (last_second!= sendtype) //新一秒
+ {
+ second_sended = false; //设置未发送
+ last_second = sendtype; //设置秒数
+ }
+ //这些类型数据需要分秒发或者不发(MSG_REV)
+ if ((seenmsg == MSG_GPS) ||
+ //(seenmsg == MSG_GLONASS) ||
+ //(seenmsg == MSG_GLONASS_PHASE) ||
+ (seenmsg == MSG_Beidou) ||
+ (seenmsg == MSG_BasePos)
+ )
+ {
+ switch (sendtype)
+ {
+ case 0: //第1秒只发GPS
+ if ((!second_sended) && (seenmsg == MSG_GPS))
+ {
+ second_sended = true;
+ Ensend = true;
+ // Plane.Windows.Messages.Message.Show("发送GPS:" + rtcm.length+"字节");
+ }
+
+ break;
+ case 1://第2秒只发GLONASS,
+ if ((!second_sended) && ((seenmsg == MSG_GLONASS)))// || (MSG_GPS == MSG_GLONASS_PHASE)))
+ {
+ second_sended = true;
+ Ensend = true;
+ // Plane.Windows.Messages.Message.Show("发送GLONASS:" + rtcm.length + "字节");
+ }
+ break;
+ case 2://空白
+ if ((!second_sended) && ((seenmsg == MSG_Beidou)))
+ {
+ second_sended = true;
+ Ensend = true;
+ //Plane.Windows.Messages.Message.Show("发送北斗:" + rtcm.length + "字节");
+ }
+ break;
+ /*
+ case 3://第4秒是 Beidou
+ if ((!second_sended) && ((seenmsg == MSG_Beidou)))
+ {
+ second_sended = true;
+ Ensend = true;
+ //Plane.Windows.Messages.Message.Show("发送北斗:" + rtcm.length + "字节");
+ }
+ break;
+ */
+
+ }
+ if ((seenmsg == MSG_BasePos))////这些直接发
+ {
+ Ensend = true;
+ //Plane.Windows.Messages.Message.Show("发送位置:" + rtcm.length + "字节");
+ }
+
+ }
+ //else Ensend = true; ////其他类型数据不发
+ /*
+
+
switch (seenmsg)
{
case MSG_GPS:
@@ -523,6 +611,7 @@ namespace Plane.FormationCreator.Formation
Ensend = true;
break;
}
+ */
if (Ensend)
{
//Console.WriteLine(DateTime.UtcNow.ToString("HH:mm:ss") + "--通讯模块发送Rtcm长度: " + (ushort)rtcm.length + " 类型: " + msgshowname + " (" + seenmsg + ")");
@@ -688,6 +777,7 @@ namespace Plane.FormationCreator.Formation
private char sys;
private byte prn;
private byte snr;
+ private byte snr2;
public RtcmInfo()
{
@@ -711,5 +801,10 @@ namespace Plane.FormationCreator.Formation
get { return snr; }
set { Set(nameof(Snr), ref snr, value); }
}
+ public byte Snr2
+ {
+ get { return snr2; }
+ set { Set(nameof(Snr2), ref snr2, value); }
+ }
}
}
diff --git a/Plane.FormationCreator/Util/rtcm3.cs b/Plane.FormationCreator/Util/rtcm3.cs
index 9b91e50..19fb8da 100644
--- a/Plane.FormationCreator/Util/rtcm3.cs
+++ b/Plane.FormationCreator/Util/rtcm3.cs
@@ -1021,6 +1021,7 @@ namespace Plane.Util
public byte prn;
public rawrtcm raw = new rawrtcm();
public byte snr;
+ public byte snr2;
public double tow;
public int week;
public char sys;
@@ -1208,6 +1209,7 @@ namespace Plane.Util
{
ob.pr2 = r[j] + pr[cellmaskused];
ob.cp2 = (r[j] + cp[cellmaskused]);
+ ob.snr2 = (byte)(cnr[cellmaskused]);
}
else if (sigs[k] >= 24 && sigs[k] <= 26)
{
diff --git a/Plane.FormationCreator/Views/RtcmInfoView.xaml b/Plane.FormationCreator/Views/RtcmInfoView.xaml
index 35b8151..90b87be 100644
--- a/Plane.FormationCreator/Views/RtcmInfoView.xaml
+++ b/Plane.FormationCreator/Views/RtcmInfoView.xaml
@@ -57,9 +57,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -116,13 +129,28 @@
Minimum="25"
Maximum="55"
Grid.RowSpan="2"
- Value="{Binding Snr, UpdateSourceTrigger=PropertyChanged}"/>
-
+ Value="{Binding Snr, UpdateSourceTrigger=PropertyChanged}"
+
+ />
+
+
+
-
+
+