public void ParentNodeOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { StartPort.CalcOrigin(); EndPort.CalcOrigin(); Sp = PointsCalculator.PortOrigin(StartPort); Ep = PointsCalculator.PortOrigin(EndPort); Wire.StartPoint = Sp; Wire.EndPoint = Ep; }
/// <summary> /// 初始化串口 /// </summary> /// <param name="port"></param> /// <returns></returns> public static bool InitSerialPort(StartPort port, bool commType) { _port = port; _commType = commType; // 实例化串口对象 port.InitSerialPort(memSerialPort); // 将基站信息传递给串口 port.InitStation(dgStation, memStation); // 初始化功能菜单 menuHelper_Main.MenuSyncFunction(_RtxtSysMsg); menuHelper_Notify.MenuSyncFunction(_RtxtSysMsg); return(true); }
/// <summary> /// Destroys this instance. /// </summary> public void Destroy() { UnWatchStartPort(); UnWatchEndPort(); if (StartPort != null && EndPort != null) { StartPort.Disconnect(EndPort); } else { ParentGraph.Members.Remove(this); } StartPort = null; EndPort = null; ParentGraph = null; }