Exemplo n.º 1
0
        public SimGPS(string name, SimConnector.simConnector connector)
            : base(name, "")
        {
            this.connector = connector;
            if (!values.ContainsKey("lbRMCPosition")) values.Add(new UAVParameter("lbRMCPosition",0, null, null));
            if (!values.ContainsKey("lbRMCPositionLongitude")) values.Add(new UAVParameter("lbRMCPositionLongitude", 0, null, null));
            if (!values.ContainsKey("lbRMCPositionLatitude")) values.Add(new UAVParameter("lbRMCPositionLatitude", 0, null, null));
            if (!values.ContainsKey("lbRMCPositionUTM")) values.Add(new UAVParameter("lbRMCPositionUTM", 0, null, null));
            if (!values.ContainsKey("lbRMCCourse")) values.Add(new UAVParameter("lbRMCCourse", 0, null, null));
            if (!values.ContainsKey("lbRMCSpeed")) values.Add(new UAVParameter("lbRMCSpeed", 0, null, null));
            if (!values.ContainsKey("lbRMCTimeOfFix")) values.Add(new UAVParameter("lbRMCTimeOfFix", 0, null, null));
            if (!values.ContainsKey("lbRMCMagneticVariation")) values.Add(new UAVParameter("lbRMCMagneticVariation", 0, null, null));
            if (!values.ContainsKey("lbGGAPosition")) values.Add(new UAVParameter("lbGGAPosition", 0, null, null));
            if (!values.ContainsKey("lbGGATimeOfFix")) values.Add(new UAVParameter("lbGGATimeOfFix", 0, null, null));
            if (!values.ContainsKey("lbGGAFixQuality")) values.Add(new UAVParameter("lbGGAFixQuality", 0, null, null));
            if (!values.ContainsKey("lbGGANoOfSats")) values.Add(new UAVParameter("lbGGANoOfSats", 0, null, null));
            if (!values.ContainsKey("lbGGAAltitude")) values.Add(new UAVParameter("lbGGAAltitude", 0, null, null));
            if (!values.ContainsKey("lbGGAAltitudeUnit")) values.Add(new UAVParameter("lbGGAAltitudeUnit", 0, null, null));

            if (!values.ContainsKey("lbGGAHDOP")) values.Add(new UAVParameter("lbGGAHDOP", 0, null, null));
            if (!values.ContainsKey("lbGGAGeoidHeight")) values.Add(new UAVParameter("lbGGAGeoidHeight", 0, null, null));
            if (!values.ContainsKey("lbGGADGPSupdate")) values.Add(new UAVParameter("lbGGADGPSupdate", 0, null, null));
            if (!values.ContainsKey("lbGGADGPSID")) values.Add(new UAVParameter("lbGGADGPSID", 0, null, null));
            if (!values.ContainsKey("lbGLLPosition")) values.Add(new UAVParameter("lbGLLPosition", 0, null, null));
            if (!values.ContainsKey("lbGLLTimeOfSolution")) values.Add(new UAVParameter("lbGLLTimeOfSolution", 0, null, null));
            if (!values.ContainsKey("lbGLLDataValid")) values.Add(new UAVParameter("lbGLLDataValid", 0, null, null));
            if (!values.ContainsKey("lbGSAMode")) values.Add(new UAVParameter("lbGSAMode", 0, null, null));
            if (!values.ContainsKey("lbGLLPosition")) values.Add(new UAVParameter("lbGLLPosition", 0, null, null));
            if (!values.ContainsKey("lbGSAFixMode")) values.Add(new UAVParameter("lbGSAFixMode", 0, null, null));
            if (!values.ContainsKey("lbGSAPRNs")) values.Add(new UAVParameter("lbGSAPRNs", 0, null, null));
            if (!values.ContainsKey("lbGSAPDOP")) values.Add(new UAVParameter("lbGSAPDOP", 0, null, null));
            if (!values.ContainsKey("lbGSAHDOP")) values.Add(new UAVParameter("lbGSAHDOP", 0, null, null));
            if (!values.ContainsKey("lbGSAVDOP")) values.Add(new UAVParameter("lbGSAVDOP", 0, null, null));
            if (!values.ContainsKey("lbRMEHorError")) values.Add(new UAVParameter("lbRMEHorError", 0, null, null));
            if (!values.ContainsKey("lbRMEVerError")) values.Add(new UAVParameter("lbRMEVerError", 0, null, null));
            if (!values.ContainsKey("lbRMESphericalError")) values.Add(new UAVParameter("lbRMESphericalError", 0, null, null));
            if (!values.ContainsKey("lbRMEVerError")) values.Add(new UAVParameter("lbRMEVerError", 0, null, null));
            if (!values.ContainsKey("lbRMEVerError")) values.Add(new UAVParameter("lbRMEVerError", 0, null, null));

            connector.NewValues += new SimConnector.simConnector.NewValuesHandler(connector_NewValues);
            /*
              uavData.Add("course",new UAVParameter("course",0));
              */
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds a new PWM Object
        /// </summary>
        /// <param name="servoname">Name of the Object to use with uavdata["Name of Object"]</param>
        /// <param name="servovalue">the Value to set on Initialisation</param>
        /// <param name="device">The Hardware Device to use</param>
        /// <param name="Channelnr">The Channel Number from 0 to x</param>
        public SimPWM(string servoname, int servovalue, string device, Byte Channelnr,SimConnector.simConnector connector)
            : base(servoname, "")
        {
            this.connector = connector;
            values.Add(new UAVParameter("LowLimit", 1000, 1000, 2000));
            values.Add(new UAVParameter("HighLimit", 2000, 1000, 2000));
            values.Add(new UAVParameter("Neutral", 1500, 1000, 2000));
            values.Add(new UAVParameter("Invert", 0, 0, 1));
            values.Add(new UAVParameter("Value", 1000, 1000, 2000));

            values["LowLimit"].ValueChanged += new UAVSingleParameter.ValueChangedHandler(PWM_ValueChanged);
            values["HighLimit"].ValueChanged += new UAVSingleParameter.ValueChangedHandler(PWM_ValueChanged);
            values["Neutral"].ValueChanged += new UAVSingleParameter.ValueChangedHandler(PWM_ValueChanged);
            values["Invert"].ValueChanged += new UAVSingleParameter.ValueChangedHandler(PWM_ValueChanged);

            //this.Value = servovalue;
            channel = Channelnr;
            this.device = device;
            this.Min = 1000;
            this.Max = 2000;
        }
Exemplo n.º 3
0
        public SimAHRS(string name,SimConnector.simConnector connector)
            : base(name, "")
        {
            this.connector = connector;
            values.Add(new UAVParameter("phi", 0,-180,180, 0));
            values.Add(new UAVParameter("theta", 0180, 0, -180));
            values.Add(new UAVParameter("psi", 0180, 0, -180));

            values.Add(new UAVParameter("accx", 0, -1000, 1000, 0));
            values.Add(new UAVParameter("accy", 0, -1000, 1000, 0));
            values.Add(new UAVParameter("accz", 0, -1000, 1000, 0));

            values.Add(new UAVParameter("magx", 0, -1000, 1000, 0));
            values.Add(new UAVParameter("magy", 0, -1000, 1000, 0));
            values.Add(new UAVParameter("magz", 0, -1000, 1000, 0));

            values.Add(new UAVParameter("gyrogammastrich", 0, -1000, 1000, 0));
            values.Add(new UAVParameter("gyrbetastrich", 0, -1000, 1000, 0));
            values.Add(new UAVParameter("gyralphastrich", 0, -1000, 1000, 0));

            connector.NewValues += new SimConnector.simConnector.NewValuesHandler(connector_NewValues);
        }
Exemplo n.º 4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, SimConnector simconnector, IHostApplicationLifetime lifetime)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            simconnector.Connect();

            app.UseStaticFiles();
            app.UseRouting();

            lifetime.ApplicationStopping.Register(() =>
            {
                MessageWindow.GetWindow().Dispose();
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapDefaultControllerRoute();
                endpoints.MapHub <WebSocketConnector>("/ws");
            });
        }