MP地面站二次开发教程MP的框架与修改(一)

MP高级功能

 

高级功能,完成图传,Follow ME功能,地面站take off,在temp.cs窗体里面。要实现VLC的视频直播功能要安装vlc-3.0.2-win64。

主界面基本修改

 

在missionplanner项目下双击MainV2.cs这个主窗体类,可以看到主窗体设计选项

1、菜单名称背景修改

 

2、主窗体语言修改
这个设计界面,我们可以修改主窗体的一些菜单名字,修改这个窗体控件我们可以修改窗体语言,窗体图标。点击具体的窗体上面的控件,我们还可以修改对应控件的名称。

 


3、主要窗体目录位置

 

界面的几个主要的窗体的项目目录

4、菜单栏删除

 


5、入口函数

 

6、参数配置函数

 


代码运行流程及其主要类

1入口函数Program(完成基本控件的初始化)
2创建Splash启动窗体并且启动
3实例化MainV2主窗体(public MainV2()这个构造函数,初始化类和控件,实例化FlightData()和FlightPlanner()类。
4创建 MainSwitcher窗体切换类
5窗体显示,通过 MainSwitcher,ShowScreen的事件完成窗体切换操作。
定制修改步骤
1、主题环境修改
在MissionPlanner-MissionPlanner1.3.49\Utilities\ThemeManager.cs 这个类里面是主题颜色修改的类,我们可以通过这个类的修改,把MP的主题背景修改了,达到更换颜色风格的目的。主要的界面颜色配置函数

 

 

 

BGColor = Color.FromArgb(0x26, 0x27, 0x28); // This changes the colour of the main menu background
ControlBGColor = Color.FromArgb(0x43, 0x44, 0x45); // This changes the colour of the sub menu backgrounds
TextColor = Color.White; // This changes the colour of text
BGColorTextBox = Color.FromArgb(0x43, 0x44, 0x45); // This changes the colour of the background of textboxes

ButtonTextColor = Color.FromArgb(64, 87, 4); // This changes the colour of button text

ButBG = Color.FromArgb(148, 193, 31); // This changes the colour of button backgrounds (Top)

ButBGBot = Color.FromArgb(205, 226, 150); // This changes the colour of button backgrounds (Bot)

ProgressBarColorTop = Color.FromArgb(102, 139, 26); // These three variables change the colours of progress bars

ProgressBarColorBot = Color.FromArgb(124, 164, 40);

ProgressBarOutlineColor = Color.FromArgb(150, 174, 112);

BannerColor1 = Color.FromArgb(0x40, 0x57, 0x04); // These two variables change the colours of banners such as "planner" umder configuration

BannerColor2 = Color.FromArgb(0x94, 0xC1, 0x1F);

ColorNotEnabled = Color.FromArgb(150, 43, 58, 3); // This changes the background color of buttons when not enabled

ColorMouseOver = Color.FromArgb(73, 43, 58, 3); // This changes the background color of buttons when the mouse is hovering over a button

ColorMouseDown = Color.FromArgb(73, 43, 58, 3); // This changes the background color of buttons when the mouse is clicked down on a button

CurrentPPMBackground = Color.Green; // This changes the background colour of the current PPM setting in the flight modes tab

ZedGraphChartFill = Color.FromArgb(0x1F, 0x1F, 0x20); // These three variables change the fill colours of Zed Graphs

ZedGraphPaneFill = Color.FromArgb(0x37, 0x37, 0x38);

ZedGraphLegendFill = Color.FromArgb(0x85, 0x84, 0x83);

RTBForeColor = Color.WhiteSmoke; // This changes the colour of text in rich text boxes

BSVButtonAreaBGColor = Color.Black; // This changes the colour of a backstageview button area

UnselectedTextColour = Color.WhiteSmoke; // This changes the colour of unselected text in a BSV button

HorizontalPBValueColor = Color.FromArgb(148, 193, 31); // This changes the colour of the horizontal progressbar


2、菜单精简(去掉冗余菜单按键)
注意观察编译报错,把对应的报错注释掉即可。

3、功能按键添加(新建按钮实现解锁,前后左右功能键的实现),在无人车上做演示效果
这个是涉及地面站控制飞控系统,要注意的是Ardupilot的控制系统中,遥控器控制和地面站数传链路控制,不能同时存在。一旦启动了地面站控制,遥控器链路是被直接切断的。同一时刻,要不然地面站控制,要不然遥控器控制。

1HUD界面修改添加自定义按键(注意VS的BUG)
2MAVLINK协议的指令发送的初步理解
3控制系统的参数配置,来适应于地面站控制控制系统的要求

 


在飞行数据子窗体添加功能按钮,分别对应遥控器的横滚和油门(试用于无人车),四轴无人机的功能类似,可以根据意义来修改。

 

posted @ 2024-12-24 11:31  Mr.石  阅读(815)  评论(0)    收藏  举报