public LinkManager(MainVM mainVM, SynchronizationContext context)
 {
     this.mainVM         = mainVM;
     Message            += mainVM.MessageInput;
     messageInputHandler = mainVM.MessageInput;
     Link          = new LinkCOM();
     this.context  = context;
     linkViewModel = mainVM.VM_Link;
     //Запускаем поток для сканирования COM портов
     ThreadPool.QueueUserWorkItem(Get_COM_List_Handler, linkViewModel);
 }
Example #2
0
        public ProtocolManager(MainVM mainVM, SynchronizationContext context)
        {
            //Data from MainVM
            this.context = context;
            LinkManager  = mainVM.LinkManager;
            Main_VM      = mainVM;
            PLCTable_VM  = Main_VM.VM_PLCTable;

            //Private
            CommandManager          = new CommandBuffer();
            CommandManager.Message += mainVM.MessageInput;
            Protocol                   = new PulsePLCv2Protocol();
            Protocol.Message          += mainVM.MessageInput; //Обработчик сообщений (для лога)
            Protocol.CommandEnd       += Protocol_CommandEnd; //Получение данных из ответов на команды
            Protocol.AccessEnd        += Protocol_AccessEnd;
            Protocol.TimeoutTickEvent += Protocol_TimeoutTickEvent;
        }