Exemple #1
0
 private void ReStartFlow()
 {
     //置开始
     if (IsRunState == false)
     {
         FlowStep                   = FlowGather.TcpStartLink;
         eventControlFlow           = new EventControlFlow();
         FlowControlThread          = new Thread(RealFlowControl);
         FlowControlThread.Priority = ThreadPriority.Normal;
         IsRunState                 = true;
         FlowControlThread.Start();
     }
 }
Exemple #2
0
        /// <summary>
        /// 控制流初始化
        /// </summary>
        /// <param name="tcpStartLinkDelegate">启动Tcp连接委托</param>
        /// <param name="tcpLinkACKDelegate">启动确认委托</param>
        /// <param name="startDataTransmissionDelegate">启动传输委托</param>
        /// <param name="startDataTransmissionACKDelegate">启动传输确认委托</param>
        /// <param name="masterInterrogation">主召唤</param>
        /// <param name="masterInterrogationACKDelegate">主召唤确认</param>
        /// <param name="timeSynchronizationDelegate">时间同步确认</param>
        /// <param name="timeSynchronizationACKDelegate">时间同步确认委托</param>
        public ControlFlow(Action tcpStartLinkDelegate,
                           Action tcpLinkACKDelegate, Action startDataTransmissionDelegate, Action startDataTransmissionACKDelegate,
                           Action masterInterrogation, Action masterInterrogationACKDelegate, Action timeSynchronizationDelegate,
                           Action timeSynchronizationACKDelegate)
        {
            TcpStartLinkDelegate             = tcpStartLinkDelegate;
            TcpLinkACKDelegate               = tcpLinkACKDelegate;
            StartDataTransmissionDelegate    = startDataTransmissionDelegate;
            StartDataTransmissionACKDelegate = startDataTransmissionACKDelegate;
            MasterInterrogation              = masterInterrogation;
            MasterInterrogationACKDelegate   = masterInterrogationACKDelegate;
            TimeSynchronizationDelegate      = timeSynchronizationDelegate;
            TimeSynchronizationACKDelegate   = timeSynchronizationACKDelegate;

            eventControlFlow = new EventControlFlow();

            FlowControlThread          = new Thread(RealFlowControl);
            FlowControlThread.Priority = ThreadPriority.Normal;
        }