public MainForm() { InitializeComponent(); theModel = new DESmodel(); propertyGrid.SelectedObject = theModel; Client.SetClientChartAndArea(chartClient, chartClient.ChartAreas[0]); // static function 不需要 new CLient 就可以呼叫 Server.SetServerChartAndPieChart(chartServerAndQueue, chartServerAndQueue.ChartAreas[0], chartPie); TimedQueue.SetQueueChartAndArea(chartServerAndQueue, chartServerAndQueue.ChartAreas[1]); chartServerAndQueue.ChartAreas[1].AxisX.MajorGrid.LineColor = Color.Silver; chartServerAndQueue.ChartAreas[1].AxisY.MajorGrid.LineColor = Color.Silver; chartServerAndQueue.ChartAreas[1].AxisY.Minimum = 0; chartServerAndQueue.ChartAreas[1].AxisX.Minimum = 0; chartClient.ChartAreas[0].CursorX.IsUserEnabled = true; chartClient.ChartAreas[0].CursorX.Interval = 0; chartClient.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; chartClient.ChartAreas[0].AxisX.ScaleView.Zoomable = true; chartClient.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true; chartClient.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.ResetZoom; chartClient.ChartAreas[0].AxisX.ScaleView.SmallScrollMinSize = 0; chartClient.ChartAreas[0].CursorY.IsUserEnabled = true; chartClient.ChartAreas[0].CursorY.Interval = 0; chartClient.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; chartClient.ChartAreas[0].AxisY.ScaleView.Zoomable = true; chartClient.ChartAreas[0].AxisY.ScrollBar.IsPositionedInside = true; chartClient.ChartAreas[0].AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.ResetZoom; chartClient.ChartAreas[0].AxisY.ScaleView.SmallScrollMinSize = 0; }
private static void StartServer() { QUEUE = new TimedQueue <Dictionary <string, string> >(messageWindowSize); var ws = new WebServer(SendResponse, "http://*:8080/test/"); ws.Run(); Console.WriteLine("A simple webserver."); }
/// <summary> /// Creates an instance of the conformance tester for an IUT stepper. /// </summary> /// <param name="model">given model stepper</param> /// <param name="impl">given implementation stepper</param> public ConformanceTester(IStrategy model, IStepper impl) { this.model = model; this.impl = impl; //set the callback in the implementation //if the implementation implements IAsyncStepper IAsyncStepper implWithObs = impl as IAsyncStepper; if (implWithObs != null) { TimedQueue<Action> obs = new TimedQueue<Action>(); this.observations = obs; implWithObs.SetObserver(obs.Enqueue); } this.testResultNotifier = this.DefaultTestResultNotifier; this.testerActionTimeout = delegate(IState state, CompoundTerm action) { return defaultTimeSpan; }; this.testerActionSymbols = model.ActionSymbols; this.cleanupActionSymbols = Set<Symbol>.EmptySet; this.internalActionSymbols = Set<Symbol>.EmptySet; this.RandomSeed = new Random().Next(); this.worker = new TimedWorker(); }
/// <summary> /// Creates an instance of the conformance tester for an IUT stepper. /// </summary> /// <param name="model">given model stepper</param> /// <param name="impl">given implementation stepper</param> public ConformanceTester(IStrategy model, IStepper impl) { this.model = model; this.impl = impl; //set the callback in the implementation //if the implementation implements IAsyncStepper IAsyncStepper implWithObs = impl as IAsyncStepper; if (implWithObs != null) { TimedQueue <Action> obs = new TimedQueue <Action>(); this.observations = obs; implWithObs.SetObserver(obs.Enqueue); } this.testResultNotifier = this.DefaultTestResultNotifier; this.testerActionTimeout = delegate(IState state, CompoundTerm action) { return(defaultTimeSpan); }; this.testerActionSymbols = model.ActionSymbols; this.cleanupActionSymbols = Set <Symbol> .EmptySet; this.internalActionSymbols = Set <Symbol> .EmptySet; this.RandomSeed = new Random().Next(); this.worker = new TimedWorker(); }
public HUDTextTimedQueue(Vector2 basePoint) { this.basePoint = basePoint; this.stringsTimedQueue = new TimedQueue<Tuple<String, Color, Boolean>>(QUEUE_SIZE, QUEUE_LIFETIME); }
public MainWindow() { midiMaster = new MIDIMaster(); midiMaster.Setup(); this.KinectSensorManager = new KinectSensorManager(); this.KinectSensorManager.KinectSensorChanged += this.KinectSensorChanged; this.DataContext = this.KinectSensorManager; InitializeComponent(); StartServer(); this.SensorChooserUI.KinectSensorChooser = sensorChooser; sensorChooser.Start(); // Bind the KinectSensor from the sensorChooser to the KinectSensor on the KinectSensorManager var kinectSensorBinding = new Binding("Kinect") { Source = this.sensorChooser }; BindingOperations.SetBinding(this.KinectSensorManager, KinectSensorManager.KinectSensorProperty, kinectSensorBinding); //this.RestoreWindowState(); jointQueue = new TimedQueue <JointCollection>(jointWindowSize); swipeThrottle = new Throttle <Swipe>(swipeThrottleTime, list => { if (list.Count >= 2) { if ((list[0].Data == Swipe.rr && list[1].Data == Swipe.ll) || (list[0].Data == Swipe.ll && list[1].Data == Swipe.rr)) { SendCommand(CmdTogglePlay); return(list.Count); } if ((list[0].Data == Swipe.rl && list[1].Data == Swipe.ll) || (list[0].Data == Swipe.ll && list[1].Data == Swipe.rl)) { SendCommand("Previous Song"); return(list.Count); } if ((list[0].Data == Swipe.rr && list[1].Data == Swipe.lr) || (list[0].Data == Swipe.lr && list[1].Data == Swipe.rr)) { SendCommand("Next Song"); return(list.Count); } } if (list[0].Data == Swipe.rr) { SendCommand(CmdForward); } if (list[0].Data == Swipe.rl) { SendCommand(CmdReverse); } return(list.Count); }); stopWatch.Start(); init(); }