public void Login(object para) { List <object> objs = para as List <object>; string logstr = (objs[0] as TextBox).Text; string passwrd = (objs[1] as PasswordBox).Password; CustomerServices ls = new CustomerServices(); if (ValidateCredentialsforLogin(objs)) { Customer c = ls.LoginCust(logstr, passwrd); if (string.IsNullOrEmpty(c.Name)) { TextBlock Errormsg = (objs[2] as TextBlock); Errormsg.Text = "User Does not Exists"; } else { AdminServices adminServices = new AdminServices(); ObservableCollection <Product> items = adminServices.ViewProduct(); //CartView cartWin = new CartView(items); //cartWin.Show(); SampleWindow Swin = new SampleWindow(items); Swin.Show(); } } else { TextBlock Errormsg = (objs[2] as TextBlock); Errormsg.Text = "Incorrect Input"; } }
void Start() { _debugUi = DebugUiManager.Create( _camera, _textShader, _texturedShader, _font, referenceScreenWidth: 1024, referenceScreenHeight: 576, screenPlaneDistance: 100f, triangleCapacity: 8192); _sampleWindow = new SampleWindow(_debugUi); _debugUi.Add(_sampleWindow, 0, 0, DebugUi.AlignX.Right, DebugUi.AlignY.Bottom); _menu = new DebugUiMenu(100, 40); var subA = new DebugUiSubMenu("SubA", 100, 40, DebugUi.Direction.Down); subA.AddItem("A1", () => Debug.Log("A1")); subA.AddItem("A2", () => Debug.Log("A2")); var subB = new DebugUiSubMenu("SubA", 100, 40, DebugUi.Direction.Down); subB.AddItem("B1", () => Debug.Log("B1")); subB.AddItem("B2", () => Debug.Log("B2")); subA.AddSubMenu(subB, DebugUi.Direction.Right); _menu.AddSubMenu(subA, DebugUi.Direction.Down); _menu.AddItem("1", () => Debug.Log("1")); _menu.AddItem("2", () => Debug.Log("2")); _debugUi.Add(_menu, 0, 0); }
public void FillWithData_When_Passed_Correct_Data_Sucessfully() { //arrange var size = 2; var featureSize = 2; var data = new double[] { 0.225, 0.333 }; var sut = new SampleWindow(size, featureSize); //act sut.FillWithData(data); //assert sut.MelFrequencyCoef .Should() .NotBeNull(); sut.MelFrequencyCoef .Should() .NotBeEmpty(); sut.MelFrequencyCoef .First() .Should() .Be(0); sut.MelFrequencyCoef[1] .Should() .Be(-0.59673461663004923); }
void Start() { // プレハブをInstantiate var manager = Instantiate(debugUiManagerPrefab, null, false); // 描画カメラを指定して手動で開始 manager.ManualStart(mainCamera); sampleWindow = new SampleWindow(manager); manager.Add(sampleWindow, 0, 0, AlignX.Right, AlignY.Bottom); menu = new Menu(100, 40); var subA = new SubMenu("SubA", 100, 40, Direction.Down); subA.AddItem("A1", () => Debug.Log("A1")); subA.AddItem("A2", () => Debug.Log("A2")); var subB = new SubMenu("SubA", 100, 40, Direction.Down); subB.AddItem("B1", () => Debug.Log("B1")); subB.AddItem("B2", () => Debug.Log("B2")); subA.AddSubMenu(subB, Direction.Right); menu.AddSubMenu(subA, Direction.Down); menu.AddItem("1", () => Debug.Log("1")); menu.AddItem("2", () => Debug.Log("2")); manager.Add(menu, 0, 0); }
public void OpenLoadWindow() { isSave = false; SampleWindow window = (SampleWindow)EditorWindow.GetWindow(typeof(SampleWindow), false, "LoadMapDataList"); window.title = "Load Map Data List"; window.Show(); }
public void OpenSaveWindow() { isSave = true; SampleWindow window = (SampleWindow)EditorWindow.GetWindow(typeof(SampleWindow), false, "Save Map Data List"); window.title = "Save Map Data List"; window.Show(); }
public void Construct_With_Negative_Features_Size_Throws_Exception() { //arrange var size = 1; var featureSize = -1; //act Action action = () => { var sut = new SampleWindow(size, featureSize); }; //assert action.Should() .Throw <ArgumentException>(); }
public void Construct_With_Correct_Parameters_Sucessfully() { //arrange var size = 1; var featureSize = 1; //act Action action = () => { var sut = new SampleWindow(size, featureSize); }; //assert action.Should() .NotThrow <ArgumentException>(); }
public Engine() { Window = new SampleWindow(); Window.Show(); _keyboard = new Keyboard(this); _keyboard.OnKeyDown += new KeyEventHandler(_keyboard_OnKeyDown); InitalizeGraphics(); InitalizePhysics(); Mouse.SetCursor(Cursors.None); }
void Start() { _renderer = new DebugPrimitiveRenderer2D( _textShader, _texturedShader, _font, _camera, capacity: 8192); _debugUi = DebugUiManager.Create( _gameObjectForDebugUiManager, _renderer); _sampleWindow = new SampleWindow(_debugUi); _debugUi.Add(_sampleWindow); }
// TODO: Clean up this class public Engine(Action <SceneDesc> sceneDescCallback = null) { _sceneDescCallback = sceneDescCallback; Window = new SampleWindow(); Window.Show(); _keyboard = new Keyboard(this); _keyboard.OnKeyDown += _keyboard_OnKeyDown; InitalizeGraphics(); InitalizePhysics(); Mouse.SetCursor(Cursors.None); }
public void FillWithData_When_Data_Is_Greater_Than_Window_Size_Throws_Exception() { //arrange var size = 1; var featureSize = 1; var data = new double[size + 1]; var sut = new SampleWindow(size, featureSize); //act Action action = () => sut.FillWithData(data); //assert action.Should() .Throw <ArgumentException>(); }
/// <summary> /// This provides a window to pick items from a list. It outputs them in ordered selection. /// </summary> /// <param name="list"></param> /// <returns name="selectedItems"></returns> public static List <Object> PickItemsFromList(List <Object> list) { //our list to return as the output List <Object> returnList = new List <object>(); //this forces the window to load on the UI thread. Important because Dynamo Sandbox is Multi-Threaded Application.Current.Dispatcher.Invoke(new Action(() => { //construct the sample window and show it SampleWindow window = new SampleWindow(list); //we show this as modal so that way we can return the selected items window.ShowDialog(); //iterate through the list box and add the items to our return list foreach (var item in window.SelectionList.SelectedItems) { returnList.Add(item); } })); return(returnList); }
/// <summary> /// Queries a signal buffer for data in the given sample window and returns first measurement. /// This method should typically be used in conjunction with sample windows without a window size, /// created using the <see cref="CreateSampleWindow(decimal, TimeSpan, decimal, TimeSpan)"/> method. /// </summary> /// <param name="key">The key that identifies the signal to be queried.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time to be queried from the buffer.</param> /// <returns>The first measurement for the given signal in the given sample window relative to the given frame time.</returns> public IMeasurement GetMeasurement(MeasurementKey key, Ticks frameTime, SampleWindow window) { return(GetMeasurements(key, frameTime, window).FirstOrDefault()); }
/// <summary> /// Queries a signal buffer for the full collection of measurements over the given sample window. /// </summary> /// <param name="key">The key that identifies the signal to be queried.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time to be queried from the buffer.</param> /// <returns>The full collection of measurements for the given signal in the given sample window relative to the given frame time.</returns> public List <IMeasurement> GetMeasurements(MeasurementKey key, Ticks frameTime, SampleWindow window) { return(GetMeasurements(key, frameTime, window, m_resamplingStrategy)); }
/// <summary> /// Queries a signal buffer for the full collection of measurements over the given sample window. /// </summary> /// <param name="key">The key that identifies the signal to be queried.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time to be queried from the buffer.</param> /// <param name="resamplingStrategy">The strategy to use for alignment of data to the sample rate of the window.</param> /// <returns>The full collection of measurements for the given signal in the given sample window relative to the given frame time.</returns> public List <IMeasurement> GetMeasurements(MeasurementKey key, Ticks frameTime, SampleWindow window, ResamplingStrategy resamplingStrategy) { SignalBuffer signalBuffer; if (!m_signalBuffers.TryGetValue(key, out signalBuffer)) { return(null); } switch (resamplingStrategy) { default: case ResamplingStrategy.NearestMeasurement: return(window.AlignNearest(signalBuffer, frameTime)); case ResamplingStrategy.FillMissingData: return(window.AlignFill(signalBuffer, frameTime)); case ResamplingStrategy.None: return(window.AlignNone(signalBuffer, frameTime)); } }
private void Button2_Click(object sender, RoutedEventArgs e) { SampleWindow sw = new SampleWindow(); sw.ShowDialog(); }
/// <summary> /// Queries multiple signal buffers for data in the given sample window and returns first frame. /// This method should typically be used in conjunction with sample windows without a window size, /// created using the <see cref="CreateSampleWindow(decimal, TimeSpan, decimal, TimeSpan)"/> method. /// </summary> /// <param name="keys">The keys that identify the signals to be queried.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time to be queried from the buffer.</param> /// <returns>The first frame for the given signal in the given sample window relative to the given frame time.</returns> public IDictionary <MeasurementKey, IMeasurement> GetFrame(MeasurementKey[] keys, Ticks frameTime, SampleWindow window) { return(GetFrames(keys, frameTime, window).FirstOrDefault()); }
/// <summary> /// Queries multiple signal buffers to build a list of frames of data over the given sample window. /// </summary> /// <param name="keys">The keys that identify the signals to be queried.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time to be queried from the buffer.</param> /// <returns>A collection of frames over the given sample window.</returns> public List <IDictionary <MeasurementKey, IMeasurement> > GetFrames(MeasurementKey[] keys, Ticks frameTime, SampleWindow window) { return(GetFrames(keys, frameTime, window, m_resamplingStrategy)); }
/// <summary> /// Queries multiple signal buffers to build a list of frames of data over the given sample window. /// </summary> /// <param name="keys">The keys that identify the signals to be queried.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time to be queried from the buffer.</param> /// <param name="resamplingStrategy">The strategy to use for alignment of data to the sample rate of the window.</param> /// <returns>A collection of frames over the given sample window.</returns> public List <IDictionary <MeasurementKey, IMeasurement> > GetFrames(MeasurementKey[] keys, Ticks frameTime, SampleWindow window, ResamplingStrategy resamplingStrategy) { List <IDictionary <MeasurementKey, IMeasurement> > frames = new List <IDictionary <MeasurementKey, IMeasurement> >(); SignalBuffer signalBuffer; foreach (MeasurementKey key in keys) { if (!m_signalBuffers.TryGetValue(key, out signalBuffer)) { continue; } List <IMeasurement> measurements = GetMeasurements(key, frameTime, window, resamplingStrategy); while (frames.Count < measurements.Count) { frames.Add(keys.ToDictionary(k => k, k => (IMeasurement)null)); } for (int i = 0; i < measurements.Count; i++) { frames[i][key] = measurements[i]; } } return(frames); }
public override void OnInspectorGUI() { #region Example //(MonsterType)EditorGUILayout.EnumPopup("", monster.monsterType); //EditorGUILayout.FloatField("", monster.hp); //EditorGUILayout.FloatField("", monster.atk); //EditorGUILayout.TextField("", monster.name); //EditorGUI.DrawPreviewTexture(Rect.zero, monster.sprite); //EditorGUILayout.BeginHorizontal(); //EditorGUILayout.LabelField(""); //EditorGUILayout.ObjectField(monster.sprite, typeof(Sprite), false, new[] { GUILayout.Width(64), GUILayout.Height(64) }) as Sprite; //monster.sprite = EditorGUILayout.ObjectField(monster.sprite, typeof(Sprite), false) as Sprite; //EditorGUILayout.EndHorizontal(); //EditorGUILayout.Slider("value", monster.value, 0f, 1f); #endregion serializedObject.Update(); EditorGUILayout.PropertyField(makeMapData); serializedObject.ApplyModifiedProperties(); if (GUILayout.Button("Save")) { Debug.Log("Save"); mapData.Save(); } if (GUILayout.Button("Load")) { Debug.Log("Load"); mapData.Load(); } GUILayout.Space(10f); if (GUILayout.Button("Save Map Data")) { SampleWindow s = new SampleWindow(); s.makeMapData = mapData; s.OpenSaveWindow(); } if (GUILayout.Button("Load Map Data")) { SampleWindow s = new SampleWindow(); s.makeMapData = mapData; s.OpenLoadWindow(); } GUILayout.Space(10f); if (GUILayout.Button("Clear Data")) { Debug.Log("Clear Data"); mapData.ClearData(); } if (GUILayout.Button("Clear Map")) { Debug.Log("Clear Map"); mapData.ClearMap(); } }
/// <summary> /// Creates new meta values aligned to the given sample window. /// </summary> /// <param name="key">The key that identifies the signal to generate meta values for.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time for which to generate meta values.</param> /// <returns>The full collection of meta values for the given signal in the given sample window relative to the given frame time.</returns> public List <MetaValues> CreateMetaValues(MeasurementKey key, Ticks frameTime, SampleWindow window) { return(window.CreateMetaValues(key, frameTime)); }
public static unsafe void Main(string[] args) { var window = new SampleWindow(); window.RunWindowLoop(); }
private void OpenSampleWindow() { var sampleWindow = new SampleWindow(); sampleWindow.Show(); }
/// <summary> /// Creates new meta values aligned to the given sample window and returns first meta value structure. /// This method should typically be used in conjunction with sample windows without a window size, /// created using the <see cref="CreateSampleWindow(decimal, TimeSpan, decimal, TimeSpan)"/> method. /// </summary> /// <param name="key">The key that identifies the signal to generate meta values for.</param> /// <param name="frameTime">The time of the frame relative to which the sample window is defined.</param> /// <param name="window">The sample window that defines the range of time for which to generate meta values.</param> /// <returns>The first meta value structure for the given signal in the given sample window relative to the given frame time.</returns> public MetaValues CreateMetaValue(MeasurementKey key, Ticks frameTime, SampleWindow window) { return(CreateMetaValues(key, frameTime, window).FirstOrDefault()); }