public void CreateSchedule(ProgramMode pm) { if (pm == ProgramMode.XML) { this.GetDataFromXML(); } else { this.GetDataFromDb(); } this.CreatingClasses(); List <Class> FirstGroup = new List <Class>(); List <Class> SecondGroup = new List <Class>(); this.Dividing(FirstGroup, SecondGroup); this.create(0, FirstGroup); this.create(3, SecondGroup); if (pm == ProgramMode.Database) { ClassRepo.AddToDb(ResSchedule); } else if (pm == ProgramMode.XML) { ClassRepo.SerializeArray("../../Data/classes.xml", ResSchedule.ToArray()); } else { ClassRepo.AddToDb(ResSchedule); ClassRepo.SerializeDb("../../Data/classes.xml"); } }
private void ParseArguments() { if (arguments.Length != 2) { throw new Exception("Incorrect number of arguments"); } var inputMode = arguments[0].ToLower(); var inputAddress = arguments[1]; if (inputMode == "filesystem") { if (!Directory.Exists(inputAddress)) { throw new Exception("Directory does not exist or you do not have access rights: " + inputAddress); } mode = ProgramMode.filesystem; address = inputAddress; } else if (inputMode == "http") { if (!File.Exists(inputAddress)) { throw new Exception("File does not exist or you do not have access rights: " + inputAddress); } mode = ProgramMode.http; address = inputAddress; } else { throw new Exception("Incorrect input mode"); } }
static void Main(string[] args) { ProgramMode mode = ConfigHelper.GetProGramType(); IDbExcute dbExcute = DbExcuteFactory.CreateDbExcute(mode); dbExcute.ExcuteDbMethod(); }
private void radioButton1_Click(object sender, EventArgs e) { if (_fingersCollection == null || _fingersCollection.Count == 0) { return; } this.BeginInvoke(new MethodInvoker(delegate() { stopCapturing(); })); ProgramMode mode = ProgramMode.Enroll; setMode(mode); setModeRadioButtons(mode); clearLog(); RadioButton rb = sender as RadioButton; int rbNumber = "radioButton".Length; rbNumber = Int32.Parse(rb.Name.Substring(rbNumber)); WsqImage wsqImage = _fingersCollection[rbNumber - 1] as WsqImage; fingerChanged(rbNumber - 1); enrollFromWSQ(wsqImage); }
public HashChecker(ProgramMode mode, string filePath = null) { this.InitializeComponent(); this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); switch (mode) { case ProgramMode.Standard: break; case ProgramMode.ValidateWithClipboard: throw new ArgumentException("Use new form for checking clipboard hash"); case ProgramMode.ValidateChecksumFile: this.cmdlineFName = filePath; break; default: throw new ArgumentException(Resources.HashChecker_Unsupported_mode, "mode"); } try { this.cbPriority.SelectedIndex = Settings.Default.ThreadPriority; } catch (System.Configuration.ConfigurationException) { CustomMessageBoxes.Warning("Failed to load settings, restoring defaults"); this.cbPriority.SelectedIndex = 4; #if DEBUG throw; #endif } }
static Program() { Config.Initialize(); Mode = (ProgramRoutines.IsParameterSet(CommandLineParameters.AUTOMATIC) || Properties.General.Default.RunSilently) ? ProgramMode.AUTOMATIC : ProgramMode.DIALOG; LogMessage.DisableStumblingDialogs = Mode == ProgramMode.AUTOMATIC; if (ProgramRoutines.IsParameterSet(CommandLineParameters.PRODUCTION)) { Properties.General.Default.RestoreBrokenSession = true; Properties.General.Default.RestoreErrorItemsAsNew = false; Properties.General.Default.WriteSessionRestoringLog = true; Properties.Log.Default.LogDownloadedFiles = false; Properties.General.Default.UseFilesFromCache = false; } AssemblyName ean = Assembly.GetEntryAssembly().GetName(); string customization_title = ean.Name; if (ean.Version.Major > 0 || ean.Version.Minor > 0) { customization_title += ean.Version.Major + "." + ean.Version.Minor; } //CustomizationModificationTime = File.GetLastWriteTime(Log.AppDir + "\\" + ean); AssemblyName can = Assembly.GetExecutingAssembly().GetName(); string CliverBot_title = can.Name; if (can.Version.Major > 0 || can.Version.Minor > 0) { CliverBot_title += can.Version.Major + "." + can.Version.Minor; } Title = customization_title + @" / " + CliverBot_title; AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); }
public void Run(string[] commandArguments) { if (commandArguments.Length != NUMBER_OF_ARGUMENTS_TO_SEARCH && commandArguments.Length != NUMBER_OF_ARGUMENTS_TO_SEARCH_AND_SWAP) { UI.ConsoleOutPut(StringConstants.WRONG_NUMBER_OF_ARGUMENTS, StringConstants.INFO_ABOUT_INPUT); return; } if (!CheckFile(commandArguments[0])) { return; } ProgramMode programMode = ChooseProgramMode(commandArguments.Length); switch (programMode) { case ProgramMode.SearchPattern: PatternSearcher patternSearcher = new PatternSearcher(); int numberOfPatterns = patternSearcher.FindPatternInFile(commandArguments[0], commandArguments[1]); UI.ConsoleOutPut(string.Format("Number of patterns in text = {0}", Convert.ToString(numberOfPatterns))); break; case ProgramMode.SearchPatternAndSwap: PatternReplace patternReplace = new PatternReplace(); int numberOfChanges = patternReplace.ReplacePattern(commandArguments[0], commandArguments[1], commandArguments[2]); UI.ConsoleOutPut(string.Format("Number of changed lines in text = {0}", Convert.ToString(numberOfChanges))); break; } //TODO СТРОКИ ПЕРЕДАВАТЬ В АЛГОРИТМЫ(ДЛЯ ТЕСТОВ) }
private void handlingProgrammingMode()// disable radio buttons because programming mode requires 115200 { if (ProgramMode.Equals("Programming mode")) { foreach (List <Control> templist in ActiveDUTs) { ((Panel)templist[5]).Enabled = false; ((RadioButton)templist[6]).Checked = false; ((RadioButton)templist[7]).Checked = true; // set the radio button ( though it is diabled) to 115200 as that is the baud rate for programming } } else // re-enable radio buttons if not in programming mode { foreach (List <Control> templist in ActiveDUTs) { ((Panel)templist[5]).Enabled = true; } if (myCommands.Devices.Count > 0) { if (myCommands.Devices[0].programmingMode) { myCommands.InitializeDUT(myCommands.Devices[0].dutNumber, myCommands.Devices[0].comport, ProgramMode, myCommands.Devices[0].baud); } } } }
private void InitializeLocalVariable() { DrawMode(); GraphicFunctions.a = 0; GraphicFunctions.b = 10; GraphicFunctions.c = 0; GraphicFunctions.d = 10; GraphicFunctions.w = pictureBox1.Width; GraphicFunctions.h = pictureBox1.Height; domain = new Domain(); ClearWindow(); polygon = new Polygon(); config = new Config(); u = null; pallette = null; textBox1.Text = ""; mode = ProgramMode.DrawMode; Matrix k = new Matrix(2, 2); k[0, 0] = 4; k[0, 1] = 0; k[1, 0] = 0; k[1, 1] = 3; model = new Model(k, 0, 1); }
private void buttonRequest_Click(object sender, EventArgs e) { //this.BeginInvoke(new MethodInvoker(delegate() { stopCapturing(); })); ProgramMode mode = ProgramMode.Enroll; setMode(mode); setModeRadioButtons(mode); if (!isUserIdValid()) { return; } nlView2.Image = null; if (_enrolledTemplateList != null) { _enrolledTemplateList.Clear(); } Clear(); //startProgressBar(); Application.DoEvents(); enrollFromImage(false); // to view1 }
private static void Init() { Glut.glutInit(); Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_DEPTH); Glut.glutInitWindowSize(Width, Height); ScreenWidth = Glut.glutGet(Glut.GLUT_SCREEN_WIDTH); ScreenHeight = Glut.glutGet(Glut.GLUT_SCREEN_HEIGHT); Glut.glutInitWindowPosition((ScreenWidth - Width) / 2, (ScreenHeight - Height) / 2); Glut.glutCreateWindow("Plexico 2D Game - Copyright Alex Tan 2016"); //Glut.glutGameModeString(Width+"x"+Height+":32@60"); Glut.glutSetOption(Glut.GLUT_ACTION_ON_WINDOW_CLOSE, Glut.GLUT_ACTION_CONTINUE_EXECUTION); Gl.Viewport(0, 0, Width, Height); Glut.glutReshapeFunc(OnReshape); Glut.glutDisplayFunc(delegate() { }); Glut.glutIdleFunc(MainGameLoop); //Console.SetWindowSize(Console.LargestWindowWidth / 4, Console.LargestWindowHeight / 4); //Console.SetWindowPosition(0, 0); Mode = ProgramMode.None; AssetsManager.Init(); Input.Init(); Gui.Init(); SwitchToTitleScreen(); }
public static ProgramMode GetProGramType() { string mode = ConfigurationManager.AppSettings["ProgramMode"]; ProgramMode mod = (ProgramMode)Enum.Parse(typeof(ProgramMode), mode); return(mod); }
static Program() { Config.Initialize(); Mode = (ProgramRoutines.IsParameterSet(CommandLineParameters.AUTOMATIC) || Properties.General.Default.RunSilently) ? ProgramMode.AUTOMATIC : ProgramMode.DIALOG; LogMessage.DisableStumblingDialogs = Mode == ProgramMode.AUTOMATIC; if (ProgramRoutines.IsParameterSet(CommandLineParameters.PRODUCTION)) { Properties.General.Default.RestoreBrokenSession = true; Properties.General.Default.RestoreErrorItemsAsNew = false; Properties.General.Default.WriteSessionRestoringLog = true; Properties.Log.Default.LogDownloadedFiles = false; Properties.General.Default.UseFilesFromCache = false; } AssemblyName ean = Assembly.GetEntryAssembly().GetName(); string customization_title = ean.Name; if (ean.Version.Major > 0 || ean.Version.Minor > 0) customization_title += ean.Version.Major + "." + ean.Version.Minor; //CustomizationModificationTime = File.GetLastWriteTime(Log.AppDir + "\\" + ean); AssemblyName can = Assembly.GetExecutingAssembly().GetName(); string CliverBot_title = can.Name; if (can.Version.Major > 0 || can.Version.Minor > 0) CliverBot_title += can.Version.Major + "." + can.Version.Minor; Title = customization_title + @" / " + CliverBot_title; AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); }
public static void SwitchToGame(string worldname, int seed) { Mode = ProgramMode.Game; Program.worldname = worldname; GameRenderer.Init(); GameLogic.InitNew(seed); GameTime.Update(); }
public static IDbExcute CreateDbExcute(ProgramMode mode) { string name = Enum.GetName(typeof(ProgramMode), mode); Assembly assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集 IDbExcute dbExcute = (IDbExcute)assembly.CreateInstance($"MyWebApiProject.DbToJsonFileTool.Service.{name}"); return(dbExcute); }
public static void SwitchToGame(string worldname, WorldData world) { Mode = ProgramMode.Game; Program.worldname = worldname; GameRenderer.Init(); GameLogic.InitLoad(world.terrain, world.entities); GameTime.Update(); }
public void Stop() { this.mode = ProgramMode.Idle; this.UpdateStatus("Ready"); // reset classifier/trainer this.classifier = null; this.trainer = null; }
private void doEnroll() { ProgramMode mode = ProgramMode.Verify; setMode(mode); setModeRadioButtons(mode); this.BeginInvoke(new MethodInvoker(delegate() { startCapturing(); })); }
public Calculator(LockType lockType, int lower, int upper, int modulus, int threads, ProgramMode programMode, string hash) { this.lower = lower; this.upper = upper; this.modulus = modulus; this.threads = threads; this.hash = hash; LockObject locker = CreateLocker(lockType); loop = CreateLoop(locker, programMode); }
public void SetState(ProgramMode mode, string ip, int port) { if (_FormState != null) { _FormState.Close(); } _Mode = mode; ChangeState(); _FormState.Open(ip, port); }
private void DomainMode() { mode = ProgramMode.DomainMode; saveResultAsImageToolStripMenuItem.Enabled = false; saveResultToolStripMenuItem.Enabled = false; btnAddPoint.Enabled = false; btnMesh.Enabled = true; btnSolve.Enabled = false; DrawDomain(); }
/// <summary> /// Constructor for the Program Class /// </summary> /// <param name="mode_"> /// The mode which the program is going to run in /// </param> /// <param name="path_"> /// The root directory /// </param> /// <returns> /// An instance of the Program Class /// </returns> Program(ProgramMode mode_, string path_) { path = path_; mode = mode_; singleThreadFolderCount = 0; singleThreadFileCount = 0; singleThreadByteCount = 0; parallelThreadFolderCount = 0; parallelThreadFileCount = 0; parallelThreadByteCount = 0; }
/// <summary> /// Toggles the program mode and returns the new mode. /// </summary> /// <returns>The new mode.</returns> public static ProgramMode ToggleMode() { if (_mode == ProgramMode.Editor) { mode = ProgramMode.Game; } else { mode = ProgramMode.Editor; } return(mode); }
public static void InitializeStubs(ProgramMode mode) { SaveFile sav8 = mode switch { ProgramMode.SWSH => new SAV8SWSH(), ProgramMode.BDSP => new SAV8BS(), ProgramMode.LA => new SAV8LA(), _ => throw new System.ArgumentOutOfRangeException(nameof(mode)), }; SetUpSpriteCreator(sav8); }
private void bStart_Click(object sender, EventArgs e) { if (!activeTest) { if (ProgramMode.Equals("Validation test mode")) { bStart.Text = "Stop"; activeTest = true; disableForm(); EVthread = new Thread(delegate() { runEVTestMode(); }); EVthread.Start(); } else if (ProgramMode.Equals("Programming mode")) { //myCommands.InitializeDUTforProgramming(myCommands.Devices[0].dutNumber, myCommands.Devices[0].comport);// reinitialize dut with new baud rate if (!myCommands.Devices[0].bootloaderMode) { MessageBox.Show("You must cycle power to the device in order to program new firmware", "Important Message"); } else { bStart.Text = "Stop"; activeTest = true; disableForm(); Thread programDevice = new Thread(delegate() { myCommands.UploadApplication(myCommands.Devices[0].m_si, myCommands.Devices[0].target, Firmware); }); programDevice.Start(); } } } else { if (ProgramMode.Equals("Validation test mode")) { bStart.Text = "Start"; activeTest = false; enableForm(); stopEVTestMode(); } else if (ProgramMode.Equals("Programming mode")) { MessageBox.Show("You should not stop a device in the middle of being programmed", "Caution"); } } }
private void DrawMode() { mode = ProgramMode.DrawMode; saveResultAsImageToolStripMenuItem.Enabled = false; saveResultToolStripMenuItem.Enabled = false; btnAddPoint.Enabled = true; btnMesh.Enabled = false; btnSolve.Enabled = false; if (polygon != null) { DrawVertexs(); } }
private void SetMode(ProgramMode mode) { _programSettingsRepository.ProgramMode = mode; if (mode == ProgramMode.Single) { SingleModeRadioButton.Checked = true; } else { MultiModeRadioButton.Checked = true; } }
LoopObject CreateLoop(LockObject locker, ProgramMode programMode) { switch (programMode) { case ProgramMode.Count: return new CountLoop(locker, lower, upper, modulus, threads); case ProgramMode.List: return new ListLoop(locker, lower, upper, modulus, threads); case ProgramMode.Search: return new SearchLoop(locker, lower, upper, modulus, threads, hash); default: throw new NotImplementedException(); } }
private void btnCapture_Click(object sender, EventArgs e) { if (_enrolledTemplateList == null || IsCapturing) { return; } ShowStatusMessage(""); capture(); ProgramMode mode = ProgramMode.Verify; setMode(mode); setModeRadioButtons(mode); createFaceRecord = true; }
private void SetProgramMode() { if (IsDatabaseChecked && IsFileChecked) { programMode = ProgramMode.Both; } else if (IsDatabaseChecked) { programMode = ProgramMode.Database; } else { programMode = ProgramMode.XML; } }
/// <summary> /// 构造函数 /// </summary> /// <param name="mode">程序模式</param> public ConfigFileOperator(ProgramMode mode) { switch (mode) { case ProgramMode.WebForm: config = WebConfigurationManager.OpenWebConfiguration("~/"); break; case ProgramMode.WinForm: config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); break; } CheckedConfigFile(); }
public ProgramSettings( IBranch[] branches, string singleModeMergeMessageFormat, string multiModeMergeMessageFormat, string changesetNumberFormat, string changesetTaskPrefix, ProgramMode programMode = ProgramMode.Single) { Branches = branches; SingleModeMergeMessageFormat = singleModeMergeMessageFormat; MultiModeMergeMessageFormat = multiModeMergeMessageFormat; ChangesetNumberFormat = changesetNumberFormat; ChangesetTaskPrefix = changesetTaskPrefix; ProgramMode = programMode; }
public ProgramMode Run(ProgramMode mode = ProgramMode.Start) { ProgramMode modeNow; if (mode == ProgramMode.Start) { NextCmd = 0; modeNow = ProgramMode.Continue; } do { long index = NextCmd; modeNow = DoCommand(index); } while (modeNow == ProgramMode.Continue); return(modeNow); }
private static async Task Main(string[] args) { LoadAppSettings(args); SetupLogger(); Log.Information("=============================================================="); DumpSettings(); if (string.IsNullOrEmpty(AppSettings.EQLog)) { Log.Fatal("No EQ Log file specified. Use 'eqlog=<EQLogPath>' argument"); return; } _programMode = GetProgramMode(); await new Program(AppSettings.EQLog).RunProgramAsync(AppSettings.EQLog, AppSettings.ParserCount); }
private void radioButtonGroup_CheckedChanged(object sender, EventArgs e) { if (sender is RadioButton) { RadioButton radiobutton = sender as RadioButton; switch (radiobutton.Text) { case "Enroll": _mode = ProgramMode.Enroll; break; case "Verify": _mode = ProgramMode.Verify; break; case "Identify": _mode = ProgramMode.Identify; break; } } }
public void BeginInitialize() { this.floodFill = new FloodFill(); this.mode = ProgramMode.Idle; this.classifier = null; this.trainer = null; this.featureFilePath = null; this.modelFilePath = null; GestureStudio.DisplayLoadingWindow("Loading Kinect Sensor..."); ThreadPool.QueueUserWorkItem((state) => { // init kinect this.StartKinectSensor(); GestureStudio.HideLoadingWindow(); this.UpdateStatus("Ready"); }); }
public void StartClassify() { this.mode = ProgramMode.Classifying; }
/// <summary> /// Called when the whole program first loads /// </summary> private void VirtualLabToplevel_Load(object sender, System.EventArgs e) { // Display a "WELCOME SCREEN" allowing the user to chose the program type WelcomeScreen ws = new WelcomeScreen(); DialogResult dResult = ws.ShowDialog(); switch (dResult) { case DialogResult.Yes: // practice mode programMode = ProgramMode.Practice; this.Text += " Practice Mode"; break; case DialogResult.No: // evaluation mode programMode = ProgramMode.Eval; resultsShow.Visible = false; pplotShowHide.Enabled = false; this.Text += " Evaluation Mode"; pplotShowHide.Enabled = false; break; } if (dResult != DialogResult.Cancel) { // get student parameters si.stName = ws.stName; si.stID = ws.stID; si.stCourse = ws.stCourse; si.stEmail = ws.stEmail; si.stProf = ws.stProf; // show the students name in title (if available if (si.stName != string.Empty) Text += " Clinician: " + si.stName; // construct and show children admtr = new Audiometer( new Audiometer.presentationDelegate(presFunc), new Audiometer.stateChangedDelegate(stChang)); admtr.MdiParent = this; admtr.Show(); admtr.Location = new Point(0, 0); admtr.Size = new Size(661, 460); // Patient Window //ptwind = new PatientWindow(pt); //Changes made 04/12/2011 ptwind = new PatientWindow(); ptwind.MdiParent = this; ptwind.Show(); ptwind.Location = new Point(0, admtr.Height); ptwind.Size = new Size(400, 450); adgrm = new Audiogram(); adgrm.vltl = this; adgrm.patient = pt; // delete me adgrm.MdiParent = this; adgrm.Show(); adgrm.Location = new Point(admtr.Width,0); adgrm.SpAudInput.MdiParent = this; adgrm.SpAudInput.Location = new Point(750, 496); pplot = new Plateau_Plot.Plateau_Plot(); pplot.MdiParent = this; pplot.Show(); pplot.Location = new Point(adgrm.Width, adgrm.Height); pplot.Visible = false; // SRT srtWind = new SRT.SRT( new SRT.SRT.ResponseDelegate(DoResponse), new SRT.SRT.DoneDelegate(EnableSpeechMenu)); srtWind.MdiParent = this; srtWind.Location = new Point(750, 496); srtWind.Hide(); // WI wiWind = new WI.WI( new WI.WI.DoneDelegate(EnableSpeechMenu), new WI.WI.ResponseDelegate(DoResponse)); wiWind.MdiParent = this; wiWind.Location = new Point(750, 496); wiWind.Hide(); // show form this.Visible = true; WindowState = System.Windows.Forms.FormWindowState.Maximized; prevState = admtr.ameterSettings; } // end if ( dResult != Cancel ) }
public void StartLearning() { this.mode = ProgramMode.Learning; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { // new Integrator _h = 0.01; //delta t _maxTime = 500; _timer = new TriggeredTimer (100); _timer.Elapsed += delegate(object sender, EventArgs e) { Gtk.Application.Invoke (delegate { _timeValue = _timeValue + _h*5; slideTime.Value = _timeValue; RepaintAll(); }); }; _settings = new SettingsChimera (); AWP awp = _settings.AWP; _int = new Integrator (_h, _maxTime, awp); _int.AWP.Changed += AwpChanged; _playing = false; _timeValue = 0; _int.EditMode = true; Build (); _surfaces = new SurfaceList(4, "j"); Table tbl = _surfaces; this.contentColumns.Add (tbl); global::Gtk.Box.BoxChild wtbl = ((global::Gtk.Box.BoxChild)(this.contentColumns [tbl])); wtbl.Position = 0; _fileOpenDialog = new FileChooserDialog ("Anfangswert öffnen", this, FileChooserAction.Open); _fileOpenDialog.AddButton(Stock.Cancel, ResponseType.Cancel); _fileOpenDialog.AddButton(Stock.Open, ResponseType.Ok); _fileOpenDialog.Filter = new FileFilter(); _fileOpenDialog.Filter.AddPattern("*.awp"); _fileSaveDialog = new FileChooserDialog ("Anfangswert speichern", this, FileChooserAction.Save); _fileSaveDialog.AddButton(Stock.Cancel, ResponseType.Cancel); _fileSaveDialog.AddButton(Stock.Save, ResponseType.Ok); _fileSaveDialog.Filter = new FileFilter(); _fileSaveDialog.Filter.AddPattern("*.awp"); _filePlotDialog = new FileChooserDialog ("Grafiken exportieren", this, FileChooserAction.CreateFolder); _filePlotDialog.AddButton(Stock.Cancel, ResponseType.Cancel); _filePlotDialog.AddButton("Exportieren", ResponseType.Ok); ValueSurfaceItem vsi_real = new ValueSurfaceItem (1500, 500, 500, 100, "x<sub>j</sub>"); vsi_real.ValueExtractor = new Func<Complex, double> (delegate(Complex z) { return z.Real; }); //vsi_real.YLimUp = 1.2; //vsi_real.YLimDown = -1.2; ValueSurfaceItem vsi_imag = new ValueSurfaceItem (1500, 500, 500, 100, "y<sub>j</sub>"); vsi_imag.ValueExtractor = new Func<Complex, double> (delegate(Complex z) { return z.Imaginary; }); //vsi_imag.YLimUp = 1.2; //vsi_imag.YLimDown = -1.2; ValueSurfaceItem vsi_magn = new ValueSurfaceItem (1500, 500, 500, 100, "r<sub>j</sub>"); //vsi_magn.YLimDown = 0; vsi_magn.ValueExtractor = new Func<Complex, double> (delegate(Complex z) { return z.Magnitude; }); //vsi_magn.YLimUp = 1.2; //vsi_magn.YLimDown = -0.2; ValueSurfaceItem vsi_phas = new ValueSurfaceItem (1500, 500, 500, 100, "φ<sub>j</sub>"); vsi_phas.ValueExtractor = new Func<Complex, double> (delegate(Complex z) { return z.Phase; }); //vsi_phas.YLimUp = 3.2; //vsi_phas.YLimDown = -3.2; vsi_real.PointChanged += delegate(object sender, OdePointEventArgs e) { modY [e.Index] = new Complex (e.Value.Real, modY [e.Index].Imaginary); _int.AWP.Y = modY; RepaintAll (); }; vsi_real.RedrawRequired += SurfaceRedrawRequired; vsi_imag.PointChanged += delegate(object sender, OdePointEventArgs e) { modY [e.Index] = new Complex (modY[e.Index].Real, e.Value.Real); _int.AWP.Y = modY; RepaintAll (); }; vsi_imag.RedrawRequired += SurfaceRedrawRequired; vsi_magn.PointChanged += delegate(object sender, OdePointEventArgs e) { modY [e.Index] = Complex.FromPolarCoordinates(Math.Max(0, e.Value.Real), modY[e.Index].Phase); _int.AWP.Y = modY; RepaintAll (); }; vsi_magn.RedrawRequired += SurfaceRedrawRequired; vsi_magn.AxisProperties.ZeroPosition = 0.92; vsi_magn.AxisProperties.AddValue(0, "0"); vsi_phas.PointChanged += delegate(object sender, OdePointEventArgs e) { modY [e.Index] = Complex.FromPolarCoordinates(modY[e.Index].Magnitude, e.Value.Real); _int.AWP.Y = modY; RepaintAll (); }; vsi_phas.RedrawRequired += SurfaceRedrawRequired; vsi_phas.AxisProperties = AxisProperties.CreateStatic (vsi_phas, -3.8, 3.8); vsi_phas.AxisProperties.MaxCount = 3; vsi_phas.AxisProperties.AddValue(Math.PI, "π"); vsi_phas.AxisProperties.AddValue(0, "0"); vsi_phas.AxisProperties.AddValue(-Math.PI, "-π"); _surfaces.Add (vsi_real); _surfaces.Add (vsi_imag); _surfaces.Add (vsi_magn); _surfaces.Add (vsi_phas); _portrait = new PhasePortraitSurfaceItem (500, 300); _portrait.PointAdded += delegate(object sender, OdePointEventArgs e) { Complex[] n = new Complex[modY.Length + 1]; Array.Copy (modY, n, modY.Length); n [modY.Length] = e.Value; modY = n; _int.AWP.Y = modY; numN.Value = n.Length; RepaintAll (); }; _portrait.Clear (); _portrait.RedrawRequired += SurfaceRedrawRequired; this.boxPhase.Add (_portrait); global::Gtk.Box.BoxChild wp = ((global::Gtk.Box.BoxChild)(this.boxPhase [_portrait])); wp.Position = 0; ShowAll (); slideTime.SetIncrements (_h, Math.Max (_h, _maxTime / 100)); slideTime.SetRange (0, _maxTime); slideBeta.Digits = 2; slideK.Digits = 1; slideLambda.Digits = 1; slideOmega.Digits = 1; slideBeta.Value = _int.AWP.Beta; slideK.Value = _int.AWP.K; slideLambda.Value = _int.AWP.Lambda; slideOmega.Value = _int.AWP.Omega; //slideTime.Value = 0; numN.Value = _int.AWP.N; numP.Value = _int.AWP.P; _int.CalculationStarted += HandleCalculationStarted; _int.CalculationFinished += (object sender, EventArgs e) => { Gtk.Application.Invoke (delegate { progressStatus.Visible = false; lblStatus.Text = "Berechnung abgeschlossen"; }); }; _int.TimeRange += (object sender, TimeRangeEventArgs e) => { // slideTime.SetRange (0, e.Time); RepaintAll(); Gtk.Application.Invoke (delegate { progressStatus.Fraction = e.Time / _maxTime; }); }; _mode = ProgramMode.Investigation; ProgramMode = ProgramMode.Presentation; _int.EditMode = false; }
private void setMode(ProgramMode mode) { switch (mode) { case ProgramMode.Enroll: EnrollMode = true; break; case ProgramMode.Identify: EnrollMode = false; break; case ProgramMode.Verify: EnrollMode = false; break; } _mode = mode; }
private void setModeRadioButtons(ProgramMode mode) { switch (mode) { case ProgramMode.Enroll: radioButtonEnroll.Enabled = true; radioButtonEnroll.Checked = true; radioButtonVerify.Enabled = false; break; case ProgramMode.Verify: radioButtonVerify.Enabled = true; radioButtonVerify.Checked = true; radioButtonEnroll.Enabled = false; break; case ProgramMode.Identify: radioButtonIdentify.Checked = true; break; } }
private ProgramArguments(ProgramMode mode, string originalFileName, string convertedFileName) { _mode = mode; _originalFileName = originalFileName; _convertedFileName = convertedFileName; }
private void ChangeMode(ProgramMode mode) { switch (mode) { case ProgramMode.Main: { LoginPanel.Visibility = Visibility.Collapsed; ProxyPanel.Visibility = Visibility.Collapsed; MenuPanel.Visibility = Visibility.Visible; TweetPanel.Visibility = Visibility.Visible; SendTweetPanel.Visibility = Visibility.Visible; break; } case ProgramMode.Login: default: { LoginPanel.Visibility = Visibility.Visible; ProxyPanel.Visibility = Visibility.Visible; MenuPanel.Visibility = Visibility.Collapsed; TweetPanel.Visibility = Visibility.Collapsed; SendTweetPanel.Visibility = Visibility.Collapsed; break; } } }
/// <summary> /// Toggles the program mode and returns the new mode. /// </summary> /// <returns>The new mode.</returns> public static ProgramMode ToggleMode() { if (_mode == ProgramMode.Editor) mode = ProgramMode.Game; else mode = ProgramMode.Editor; return mode; }
/* private void LogWait() { //if (count == 1) //{ lblWaitingForImg.Text = "Waiting for image..."; LogLine(lblWaitingForImg.Text, true); //} //else //{ // lblWaitingForImg.Text = string.Format("Waiting for image {0} of {1}", availableCount + 1, count); //LogLine(lblWaitingForImg.Text, true); //} } */ //private void setStatus(string status) //{ // Text = appName + status; //} private void setMode(ProgramMode mode) { //setStatus(mode.ToString()); switch (mode) { case ProgramMode.Enroll: EnrollMode = true; break; case ProgramMode.Identify: EnrollMode = false; break; case ProgramMode.Verify: EnrollMode = false; break; } _mode = mode; // dgvFields.Rows.Clear(); }