protected FanucControlConnectionBase(TConnectionSettings connectionSettings)
        {
            this.connectionSettings = connectionSettings;
            currentConnectionState  = FanucControlConnectionState.Disconnected;

            ConnectionState = new BehaviorSubject <FanucControlConnectionState>(currentConnectionState);
        }
Пример #2
0
 private void SetConnectionState(FanucControlConnectionState connectionState)
 {
     if (connectionState != currentConnectionState)
     {
         currentConnectionState = connectionState;
         connectionStateSubject.OnNext(currentConnectionState);
     }
 }
Пример #3
0
        public FanucControlConnectionLoop(
            Func <ConnectionHandleAllocationResult> allocateHandle,
            IFanucControlReadWriteActionsProvider readWriteActionsProvider,
            Action <ushort> freeHandle)
        {
            currentConnectionState = FanucControlConnectionState.Disconnected;
            connectionStateSubject = new BehaviorSubject <FanucControlConnectionState>(currentConnectionState);

            this.allocateHandle           = allocateHandle;
            this.readWriteActionsProvider = readWriteActionsProvider;
            this.freeHandle = freeHandle;

            waitForConnectedOrFailed = new ManualResetEvent(false);
            waitForStopped           = new ManualResetEvent(false);

            connectionThread = new Thread(() => ConnectionLoop());
        }