public ImageDemoPage() { Image img; int size = 64; Bitmap bmp = DemoManager.GetBitmap(Resources.BinaryResources.Operation, Bitmap.BitmapImageType.Gif); img = new Image(20, 10, size, size, bmp); Content.Children.Add(img); img = new Image(120, 10, size + 100, size, bmp); Content.Children.Add(img); img = new Image(20, 80, size, size, bmp) { Border = new Pen(Color.Red, 1) }; Content.Children.Add(img); img = new Image(120, 80, size, size, bmp) { Opacity = 80 }; Content.Children.Add(img); img = new Image(240, 80, size, size, bmp) { Opacity = 150, Background = new LinearGradientBrush(Color.LimeGreen, Color.CornflowerBlue) { Opacity = 80 } }; Content.Children.Add(img); }
public DemoControlViewModel() { DemoManager = new DemoManager(); StartStopCommand = new RelayCommand(o => StartStop()); PlaybackImagesCommand = new RelayCommand(o => PlaybackImages()); DeleteSettingCommand = new RelayCommand(o => DeleteSetting()); NewSettingCommand = new RelayCommand(o => NewSetting()); AddClipCommand = new RelayCommand(o => AddClip()); DeleteClipCommand = new RelayCommand(o => DeleteClip()); AddAllVisualizationsCommand = new RelayCommand(o => AddAllVisualizations()); DeleteAllDemosCommand = new RelayCommand(o => DeleteAllDemos()); AddSelectedVisualizationToScheduleCommand = new RelayCommand(o => AddVisualizationToSchedule(true)); AddAllVisualizationsToScheduleCommand = new RelayCommand(o => AddVisualizationToSchedule(false)); DeleteSelectedDemoCommand = new RelayCommand(o => DeleteSelectedDemo()); MoveSelectedDemoUpCommand = new RelayCommand(o => MoveSelectedDemoUp()); MoveSelectedDemoDownCommand = new RelayCommand(o => MoveSelectedDemoDown()); ClipList = new ObservableCollection <Clipping>(); Remappings = new ObservableCollection <Remapper>(); Settings = new ObservableCollection <Setting>(); Playback = new Playback(this, DemoManager, frame => Dispatch(() => DrawFrameToScreen(frame)) ); LoadItems(); var designTime = DesignerProperties.GetIsInDesignMode(new DependencyObject()); if (!designTime) { LoadSettings(); } }
// Start is called before the first frame update void Start() { delaySlider = GetComponent <Slider>(); dm = demoManager.GetComponent <DemoManager>(); delayTime = dm.delayTime; delaySlider.value = delayTime; }
public App() { Form_ = new AppForm(); /*{ * Text = "LiteGui Demo - 0.0.0.1", * KeyPreview = true, * MaximizeBox = false, * ClientSize = new Size(960, 540), * StartPosition = FormStartPosition.CenterScreen, * FormBorderStyle = FormBorderStyle.FixedSingle, * };*/ Form_.KeyDown += (Sender, Args) => { Input.OnKeyDown(Args.KeyCode); }; Form_.KeyUp += (Sender, Args) => { Input.OnKeyUp(Args.KeyCode); }; Form_.Surface.MouseDown += (Sender, Args) => { Input.OnMouseDown(Args.Button, Args.X, Args.Y); }; Form_.Surface.MouseUp += (Sender, Args) => { Input.OnMouseUp(Args.Button, Args.X, Args.Y); }; Form_.Surface.MouseMove += (Sender, Args) => { Input.OnMouseMove(Args.Button, Args.X, Args.Y); }; Form_.Surface.MouseWheel += (Sender, Args) => { Input.OnMouseWheel(Args.Delta); }; TextFont_ = new Font("Arial", 10); Swapchain_ = new Swapchain(Form_.Handle, Form_.ClientSize.Width, Form_.ClientSize.Height); DemoMgr_ = new DemoManager(new LGuiVec2(960, 540)); }
// Start is called before the first frame update void Start() { amountSlider = GetComponent <Slider>(); dm = demoManager.GetComponent <DemoManager>(); dummyNum = dm.dummyNum; amountSlider.value = dummyNum; }
private void Awake() { if (Instance == null) { Instance = this; } }
private void Demo35Video() { //Configuration.LCD.EnableLCDBootupMessages(false); demo = new DemoManager(320, 240); demo.VideoDemo(); }
public ActionResult Demo() { string testField = Request["testField"] == null ? "" : Request["testField"].ToString(); MsgBox mb = new DemoManager().DemoTest(testField); return(Json(mb)); }
private DemoManager() { if (instance != null) { return; } instance = this; }
/// <summary> /// Read a setting from a text representation /// </summary> /// <param name="input"></param> /// <returns></returns> internal static Setting Read(StreamReader input, DemoManager demoManager) { var visualizations = demoManager.VisualizationTypes; if (input == null) { return(null); } try { var name = input.ReadLine(); var s = new Setting(name); s.Brightness = Double.Parse(input.ReadLine()); s.CycleAnimation = input.ReadLine().ToLower() == "true"; s.FramesPerSecond = Int32.Parse(input.ReadLine()); s.Width = Int32.Parse(input.ReadLine()); s.Height = Int32.Parse(input.ReadLine()); s.PortName = input.ReadLine(); s.RemappingName = input.ReadLine(); s.TimePerAnimation = Int32.Parse(input.ReadLine()); s.Strands = Int32.Parse(input.ReadLine()); s.Gamma = Double.Parse(input.ReadLine()); s.UseGamma = input.ReadLine().ToLower() == "true"; s.BaudRate = Int32.Parse(input.ReadLine()); var visCount = Int32.Parse(input.ReadLine()); for (var i = 0; i < visCount; ++i) { var line = input.ReadLine(); var parameterText = ""; var pti = line.IndexOf(':'); if (pti != -1) { parameterText = line.Substring(pti + 1); line = line.Substring(0, pti - 1); } var words = line.Split(' '); int length; if (words.Length == 2 && Int32.TryParse(words[1], out length)) { var dname = words[0]; var type = visualizations.First(t => t.Name == dname); var v = new DemoManager.VisualizationWrapper(type, length); v.ParameterText = parameterText; s.DemoSchedule.Add(v); } } return(s); } catch (Exception e) { Trace.TraceError("Exception loading setting"); Trace.TraceError(e.ToString()); } return(null); }
private void Demo22SPI() { display = new DisplayS22(5); demo = new DemoManager(240, 320, delegate(Bitmap bitmap, Rect dirtyArea) { display.SimpleGraphics.DisplayImage(bitmap, (uint)dirtyArea.X, (uint)dirtyArea.Y, (uint)dirtyArea.X, (uint)dirtyArea.Y, (uint)dirtyArea.Width, (uint)dirtyArea.Height); }); demo.QuickDemo(); }
// Start is called before the first frame update void Start() { currentSettings = GetComponent <Text>(); dm = demoManager.GetComponent <DemoManager>(); currentSettings.text = "\n" + "\n" + (dm.delayTime * 1000).ToString() + "[ms]\n" + dm.dummyNum.ToString() + "\n" + dm.cdr.ToString() + "\n" + dm.minAngle.ToString() + " / " + dm.maxAngle.ToString(); }
public void Awake() { // if the singleton hasn't been initialized yet if (instance != null && instance != this) { Destroy(this.gameObject); // NOTE: Destroy(this); will just destroy the script component that calls it rather than destroying the GameObject the script is attached to. return; //Avoid doing anything else } instance = this; }
private void initializeSettings() { dm = GameObject.Find("DemoManager").GetComponent <DemoManager>(); delayTime = dm.delayTime; dummyNum = dm.dummyNum; cdr = dm.cdr; minAngle = dm.minAngle; maxAngle = dm.maxAngle; selectedVisual = dm.selectedVisual; isDelay = (dm.delayTime) == 0f ? true : false; }
private void Start() { if (Instance == null) { Instance = this; } else { Destroy(this); } DontDestroyOnLoad(gameObject); }
void Awake() { Instance = this; // Create GameObject ScreenBlocker = Instantiate( ScreenBlocker, new Vector3(0,0,-8), Quaternion.identity ) as GameObject; currBackground = new GameObject( "Background" ); currBackgroundRend = currBackground.AddComponent<SpriteRenderer>(); newBackground = new GameObject( "NewBackground" ); newBackground.transform.position = new Vector3( 0f, 0f, -0.01f ); newBackgroundRend = newBackground.AddComponent<SpriteRenderer>(); newBackgroundRend.sprite = null; }
/// <summary> /// Initialize the default values. /// </summary> protected override void Awake() { base.Awake(); m_MovementTypeSwitcher = GameObject.FindObjectOfType <MovementTypeSwitcher>(); m_DemoManager = GameObject.FindObjectOfType <DemoManager>(); m_DemoZoneTrigger = GameObject.FindObjectOfType <DemoZoneTrigger>(); // Remember the positions/rotations so they can be restored when the character leaves the zone. m_DrunkAstronautPosition = m_DrunkAstronautCharacter.transform.position; m_DrunkAstronautRotation = m_DrunkAstronautCharacter.transform.rotation; m_GiantPosition = m_GiantCharacter.transform.position; m_GiantRotation = m_GiantCharacter.transform.rotation; ChangeSpringType(SpringType.Modern); m_DrunkAstronautCharacter.SetActive(false); m_GiantCharacter.SetActive(false); }
public void Start() { if (SelectedRemapping == null) { MessageBox.Show("Select a remapping first"); return; } if (DemoManager.VisualizationSchedule.Count <= 0) { MessageBox.Show("No demos added to schedule"); return; } if (Device == null || Device.IsConnected == false) { MessageBox.Show("Must be connected to a HypnoLSD module first"); return; } SetRemappingParameters(false); Task.Factory.StartNew(() => { try { if (SelectedDemoIndex < 0) { SelectedDemoIndex = 0; } DemoManager.Start(Device, SelectedRemapping, BaudRate, ClipFilter); } catch (Exception e) { Messager.AddError(e.ToString()); } Playback.Start(); IsRunning = true; Thread.Sleep(1000); if (EnableLoggingAction != null) { EnableLoggingAction(false); // otherwise kills gui } }); }
private void Run() { //bool reset = false; //if (reset) // LCDManager.SetLCDConfiguration_800_480(); //if (reset) //{ // Util.FlushExtendedWeakReferences(); // Microsoft.SPOT.Hardware.PowerState.RebootDevice(false); //} //demo = new Demo(800, 480); //demo.QuickDemo(); demo = new DemoManager(320, 240); demo.LibraryDemo(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); waits = new List <WaitForSeconds> () { new WaitForSeconds(2f), new WaitForSeconds(1f), new WaitForSeconds(0.5f), new WaitForSeconds(0.25f), new WaitForSeconds(0.125f), new WaitForSeconds(0.0625f), new WaitForSeconds(0.03125f) }; waitSeconds = new Dictionary <StepTime, float> () { { StepTime.wait2Sec, 2f }, { StepTime.wait1Sec, 1f }, { StepTime.wait0_5Sec, 0.5f }, { StepTime.wait0_25Sec, 0.25f }, { StepTime.wait0_125Sec, 0.125f }, { StepTime.wait0_0625Sec, 0.0625f }, { StepTime.wait0_03125Sec, 0.03125f } }; currentWait = waits[(int)currentStepTime]; Debug.Log("Initial Wait Seconds:" + GetWaitSeconds()); }
private void Demo35() { //if (!Utils.IsEmulator) //{ // bool reboot = false; // //reboot |= LCDManager.SetLCDConfiguration_800_480(); // reboot |= LCDManager.SetLCDConfiguration_320_240(); // //reboot |= LCDManager.SetBootLogo(null, 0, 0); // reboot |= LCDManager.SetLCDBootupMessages(false); // if (reboot) // { // Thread.Sleep(10000); // Util.FlushExtendedWeakReferences(); // PowerState.RebootDevice(false); // } //} demo = new DemoManager(320, 240); //demo.QuickDemo(); demo.CrashDemo(); }
// Start is called before the first frame update void Start() { dm = demoManager.GetComponent <DemoManager>(); }
public void Awake() { Intance = this; }
// Start is called before the first frame update void Start() { dm = demoManager.GetComponent <DemoManager>(); visualSelector = GetComponent <Dropdown>(); visualSelector.value = dm.selectedVisual; }
public static void ParseCommand(string response) { switch (response.ToUpper()) { case "CLS": Console.Clear(); break; case "1": DemoManager.RunCustomConfigSectionsDemo(); break; case "2": DemoManager.RunIComparableDemo(); break; case "3": DemoManager.RunDependencyInjectionWithUnityDemo(); break; case "4": DemoManager.RunFactoryPatternDemo(); break; case "5": DemoManager.RunFileStreamDemo(); break; case "6": DemoManager.RunOUTDemo(); break; case "7": DemoManager.RunBooleanDemo(); break; case "8": DemoManager.RunFacadePatternDemo(); break; case "9": DemoManager.RunProcessAndThreadingDemo(); break; case "10": DemoManager.RunCarDemo(); break; case "11": DemoManager.RunEuclidDemo(); break; case "12": DemoManager.RunBinarySearchDemo(); break; case "13": DemoManager.RunDelegateDemo(); break; case "14": DemoManager.rUntITleCaseDEMO(); break; case "15": DemoManager.RunFibonacciDemo(); break; case "16": DemoManager.RunInterfaceDemo(); break; case "17": DemoManager.RunPointRollDemo(); break; case "18": DemoManager.RunTracingAndLoggingDemo(); break; case "19": DemoManager.RunRESTfulCrapDemo(); break; case "20": DemoManager.RunAsycCrapDemo(); break; case "21": DemoManager.RunRegexCrapDemo(); break; case "22": DemoManager.RunBitWiseDemo(); break; case "23": DemoManager.RunSMSTextingDemo(); break; case "24": DemoManager.RunMONGODemo(); break; case "25": DemoManager.RunSTOCKSDemo(); break; case "26": DemoManager.RunFileNameCompareDemo(); break; case "27": DemoManager.RunAmazonCrap(); break; case "28": DemoManager.RunQuoraPuzzler(); break; case "29": DemoManager.RunLeetCodeShit(); break; case "30": DemoManager.RunLongestCommonSubstringAlgorithmDemo(); break; case "HELP": case "?": ScreenHelper.Welcome(); ScreenHelper.ListOptions(); break; case "EXIT": case "X": case "Q": case "QUIT": ScreenHelper.SignOff(); break; default: //TestHelper.RunTest(); Console.WriteLine("Unknown command."); break; } if (Environment.UserInteractive) { ScreenHelper.ShowContinuePrompt(); } }
// Start is called before the first frame update void Start() { cdrSlider = GetComponent <Slider>(); dm = demoManager.GetComponent <DemoManager>(); cdrSlider.value = dm.cdr; }