[feat] 增加RTCM双频信号强度

详细描述

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
xu 2024-06-24 15:37:19 +08:00
parent 77afef5ee1
commit 7402ace3f8
3 changed files with 133 additions and 8 deletions

View File

@ -42,6 +42,23 @@ namespace Plane.FormationCreator.Formation
// rtcm发送类型0:直接发送, // rtcm发送类型0:直接发送,
// 11秒只发一种卫星1秒发GPS,第2秒发北斗第3秒发格洛纳斯其他数据随来随发 // 11秒只发一种卫星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; private int _resendtocom = 1;
const int MSG_GPS = 1074; const int MSG_GPS = 1074;
const int MSG_GLONASS = 1084; const int MSG_GLONASS = 1084;
@ -49,6 +66,7 @@ namespace Plane.FormationCreator.Formation
const int MSG_BasePos = 1005; const int MSG_BasePos = 1005;
const int MSG_REV = 1033; const int MSG_REV = 1033;
const int MSG_GLONASS_PHASE = 1230; const int MSG_GLONASS_PHASE = 1230;
const int MSG_GALILEO = 1094;
public string rtcm_typename(int msgtype) public string rtcm_typename(int msgtype)
@ -57,16 +75,16 @@ namespace Plane.FormationCreator.Formation
switch (msgtype) switch (msgtype)
{ {
case MSG_GPS: case MSG_GPS:
typename = "GPS"; typename = "GPS(G)";
break; break;
case MSG_GLONASS: case MSG_GLONASS:
typename = "GLONASS"; typename = "GLONASS(R)";
break; break;
case MSG_GLONASS_PHASE: case MSG_GLONASS_PHASE:
typename = "GLONASS相位差"; typename = "GLONASS相位差";
break; break;
case MSG_Beidou: case MSG_Beidou:
typename = "北斗"; typename = "北斗(B)";
break; break;
//位置5秒发一次就可以了 //位置5秒发一次就可以了
case MSG_BasePos: case MSG_BasePos:
@ -75,6 +93,9 @@ namespace Plane.FormationCreator.Formation
case MSG_REV: //这个没必要发 case MSG_REV: //这个没必要发
typename = "版本"; typename = "版本";
break; break;
case MSG_GALILEO: //这个没必要发-移动端默认配置不收这个卫星
typename = "伽利略(E)";
break;
} }
return typename; return typename;
@ -259,6 +280,7 @@ namespace Plane.FormationCreator.Formation
partRtcmInfos[i].Sys = obs[i].sys; partRtcmInfos[i].Sys = obs[i].sys;
partRtcmInfos[i].Prn = obs[i].prn; partRtcmInfos[i].Prn = obs[i].prn;
partRtcmInfos[i].Snr = obs[i].snr; partRtcmInfos[i].Snr = obs[i].snr;
partRtcmInfos[i].Snr2 = obs[i].snr2;
} }
} }
@ -405,6 +427,8 @@ namespace Plane.FormationCreator.Formation
DateTime unow = DateTime.UtcNow; DateTime unow = DateTime.UtcNow;
long last_send_pos = CurrentTimeMillis()- 5000;//5秒发一次就可以了 long last_send_pos = CurrentTimeMillis()- 5000;//5秒发一次就可以了
bool Ensend = false; bool Ensend = false;
bool second_sended = false; //当前秒是否已发
int last_second = 0; //当前秒
//新版本打包发送模式 //新版本打包发送模式
//await _commModuleManager.StartRtcmLoop(); //await _commModuleManager.StartRtcmLoop();
Plane.Windows.Messages.Message.Show("RTCM发送开始............"); Plane.Windows.Messages.Message.Show("RTCM发送开始............");
@ -462,6 +486,7 @@ namespace Plane.FormationCreator.Formation
ubx_m8p.resetParser(); ubx_m8p.resetParser();
nmea.resetParser(); nmea.resetParser();
string msgshowname = rtcm_typename(seenmsg); string msgshowname = rtcm_typename(seenmsg);
//Plane.Windows.Messages.Message.Show("--收到[" + seenmsg + "]:"+ msgshowname+" ,长度:"+ rtcm.length);
//广播数据直接发送不受小带宽数据选项影响 //广播数据直接发送不受小带宽数据选项影响
if (_enrecom) if (_enrecom)
{ {
@ -489,6 +514,69 @@ namespace Plane.FormationCreator.Formation
//1秒内可能发送多个同一种类型的数据看数据大小和原始频率 //1秒内可能发送多个同一种类型的数据看数据大小和原始频率
long curr_s = CurrentTimeMillis() / 1000; long curr_s = CurrentTimeMillis() / 1000;
int sendtype = (int)(curr_s % 3); 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) switch (seenmsg)
{ {
case MSG_GPS: case MSG_GPS:
@ -523,6 +611,7 @@ namespace Plane.FormationCreator.Formation
Ensend = true; Ensend = true;
break; break;
} }
*/
if (Ensend) if (Ensend)
{ {
//Console.WriteLine(DateTime.UtcNow.ToString("HH:mm:ss") + "--通讯模块发送Rtcm长度: " + (ushort)rtcm.length + " 类型: " + msgshowname + " (" + seenmsg + ")"); //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 char sys;
private byte prn; private byte prn;
private byte snr; private byte snr;
private byte snr2;
public RtcmInfo() public RtcmInfo()
{ {
@ -711,5 +801,10 @@ namespace Plane.FormationCreator.Formation
get { return snr; } get { return snr; }
set { Set(nameof(Snr), ref snr, value); } set { Set(nameof(Snr), ref snr, value); }
} }
public byte Snr2
{
get { return snr2; }
set { Set(nameof(Snr2), ref snr2, value); }
}
} }
} }

