• 大小: 31.11MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-03
  • 语言: 其他
  • 标签: 地面站  

资源简介

MissionPlanner地面站源代码,可以直接编译 可以自己编译

资源截图

代码片段和文件信息

using System;
using System.Text;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.CodeDom;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
using System.Reflection;
using System.IO;
using System.Text.Regularexpressions;

namespace MissionPlanner
{
    static class CodeGen
    {
        public static object runCode(string code)
        {
            object answer = null;

            GetMathMemberNames();

            // change evaluation string to pick up Math class members
            string expression = RefineEvaluationString(code);

            // build the class using codedom
            BuildClass(expression);

            // compile the class into an in-memory assembly.
            // if it doesn‘t compile show errors in the window
            CompilerResults results = CompileAssembly();

            Console.WriteLine(“...........................\r\n“);
            Console.WriteLine(_source.ToString());

            // if the code compiled okay
            // run the code using the new assembly (which is inside the results)
            if (results != null && results.CompiledAssembly != null)
            {
                // run the evaluation function
                answer = RunCode(results);
            }
            else
            {
            }

            return answer;
        }

        public static CodeDomProvider CreateCompiler()
        {
            //Create an instance of the C# compiler   
            CodeDomProvider codeProvider = CodeDomProvider.CreateProvider(“CSharp“);
            //ICodeCompiler compiler = codeProvider.CreateCompiler();
            return codeProvider;
        }

        /// 
        /// Creawte parameters for compiling
        /// 

        /// 
        public static CompilerParameters CreateCompilerParameters()
        {
            //add compiler parameters and assembly references
            CompilerParameters compilerParams = new CompilerParameters();
            compilerParams.CompilerOptions = “/target:library /optimize“;
            compilerParams.GenerateExecutable = false;
            compilerParams.GenerateInMemory = true;
            compilerParams.IncludeDebugInformation = false;
            compilerParams.ReferencedAssemblies.Add(“mscorlib.dll“);
            compilerParams.ReferencedAssemblies.Add(“System.dll“);
            compilerParams.ReferencedAssemblies.Add(“System.Windows.Forms.dll“);
            compilerParams.ReferencedAssemblies.Add(Application.ExecutablePath);
            compilerParams.ReferencedAssemblies.Add(“MAVlink.dll“);

            compilerParams.ReferencedAssemblies.Add(““);

            //add any aditional references needed
            //            foreach (string refAssembly in code.References)
            //              compilerParams.ReferencedAssemblies.Add(refAssembly);

            return compilerParams;
        }

        /// <

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-05 23:17  MissionPlanner-master\
     目录           0  2017-12-05 23:17  MissionPlanner-master\.github\
     文件         466  2017-12-05 23:17  MissionPlanner-master\.github\ISSUE_TEMPLATE.md
     文件        1304  2017-12-05 23:17  MissionPlanner-master\.gitignore
     目录           0  2017-12-05 23:17  MissionPlanner-master\.nuget\
     文件         169  2017-12-05 23:17  MissionPlanner-master\.nuget\NuGet.Config
     文件     5010552  2017-12-05 23:17  MissionPlanner-master\.nuget\NuGet.exe
     文件        7484  2017-12-05 23:17  MissionPlanner-master\.nuget\NuGet.targets
     目录           0  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\
     文件           6  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\.gitignore
     文件         903  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes.sln
     目录           0  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\
     文件        6965  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\APMPlannerXplanes.cpp
     文件         177  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\APMPlannerXplanes.h
     文件        4804  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\APMPlannerXplanes.vcxproj
     文件        1427  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\APMPlannerXplanes.vcxproj.filters
     文件        2102  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\AircraftUtils.cpp
     文件         590  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\AircraftUtils.h
     文件        1308  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\AssemblyInfo.cpp
     文件        1600  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\ReadMe.txt
     文件          88  2017-12-05 23:17  MissionPlanner-master\APMPlannerXplanes\APMPlannerXplanes\resource.h
     文件       97792  2017-12-05 23:17  MissionPlanner-master\AdbWinApi.dll
     文件      303538  2017-12-05 23:17  MissionPlanner-master\AeroSimRCAPMHil.zip
     目录           0  2017-12-05 23:17  MissionPlanner-master\Antenna\
     文件        4980  2017-12-05 23:17  MissionPlanner-master\Antenna\ArduTracker.cs
     文件        3481  2017-12-05 23:17  MissionPlanner-master\Antenna\DegreeTracker.cs
     文件        1066  2017-12-05 23:17  MissionPlanner-master\Antenna\ITrackerOutput.cs
     文件        7300  2017-12-05 23:17  MissionPlanner-master\Antenna\Maestro.cs
     文件       18585  2017-12-05 23:17  MissionPlanner-master\Antenna\Tracker.Designer.cs
     文件        7369  2017-12-05 23:17  MissionPlanner-master\Antenna\Tracker.ar.resx
     文件        7767  2017-12-05 23:17  MissionPlanner-master\Antenna\Tracker.az-Latn-AZ.resx
............此处省略3552个文件信息

评论

共有 条评论