public Device() { ConnectionStatus.IsConnected = true; localSettings = ApplicationData.Current.LocalSettings; Model = localSettings.Values["CameraModel"] as string; action = new Logic.Action(); this.InitializeComponent(); currentView = ApplicationView.GetForCurrentView(); Window.Current.SizeChanged += Current_SizeChanged; Animate(); this.Loaded += (e, o) => { if (ConnectionStatus.IsConnected == false) { ShowErrorMsgAsync("Not connected to a camera"); return; } StreamPlayer.Width = this.ActualWidth - 40; StreamPlayer.Height = 150; StreamPlayer.Loaded += (r, p) => { //StreamPlayer.Play(); }; }; LoadSettings(); }
public FilesControl() { action = new Logic.Action(); NamePhotoList = new List <string>(); NameVideoList = new List <string>(); Photo = new ObservableCollection <string>(); Video = new ObservableCollection <string>(); this.InitializeComponent(); Setup(); }
public SettingsControls() { action = new Logic.Action(); Exposure = new List <string>() { "+2", "+5/3", "+4/3", "+1", "+2/3", "+1/3", "0", "-1/3", "-2/3", "-1", "-4/3", "-5/3", "-2" }; WhiteBalance = new List <string>() { "Auto", "DayLight", "Cloudy", "Tungsten", "Fluorescent" }; PhotoLapse = new List <string>() { "3s", "5s", "10s", "20s" }; VideoLapse = new List <string>() { "1s", "2s", "5s", "10s", "20s", "60s" }; AutoPower = new List <string>() { "3 min", "5 min", "10 min", "off" }; this.InitializeComponent(); Loaded += async(e, o) => { await Task.Delay(1000); if (ConnectionStatus.IsConnected == true) { CheckSettings(); } else { ToggleAudio.IsEnabled = false; ToggleGyro.IsEnabled = false; ToggleWDR.IsEnabled = false; ToggleStamp.IsEnabled = false; } }; }
public PhotoControl() { ResolutionString = new List <string>() { "16Mpx", "14Mpx", "12Mpx", "10Mpx", "8Mpx", "5Mpx", "3Mpx", "VGA" }; action = new Logic.Action(); this.InitializeComponent(); this.Loaded += async(e, o) => { await Task.Delay(1000); if (ConnectionStatus.IsConnected == true) { CheckSettings(); } else { SnapButton.IsEnabled = false; } }; }
private void StartAsync() { ResolutionString = new List <string>() { "2K 30fps", "1080p 60fps", "1080p 30fps", "720p 120fps", "720p 60fps", "720p 30fps", "480p 240fps" }; action = new Logic.Action(); this.InitializeComponent(); this.Loaded += async(e, o) => { await Task.Delay(1000); if (ConnectionStatus.IsConnected == true) { CheckSettings(); } else { SnapButton.IsEnabled = false; } }; }
public Logic.Action Decision() { Logic.Action choice = Logic.Action.Idle; if (this.Health < (this.maxHP / 4)) { this.moraleBreak(); choice = Logic.Action.Potion; } else if (this.Health < (this.maxHP / 2)) { switch (this.morale) { case Morale.Foolish: if (this.Focus > (this.maxFP / 2)) { if (this.rollSpirit() > this.rollCombat()) { choice = Logic.Action.Magic; } else { choice = Logic.Action.Attack; } } else { choice = Logic.Action.Magic; } break; case Morale.Brave: if (this.Focus > (this.maxFP / 2)) { if (this.rollSpirit() > this.rollCombat()) { choice = Logic.Action.Magic; } else { choice = Logic.Action.Attack; } } else { choice = Logic.Action.Attack; } break; case Morale.Cautious: if (this.Focus > (this.maxFP / 2)) { if (this.rollCombat() > this.rollProtection()) { choice = Logic.Action.Attack; } else { choice = Logic.Action.Defend; } } else { choice = Logic.Action.Potion; } break; case Morale.Shaken: if (this.Focus > (this.maxFP / 2)) { if (this.rollSpirit() > this.rollProtection()) { choice = Logic.Action.Magic; } else { choice = Logic.Action.Potion; } } else { choice = Logic.Action.Potion; } break; case Morale.Terrified: if (this.Focus > (this.maxFP / 2)) { if (this.rollLuck() < this.rollLuck()) { this.moraleRally(); choice = Logic.Action.Magic; } else { this.moraleRally(); choice = Logic.Action.Potion; } } else { choice = Logic.Action.Defend; } break; } } else { switch (this.morale) { case Morale.Foolish: choice = Logic.Action.Magic; break; case Morale.Brave: choice = Logic.Action.Attack; break; case Morale.Cautious: if (this.rollCombat() > this.rollProtection()) { choice = Logic.Action.Attack; } else { choice = Logic.Action.Defend; } break; case Morale.Shaken: choice = Logic.Action.Defend; break; case Morale.Terrified: choice = Logic.Action.Potion; break; } } return(choice); }