View File

@ -1021,6 +1021,7 @@ namespace Plane.Util
public byte prn; public byte prn;
public rawrtcm raw = new rawrtcm(); public rawrtcm raw = new rawrtcm();
public byte snr; public byte snr;
public byte snr2;
public double tow; public double tow;
public int week; public int week;
public char sys; public char sys;
@ -1208,6 +1209,7 @@ namespace Plane.Util
{ {
ob.pr2 = r[j] + pr[cellmaskused]; ob.pr2 = r[j] + pr[cellmaskused];
ob.cp2 = (r[j] + cp[cellmaskused]); ob.cp2 = (r[j] + cp[cellmaskused]);
ob.snr2 = (byte)(cnr[cellmaskused]);
} }
else if (sigs[k] >= 24 && sigs[k] <= 26) else if (sigs[k] >= 24 && sigs[k] <= 26)
{ {

View File

@ -57,9 +57,22 @@
<StackPanel Margin="5" Orientation="Horizontal"> <StackPanel Margin="5" Orientation="Horizontal">
<TextBlock Text="消息: "/> <TextBlock Text="消息: "/>
<TextBlock Text="{Binding RtcmManager.Messages_seen}" <TextBlock Text="{Binding RtcmManager.Messages_seen}"/>
/>
</StackPanel> </StackPanel>
<StackPanel Margin="0" Orientation="Horizontal">
<TextBlock Margin="5" Text="L1信号强度"/>
<Rectangle Margin="0,0,15,0" Width="20" Height="20" Fill="#3EBE55"/>
<TextBlock Margin="5" Text="L2信号强度"/>
<Rectangle Margin="0,0,15,0" Width="20" Height="20" Fill="#ACACEC"/>
<TextBlock Margin="5" Text="L1/L2重合"/>
<Rectangle Margin="0,0,15,0" Width="20" Height="20" Fill="#04845C"/>
</StackPanel>
</StackPanel> </StackPanel>
@ -116,13 +129,28 @@
Minimum="25" Minimum="25"
Maximum="55" Maximum="55"
Grid.RowSpan="2" Grid.RowSpan="2"
Value="{Binding Snr, UpdateSourceTrigger=PropertyChanged}"/> Value="{Binding Snr, UpdateSourceTrigger=PropertyChanged}"
<StackPanel Orientation ="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
/>
<ProgressBar x:Name="BarSnr2"
Margin="0.5"
Orientation="Vertical"
Minimum="25"
Maximum="55"
Grid.RowSpan="2"
Foreground="Blue"
Value="{Binding Snr2, UpdateSourceTrigger=PropertyChanged}"
Opacity="0.25"
/>
<StackPanel Orientation ="Vertical" VerticalAlignment="Top" HorizontalAlignment="Center">
<StackPanel Orientation ="Horizontal"> <StackPanel Orientation ="Horizontal">
<TextBlock Text="{Binding Sys,UpdateSourceTrigger=PropertyChanged}" Foreground="Black"></TextBlock> <TextBlock Text="{Binding Sys,UpdateSourceTrigger=PropertyChanged}" Foreground="Black"></TextBlock>
<TextBlock Text="{Binding Prn,UpdateSourceTrigger=PropertyChanged}" Foreground="Black"></TextBlock> <TextBlock Text="{Binding Prn,UpdateSourceTrigger=PropertyChanged}" Foreground="Black"></TextBlock>
</StackPanel> </StackPanel>
<TextBlock Margin="0,20,0,0" Text="{Binding Snr,UpdateSourceTrigger=PropertyChanged}" Foreground="Black"></TextBlock> <TextBlock Margin="0,5,0,0" Text="{Binding Snr,UpdateSourceTrigger=PropertyChanged}" Foreground="Black"></TextBlock>
<TextBlock Margin="0,5,0,0" Text="{Binding Snr2,UpdateSourceTrigger=PropertyChanged}" Foreground="Blue" ></TextBlock>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Orientation ="Vertical" HorizontalAlignment="Center"> <StackPanel Grid.Row="1" Orientation ="Vertical" HorizontalAlignment="Center">
<Line Stroke="Red" X2="1000" StrokeThickness="3" /> <Line Stroke="Red" X2="1000" StrokeThickness="3" />