Beispiel #1
0
        public AutoSuture2()
        {
            this.TypeName   = "AutoSuture";
            this.PluginInfo = "";
            InitializeComponent();

            // OUTPUTS
            Outputs.Add("X", new ViewModel.OutputSignalViewModel("X"));
            Outputs.Add("Y", new ViewModel.OutputSignalViewModel("Y"));
            Outputs.Add("Z", new ViewModel.OutputSignalViewModel("Z"));
            Outputs.Add("Twist", new ViewModel.OutputSignalViewModel("Twist"));
            Outputs.Add("Trajectory_X", new ViewModel.OutputSignalViewModel("Trajectory_X"));
            Outputs.Add("Trajectory_Y", new ViewModel.OutputSignalViewModel("Trajectory_Y"));
            Outputs.Add("Trajectory_Z", new ViewModel.OutputSignalViewModel("Trajectory_Z"));
            Outputs.Add("Trajectory_Twist", new ViewModel.OutputSignalViewModel("Trajectory_Twist"));
            Outputs.Add("Clutch", new ViewModel.OutputSignalViewModel("Clutch"));

            // INPUTS
            Inputs.Add("X", new ViewModel.InputSignalViewModel("X", this.InstanceName));
            Inputs.Add("Y", new ViewModel.InputSignalViewModel("Y", this.InstanceName));
            Inputs.Add("Z", new ViewModel.InputSignalViewModel("Z", this.InstanceName));
            Inputs.Add("Roll/Twist", new ViewModel.InputSignalViewModel("Roll/Twist", this.InstanceName));
            Inputs.Add("Entry", new ViewModel.InputSignalViewModel("Entry", this.InstanceName));
            Inputs.Add("Exit", new ViewModel.InputSignalViewModel("Exit", this.InstanceName));
            Inputs.Add("leftUpperBevel", new ViewModel.InputSignalViewModel("leftUpperBevel", this.InstanceName));
            Inputs.Add("leftLowerBevel", new ViewModel.InputSignalViewModel("leftLowerBevel", this.InstanceName));
            Inputs.Add("leftElbow", new ViewModel.InputSignalViewModel("leftElbow", this.InstanceName));

            //End Sutring button
            EndSuturingButton.IsEnabled = false;

            // set up output timer for performing suturing
            stepTimer.Interval = 100;
            stepTimer.Tick    += StepTimer_Tick;

            PostLoadSetup();
        }
Beispiel #2
0
        public Resolution(Window parentWindow)
            : base("Change Resolution", 10, 45, 30, 8, parentWindow)
        {
            var widthLabel = new Label("Width", 12, 48, "widthLabel", parentWindow);

            widthTxtBox = new TextBox(12, 56, Console.WindowWidth.ToString(), "widthTxtBox", this, 5);
            var widthMaxBtn = new Button(12, 64, "Max", "widthMaxBtn", this);

            widthMaxBtn.Action = delegate() { widthTxtBox.SetText(Console.LargestWindowWidth.ToString()); };

            var heightLabel = new Label("Height", 14, 48, "widthLabel", parentWindow);

            heightTxtBox = new TextBox(14, 56, Console.WindowHeight.ToString(), "heightTxtBox", this, 5);
            var heightMaxBtn = new Button(14, 64, "Max", "heighthMaxBtn", this);

            heightMaxBtn.Action = delegate() { heightTxtBox.SetText(Console.LargestWindowHeight.ToString()); };

            applyBtn        = new Button(16, 48, "Apply", "applyBtn", this);
            applyBtn.Action = delegate() { Apply(); };

            exitBtn        = new Button(16, 57, "Exit", "exitBtn", this);
            exitBtn.Action = delegate() { ExitWindow(); };

            Inputs.Add(widthLabel);
            Inputs.Add(widthTxtBox);
            Inputs.Add(widthMaxBtn);
            Inputs.Add(heightLabel);
            Inputs.Add(heightTxtBox);
            Inputs.Add(heightMaxBtn);
            Inputs.Add(applyBtn);
            Inputs.Add(exitBtn);

            CurrentlySelected = applyBtn;

            Draw();
            MainLoop();
        }
