public void Step(ControlElement controlElement) { ContactEnv.Elevation = _gmTerrainH; ContactEnv.Normal = _normal; Hel.WindSpeed = _windSpeed; Hel.Mass = 10800.0; Hel.InertialMoments = _inertialMoments; Hel.PosCG = _posCg; Hel.vehicleCtrl.CyclicPitch = controlElement._cyclicStepHandleLeft.Elevator; Hel.vehicleCtrl.CyclicRoll = controlElement._cyclicStepHandleLeft.Aileron; Hel.vehicleCtrl.Direction = controlElement._pedalsLeft.Pedal; Hel.vehicleCtrl.Collective = controlElement._generalStepHandleLeft.GeneralStep; IntPtr ptrHel = GetIntPtr(Hel); IntPtr ptrCe = GetIntPtr(ContactEnv); IntPtr ptrRs = GetIntPtr(ResState); IntPtr ptrRh = GetIntPtr(ResHel); Step(0.02, ptrHel, ptrCe, ptrRs, ptrRh); ResState = (KinematicsState)Marshal.PtrToStructure(ptrRs, typeof(KinematicsState)); ResHel = (VhclOutp)Marshal.PtrToStructure(ptrRh, typeof(VhclOutp)); _dataOut.KinematicsState = ResState; _dataOut.VhclOutp = ResHel; _udpHelper.Send(GetByte(ResState), "127.0.0.1", 6100); _udpHelper.Send(GetByte(_dataOut), "127.0.0.1", 20020); _udpHelper.Send(GetByte(ResState), "127.0.0.1", 6105); Marshal.FreeHGlobal(ptrHel); Marshal.FreeHGlobal(ptrCe); Marshal.FreeHGlobal(ptrRs); Marshal.FreeHGlobal(ptrRh); }
private static Rect CheckAlignVertical(ControlElement brother, Rect rect) { float deltaTToT = Mathf.Abs(rect.y - brother.position.y); float deltaBToB = Mathf.Abs(rect.y + rect.height - (brother.position.y + brother.size.y)); if (deltaBToB <= deltaTToT && deltaBToB < 2) { rect.y = brother.position.y + brother.size.y - rect.height; return(rect); } else if (deltaTToT <= deltaBToB && deltaTToT < 2) { rect.y = brother.position.y; return(rect); } float deltaTToB = Mathf.Abs(rect.y - (brother.position.y + brother.size.y)); if (deltaTToB < 2) { rect.y = brother.position.y + brother.size.y; return(rect); } float deltaBToT = Mathf.Abs(rect.y + rect.height - brother.position.y); if (deltaBToT < 2) { rect.y = brother.position.y - rect.height; return(rect); } return(rect); }
static void Main(string[] args) { GeometricFigure circle = new Circle("Circle", 360); circle.Show(); GeometricFigure rectangle = new Rectangle("Rectangle", 360); rectangle.Show(); Console.WriteLine(rectangle is Rectangle); Console.WriteLine(rectangle is GeometricFigure); GeometricFigure figure = circle as Rectangle; Console.WriteLine(figure); ControlElement controlElement = new ControlElement(true, "square"); Console.WriteLine(controlElement.ToString()); GeometricFigure ellipse = new Circle("Ellipse", 360); GeometricFigure oval = new Circle("Oval", 360); GeometricFigure square = new Rectangle("Square", 360); GeometricFigure rhombus = new Rectangle("Rhombus", 360); dynamic[] PrinterArr = { ellipse, oval, square, rhombus }; Console.WriteLine("PRINTER"); foreach (var item in PrinterArr) { Console.WriteLine(Printer.IAmPrinting(item)); } Console.ReadKey(); }
private void InitializeViewElements() { FileMenu = new MenuElement(fileToolStripMenuItem); NewProjectCommand = new MenuElement(newProjectToolStripMenuItem); OpenProjectCommand = new MenuElement(openProjectToolStripMenuItem); CloseCommand = new MenuElement(closeToolStripMenuItem); SaveCommand = new MenuElement(saveToolStripMenuItem); SaveAsCommand = new MenuElement(saveAsToolStripMenuItem); SaveResultsCommand = new MenuElement(saveResultsToolStripMenuItem); ReloadTestsCommand = new MenuElement(reloadTestsToolStripMenuItem); SelectRuntimeMenu = new MenuElement(selectRuntimeToolStripMenuItem); RecentProjectsMenu = new MenuElement(recentProjectsToolStripMenuItem); ExitCommand = new MenuElement(exitToolStripMenuItem); FullGuiCommand = new MenuElement(fullGuiToolStripMenuItem); MiniGuiCommand = new MenuElement(miniGuiToolStripMenuItem); GuiFontCommand = new MenuElement(guiFontToolStripMenuItem); FixedFontCommand = new MenuElement(fixedFontToolStripMenuItem); StatusBarCommand = new MenuElement(statusBarToolStripMenuItem); ProjectMenu = new MenuElement(projectToolStripMenuItem); SettingsCommand = new MenuElement(settingsToolStripMenuItem); AddinsCommand = new MenuElement(addinsToolStripMenuItem); NUnitHelpCommand = new MenuElement(nUnitHelpToolStripMenuItem); AboutNUnitCommand = new MenuElement(aboutNUnitToolStripMenuItem); TestResult = new ControlElement<Label>(testResult); TestName = new ControlElement<Label>(testName); DialogManager = new DialogManager(); }
private static Rect CheckAlignHorizontal(ControlElement brother, Rect rect) { float deltaLToL = Mathf.Abs(rect.x - brother.position.x); float deltaRToR = Mathf.Abs(rect.x + rect.width - (brother.position.x + brother.size.x)); if (deltaRToR <= deltaLToL && deltaRToR < 2) { rect.x = brother.position.x + brother.size.x - rect.width; return(rect); } else if (deltaLToL <= deltaRToR && deltaLToL < 2) { rect.x = brother.position.x; return(rect); } float deltaLToR = Mathf.Abs(rect.x - (brother.position.x + brother.size.x)); if (deltaLToR < 2) { rect.x = brother.position.x + brother.size.x; return(rect); } float deltaRToL = Mathf.Abs(rect.x + rect.width - brother.position.x); if (deltaRToL < 2) { rect.x = brother.position.x - rect.width; return(rect); } return(rect); }
private void InitializeViewElements() { FileMenu = new MenuElement(fileToolStripMenuItem); NewProjectCommand = new MenuElement(newProjectToolStripMenuItem); OpenProjectCommand = new MenuElement(openProjectToolStripMenuItem); CloseCommand = new MenuElement(closeToolStripMenuItem); SaveCommand = new MenuElement(saveToolStripMenuItem); SaveAsCommand = new MenuElement(saveAsToolStripMenuItem); SaveResultsCommand = new MenuElement(saveResultsToolStripMenuItem); ReloadProjectCommand = new MenuElement(reloadProjectToolStripMenuItem); ReloadTestsCommand = new MenuElement(reloadTestsToolStripMenuItem); SelectRuntimeMenu = new MenuElement(selectRuntimeToolStripMenuItem); RecentProjectsMenu = new MenuElement(recentProjectsToolStripMenuItem); ExitCommand = new MenuElement(exitToolStripMenuItem); FullGuiCommand = new MenuElement(fullGuiToolStripMenuItem); MiniGuiCommand = new MenuElement(miniGuiToolStripMenuItem); GuiFontCommand = new MenuElement(guiFontToolStripMenuItem); FixedFontCommand = new MenuElement(fixedFontToolStripMenuItem); StatusBarCommand = new MenuElement(statusBarToolStripMenuItem); ProjectMenu = new MenuElement(projectToolStripMenuItem); SettingsCommand = new MenuElement(settingsToolStripMenuItem); AddinsCommand = new MenuElement(addinsToolStripMenuItem); NUnitHelpCommand = new MenuElement(nUnitHelpToolStripMenuItem); AboutNUnitCommand = new MenuElement(aboutNUnitToolStripMenuItem); TestResult = new ControlElement <Label>(testResult); TestName = new ControlElement <Label>(testName); DialogManager = new DialogManager(); }
public FdmManager() { _config = Config.Instance(); uint version = 0; uint release = 0; uint releaseDay = 0; uint releaseMonth = 0; uint releaseYear = 0; IntPtr pversion = GetIntPtr(version); IntPtr prelease = GetIntPtr(release); IntPtr preleaseDay = GetIntPtr(releaseDay); IntPtr preleaseMonth = GetIntPtr(releaseMonth); IntPtr preleaseYear = GetIntPtr(releaseYear); GetDllVersion(pversion, prelease, preleaseDay, preleaseMonth, preleaseYear); version = (uint)Marshal.ReadInt32(pversion); release = (uint)Marshal.ReadInt32(prelease); releaseDay = (uint)Marshal.ReadInt32(preleaseDay); releaseMonth = (uint)Marshal.ReadInt32(preleaseMonth); releaseYear = (uint)Marshal.ReadInt32(preleaseYear); _udpHelper = new UdpHelper(); _startPosition = new StartPosition(); _controlElement = new ControlElement(); _svvo = new Svvo(); _dataOut = new DataOut(); fCSCmds = new FCSCmds(); InitThread(); StartThread(); }
public XmlView() { InitializeComponent(); XmlPanel = new ControlElement<Panel>(xmlPanel); XmlTextBox = new ControlElement<RichTextBox>(xmlTextBox); CopyToolStripMenuItem = new ToolStripElement<ToolStripMenuItem>(copyToolStripMenuItem); WordWrapToolStripMenuItem = new ToolStripElement<ToolStripMenuItem>(wordWrapToolStripMenuItem); selectAllToolStripMenuItem.Click += (s, a) => { if (SelectAllCommand != null) SelectAllCommand(); }; xmlTextBox.SelectionChanged += (s, a) => { if (SelectionChanged != null) SelectionChanged(); }; copyToolStripMenuItem.Click += (s, a) => { if (CopyCommand != null) CopyCommand(); }; wordWrapToolStripMenuItem.CheckedChanged += (s, a) => { if (WordWrapChanged != null) WordWrapChanged(); }; }
public static CompositeElement Add(this CompositeElement parent, ControlElement child) { var allChildren = parent.Children.ToList(); allChildren.Add(child); parent.Children = allChildren; return(parent); }
public void AddControl(ControlType type, Vector2 position) { var element = new ControlElement() { id = model.GenerateUniqueID(), name = type.ToString(), position = position }; model.AddElement(element, model.root, 0); }
public ControlElementViewModel(ControlElement element) { _element = element; Date = _element.Date; InValue = _element.OutValue; OutValue = _element.InValue; RemoveCommand = new RelayCommand <Object>(RemoveCommandExecute); OpenSumCommand = new RelayCommand <string>(OpenSumCommandExecute); }
public FdmManager() { _udpHelper = new UdpHelper(); _startPosition = new StartPosition(); _controlElement = new ControlElement(); _svvo = new Svvo(); _dataOut = new DataOut(); InitThread(); StartThread(); }
private void button1_Click(object sender, EventArgs e) { string str出厂编号 = ""; ControlElement control = _form.GetControlElementByInfo("dbo.水泵型号管理", "出厂编号"); str出厂编号 += control.GetValue(); 水泵环境参数配置 dp = new 水泵环境参数配置(str出厂编号, (int)ID号); dp.ShowDialog(); }
private void InitializeViewElements() { FileMenu = new MenuElement(fileToolStripMenuItem); NewProjectCommand = new MenuElement(newProjectToolStripMenuItem); OpenProjectCommand = new MenuElement(openProjectToolStripMenuItem); CloseCommand = new MenuElement(closeToolStripMenuItem); SaveCommand = new MenuElement(saveToolStripMenuItem); SaveAsCommand = new MenuElement(saveAsToolStripMenuItem); SaveResultsCommand = new MenuElement(saveResultsToolStripMenuItem); ReloadTestsCommand = new MenuElement(reloadTestsToolStripMenuItem); SelectRuntimeMenu = new MenuElement(selectRuntimeToolStripMenuItem); RecentProjectsMenu = new MenuElement(recentProjectsToolStripMenuItem); ExitCommand = new MenuElement(exitToolStripMenuItem); FullGuiCommand = new MenuElement(fullGuiToolStripMenuItem); MiniGuiCommand = new MenuElement(miniGuiToolStripMenuItem); GuiFontCommand = new MenuElement(guiFontToolStripMenuItem); FixedFontCommand = new MenuElement(fixedFontToolStripMenuItem); StatusBarCommand = new MenuElement(statusBarToolStripMenuItem); ProjectMenu = new MenuElement(projectToolStripMenuItem); SettingsCommand = new MenuElement(settingsToolStripMenuItem); AddinsCommand = new MenuElement(addinsToolStripMenuItem); NUnitHelpCommand = new MenuElement(nUnitHelpToolStripMenuItem); AboutNUnitCommand = new MenuElement(aboutNUnitToolStripMenuItem); TestResult = new ControlElement <Label>(testResult); TestName = new ControlElement <Label>(testName); DialogManager = new DialogManager(); SuspendLayout(); this.Controls.Remove(MainMenuStrip); sp = splitContainer1; sp.Orientation = Orientation.Horizontal; statusBarView.Visible = false; sp.Panel2.Controls.Clear(); tabPage1.Controls.Clear(); sp.Panel2.Controls.Add(propertiesView); propertiesView.ApplyTheme(); ttv = TestTreeView; ResumeLayout(); }
public TestCentricMainView() : base("TestCentric") { InitializeComponent(); // View Parameters FontSelector = new FontSelector(this); SplitterPosition = new SplitterPosition(treeSplitter); // UI Elements on main form RunButton = new ButtonElement(runButton); StopButton = new ButtonElement(stopButton); RunSummary = new ControlElement <ExpandingLabel>(runCount); ResultTabs = new TabSelector(resultTabs); // Initialize File Menu Commands FileMenu = new PopupMenu(fileMenu); OpenCommand = new MenuCommand(openMenuItem); CloseCommand = new MenuCommand(closeMenuItem); AddTestFileCommand = new MenuCommand(addTestFileMenuItem); ReloadTestsCommand = new MenuCommand(reloadTestsMenuItem); RuntimeMenu = new PopupMenu(runtimeMenuItem); SelectedRuntime = new CheckedMenuGroup(runtimeMenuItem); RecentFilesMenu = new PopupMenu(recentFilesMenu); ExitCommand = new MenuCommand(exitMenuItem); // Initialize View Menu Commands DisplayFormat = new CheckedMenuGroup(fullGuiMenuItem, miniGuiMenuItem); IncreaseFontCommand = new MenuCommand(increaseFontMenuItem); DecreaseFontCommand = new MenuCommand(decreaseFontMenuItem); ChangeFontCommand = new MenuCommand(fontChangeMenuItem); RestoreFontCommand = new MenuCommand(defaultFontMenuItem); IncreaseFixedFontCommand = new MenuCommand(increaseFixedFontMenuItem); DecreaseFixedFontCommand = new MenuCommand(decreaseFixedFontMenuItem); RestoreFixedFontCommand = new MenuCommand(restoreFixedFontMenuItem); StatusBarCommand = new CheckedMenuItem(statusBarMenuItem); // Initialize Test Menu Commands RunAllCommand = new MenuCommand(runAllMenuItem); RunSelectedCommand = new MenuCommand(runSelectedMenuItem); RunFailedCommand = new MenuCommand(runFailedMenuItem); StopRunCommand = new MenuCommand(stopRunMenuItem); // Initialize Tools Menu Comands ToolsMenu = new PopupMenu(toolsMenu); ProjectEditorCommand = new MenuCommand(projectEditorMenuItem); SaveResultsCommand = new MenuCommand(saveResultsMenuItem); ExtensionsCommand = new MenuCommand(extensionsMenuItem); SettingsCommand = new MenuCommand(settingsMenuItem); TestCentricHelpCommand = new MenuCommand(testCentricHelpMenuItem); NUnitHelpCommand = new MenuCommand(nunitHelpMenuItem); AboutCommand = new MenuCommand(aboutMenuItem); }
private void InitializeViewElements() { // File Menu FileMenu = new ToolStripMenuElement(fileToolStripMenuItem); NewProjectCommand = new ToolStripMenuElement(newProjectToolStripMenuItem); OpenProjectCommand = new ToolStripMenuElement(openProjectToolStripMenuItem); CloseCommand = new ToolStripMenuElement(closeToolStripMenuItem); AddTestFilesCommand = new ToolStripMenuElement(addTestFilesToolStripMenuItem); SaveCommand = new ToolStripMenuElement(saveToolStripMenuItem); SaveAsCommand = new ToolStripMenuElement(saveAsToolStripMenuItem); SaveResultsCommand = new ToolStripMenuElement(saveResultsToolStripMenuItem); ReloadTestsCommand = new ToolStripMenuElement(reloadTestsToolStripMenuItem); SelectRuntimeMenu = new ToolStripMenuElement(selectRuntimeToolStripMenuItem); SelectedRuntime = new CheckedToolStripMenuGroup(selectRuntimeToolStripMenuItem); ProcessModel = new CheckedToolStripMenuGroup("processModel", defaultProcessToolStripMenuItem, inProcessToolStripMenuItem, separateProcessToolStripMenuItem, multipleProcessToolStripMenuItem); DomainUsage = new CheckedToolStripMenuGroup("domainUsage", defaultDomainToolStripMenuItem, singleDomainToolStripMenuItem, multipleDomainToolStripMenuItem); RunAsX86 = new ToolStripMenuElement(loadAsX86ToolStripMenuItem); RecentProjectsMenu = new ToolStripMenuElement(recentProjectsToolStripMenuItem); ExitCommand = new ToolStripMenuElement(exitToolStripMenuItem); // View Menu FullGuiCommand = new ToolStripMenuElement(fullGuiToolStripMenuItem); MiniGuiCommand = new ToolStripMenuElement(miniGuiToolStripMenuItem); IncreaseFontCommand = new ToolStripMenuElement(increaseToolStripMenuItem); DecreaseFontCommand = new ToolStripMenuElement(decreaseToolStripMenuItem); ChangeFontCommand = new ToolStripMenuElement(changeToolStripMenuItem); RestoreFontCommand = new ToolStripMenuElement(restoreToolStripMenuItem); StatusBarCommand = new ToolStripMenuElement(statusBarToolStripMenuItem); // Project Menu ProjectMenu = new ToolStripMenuElement(projectToolStripMenuItem); // Tools Menu SettingsCommand = new ToolStripMenuElement(settingsToolStripMenuItem); ExtensionsCommand = new ToolStripMenuElement(extensionsToolStripMenuItem); // Help Menu NUnitHelpCommand = new ToolStripMenuElement(nUnitHelpToolStripMenuItem); AboutNUnitCommand = new ToolStripMenuElement(aboutNUnitToolStripMenuItem); TestResult = new ControlElement(testResult); TestName = new ControlElement(testName); DialogManager = new DialogManager(); MessageDisplay = new MessageDisplay(); }
private void ControlUpdate() { ControlElement last = GetLastControl(); if (ElementInControl == last && ElementInControl != null) { ElementInControl.OnControlUpdate(); } else { ElementInControl?.OnLoseControl(); last?.OnGainControl(); ElementInControl = last; } }
public ScTextBox SetText(string value) { try { Logger.Debug($"Setting {value} to {ControlLabel}"); ControlElement.Clear(); ControlElement.SendKeys(value); } catch (Exception e) { var msg = $"Unable to set value to {ControlLabel} in {ControlPanelLabel}"; Logger.Error(msg); throw new ScContentEditorException(msg, e); } return(this); }
private void InitializeViewElements() { // File Menu FileMenu = new PopupMenuElement(fileToolStripMenuItem); NewProjectCommand = new CommandMenuElement(newProjectToolStripMenuItem); OpenProjectCommand = new CommandMenuElement(openProjectToolStripMenuItem); CloseCommand = new CommandMenuElement(closeToolStripMenuItem); AddTestFilesCommand = new CommandMenuElement(addTestFilesToolStripMenuItem); SaveCommand = new CommandMenuElement(saveToolStripMenuItem); SaveAsCommand = new CommandMenuElement(saveAsToolStripMenuItem); SaveResultsCommand = new CommandMenuElement(saveResultsToolStripMenuItem); ReloadTestsCommand = new CommandMenuElement(reloadTestsToolStripMenuItem); SelectRuntimeMenu = new PopupMenuElement(selectRuntimeToolStripMenuItem); RunAsX86 = new CheckedMenuElement(loadAsX86ToolStripMenuItem); RecentProjectsMenu = new PopupMenuElement(recentProjectsToolStripMenuItem); ExitCommand = new CommandMenuElement(exitToolStripMenuItem); // View Menu FullGuiCommand = new CommandMenuElement(fullGuiToolStripMenuItem); MiniGuiCommand = new CommandMenuElement(miniGuiToolStripMenuItem); IncreaseFontCommand = new CommandMenuElement(increaseToolStripMenuItem); DecreaseFontCommand = new CommandMenuElement(decreaseToolStripMenuItem); ChangeFontCommand = new CommandMenuElement(changeToolStripMenuItem); RestoreFontCommand = new CommandMenuElement(restoreToolStripMenuItem); StatusBarCommand = new CheckedMenuElement(statusBarToolStripMenuItem); // Project Menu ProjectMenu = new PopupMenuElement(projectToolStripMenuItem); // Tools Menu SettingsCommand = new CommandMenuElement(settingsToolStripMenuItem); ExtensionsCommand = new CommandMenuElement(extensionsToolStripMenuItem); // Help Menu NUnitHelpCommand = new CommandMenuElement(nUnitHelpToolStripMenuItem); AboutNUnitCommand = new CommandMenuElement(aboutNUnitToolStripMenuItem); TestResult = new ControlElement(testResult); TestName = new ControlElement(testName); DialogManager = new DialogManager(); MessageDisplay = new MessageBoxDisplay(); LongRunningOperation = new LongRunningOperationDisplay(this); }
public PointF PosCE(ControlElement ce) { var rect = GetRect(); switch (ce) { case ControlElement.Inside: return(rect.Location); case ControlElement.Outside: return(new PointF(0, 0)); case ControlElement.Center: return(rect.Location.Move(RotateCenter.UnRelative(rect.Size))); case ControlElement.SizeTopLeft: return(rect.Location); case ControlElement.SizeTopRight: return(rect.Location.Move(rect.Size.Width, 0)); case ControlElement.SizeBottomRight: return(rect.Location.Move(rect.Size.Width, rect.Size.Height)); case ControlElement.SizeBottomLeft: return(rect.Location.Move(0, rect.Size.Height)); case ControlElement.SizeTop: return(rect.Location.Move(rect.Size.Width / 2, 0)); case ControlElement.SizeRight: return(rect.Location.Move(rect.Size.Width, rect.Size.Height / 2)); case ControlElement.SizeBottom: return(rect.Location.Move(rect.Size.Width / 2, rect.Size.Height)); case ControlElement.SizeLeft: return(rect.Location.Move(0, rect.Size.Height / 2)); default: throw new ArgumentException(); } }
private Cursor getCursor(ControlElement ce) { switch (ce) { case ControlElement.Inside: return(Cursors.SizeAll); case ControlElement.Outside: return(Cursors.Default); case ControlElement.Center: return(Cursors.NoMove2D); case ControlElement.SizeTopLeft: return(Cursors.SizeNWSE); case ControlElement.SizeTopRight: return(Cursors.SizeNESW); case ControlElement.SizeBottomRight: return(Cursors.SizeNWSE); case ControlElement.SizeBottomLeft: return(Cursors.SizeNESW); case ControlElement.SizeTop: return(Cursors.SizeNS); case ControlElement.SizeRight: return(Cursors.SizeWE); case ControlElement.SizeBottom: return(Cursors.SizeNS); case ControlElement.SizeLeft: return(Cursors.SizeWE); default: throw new ArgumentException(); } }
private static Rect CheckAlign(ControlElement element, Rect rect) { if (element.parent != null) { if (element.parent.hasChildren) { for (int i = 0; i < element.parent.children.Count; i++) { if (element.parent.children[i] == element) { continue; } var brother = (ControlElement)element.parent.children[i]; rect = CheckAlignHorizontal(brother, rect); rect = CheckAlignVertical(brother, rect); } } } return(rect); }
public XmlView() { InitializeComponent(); XmlPanel = new ControlElement <Panel>(xmlPanel); XmlTextBox = new ControlElement <RichTextBox>(xmlTextBox); CopyToolStripMenuItem = new MenuElement(copyToolStripMenuItem); WordWrapToolStripMenuItem = new MenuElement(wordWrapToolStripMenuItem); selectAllToolStripMenuItem.Click += (s, a) => { if (SelectAllCommand != null) { SelectAllCommand(); } }; xmlTextBox.SelectionChanged += (s, a) => { if (SelectionChanged != null) { SelectionChanged(); } }; copyToolStripMenuItem.Click += (s, a) => { if (CopyCommand != null) { CopyCommand(); } }; wordWrapToolStripMenuItem.CheckedChanged += (s, a) => { if (WordWrapChanged != null) { WordWrapChanged(); } }; }
private string 方案保存_拼接插入Sql() { Decimal id = -1; id = Convert.ToDecimal(this.grid1.GetFocusedRowCellValue("ID")); string strSql = "insert dbo.电机型号管理方案 (ID,电机型号,电机制造商,出厂编号,额定电压,额定电流,额定功率,额定效率) values (" + id + ","; ControlElement control = _form.GetControlElementByInfo("dbo.电机型号管理", "电机型号"); strSql += "'"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "电机制造商"); strSql += "'"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "出厂编号"); strSql += "'"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定电压"); strSql += "'"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定电流"); strSql += "'"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定功率"); strSql += "'"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定效率"); strSql += "'"; strSql += control.GetValue(); strSql += "')"; return(strSql); }
private string 方案保存_拼接更新Sql() { Decimal id = -1; id = Convert.ToDecimal(this.grid1.GetFocusedRowCellValue("ID")); string strSql = "update dbo.电机型号管理方案 set "; ControlElement control = _form.GetControlElementByInfo("dbo.电机型号管理", "电机型号"); strSql += "电机型号='"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "电机制造商"); strSql += "电机制造商='"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "出厂编号"); strSql += "出厂编号='"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定电压"); strSql += "额定电压='"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定电流"); strSql += "额定电流='"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定功率"); strSql += "额定功率='"; strSql += control.GetValue(); strSql += "',"; control = _form.GetControlElementByInfo("dbo.电机型号管理", "额定效率"); strSql += "额定效率='"; strSql += control.GetValue(); strSql += "' where ID=" + id; return(strSql); }
public override void OnMouseDown(PointF location, Keys keys, MouseButtons buttons) { base.OnMouseDown(location, keys, buttons); controlElement = GetCE(location); }
public TestCentricMainView() : base("TestCentric") { InitializeComponent(); treeSplitter.SplitterMoved += (s, e) => { SplitterPositionChanged?.Invoke(s, e); }; // UI Elements on main form RunButton = new ButtonElement(runButton); StopButton = new ButtonElement(stopButton); RunSummary = new ControlElement(runSummary); ResultTabs = new TabSelector(resultTabs); // Initialize File Menu Commands FileMenu = new PopupMenu(fileMenu); OpenCommand = new MenuCommand(openMenuItem); CloseCommand = new MenuCommand(closeMenuItem); AddTestFilesCommand = new MenuCommand(addTestFileMenuItem); ReloadTestsCommand = new MenuCommand(reloadTestsMenuItem); RuntimeMenu = new PopupMenu(runtimeMenuItem); SelectedRuntime = new CheckedMenuGroup(runtimeMenuItem); ProcessModel = new CheckedMenuGroup( defaultProcessMenuItem, inProcessMenuItem, singleProcessMenuItem, multipleProcessMenuItem); DomainUsage = new CheckedMenuGroup( defaultDomainMenuItem, singleDomainMenuItem, multipleDomainMenuItem); RunAsX86 = new CheckedMenuItem(runAsX86MenuItem); RecentFilesMenu = new PopupMenu(recentFilesMenu); ExitCommand = new MenuCommand(exitMenuItem); // Initialize View Menu Commands DisplayFormat = new CheckedMenuGroup(fullGuiMenuItem, miniGuiMenuItem); IncreaseFontCommand = new MenuCommand(increaseFontMenuItem); DecreaseFontCommand = new MenuCommand(decreaseFontMenuItem); ChangeFontCommand = new MenuCommand(fontChangeMenuItem); RestoreFontCommand = new MenuCommand(defaultFontMenuItem); IncreaseFixedFontCommand = new MenuCommand(increaseFixedFontMenuItem); DecreaseFixedFontCommand = new MenuCommand(decreaseFixedFontMenuItem); RestoreFixedFontCommand = new MenuCommand(restoreFixedFontMenuItem); StatusBarCommand = new CheckedMenuItem(statusBarMenuItem); // Initialize Test Menu Commands RunAllCommand = new MenuCommand(runAllMenuItem); RunSelectedCommand = new MenuCommand(runSelectedMenuItem); RunFailedCommand = new MenuCommand(runFailedMenuItem); StopRunCommand = new MenuCommand(stopRunMenuItem); // Initialize Tools Menu Comands ToolsMenu = new PopupMenu(toolsMenu); SaveResultsCommand = new MenuCommand(saveResultsMenuItem); OpenWorkDirectoryCommand = new MenuCommand(openWorkDirectoryMenuItem); ExtensionsCommand = new MenuCommand(extensionsMenuItem); SettingsCommand = new MenuCommand(settingsMenuItem); TestCentricHelpCommand = new MenuCommand(testCentricHelpMenuItem); NUnitHelpCommand = new MenuCommand(nunitHelpMenuItem); AboutCommand = new MenuCommand(aboutMenuItem); DialogManager = new DialogManager(); }
public XmlView() { InitializeComponent(); XmlPanel = new ControlElement<Panel>(xmlPanel); }
// Methods public void Add(ControlElement controlElement) {}
public void Remove(ControlElement controlElement) {}
public ScTreeList(string panelLabel, string itemLabel) : base(panelLabel, itemLabel, FieldType.TreeList) { ControlElement.JsHighlight(cssColor: "red"); }
public void ActionCE(ControlElement ce, PointF from, PointF to) { var rect = GetRect(); switch (ce) { case ControlElement.Inside: Translate = Translate.Move(to.Shift(from)); break; case ControlElement.Outside: var c = PosCE(ControlElement.Center); var a = from.Shift(c); var b = to.Shift(c); var nA = a.Norm(); var nB = b.Norm(); var d = from.DistanceTo(to); var cos = (nA * nA + nB * nB - d * d) / (2 * nA * nB); // law of cosines var ang = Math.Acos(cos) * Math.Sign(a.Cross(b)); Rotate += ang.ToDegrees(); Rotate %= 360; break; case ControlElement.Center: RotateCenter = RotateCenter.Move(to.Shift(from).Relative(img.Size)); break; case ControlElement.SizeTopLeft: Scale = Scale.Move(to.Shift(from).Factors(-1, -1).Relative(img.Size)); Translate = Translate.Move(to.Shift(from).Factors(1, 1)); break; case ControlElement.SizeTopRight: Scale = Scale.Move(to.Shift(from).Factors(1, -1).Relative(img.Size)); Translate = Translate.Move(to.Shift(from).Factors(0, 1)); break; case ControlElement.SizeBottomRight: Scale = Scale.Move(to.Shift(from).Relative(img.Size)); break; case ControlElement.SizeBottomLeft: Scale = Scale.Move(to.Shift(from).Factors(-1, 1).Relative(img.Size)); Translate = Translate.Move(to.Shift(from).Factors(1, 0)); break; case ControlElement.SizeTop: Scale = Scale.Move(to.Shift(from).Factors(0, -1).Relative(img.Size)); Translate = Translate.Move(to.Shift(from).Factors(0, 1)); break; case ControlElement.SizeRight: Scale = Scale.Move(to.Shift(from).Factors(1, 0).Relative(img.Size)); break; case ControlElement.SizeBottom: Scale = Scale.Move(to.Shift(from).Factors(0, 1).Relative(img.Size)); break; case ControlElement.SizeLeft: Scale = Scale.Move(to.Shift(from).Factors(-1, 0).Relative(img.Size)); Translate = Translate.Move(to.Shift(from).Factors(1, 0)); break; default: break; } if (Math.Abs(Scale.X) < 0.0001) { Scale = new PointF(0.0001f, Scale.Y); } if (Math.Abs(Scale.Y) < 0.0001) { Scale = new PointF(Scale.X, 0.0001f); } }
public ScCheckBox Click() { Logger.Debug($"Clicking checkbox with lable {ControlLabel}"); ControlElement.Click(); return(this); }
public void Step(ControlElement controlElement) { Hel.VehicleCtrl.AltimeterBaroPressure = 761.2; ContactEnv.Elevation = _gmTerrainH; ContactEnv.Normal = _normal; Hel.AirState.WindSpeed = _windSpeed; Hel.Mass = 10800.0; Hel.InertialMoments = _inertialMoments; Hel.PosCG = _posCg; if (controlElement.Channel == 1) { Hel.VehicleCtrl.CyclicPitch = controlElement._cyclicStepHandleLeft.Elevator; Hel.VehicleCtrl.CyclicRoll = controlElement._cyclicStepHandleLeft.Aileron; Hel.VehicleCtrl.Direction = controlElement._pedalsLeft.Pedal; Hel.VehicleCtrl.Collective = controlElement._generalStepHandleLeft.GeneralStep; Hel.VehicleCtrl.Trimmer = (byte)controlElement._cyclicStepHandleLeft.BtnTrim; Hel.VehicleCtrl.Friction = (byte)controlElement._generalStepHandleLeft.BtnStabilizer; Hel.VehicleCtrl.NoseGear.Brake = controlElement._cyclicStepHandleLeft.BtnWheelBrake; Hel.VehicleCtrl.MainGearLeft.Brake = controlElement._cyclicStepHandleLeft.BtnWheelBrake; Hel.VehicleCtrl.MainGearRight.Brake = controlElement._cyclicStepHandleLeft.BtnWheelBrake; } else if (controlElement.Channel == 2) { Hel.VehicleCtrl.CyclicPitch = controlElement._cyclicStepHandleRight.Elevator; Hel.VehicleCtrl.CyclicRoll = controlElement._cyclicStepHandleRight.Aileron; Hel.VehicleCtrl.Direction = controlElement._pedalsLeft.Pedal; Hel.VehicleCtrl.Collective = controlElement._generalStepHandleRight.GeneralStep; Hel.VehicleCtrl.Trimmer = (byte)controlElement._cyclicStepHandleRight.BtnTrim; Hel.VehicleCtrl.Friction = (byte)controlElement._generalStepHandleRight.BtnStabilizer; Hel.VehicleCtrl.NoseGear.Brake = controlElement._cyclicStepHandleRight.BtnWheelBrake; Hel.VehicleCtrl.MainGearLeft.Brake = controlElement._cyclicStepHandleRight.BtnWheelBrake; Hel.VehicleCtrl.MainGearRight.Brake = controlElement._cyclicStepHandleRight.BtnWheelBrake; } //Hel.VehicleCtrl.CyclicPitch = 0.5; //Hel.VehicleCtrl.CyclicRoll = 0.5; //Hel.VehicleCtrl.Direction = 0.5; ; //Hel.VehicleCtrl.Collective = 0.0; //Hel.VehicleCtrl.Trimmer = 0; //Hel.VehicleCtrl.Friction = 0; //Hel.VehicleCtrl.NoseGear.Brake = 1; //Hel.VehicleCtrl.MainGearLeft.Brake = 1; //Hel.VehicleCtrl.MainGearRight.Brake = 1; IntPtr ptrHel = GetIntPtr(Hel); IntPtr ptrCe = GetIntPtr(ContactEnv); IntPtr ptrRs = GetIntPtr(ResState); IntPtr ptrRh = GetIntPtr(ResHel); Step(0.01, ptrHel, ptrCe, ptrRs, ptrRh); ResState = (KinematicsState)Marshal.PtrToStructure(ptrRs, typeof(KinematicsState)); ResHel = (VhclOutp)Marshal.PtrToStructure(ptrRh, typeof(VhclOutp)); _dataOut.KinematicsState = ResState; _dataOut.VhclOutp = ResHel; _dataOut.VhclInp = Hel; foreach (var ippoint in _config.NetworkSettings.Svvo.Position.IPPoint) { _udpHelper.Send(GetByte(ResState), ippoint.Ip, ippoint.Port); } foreach (var ippoint in _config.NetworkSettings.DataTransfer.DynamicModel.IPPoint) { _udpHelper.Send(GetByte(_dataOut), ippoint.Ip, ippoint.Port); } if (_isRecord) { _recordFlight.RecordData(_dataOut, ResState); } Marshal.FreeHGlobal(ptrHel); Marshal.FreeHGlobal(ptrCe); Marshal.FreeHGlobal(ptrRs); Marshal.FreeHGlobal(ptrRh); }
private void setCursor(ControlElement ce) { changeCursor(getCursor(ce)); }