예제 #1
0
        private bool SetupCommunication(ProcessController rtu)
        {
            bool retval = false;


            switch (rtu.TransportHandler)
            {
            case TransportHandler.TCP:

                // na osnovu ovoga on sad zna u factoryju da pravi sta treba konkretno za Tcp...
                CommunicationManager.CurrentTransportHndl = TransportHandler.TCP;

                CommunicationParameters commPar = new CommunicationParameters(rtu.HostName, rtu.HostPort);
                var commObj = CommunicationManager.Factory.CreateNew(commPar);

                if (commObj.Setup())
                {
                    CommunicationManager.CommunicationObjects.TryAdd(rtu.Name, commObj);
                    retval = true;
                }

                break;

            default:
                // not implemented yet
                break;
            }
            return(retval);
        }
예제 #2
0
        private void MyCommandExecute()
        {
            //Escrever o valor que deve ser passado em um arquivo
            _fileStore.WriteFile(Constants.FileName, "2");

            //Passar o valor para o método init
            ShowViewModel <CommunicationViewModel>(CommunicationParameters.FromInteger(2));
        }