Beispiel #3
0
        public void AddItem(string item, List <MenuButton> menuItems)
        {
            if (!(ParentWindow is FullWindow fw))
            {
                return;
            }
            var w          = MenuWidth;
            var menuWindow = new MenuItemWindow(MenuWidth, 1, 20, menuItems.Count, this)
            {
                Visible = false
            };
            var y = 0;

            foreach (var i in menuItems)
            {
                var a = i.Action;
                i.ParentWindow = menuWindow;
                i.PositionX    = 0;
                i.PositionY    = y;
                i.Action       = () =>
                {
                    menuWindow.Visible = false;
                    a?.Invoke();
                };
                menuWindow.Inputs.Add(i);
                y++;
            }
            MenuWindows.Add(menuWindow);
            fw.Windows.Add(menuWindow);
            Inputs.Add(new Button(w + 1, 0, item, this)
            {
                BackColor         = Terminal.DARK_GRAY,
                SelectedBackColor = Terminal.GRAY,
                SelectedTextColor = Terminal.WHITE,
                Action            = () => ActivateMenu(menuWindow)
            });
        }
Beispiel #4
0
        public LoadMenu(String path, Dictionary <String, String> fileTypes, Window parentWindow)
            : base("Load Menu", Math.Min(6, Console.WindowHeight - 22), (Console.WindowWidth / 2) - 30, 60, 20, parentWindow)
        {
            BackgroundColour = ConsoleColor.White;
            FileTypes        = fileTypes;

            fileSelect            = new FileBrowser(PostionX + 2, PostionY + 2, 56, 13, path, "fileSelect", this, true, "txt");
            fileSelect.ChangeItem = delegate() { UpdateCurrentlySelectedFileName(); };
            fileSelect.SelectFile = delegate() { LoadFile(); };

            var openLabel = new Label("Open", PostionX + 16, PostionY + 2, "openLabel", this);

            openTxtBox = new TextBox(PostionX + 16, PostionY + 7, "openTxtBox", this, Width - 13)
            {
                Selectable = false
            };

            fileTypeDropdown            = new Dropdown(PostionX + 18, PostionY + 40, FileTypes.Select(x => x.Value).ToList(), "fileTypeDropdown", this, 17);
            fileTypeDropdown.OnUnselect = delegate() { UpdateFileTypeFilter(); };

            loadBtn          = new Button(PostionX + 18, PostionY + 2, "Load", "loadBtn", this);
            loadBtn.Action   = delegate() { LoadFile(); };
            cancelBtn        = new Button(PostionX + 18, PostionY + 9, "Cancel", "cancelBtn", this);
            cancelBtn.Action = delegate() { ExitWindow(); };

            Inputs.Add(fileSelect);
            Inputs.Add(loadBtn);
            Inputs.Add(cancelBtn);
            Inputs.Add(openLabel);
            Inputs.Add(openTxtBox);
            Inputs.Add(fileTypeDropdown);

            CurrentlySelected = fileSelect;

            Draw();
            MainLoop();
        }
Beispiel #5
0
        public MainWindow()
            : base("Change Folder", 1, (Console.WindowWidth / 2) - ((Console.WindowWidth - 4) / 2), Console.WindowWidth - 4, Console.WindowHeight - 2, null)
        {
            var folderSelect = new FileSelect(3, 3, Console.WindowWidth - 6, Height - 6, Directory.GetCurrentDirectory(), "folderSelect", this, true);

            folderSelect.SelectFile = delegate() { Path = folderSelect.CurrentPath; changePath = true; ExitWindow(); };

            var selectBtn = new Button(PostionX + Height - 2, 3, "Select", "selectBtn", this);

            selectBtn.Action = delegate() { Path = folderSelect.CurrentPath; changePath = true; ExitWindow(); };

            var cancelBtn = new Button(PostionX + Height - 2, 12, "Cancel", "cancelBtn", this);

            cancelBtn.Action = delegate() { changePath = false; ExitWindow(); };

            Inputs.Add(folderSelect);
            Inputs.Add(selectBtn);
            Inputs.Add(cancelBtn);

            CurrentlySelected = selectBtn;

            Draw();
            MainLoop();
        }
