protected override void SLForm_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == System.Windows.Forms.Keys.Escape) { logger.Log("Total Frames: " + frameinfo.TotalFrames.ToString() + " \nTotal Time(sec): " + frameinfo.TotalTime.ToString("F3") + " \nMean IFI(ms): " + (frameinfo.MeanIFI * 1000).ToString("F3") + " \nSTD IFI(ms): " + (frameinfo.StdIFI * 1000).ToString("F3") + " \nMax IFI(ms): " + (frameinfo.MaxIFI * 1000).ToString("F3") + " \nMin IFI(ms): " + (frameinfo.MinIFI * 1000).ToString("F3")); } if (e.KeyCode == System.Windows.Forms.Keys.T) { ToggleFullScreen(); } if (e.KeyCode == System.Windows.Forms.Keys.G) { SetGamma(new Vector3(2.1f, 2.1f, 2.1f)); } if (e.KeyCode == System.Windows.Forms.Keys.A) { grating.SetGratingType(GratingType.Square); vsc.SetVisible(false); } if (e.KeyCode == System.Windows.Forms.Keys.S) { grating.SetGratingType(GratingType.Sinusoidal); vsc.SetVisible(true); } if (e.KeyCode == System.Windows.Forms.Keys.D) { grating.SetGratingType(GratingType.Linear); } if (e.KeyCode == System.Windows.Forms.Keys.M) { grating.SetMask(MaskType.Gaussian); } if (e.KeyCode == System.Windows.Forms.Keys.N) { grating.SetMask(MaskType.None); } if (e.KeyCode == System.Windows.Forms.Keys.R) { vsc.RandomCenterSpeed(1.0f); } base.SLForm_KeyDown(sender, e); }
void Grating_Type() { if (Input.IsKeyPressed(Keys.Space)) { GratingType += 1; if ((int)GratingType > 2) { GratingType = 0; } Grating.SetGratingType(GratingType); } if (Input.IsKeyPressed(Keys.E)) { if (GratingShape == Shape.Quadrate) { GratingShape = Shape.Circle; } else { GratingShape = Shape.Quadrate; } Grating.SetShape(GratingShape); } if (Input.IsKeyPressed(Keys.M)) { GratingMask += 1; if ((int)GratingMask > 1) { GratingMask = 0; } Grating.SetMask(GratingMask); } if (Input.IsKeyDown(Keys.T)) { Grating.SetGaussianSigma(Grating.Para.maskpara.BasePara.diameter * 1.01f); } if (Input.IsKeyDown(Keys.Y)) { Grating.SetGaussianSigma(Grating.Para.maskpara.BasePara.diameter * 0.99f); } }