コード例 #1
0
ファイル: Connectors.cs プロジェクト: prafullahunde/VisualSR
 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;
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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;
        }