public bool Open(Uri.Locator name) { bool result = false; if (name.Scheme == "sensoray") { int device = 0; int stream = 0; if (name.Authority.NotNull() && name.Authority.Endpoint.Host.NotNull() && name.Authority.Endpoint.Host.Head.NotEmpty()) { if (name.Authority.Endpoint.Host.Tail.NotNull() && name.Authority.Endpoint.Host.Tail.Head.NotEmpty()) { if (!(int.TryParse(name.Authority.Endpoint.Host.Head, out device))) { device = 0; } if (!(int.TryParse(name.Authority.Endpoint.Host.Tail.Head, out stream))) { stream = 0; } } else if (!(int.TryParse(name.Authority.Endpoint.Host.Head, out stream))) { stream = 0; } } string system = name.Query["system"]; this.videoSystem = name.Query.GetEnumeration <VideoSystem>("system", VideoSystem.Pal); this.device = Device.Open(device, this.videoSystem); this.device.Deinterlace = name.Query.NotFalse("deinterlace"); this.size = (Geometry2D.Integer.Size)name.Query["size"]; if (this.size.IsNull() || this.size.Area <= 0) { this.size = this.device.NativeSize; } this.stream = this.device[stream]; string record = null; if ((record = name.Query["record"]).NotEmpty()) { result = this.stream.Start(this.size, name.Query.GetEnumeration <Encoding>("encoding", Encoding.H264), name.Query.Get("bitrate", 2500), record); } else { result = this.stream.Start(this.size, image => this.Send(0, DateTime.Now, TimeSpan.FromSeconds(this.videoSystem == VideoSystem.Ntsc ? 1 / 30.0f : 1 / 25.0f), image.Convert <Raster.Yuv422>(), null)); string video = null; if (result && (video = name.Query["video"]).NotEmpty()) { this.recordStream = this.device[(stream + 1) % 2]; this.recordStream.Start(this.size, name.Query.GetEnumeration <Encoding>("encoding", Encoding.H264), name.Query.Get("bitrate", 2500), new Uri.Locator("file", video)); } } this.Status = result ? Status.Playing : Status.Closed; } return(result); }
/// <inheritdoc /> protected override void OnSystemAdd() { var videoSystem = Services.GetService <VideoSystem>(); if (videoSystem == null) { videoSystem = new VideoSystem(Services); Services.AddService(videoSystem); var gameSystems = Services.GetSafeServiceAs <IGameSystemCollection>(); gameSystems.Add(videoSystem); } }
public static Device Open(int device, VideoSystem videoSystem) { Device result = null; Binding.Device backend = Binding.Board.Open()[device]; if (backend.NotNull()) { backend.VideoSystem = videoSystem; result = new Device(backend); } return(result); }
public void EnterWorld(int mapID) { Ect = new EffectSystem(); Fly = new FlywordSystem(); Hud = new HUDSystem(); Act = new ActSystem(); Nts = new NodeTreeSystem(); Plt = new PlotSystem(); Cut = new VideoSystem(); WorldMap = new GameObject("FTWorldMap").AddComponent <FTWorldMap>(); WorldMap.MapLoadFinish = OnLoadMapFinished; WorldMap.EnterWorld(mapID); }
public void EnterWorld(int mapID) { Lvl = GameObject.FindObjectOfType <LevelSystem>(); if (Lvl == null) { GameObject go = new GameObject("LevelSystem"); Lvl = go.AddComponent <LevelSystem>(); } else { Lvl.DelAllElements(); } CharacterManager.Instance.SetRoot(Lvl.transform); Ect = new EffectSystem(); Fly = new FlywordSystem(); Hud = new HUDSystem(); Act = new ActSystem(); Nts = new NodeTreeSystem(); Plt = new PlotSystem(); Cut = new VideoSystem(); Lvl.Id = mapID; Lvl.Startup(); }
public Scene(MenuSystem menuSystem, TextSection textSection, SpriteManager spriteManager, AnimationManager animationManager, SoundManager soundManager, FontMap fontMap) { m_endTime = textSection.GetAttribute <int>("end.time"); var clearColor = textSection.GetAttribute("clearcolor", (Vector3?)null); if (clearColor.HasValue) { ClearColor = new Color(clearColor.Value); } Position = textSection.GetAttribute("layerall.pos", (Vector2?)null); var collection = new Collection(spriteManager, animationManager, soundManager, fontMap); m_videoSystem = menuSystem.GetSubSystem <VideoSystem>(); m_spriteBatch = new SpriteBatch(m_videoSystem.Device); m_fader = new Fader(m_videoSystem.EmptyTexture, textSection); m_layers = new Layer[10]; for (var i = 0; i < m_layers.Length; i++) { m_layers[i] = new Layer(); var prefix = $"layer{i}"; if (textSection.HasAttribute($"{prefix}.starttime")) { m_layers[i].StartTime = textSection.GetAttribute <int>($"{prefix}.starttime"); } if (textSection.HasAttribute($"{prefix}.anim")) { m_layers[i].AnimatedImage = (AnimatedImage)collection.Build(textSection, prefix); } if (textSection.HasAttribute($"{prefix}.offset")) { m_layers[i].Offset = textSection.GetAttribute <Vector2>($"{prefix}.offset"); } } }
public void FromRegistry() { RegistryKey key = Registry.CurrentUser.OpenSubKey(registryPath); if (key != null) { try { this.GoogleMapsCookie = (string)key.GetValue("GoogleMapsCookie"); this.HomeLon = float.Parse(key.GetValue("HomeLon").ToString(),CultureInfo.InvariantCulture); this.HomeLat = float.Parse(key.GetValue("HomeLat").ToString(), CultureInfo.InvariantCulture); this.HomeAlt = float.Parse(key.GetValue("HomeAlt").ToString(), CultureInfo.InvariantCulture); this.videoCaptureStr = (string)key.GetValue("VideoCaptureStr"); this.telemetria = (Telemetria)key.GetValue("Telemetry"); this.videosystem = (VideoSystem)key.GetValue("VideoSystem"); this.commPort = (string)key.GetValue("CommPort"); this.commBps = (int)key.GetValue("CommBauds"); this.CacheMapsPath = (string)key.GetValue("CacheMapsPath"); this.FlightLogPath = (string)key.GetValue("FlightLogPath"); this.cells1 = (int)key.GetValue("CellCount1"); this.cells2 = (int)key.GetValue("CellCount2"); this.moduloTX = (Singleton.ModuloControl)(int)key.GetValue("ModuloTX"); try { for (int i = 0; i < servo_ch.Length; i++) { this.servo_min[i] = (int)key.GetValue("ServoMin" + i); this.servo_center[i] = (int)key.GetValue("ServoCenter" + i); this.servo_max[i] = (int)key.GetValue("ServoMax" + i); this.servo_rev[i] = (int)key.GetValue("ServoRev" + i) == 1; this.servo_ch[i] = (byte)((int)key.GetValue("ServoCh" + i)); } for (int i = 0; i < 16; i++) { this.joy_buttons[i] = (byte)((int)key.GetValue("JoyButtom" + i)); } this.tipo_mezcla = (Mezclas)key.GetValue("TipoMezcla"); // this.tipo_control = (ModoControl)key.GetValue("TipoControl"); this.rev_mix = (int)key.GetValue("rev_mix") == 1; this.rev_flap = (int)key.GetValue("rev_flap") == 1; this.full_flap = float.Parse(key.GetValue("full_flap").ToString()); this.step_flap = float.Parse(key.GetValue("step_flap").ToString()); this.pantilt_speed = float.Parse(key.GetValue("pantilt_speed").ToString()); this.enable_axis = (int)key.GetValue("AXISenable") == 1; this.enable_pan = (int)key.GetValue("PANenable") == 1; this.enable_tilt = (int)key.GetValue("TILTenable") == 1; this.enable_headtrack = (int)key.GetValue("enable_headtrack") == 1; object pepe = key.GetValue("headtrack_panCh"); this.headtrack_panCh = (byte)((int)key.GetValue("headtrack_panCh")); this.headtrack_tiltCh = (byte)((int)key.GetValue("headtrack_tiltCh")); this.uplinkVmax = float.Parse(key.GetValue("uplinkVmax").ToString(), CultureInfo.InvariantCulture); this.uplinkVmin = float.Parse(key.GetValue("uplinkVmin").ToString(), CultureInfo.InvariantCulture); this.uplinkValarm = float.Parse(key.GetValue("uplinkValarm").ToString(), CultureInfo.InvariantCulture); this.uplinkLipo = (int)key.GetValue("uplinkLipo") == 1; this.uplinkNumCells = (int)key.GetValue("uplinkNumCells"); this.useEmisora = (int)key.GetValue("useEmisora") == 1; this.txNumCanales = (byte)((int)key.GetValue("txNumCanales")); ; this.txPeriodo = (int)key.GetValue("txPeriodo"); ; this.txSeparador = (int)key.GetValue("txSeparador"); this.txPolarity = (int)key.GetValue("txPolarity") == 1; } catch (Exception) { }; //Configuracion joystick try { this.Idioma = (int)key.GetValue("Language"); this.SistemaMetrico = (int)key.GetValue("SistemaMetrico"); } catch (Exception) { } this.NombrePiloto = key.GetValue("NombrePiloto").ToString(); this.portUDPinout = (int)key.GetValue("portUDPinout"); this.portWebServer = (int)key.GetValue("portWebServer"); this.enableWebServer = (int)key.GetValue("enableWebServer") == 1; this.enableUDPinout = (int)key.GetValue("enableUDPinout") == 1; try { this.AlarmAltitude_enabled = (int)key.GetValue("AlarmAltitude_enabled") == 1; this.AlarmAltitude = float.Parse(key.GetValue("AlarmAltitude").ToString(), CultureInfo.InvariantCulture); this.AlarmAscenso_enabled = (int)key.GetValue("AlarmAscenso_enabled") == 1; this.AlarmAscenso = float.Parse(key.GetValue("AlarmAscenso").ToString(), CultureInfo.InvariantCulture); this.AlarmCellVoltage_enabled = (int)key.GetValue("AlarmCellVoltage_enabled") == 1; this.AlarmCellVoltage = float.Parse(key.GetValue("AlarmCellVoltage").ToString(), CultureInfo.InvariantCulture); this.AlarmDistance_enabled = (int)key.GetValue("AlarmDistance_enabled") == 1; this.AlarmDistance = float.Parse(key.GetValue("AlarmDistance").ToString(), CultureInfo.InvariantCulture); this.AlarmFastDescentRate_enabled = (int)key.GetValue("AlarmFastDescentRate_enabled") == 1; this.AlarmFastDescentRate = float.Parse(key.GetValue("AlarmFastDescentRate").ToString(), CultureInfo.InvariantCulture); } catch (Exception) { }; try { this.enableAntTrack = (int)key.GetValue("enableAntTrack") == 1; this.enableCasaAntTrack = (int)key.GetValue("enaleCasaAntTrack")==1; } catch (Exception){}; try { for (int i = 0; i < asignaciones.Length; i++) { this.asignaciones[i] = (int)key.GetValue("TeclaAsignada" + i); } } catch (Exception) { }; try { // Uplink debug values this.uplink_pid_ail_P = float.Parse(key.GetValue("uplink_pid_ail_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_I = float.Parse(key.GetValue("uplink_pid_ail_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_D = float.Parse(key.GetValue("uplink_pid_ail_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_IL = float.Parse(key.GetValue("uplink_pid_ail_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_DL = float.Parse(key.GetValue("uplink_pid_ail_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_P = float.Parse(key.GetValue("uplink_pid_ele_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_I = float.Parse(key.GetValue("uplink_pid_ele_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_D = float.Parse(key.GetValue("uplink_pid_ele_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_IL = float.Parse(key.GetValue("uplink_pid_ele_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_DL = float.Parse(key.GetValue("uplink_pid_ele_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_P = float.Parse(key.GetValue("uplink_pid_thr_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_I = float.Parse(key.GetValue("uplink_pid_thr_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_D = float.Parse(key.GetValue("uplink_pid_thr_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_IL = float.Parse(key.GetValue("uplink_pid_thr_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_DL = float.Parse(key.GetValue("uplink_pid_thr_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_P = float.Parse(key.GetValue("uplink_pid_tail_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_I = float.Parse(key.GetValue("uplink_pid_tail_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_D = float.Parse(key.GetValue("uplink_pid_tail_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_IL = float.Parse(key.GetValue("uplink_pid_tail_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_DL = float.Parse(key.GetValue("uplink_pid_tail_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_offX = float.Parse(key.GetValue("uplink_IR_offX").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_offY = float.Parse(key.GetValue("uplink_IR_offY").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_gain = float.Parse(key.GetValue("uplink_IR_gain").ToString(), CultureInfo.InvariantCulture); this.uplink_rumbo_ail = float.Parse(key.GetValue("uplink_rumbo_ail").ToString(), CultureInfo.InvariantCulture); this.uplink_altura_ele = float.Parse(key.GetValue("uplink_altura_ele").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_rev_P = (int)key.GetValue("uplink_IR_rev_P") == 1; this.uplink_IR_rev_R = (int)key.GetValue("uplink_IR_rev_R") == 1; this.uplink_IR_cross = (int)key.GetValue("uplink_IR_cross") == 1; this.uplink_IR_rev_cross = (int)key.GetValue("uplink_IR_rev_cross")==1; } catch (Exception) { }; this.PicturePath = (string)key.GetValue("PicturePath", "C:\\Fotos"); this.VideosPath = (string)key.GetValue("VideosPath", "C:\\Videos"); try { this.trocearVideo = (int)key.GetValue("trocearVideo") == 1; this.trocearTamMB = (int)key.GetValue("trocearTamMB"); this.calidadVideo = (int)key.GetValue("calidadVideo"); this.fpsVideo = (int)key.GetValue("fpsVideo"); } catch (Exception) { }; } catch (Exception) { } } else Registry.CurrentUser.CreateSubKey(registryPath); }
protected Singleton() { asignaciones = new int[Enum.GetNames(typeof(EventosJoy)).Length - 1]; Ruta = new List<WayPoint>(); commPort = ""; videoCaptureStr = ""; HomeLon = -6.0345f; HomeLat = 37.2342f; HomeAlt = 100.0f; telemetria = Telemetria.Video; videosystem = VideoSystem.PAL; this.NombrePiloto = "Ikarus"; this.enableUDPinout = false; this.enableWebServer = false; this.portWebServer = 8080; this.portUDPinout = 9500; this.Idioma = 0; // Español this.SistemaMetrico = 0; // Metrico this.servo_ch = new byte[8]; this.servo_min = new int[servo_ch.Length]; this.servo_center = new int[servo_ch.Length]; this.servo_max = new int[servo_ch.Length]; this.servo_rev = new bool[servo_ch.Length]; for (int i = 0; i < servo_ch.Length; i++) { this.servo_min[i] = 1000; this.servo_center[i] = 1500; this.servo_max[i] = 2000; this.servo_rev[i] = false; this.servo_ch[i] = (byte)i; } this.joy_buttons = new byte[16]; for (int i = 0; i < 16; i++) { this.joy_buttons[i] = 0; } this.tipo_mezcla = Mezclas.Normal; // this.tipo_control = ModoControl.MODO_MODEM; this.rev_mix = false; this.rev_flap = false; this.full_flap = 1.0f; this.step_flap = 0.1f; this.pantilt_speed = 1.0f; this.AlarmAltitude_enabled = false; this.AlarmAscenso_enabled = false; this.AlarmCellVoltage_enabled = false; this.AlarmDistance_enabled = false; this.AlarmFastDescentRate_enabled = false; this.AlarmAltitude = 80.0f; this.AlarmAscenso = 5.0f; this.AlarmCellVoltage = 3.5f; this.AlarmDistance = 1000.0f; this.AlarmFastDescentRate = 10.0f; this.enable_headtrack = false; this.headtrack_panCh = 0; this.headtrack_tiltCh = 1; this.uplinkVmax = 12.6f; this.uplinkVmin = 9.6f; this.uplinkValarm = 10.0f; this.uplinkLipo = true; this.uplinkNumCells = 3; this.enableAntTrack = false; this.enableCasaAntTrack = false; this.useEmisora = true; this.txNumCanales = 8; this.txPeriodo = 20000; this.txSeparador = 400; this.txPolarity = false; // Uplink debug values this.uplink_pid_ail_P=0.02f; this.uplink_pid_ail_I=0.0f; this.uplink_pid_ail_D=0.0f; this.uplink_pid_ail_IL=0.0f; this.uplink_pid_ail_DL=1.0f; this.uplink_pid_ele_P=0.02f; this.uplink_pid_ele_I=0.0f; this.uplink_pid_ele_D=0.0f; this.uplink_pid_ele_IL=0.0f; this.uplink_pid_ele_DL=1.0f; this.uplink_pid_thr_P=0.02f; this.uplink_pid_thr_I=0.0f; this.uplink_pid_thr_D=0.0f; this.uplink_pid_thr_IL=0.0f; this.uplink_pid_thr_DL=1.0f; this.uplink_pid_tail_P=0.02f; this.uplink_pid_tail_I=0.0f; this.uplink_pid_tail_D=0.0f; this.uplink_pid_tail_IL=0.0f; this.uplink_pid_tail_DL=1.0f; this.uplink_IR_offX=1.66f; this.uplink_IR_offY = 1.66f; this.uplink_IR_gain = 1.14f; this.uplink_rumbo_ail = 20.0f; this.uplink_altura_ele = 10.0f; this.uplink_IR_rev_P = false; this.uplink_IR_rev_R = false; this.uplink_IR_cross = false; this.uplink_IR_rev_cross = false; this.trocearVideo = false; this.trocearTamMB = 1024; this.calidadVideo = 50; this.fpsVideo = 15; FromRegistry(); }
public void FromRegistry() { RegistryKey key = Registry.CurrentUser.OpenSubKey(registryPath); if (key != null) { try { this.GoogleMapsCookie = (string)key.GetValue("GoogleMapsCookie"); this.HomeLon = float.Parse(key.GetValue("HomeLon").ToString(), CultureInfo.InvariantCulture); this.HomeLat = float.Parse(key.GetValue("HomeLat").ToString(), CultureInfo.InvariantCulture); this.HomeAlt = float.Parse(key.GetValue("HomeAlt").ToString(), CultureInfo.InvariantCulture); this.videoCaptureStr = (string)key.GetValue("VideoCaptureStr"); this.telemetria = (Telemetria)key.GetValue("Telemetry"); this.videosystem = (VideoSystem)key.GetValue("VideoSystem"); this.commPort = (string)key.GetValue("CommPort"); this.commBps = (int)key.GetValue("CommBauds"); this.CacheMapsPath = (string)key.GetValue("CacheMapsPath"); this.FlightLogPath = (string)key.GetValue("FlightLogPath"); this.cells1 = (int)key.GetValue("CellCount1"); this.cells2 = (int)key.GetValue("CellCount2"); this.moduloTX = (Singleton.ModuloControl)(int) key.GetValue("ModuloTX"); try { for (int i = 0; i < servo_ch.Length; i++) { this.servo_min[i] = (int)key.GetValue("ServoMin" + i); this.servo_center[i] = (int)key.GetValue("ServoCenter" + i); this.servo_max[i] = (int)key.GetValue("ServoMax" + i); this.servo_rev[i] = (int)key.GetValue("ServoRev" + i) == 1; this.servo_ch[i] = (byte)((int)key.GetValue("ServoCh" + i)); } for (int i = 0; i < 16; i++) { this.joy_buttons[i] = (byte)((int)key.GetValue("JoyButtom" + i)); } this.tipo_mezcla = (Mezclas)key.GetValue("TipoMezcla"); // this.tipo_control = (ModoControl)key.GetValue("TipoControl"); this.rev_mix = (int)key.GetValue("rev_mix") == 1; this.rev_flap = (int)key.GetValue("rev_flap") == 1; this.full_flap = float.Parse(key.GetValue("full_flap").ToString()); this.step_flap = float.Parse(key.GetValue("step_flap").ToString()); this.pantilt_speed = float.Parse(key.GetValue("pantilt_speed").ToString()); this.enable_axis = (int)key.GetValue("AXISenable") == 1; this.enable_pan = (int)key.GetValue("PANenable") == 1; this.enable_tilt = (int)key.GetValue("TILTenable") == 1; this.enable_headtrack = (int)key.GetValue("enable_headtrack") == 1; object pepe = key.GetValue("headtrack_panCh"); this.headtrack_panCh = (byte)((int)key.GetValue("headtrack_panCh")); this.headtrack_tiltCh = (byte)((int)key.GetValue("headtrack_tiltCh")); this.uplinkVmax = float.Parse(key.GetValue("uplinkVmax").ToString(), CultureInfo.InvariantCulture); this.uplinkVmin = float.Parse(key.GetValue("uplinkVmin").ToString(), CultureInfo.InvariantCulture); this.uplinkValarm = float.Parse(key.GetValue("uplinkValarm").ToString(), CultureInfo.InvariantCulture); this.uplinkLipo = (int)key.GetValue("uplinkLipo") == 1; this.uplinkNumCells = (int)key.GetValue("uplinkNumCells"); this.useEmisora = (int)key.GetValue("useEmisora") == 1; this.txNumCanales = (byte)((int)key.GetValue("txNumCanales"));; this.txPeriodo = (int)key.GetValue("txPeriodo");; this.txSeparador = (int)key.GetValue("txSeparador"); this.txPolarity = (int)key.GetValue("txPolarity") == 1; } catch (Exception) { }; //Configuracion joystick try { this.Idioma = (int)key.GetValue("Language"); this.SistemaMetrico = (int)key.GetValue("SistemaMetrico"); } catch (Exception) { } this.NombrePiloto = key.GetValue("NombrePiloto").ToString(); this.portUDPinout = (int)key.GetValue("portUDPinout"); this.portWebServer = (int)key.GetValue("portWebServer"); this.enableWebServer = (int)key.GetValue("enableWebServer") == 1; this.enableUDPinout = (int)key.GetValue("enableUDPinout") == 1; try { this.AlarmAltitude_enabled = (int)key.GetValue("AlarmAltitude_enabled") == 1; this.AlarmAltitude = float.Parse(key.GetValue("AlarmAltitude").ToString(), CultureInfo.InvariantCulture); this.AlarmAscenso_enabled = (int)key.GetValue("AlarmAscenso_enabled") == 1; this.AlarmAscenso = float.Parse(key.GetValue("AlarmAscenso").ToString(), CultureInfo.InvariantCulture); this.AlarmCellVoltage_enabled = (int)key.GetValue("AlarmCellVoltage_enabled") == 1; this.AlarmCellVoltage = float.Parse(key.GetValue("AlarmCellVoltage").ToString(), CultureInfo.InvariantCulture); this.AlarmDistance_enabled = (int)key.GetValue("AlarmDistance_enabled") == 1; this.AlarmDistance = float.Parse(key.GetValue("AlarmDistance").ToString(), CultureInfo.InvariantCulture); this.AlarmFastDescentRate_enabled = (int)key.GetValue("AlarmFastDescentRate_enabled") == 1; this.AlarmFastDescentRate = float.Parse(key.GetValue("AlarmFastDescentRate").ToString(), CultureInfo.InvariantCulture); } catch (Exception) { }; try { this.enableAntTrack = (int)key.GetValue("enableAntTrack") == 1; this.enableCasaAntTrack = (int)key.GetValue("enaleCasaAntTrack") == 1; } catch (Exception) {}; try { for (int i = 0; i < asignaciones.Length; i++) { this.asignaciones[i] = (int)key.GetValue("TeclaAsignada" + i); } } catch (Exception) { }; try { // Uplink debug values this.uplink_pid_ail_P = float.Parse(key.GetValue("uplink_pid_ail_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_I = float.Parse(key.GetValue("uplink_pid_ail_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_D = float.Parse(key.GetValue("uplink_pid_ail_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_IL = float.Parse(key.GetValue("uplink_pid_ail_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ail_DL = float.Parse(key.GetValue("uplink_pid_ail_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_P = float.Parse(key.GetValue("uplink_pid_ele_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_I = float.Parse(key.GetValue("uplink_pid_ele_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_D = float.Parse(key.GetValue("uplink_pid_ele_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_IL = float.Parse(key.GetValue("uplink_pid_ele_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_ele_DL = float.Parse(key.GetValue("uplink_pid_ele_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_P = float.Parse(key.GetValue("uplink_pid_thr_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_I = float.Parse(key.GetValue("uplink_pid_thr_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_D = float.Parse(key.GetValue("uplink_pid_thr_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_IL = float.Parse(key.GetValue("uplink_pid_thr_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_thr_DL = float.Parse(key.GetValue("uplink_pid_thr_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_P = float.Parse(key.GetValue("uplink_pid_tail_P").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_I = float.Parse(key.GetValue("uplink_pid_tail_I").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_D = float.Parse(key.GetValue("uplink_pid_tail_D").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_IL = float.Parse(key.GetValue("uplink_pid_tail_IL").ToString(), CultureInfo.InvariantCulture); this.uplink_pid_tail_DL = float.Parse(key.GetValue("uplink_pid_tail_DL").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_offX = float.Parse(key.GetValue("uplink_IR_offX").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_offY = float.Parse(key.GetValue("uplink_IR_offY").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_gain = float.Parse(key.GetValue("uplink_IR_gain").ToString(), CultureInfo.InvariantCulture); this.uplink_rumbo_ail = float.Parse(key.GetValue("uplink_rumbo_ail").ToString(), CultureInfo.InvariantCulture); this.uplink_altura_ele = float.Parse(key.GetValue("uplink_altura_ele").ToString(), CultureInfo.InvariantCulture); this.uplink_IR_rev_P = (int)key.GetValue("uplink_IR_rev_P") == 1; this.uplink_IR_rev_R = (int)key.GetValue("uplink_IR_rev_R") == 1; this.uplink_IR_cross = (int)key.GetValue("uplink_IR_cross") == 1; this.uplink_IR_rev_cross = (int)key.GetValue("uplink_IR_rev_cross") == 1; } catch (Exception) { }; this.PicturePath = (string)key.GetValue("PicturePath", "C:\\Fotos"); this.VideosPath = (string)key.GetValue("VideosPath", "C:\\Videos"); try { this.trocearVideo = (int)key.GetValue("trocearVideo") == 1; this.trocearTamMB = (int)key.GetValue("trocearTamMB"); this.calidadVideo = (int)key.GetValue("calidadVideo"); this.fpsVideo = (int)key.GetValue("fpsVideo"); } catch (Exception) { }; } catch (Exception) { } } else { Registry.CurrentUser.CreateSubKey(registryPath); } }
protected Singleton() { asignaciones = new int[Enum.GetNames(typeof(EventosJoy)).Length - 1]; Ruta = new List <WayPoint>(); commPort = ""; videoCaptureStr = ""; HomeLon = -6.0345f; HomeLat = 37.2342f; HomeAlt = 100.0f; telemetria = Telemetria.Video; videosystem = VideoSystem.PAL; this.NombrePiloto = "Ikarus"; this.enableUDPinout = false; this.enableWebServer = false; this.portWebServer = 8080; this.portUDPinout = 9500; this.Idioma = 0; // Español this.SistemaMetrico = 0; // Metrico this.servo_ch = new byte[8]; this.servo_min = new int[servo_ch.Length]; this.servo_center = new int[servo_ch.Length]; this.servo_max = new int[servo_ch.Length]; this.servo_rev = new bool[servo_ch.Length]; for (int i = 0; i < servo_ch.Length; i++) { this.servo_min[i] = 1000; this.servo_center[i] = 1500; this.servo_max[i] = 2000; this.servo_rev[i] = false; this.servo_ch[i] = (byte)i; } this.joy_buttons = new byte[16]; for (int i = 0; i < 16; i++) { this.joy_buttons[i] = 0; } this.tipo_mezcla = Mezclas.Normal; // this.tipo_control = ModoControl.MODO_MODEM; this.rev_mix = false; this.rev_flap = false; this.full_flap = 1.0f; this.step_flap = 0.1f; this.pantilt_speed = 1.0f; this.AlarmAltitude_enabled = false; this.AlarmAscenso_enabled = false; this.AlarmCellVoltage_enabled = false; this.AlarmDistance_enabled = false; this.AlarmFastDescentRate_enabled = false; this.AlarmAltitude = 80.0f; this.AlarmAscenso = 5.0f; this.AlarmCellVoltage = 3.5f; this.AlarmDistance = 1000.0f; this.AlarmFastDescentRate = 10.0f; this.enable_headtrack = false; this.headtrack_panCh = 0; this.headtrack_tiltCh = 1; this.uplinkVmax = 12.6f; this.uplinkVmin = 9.6f; this.uplinkValarm = 10.0f; this.uplinkLipo = true; this.uplinkNumCells = 3; this.enableAntTrack = false; this.enableCasaAntTrack = false; this.useEmisora = true; this.txNumCanales = 8; this.txPeriodo = 20000; this.txSeparador = 400; this.txPolarity = false; // Uplink debug values this.uplink_pid_ail_P = 0.02f; this.uplink_pid_ail_I = 0.0f; this.uplink_pid_ail_D = 0.0f; this.uplink_pid_ail_IL = 0.0f; this.uplink_pid_ail_DL = 1.0f; this.uplink_pid_ele_P = 0.02f; this.uplink_pid_ele_I = 0.0f; this.uplink_pid_ele_D = 0.0f; this.uplink_pid_ele_IL = 0.0f; this.uplink_pid_ele_DL = 1.0f; this.uplink_pid_thr_P = 0.02f; this.uplink_pid_thr_I = 0.0f; this.uplink_pid_thr_D = 0.0f; this.uplink_pid_thr_IL = 0.0f; this.uplink_pid_thr_DL = 1.0f; this.uplink_pid_tail_P = 0.02f; this.uplink_pid_tail_I = 0.0f; this.uplink_pid_tail_D = 0.0f; this.uplink_pid_tail_IL = 0.0f; this.uplink_pid_tail_DL = 1.0f; this.uplink_IR_offX = 1.66f; this.uplink_IR_offY = 1.66f; this.uplink_IR_gain = 1.14f; this.uplink_rumbo_ail = 20.0f; this.uplink_altura_ele = 10.0f; this.uplink_IR_rev_P = false; this.uplink_IR_rev_R = false; this.uplink_IR_cross = false; this.uplink_IR_rev_cross = false; this.trocearVideo = false; this.trocearTamMB = 1024; this.calidadVideo = 50; this.fpsVideo = 15; FromRegistry(); }