Beispiel #6
0
        public BreakFloat3Node(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base()
        {
            //we ignore w,h,p

            CanPreview = false;

            Name     = "Break Float3";
            Id       = Guid.NewGuid().ToString();
            shaderId = "S" + Id.Split('-')[0];

            input   = new NodeInput(NodeType.Float3, this, "Float3 Type");
            output  = new NodeOutput(NodeType.Float, this, "X");
            output2 = new NodeOutput(NodeType.Float, this, "Y");
            output3 = new NodeOutput(NodeType.Float, this, "Z");

            Inputs.Add(input);

            input.OnInputAdded   += Input_OnInputAdded;
            input.OnInputChanged += Input_OnInputChanged;

            Outputs.Add(output);
            Outputs.Add(output2);
            Outputs.Add(output3);
        }
Beispiel #7
0
        public void AddAllInputs()
        {
            Inputs.Add(libraryTextBox);
            Inputs.Add(musicTextBox);
            Inputs.Add(playlistTextBox);
            Inputs.Add(controlsLabel);

            Inputs.Add(shufflePlayBtn);
            Inputs.Add(repeatAllBtn);
            Inputs.Add(stopBtn);
            Inputs.Add(playBtn);
            Inputs.Add(nextTrackBtn);
            Inputs.Add(previousTrackBtn);
            Inputs.Add(startLabel);
            Inputs.Add(endLabel);
            Inputs.Add(pouseBtn);
            //Inputs.Add(artistLabel);
            //Inputs.Add(albumLabel);
            //Inputs.Add(nameLabel);
            //Inputs.Add(rankLabel);
            Inputs.Add(volumeDownBtn);
            Inputs.Add(volumeLabel);
            Inputs.Add(volumeUpBtn);
            Inputs.Add(addNewLibraryBtn);
            Inputs.Add(addNewPlaylistBtn);

            Inputs.Add(artistLabelBtn);
            Inputs.Add(nameLabelBtn);
            Inputs.Add(albumLabelBtn);
            Inputs.Add(currentSongLabel);
            //Inputs.Add(openWindow);

            Inputs.Add(currentPlaylistBrowser);
            Inputs.Add(playlistsBrowser);
            Inputs.Add(libraryBrowser);
        }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the Scale class.
        /// </summary>
        public Scale()
        {
            TypeName     = "Two Armed Scaling";
            InstanceName = "Scaling";

            Outputs.Add("X-Left", new ViewModel.OutputSignalViewModel("Scaled - X-Left"));
            Outputs.Add("Y-Left", new ViewModel.OutputSignalViewModel("Scaled - Y-Left"));
            Outputs.Add("Z-Left", new ViewModel.OutputSignalViewModel("Scaled - Z-Left"));
            Outputs.Add("X-Right", new ViewModel.OutputSignalViewModel("Scaled - X-Right"));
            Outputs.Add("Y-Right", new ViewModel.OutputSignalViewModel("Scaled - Y-Right"));
            Outputs.Add("Z-Right", new ViewModel.OutputSignalViewModel("Scaled - Z-Right"));
            Outputs.Add("Scale", new ViewModel.OutputSignalViewModel("Scale Level"));

            Inputs.Add("X-Left", new ViewModel.InputSignalViewModel("X-Left", this.InstanceName));
            Inputs.Add("Y-Left", new ViewModel.InputSignalViewModel("Y-Left", this.InstanceName));
            Inputs.Add("Z-Left", new ViewModel.InputSignalViewModel("Z-Left", this.InstanceName));
            Inputs.Add("X-Right", new ViewModel.InputSignalViewModel("X-Right", this.InstanceName));
            Inputs.Add("Y-Right", new ViewModel.InputSignalViewModel("Y-Right", this.InstanceName));
            Inputs.Add("Z-Right", new ViewModel.InputSignalViewModel("Z-Right", this.InstanceName));

            InitializeComponent();

            PostLoadSetup();
        }
Beispiel #9
0
        public SwitchNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base()
        {
            Name = "Switch";
            Id   = Guid.NewGuid().ToString();

            width  = w;
            height = h;

            selected = SwitchInput.Input0;

            tileX = tileY = 1;

            internalPixelType = p;

            previewProcessor = new BasicImageRenderer();

            input  = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input 0");
            input2 = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input 1");
            Output = new NodeOutput(NodeType.Color | NodeType.Gray, this);

            Inputs.Add(input);
            Inputs.Add(input2);
            Outputs.Add(Output);
        }
Beispiel #10
0
        public HSLNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base()
        {
            Name   = "HSL";
            Id     = Guid.NewGuid().ToString();
            width  = w;
            height = h;

            tileX = tileY = 1;

            previewProcessor = new BasicImageRenderer();
            processor        = new HSLProcessor();

            hue        = 0;
            saturation = 0;
            lightness  = 0;

            internalPixelType = p;

            input  = new NodeInput(NodeType.Gray | NodeType.Color, this, "Image");
            Output = new NodeOutput(NodeType.Color, this);

            Inputs.Add(input);
            Outputs.Add(Output);
        }
Beispiel #11
0
        /// <summary>
        /// Create a new GeomagicTouch.
        ///
        /// This function only runs when creating new instances of this class -- it does *not* run when instances of this class are deserialized.
        /// </summary>
        public GeomagicTouch()
        {
            this.DataContext = this;
            InitializeComponent();

            DeviceNames = new ObservableCollection <string>();

            Outputs.Add("X", new OutputSignalViewModel("X Position"));
            Outputs.Add("Y", new OutputSignalViewModel("Y Position"));
            Outputs.Add("Z", new OutputSignalViewModel("Z Position"));
            Outputs.Add("Theta1", new OutputSignalViewModel("Pitch / Theta 1"));
            Outputs.Add("Theta2", new OutputSignalViewModel("Yaw / Theta 2"));
            Outputs.Add("Theta3", new OutputSignalViewModel("Roll / Theta 3"));
            Outputs.Add("Inkwell", new OutputSignalViewModel("Inkwell Switch"));
            Outputs.Add("Button1", new OutputSignalViewModel("Button 1"));
            Outputs.Add("Button2", new OutputSignalViewModel("Button 2"));
            TypeName = "Geomagic Touch";

            Inputs.Add("ForceX", new ViewModel.InputSignalViewModel("SetpointX", this.InstanceName));
            Inputs.Add("ForceY", new ViewModel.InputSignalViewModel("SetpointY", this.InstanceName));
            Inputs.Add("ForceZ", new ViewModel.InputSignalViewModel("SetpointZ", this.InstanceName));
            Inputs.Add("HapticsEnabled", new ViewModel.InputSignalViewModel("HapticsEnabled", this.InstanceName));

            // Get a list of all GeomagicTouch device names
            foreach (string device in GetGeomagicDevices())
            {
                DeviceNames.Add(device);
            }

//            UpdateTimer = new System.Timers.Timer();
            UpdateTimer.Tick    += UpdateTimer_Tick;
            UpdateTimer.Interval = 15;

            // Call any additional setup work that needs to happen in either constructor's case, or loading the plugin from deserialization.
            PostLoadSetup();
        }
Beispiel #12
0
        /// <summary>
        /// Initializes a new instance of the Scale class.
        /// </summary>
        public PerformanceEvaluator()
        {
            TypeName     = "Performance Evaluator (Message Timer)";
            InstanceName = "PerformanceEvaluator";

            Outputs.Add("StimulusOutput", new ViewModel.OutputSignalViewModel("StimulusOutput"));

            Inputs.Add("Input", new ViewModel.InputSignalViewModel("Input", this.InstanceName));

            InitializeComponent();

            Messenger.Default.Register <Messages.Signal>(this, Inputs["Input"].UniqueID, (message) =>
            {
                if ((int)message.Value == NumberOfMessages)
                {
                    stopwatch.Stop();
                    Ticks = stopwatch.ElapsedMilliseconds;
                    stopwatch.Reset();
                    MeasuredFrequency = NumberOfMessages / Ticks;
                    this.RaisePropertyChanged("Ticks");
                    this.RaisePropertyChanged("MeasuredFrequency");
                }
            });
        }
Beispiel #13
0
        public Vec3UnpackNodeViewModel()
        {
            this.Name     = "Unpack Vec3";
            this.Category = NodeCategory.Vector;

            VectorInput.Name   = "Vec3";
            VectorInput.Editor = null;
            Inputs.Add(VectorInput);

            X.Name       = "X";
            X.ReturnType = typeof(float);
            X.Value      = this.WhenAnyValue(vm => vm.VectorInput.Value).Select(v => v == null ? null : new ShaderFunc(() => $"({v.Compile()}).x"));
            Outputs.Add(X);

            Y.Name       = "Y";
            Y.ReturnType = typeof(float);
            Y.Value      = this.WhenAnyValue(vm => vm.VectorInput.Value).Select(v => v == null ? null : new ShaderFunc(() => $"({v.Compile()}).y"));
            Outputs.Add(Y);

            Z.Name       = "Z";
            Z.ReturnType = typeof(float);
            Z.Value      = this.WhenAnyValue(vm => vm.VectorInput.Value).Select(v => v == null ? null : new ShaderFunc(() => $"({v.Compile()}).z"));
            Outputs.Add(Z);
        }
Beispiel #14
0
        public MainWindow()
            : base(0, 0, Console.WindowWidth, Console.WindowHeight, null)
        {
            fileLabel = new Label(' ' + FileInfo.Filename + ' ', 2, (Console.WindowWidth / 2) - (FileInfo.Filename.Count() + 2), "fileLabel", this);

            fileMenu    = BulidFileMenu();
            settingMenu = BuildSettingMenu();
            helpMenu    = BulidHelpMenu();

            textArea          = new TextArea(3, 1, Console.WindowWidth - 3, Console.WindowHeight - 5, "textArea", this);
            textArea.OnChange = delegate() { FileInfo.HasChanged = true; };

            Inputs.Add(fileMenu);
            Inputs.Add(settingMenu);
            Inputs.Add(helpMenu);

            Inputs.Add(fileLabel);
            Inputs.Add(textArea);


            CurrentlySelected = textArea;
            Draw();
            MainLoop();
        }
Beispiel #15
0
        public BlurNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base()
        {
            Name = "Blur";

            Id = Guid.NewGuid().ToString();

            tileX = tileY = 1;

            width  = w;
            height = h;

            intensity = 10;

            internalPixelType = p;

            previewProcessor = new BasicImageRenderer();
            processor        = new BlurProcessor();

            input  = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input");
            Output = new NodeOutput(NodeType.Color | NodeType.Gray, this);

            Inputs.Add(input);
            Outputs.Add(Output);
        }
Beispiel #16
0
        /// <summary>
        /// Add a Input control point info
        /// </summary>
        /// <param name="input">Input Point</param>
        /// <param name="index">Index</param>
        public void Add(InputPoint input, int index)
        {
            try
            {
                ControlPointInfo newCPInfo = new ControlPointInfo
                {
                    ControlPointName = "IN" + index,
                    Label            = input.Label,
                    FullLabel        = input.Description,
                    Type             = IdentifierTypes.INS,
                    Value            = input.Value.ToString(),
                    Units            = input.Value.Unit.GetUnitsNames(null).OffOnName,
                    AutoManual       = input.AutoManual == 0 ? "Auto" : "Manual",
                    Index            = (short)index
                };


                Inputs.Add(newCPInfo);
            }
            catch (Exception ex)
            {
                ExceptionHandler.Show(ex, "Addition of new Input to ControlPointsInfo");
            }
        }
Beispiel #17
0
        public AddEmployee()
        {
            InitializeComponent();

            Inputs.Add(new TextBoxInput("FirstName", txtFirstName));
            Inputs.Add(new TextBoxInput("LastName", txtLastName));
            Inputs.Add(new TextBoxInput("Phone", txtPhone));
            Inputs.Add(new TextBoxInput("Email", txtEmail));
            Inputs.Add(new TextBoxInput("SIN", txtSIN));
            Inputs.Add(new ComboBoxValueInput("Role", cbRole));
            Inputs.Add(new TextBoxInput("Address.StreetAddress", txtStreet));
            Inputs.Add(new ComboBoxTextInput("Address.Country", cbCountry));
            Inputs.Add(new ComboBoxTextInput("Address.State", cbState));
            Inputs.Add(new ComboBoxTextInput("Address.City", cbCity));
            Inputs.Add(new TextBoxInput("Address.PostalCode", txtPostalCode));
            Inputs.Add(new TextBoxInput("Address.AptNum", txtAptNum));

            ViewManager.PopulateList <EmployeeRole, ComboBox>(cbRole);
            ViewManager.PopulateFromQuery(cbState, DataAccess.Execute("select state from tbladdress group by state order by state"));
            ViewManager.PopulateFromQuery(cbCountry, DataAccess.Execute("select country from tbladdress group by country order by country"));
            ViewManager.PopulateFromQuery(cbCity, DataAccess.Execute("select city from tbladdress group by city order by city"));

            btnSubmit.Click += (X, Y) => AttemptAction("insert_employee");
        }
Beispiel #18
0
        public void Add_INPUT(ControlPointInfo variable, int index)
        {
            try
            {
                ControlPointInfo newCPInfo = new ControlPointInfo
                {
                    ControlPointName = "IN" + index,
                    Label            = variable.Label,
                    FullLabel        = variable.FullLabel,
                    Type             = IdentifierTypes.INS,
                    Value            = variable.Value.ToString(),
                    Units            = variable.Units,
                    AutoManual       = variable.AutoManual,
                    Index            = (short)index
                };


                Inputs.Add(newCPInfo);
            }
            catch (Exception ex)
            {
                ExceptionHandler.Show(ex, "Addition of new Variable to ControlPointsInfo");
            }
        }
Beispiel #19
0
        public AddNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base()
        {
            //we ignore w,h,p

            CanPreview = false;

            Name     = "Add";
            Id       = Guid.NewGuid().ToString();
            shaderId = "S" + Id.Split('-')[0];

            output = new NodeOutput(NodeType.Float | NodeType.Float2 | NodeType.Float3 | NodeType.Float4, this);


            for (int i = 0; i < 2; i++)
            {
                var input = new NodeInput(NodeType.Float | NodeType.Float2 | NodeType.Float3 | NodeType.Float4, this, "Any Float Input " + i);
                Inputs.Add(input);

                input.OnInputAdded   += Input_OnInputAdded;
                input.OnInputChanged += Input_OnInputChanged;
            }

            Outputs.Add(output);
        }
Beispiel #20
0
        private void Create(String Message, Window parentWindow)
        {
            var count = 0;

            while ((count * 45) < Message.Count())
            {
                var splitMessage = Message.PadRight(textLength * (count + 1), ' ').Substring((count * textLength), textLength);
                var messageLabel = new Label(splitMessage, PostionX + 2 + count, PostionY + 2, "messageLabel", this);
                Inputs.Add(messageLabel);

                count++;
            }

            okBtn        = new Button(PostionX + Height - 2, PostionY + 2, "OK", "OkBtn", this);
            okBtn.Action = delegate() { ExitWindow(); dr = DialogResult.OK; };

            cancelBtn        = new Button(PostionX + Height - 2, PostionY + 8, "Cancel", "cancelBtn", this);
            cancelBtn.Action = delegate() { ExitWindow(); dr = DialogResult.Cancel; };

            Inputs.Add(okBtn);
            Inputs.Add(cancelBtn);

            CurrentlySelected = okBtn;
        }
Beispiel #21
0
        public VisionOperation()
        {
            //创建运行时/配置窗口控件
            var runningSmartWindow = new HSmartWindowControlWPF();

            runningSmartWindow.HInitWindow += RunningSmartWindow_HInitWindow;
            runningSmartWindow.Unloaded    += RunningSmartWindow_Unloaded;
            RunningWindow = runningSmartWindow;

            var configSmartWindow = new HSmartWindowControlWPF();

            configSmartWindow.HInitWindow += ConfigSmartWindow_HInitWindow;
            configSmartWindow.Unloaded    += ConfigSmartWindow_Unloaded;
            ConfigWindow = configSmartWindow;

            //配置输入参数
            Inputs.Clear();
            Inputs.Add(new ItemBase("ModelPath", @"C:\Users\Public\Documents\MVTec\HALCON-17.12-Progress\examples\hdevelop\Matching\Deformable\brake_disk_bike.dxf", typeof(string), "模板文件(.dxf)路径"));

            //配置输出参数
            Outputs.Clear();
            Outputs.Add(new ItemBase("MatchCount", typeof(int), "匹配数量"));
            Outputs.Add(new ItemBase("Scores", typeof(double[]), "匹配分数(List列表)"));
        }
Beispiel #22
0
        public AxisInverterNode()
        {
            Name = "Axis\nInverter";

            var input = new ValueNodeInputViewModel <short?>()
            {
                Name = "Input",
                Port = new AxisPortViewModel(),
            };

            Inputs.Add(input);

            input.ValueChanged.Subscribe(newValue =>
            {
                _output.OnNext(InvertAxis(newValue));
            });

            Outputs.Add(new ValueNodeOutputViewModel <short?>
            {
                Name  = "Output",
                Port  = new AxisPortViewModel(),
                Value = _output
            });
        }
Beispiel #23
0
        public DistanceNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base()
        {
            Name   = "Distance";
            Id     = Guid.NewGuid().ToString();
            width  = w;
            height = h;

            tileX    = tileY = 1;
            distance = 0.2f;

            previewProcessor = new BasicImageRenderer();
            processor        = new DistanceProcessor();

            //distance node requires RGBA32F to compute properly
            internalPixelType = GraphPixelType.RGBA32F;

            input  = new NodeInput(NodeType.Gray, this, "Mask");
            input2 = new NodeInput(NodeType.Gray | NodeType.Color, this, "Source");
            Output = new NodeOutput(NodeType.Gray, this);

            Inputs.Add(input);
            Inputs.Add(input2);
            Outputs.Add(Output);
        }
Beispiel #24
0
 private void GenerateRand(int inputs, List <int> hiddenLayers, int outputs, int memory)
 {
     for (int i = 0; i < inputs; i++)
     {
         Inputs.Add(new Neuron());
     }
     for (int i = 0; i < memory; i++)
     {
         Memory.Add(new Neuron(hiddenLayers[hiddenLayers.Count - 1], 0, NeuronType.MEMORY));
     }
     for (int i = 0; i < hiddenLayers.Count; i++)
     {
         for (int j = 0; j < hiddenLayers[i]; j++)
         {
             var value     = GetRandomWeight();
             var prevLayer = i == 0 ? Inputs.Concat(Memory).ToList() : HiddenLayers[i - 1];
             HiddenLayers[i].Add(new Neuron(prevLayer.Count, value, NeuronType.HIDDEN));
         }
     }
     for (int i = 0; i < outputs; i++)
     {
         Outputs.Add(new Neuron(hiddenLayers[hiddenLayers.Count - 1], 0, NeuronType.OUTPUT));
     }
 }
Beispiel #25
0
 public void AddInputSafe(Output node)
 {
     if (Inputs.Count < Context.MergerInputs)
     {
         node.Inputs[0].ReassignOutput(node, this);
         Inputs.Add(node.Inputs[0]);
     }
     else
     {
         int    lowestDepth = int.MaxValue;
         Merger bestMerger  = null;
         foreach (Node input in Inputs)
         {
             if (input is Merger merger)
             {
                 int i = merger.AddInputSafeDepth();
                 if (i < lowestDepth)
                 {
                     lowestDepth = i;
                     bestMerger  = merger;
                 }
             }
         }
         if (bestMerger == null)
         {
             Node   temp   = Inputs[Context.MergerInputs - 1];
             Merger merger = new Merger(Context, this, temp);
             merger.AddInputSafe(temp, this);
             merger.AddInputSafe(node);
         }
         else
         {
             bestMerger.AddInputSafe(node);
         }
     }
 }
Beispiel #26
0
 public SNListByWo()
 {
     Inputs.Add(inputWo);
     Inputs.Add(inputEventName);
 }
Beispiel #27
0
 public MmalVideoEncoder() : base(MmalParameters.MmalComponentDefaultVideoEncoder)
 {
     Inputs.Add(new InputPort((IntPtr)(&(*Ptr->Input[0])), this, Guid.NewGuid()));
     Outputs.Add(new VideoPort((IntPtr)(&(*Ptr->Output[0])), this, Guid.NewGuid()));
 }
Beispiel #28
0
        public CalculatorWindow(int x, int y, IWindow parentWindow) : base(x, y, 17, 14, parentWindow)
        {
            _display = new TextBox(1, 2, "0", "displayTxtBox", this, 15)
            {
                Selectable = false
            };

            var pointBtn = new Button(5, 12, ".", this, "pointBtn")
            {
                Action = AddPoint
            };
            var clearBtn = new Button(1, 4, "C", this, "clearBtn")
            {
                Action = Clear
            };

            var zeroBtn = new Button(1, 12, "0", this, "zeroBtn")
            {
                Action = delegate { Number('0'); }
            };
            var oneBtn = new Button(1, 10, "1", this, "oneBtn")
            {
                Action = delegate { Number('1'); }
            };
            var twoBtn = new Button(5, 10, "2", this, "twoBtn")
            {
                Action = delegate { Number('2'); }
            };
            var threeBtn = new Button(9, 10, "3", this, "threeBtn")
            {
                Action = delegate { Number('3'); }
            };
            var fourBtn = new Button(1, 8, "4", this, "fourBtn")
            {
                Action = delegate { Number('4'); }
            };
            var fiveBtn = new Button(5, 8, "5", this, "fiveBtn")
            {
                Action = delegate { Number('5'); }
            };
            var sixBtn = new Button(9, 8, "6", this, "sixBtn")
            {
                Action = delegate { Number('6'); }
            };
            var sevenBtn = new Button(1, 6, "7", this, "sevenBtn")
            {
                Action = delegate { Number('7'); }
            };
            var eightBtn = new Button(5, 6, "8", this, "eightBtn")
            {
                Action = delegate { Number('8'); }
            };
            var nineBtn = new Button(9, 6, "9", this, "nineBtn")
            {
                Action = delegate { Number('9'); }
            };


            var minusBtn = new Button(13, 4, "-", this, "minusBtn")
            {
                Action = delegate { Operator('-'); }
            };
            var addBtn = new Button(13, 6, "+", this, "addBtn")
            {
                Action = delegate { Operator('+'); }
            };
            var timesBtn = new Button(13, 8, "x", this, "timesBtn")
            {
                Action = delegate { Operator('*'); }
            };
            var divideBtn = new Button(13, 10, "/", this, "divideBtn")
            {
                Action = delegate { Operator('/'); }
            };

            EqualsBtn = new Button(9, 12, "  =  ", this, "equalsBtn")
            {
                Action = delegate { Operator('='); }
            };

            Inputs.Add(_display);

            Inputs.Add(clearBtn);
            Inputs.Add(minusBtn);

            Inputs.Add(sevenBtn);
            Inputs.Add(eightBtn);
            Inputs.Add(nineBtn);
            Inputs.Add(addBtn);

            Inputs.Add(fourBtn);
            Inputs.Add(fiveBtn);
            Inputs.Add(sixBtn);

            Inputs.Add(timesBtn);

            Inputs.Add(oneBtn);
            Inputs.Add(twoBtn);
            Inputs.Add(threeBtn);

            Inputs.Add(divideBtn);

            Inputs.Add(zeroBtn);
            Inputs.Add(pointBtn);
            Inputs.Add(EqualsBtn);
            Inputs.Reverse();

            CurrentlySelected = oneBtn;
        }
Beispiel #29
0
    /// <summary>
    /// Input Layer neurons just receive input values.
    /// For this they need to have connections.
    /// This function adds this kind of connection to the neuron.
    /// </summary>
    /// <param name="inputValue">
    /// Initial value that will be "pushed" as an input to connection.
    /// </param>
    public void AddInputSynapse(double inputValue)
    {
        var inputSynapse = new InputSynapse(this, inputValue);

        Inputs.Add(inputSynapse);
    }
 public void AddInput(CreateRawTransactionInput input)
 {
     Inputs.Add(input);
 }