private void MovingAverages() { var tree = new TreeNode("Moving Average") { //DefaultOpened = true, FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; Group.AddComponent(tree); tool_MA_Count = new InputInt1("Count", 1) { Max = 2, Min = 1 }; tree.AddComponent(tool_MA_Count); tool_MA_LineColor = new ColorEdit("Color", new Color(100, 100, 255)) { EditAlpha = false }; tree.AddComponent(tool_MA_LineColor); var button_Do = new Button("Create Line"); button_Do.Clicked += new EventHandler(Tool_MA_Button_Do); tree.AddComponent(button_Do); }
private void IOBinary() { var tree = new TreeNode("I/O") { FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; var line_Load = new Line(); var tool_LoadBinary = new Button("Load Binary"); tool_LoadBinary.Clicked += new EventHandler(Tool_LoadBinary); line_Load.AddComponent(tool_LoadBinary); tool_load_Error = new Text() { IsUpdated = false }; line_Load.AddComponent(tool_load_Error); tree.AddComponent(line_Load); var line_Save = new Line(); var tool_SaveBinary = new Button("Save Binary"); tool_SaveBinary.Clicked += new EventHandler(Tool_SaveBinary); line_Save.AddComponent(tool_SaveBinary); tool_save_Error = new Text() { IsUpdated = false }; line_Save.AddComponent(tool_save_Error); var tool_Export = new Button("Export as csv"); tree.AddComponent(line_Save); tool_Export.Clicked += new EventHandler(Tool_Export); tree.AddComponent(tool_Export); Group.AddComponent(tree); }
private void InitLogistics() { var tree = new TreeNode("Logistics") { //DefaultOpened = true, FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; Group.AddComponent(tree); var line = graph.AddData(CalcLogistics(DataBase.Data.Count, 0.3f, DataBase.Data.Count > 0 ? DataBase.Data.First.Value : 0, (int)graph.MaxY)); line.Color = new Color(255, 255, 255, 0); var colorEdit = new ColorEdit("Color", new Color(255, 255, 255)) { EditAlpha = false }; colorEdit.ColorChanged += (x, y) => { var c = y.NewValue; c.A = line.Color.A; line.Color = c; }; tree.AddComponent(colorEdit); var inputFloat_R = new InputFloat1("r", 0.3f) { Max = 1.0f, Min = 0.0f }; inputFloat_R.ValueChanged += (x, y) => updateLogisticsLine?.Invoke(false); tree.AddComponent(inputFloat_R); var inputInt_K = new InputInt1("K", (int)graph.MaxY) { Min = 1 }; inputInt_K.ValueChanged += (x, y) => updateLogisticsLine?.Invoke(false); tree.AddComponent(inputInt_K); var checkBox = new CheckBox("Shown", false); checkBox.ChangeChecked += (x, y) => { var color = line.Color; color.A = y.NewValue ? (byte)255 : default; line.Color = color; }; tree.AddComponent(checkBox); updateLogisticsLine = (x) => { if (x) { inputInt_K.Value = (int)graph.MaxY; } line.Data = CalcLogistics(DataBase.Data.Count, inputFloat_R.Value, DataBase.Data.Count > 0 ? DataBase.Data.First.Value : 0, inputInt_K.Value); }; }
private void InitTool() { ToolHelper.Position = new Vector2F(960, 0); ToolHelper.Size = new Vector2I(300, 720); ToolHelper.Name = "Settings"; ToolHelper.WindowFlags = ToolWindowFlags.NoCollapse | ToolWindowFlags.NoMove | ToolWindowFlags.NoResize; var tree_GraphButtons = new TreeNode("Lines") { DefaultOpened = true, FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; Group.AddComponent(tree_GraphButtons); var tool_RawData = new CheckBox("Raw Data", true); tool_RawData.ChangeChecked += new EventHandler <ToolValueEventArgs <bool> >(Tool_RawData); tree_GraphButtons.AddComponent(tool_RawData); var tool_Substract = new CheckBox("Substract", true); tool_Substract.ChangeChecked += new EventHandler <ToolValueEventArgs <bool> >(Tool_Substract); tree_GraphButtons.AddComponent(tool_Substract); tree_GraphButtons.AddComponent(graphButtonGroup); var tree_Parameters = new TreeNode("Parameter") { DefaultOpened = true, FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; Group.AddComponent(tree_Parameters); tool_Max = new InputInt1("Max", (int)graph.MaxY) { Min = (int)graph.MinY + 1 }; tool_Max.ValueChanged += new EventHandler <ToolValueEventArgs <int> >(Tool_MaxChange); tree_Parameters.AddComponent(tool_Max); tool_Min = new InputInt1("Min", (int)graph.MinY) { Max = (int)graph.MaxY - 1 }; tool_Min.ValueChanged += new EventHandler <ToolValueEventArgs <int> >(Tool_MinChange); tree_Parameters.AddComponent(tool_Min); MovingAverages(); InitChaos(); InitLogistics(); var tool_ToMain = new Button("Back"); tool_ToMain.Clicked += (x, y) => DataBase.ToMain(); Group.AddComponent(tool_ToMain); }
private void Register() { buttons = new Dictionary <Entry, CheckBox>(18); var tree = new TreeNode("Dead-Alive setting") { DefaultOpened = true, FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; Group.AddComponent(tree); for (int i = 0; i <= 8; i++) { var value = i; var check_Alive = new CheckBox($"{value}-Alive", DataBase.LiveDeadTable[new Entry(value, true)]); var check_Dead = new CheckBox($"{value}-Dead", DataBase.LiveDeadTable[new Entry(value, false)]); check_Alive.ChangeChecked += (x, y) => DataBase.LiveDeadTable[new Entry(value, true)] = y.NewValue; check_Dead.ChangeChecked += (x, y) => DataBase.LiveDeadTable[new Entry(value, false)] = y.NewValue; var line = new Line(); line.AddComponent(check_Alive); line.AddComponent(check_Dead); buttons.Add(new Entry(i, true), check_Alive); buttons.Add(new Entry(i, false), check_Dead); tree.AddComponent(line); } }
private void InitChaos() { var tree = new TreeNode("Chaos") { //DefaultOpened = true, FrameType = IToolTreeNode.TreeNodeFrameType.Framed }; Group.AddComponent(tree); var line = graph.AddData(Array.Empty <Vector2F>()); var color = new Color(255, 255, 100, 0); line.Color = color; color.A = 255; var colorEdit = new ColorEdit("Color", color) { EditAlpha = false }; colorEdit.ColorChanged += (x, y) => { var c = y.NewValue; c.A = line.Color.A; line.Color = c; }; tree.AddComponent(colorEdit); var inputFloat_Init = new InputFloat1("InitValue", 0.1f) { Min = 0.0f, Max = 1.0f }; inputFloat_Init.ValueChanged += (x, y) => updateChaosLine?.Invoke(false); tree.AddComponent(inputFloat_Init); var inputFloat_Lamda = new InputFloat1("lamda", 1.0f) { Min = 0.0f, Max = 4.0f, }; inputFloat_Lamda.ValueChanged += (x, y) => updateChaosLine?.Invoke(false); tree.AddComponent(inputFloat_Lamda); var inputFloat_Arg = new InputFloat1("Arg", 1.0f) { Min = 0.0f }; inputFloat_Arg.ValueChanged += (x, y) => updateChaosLine?.Invoke(false); tree.AddComponent(inputFloat_Arg); var inputInt_Count = new InputInt1("Count", 50) { Min = 1 }; inputInt_Count.ValueChanged += (x, y) => updateChaosLine?.Invoke(false); tree.AddComponent(inputInt_Count); var checkBox = new CheckBox("Shown", false); checkBox.ChangeChecked += (x, y) => { var c = line.Color; c.A = y.NewValue ? byte.MaxValue : default; line.Color = c; }; tree.AddComponent(checkBox); updateChaosLine = x => { if (x) { inputFloat_Arg.Value = graph.MaxY; } line.Data = CalcChaos(inputInt_Count.Value, inputFloat_Lamda.Value, inputFloat_Init.Value, inputFloat_Arg.Value); }; }