Esempio n. 1
0
        public static MasterDeviceDispatcher Create(IReadOnlyCollection <NandakaDevice> slaveDevices, IDeviceUpdatePolicy updatePolicy, ILog log)
        {
            var updaterLog = new PrefixLog(log, "[Dispatcher]");

            return(new MasterDeviceDispatcher(slaveDevices, updatePolicy, updaterLog));
        }
Esempio n. 2
0
        public static MasterThread Create(IReadOnlyCollection <NandakaDevice> slaveDevices, IProtocol protocol, IDeviceUpdatePolicy updatePolicy, ILog log)
        {
            var threadLog  = new PrefixLog(log, "[Master]");
            var dispatcher = MasterDeviceDispatcher.Create(slaveDevices, updatePolicy, threadLog);

            return(new MasterThread(dispatcher, protocol, threadLog));
        }
Esempio n. 3
0
 private MasterDeviceDispatcher(IReadOnlyCollection <NandakaDevice> slaveDevices, IDeviceUpdatePolicy updatePolicy, ILog log)
 {
     SlaveDevices  = slaveDevices;
     _updatePolicy = updatePolicy;
     _log          = log;
 }
Esempio n. 4
0
 public void Start(IProtocol protocol, IDeviceUpdatePolicy updatePolicy)
 {
     _log.AppendMessage(LogMessageType.Info, "Starting Master thread");
     _thread = MasterThread.Create(SlaveDevices, protocol, updatePolicy, _log);
     _thread.StartRoutine();
 }