Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            /// MainWindow과  데이터 동기화를 하기 위해서는 아래 문장을 실행 시켜 준다.
            DataContext = this;

            recvTabUsrCtrl = (RecvUserControl)rcvTabCtrl.Content;
            sndTabUsrCtrl  = (SendUserControl)sndTabCtrl.Content;
            othTabUsrCtrl  = (OtherUserControl)othTabCtrl.Content;

            Form = this;

            m_cfg = new ConfigManager(this);
            GetCfgManager().setFileName(System.AppDomain.CurrentDomain.BaseDirectory + @"HMCUSIM.ini");
            GetCfgManager().Load();



            recvTab = recvTabUsrCtrl;
            sndTab  = sndTabUsrCtrl;
            othTab  = othTabUsrCtrl;
            sndTabUsrCtrl.othTabUsrCtrl = othTab;

            recvTabUsrCtrl.ethIP.Text   = SvrIP;
            recvTabUsrCtrl.ethPort.Text = svrport;

            /// 시리얼 통신이면 초기화 과정을 수행한다.
            if (comm == CommMethod.Serial)
            {
                this.Loaded += new RoutedEventHandler(InitSerialPort);
                commHandler  = new SerialHandler();
                frameHeader  = new SerialHeader();
            }
            else
            {
                //commHandler = new EtherHandler();
                commHandler = new EtherHandler(new AsyncCallback(SendCallback));
                frameHeader = new EthHeader();
            }

            isRuning = false;

            recvBuff = new RecvBufferStruct();

            dataBuf = new RecvBufferStruct();

            frameBuf = new RecvBufferStruct();
        }
Example #2
0
 private void IsEtherSerial_Checked(object sender, RoutedEventArgs e)
 {
     if (comm == CommMethod.Serial)
     {
         this.Loaded += new RoutedEventHandler(InitSerialPort);
         commHandler  = new SerialHandler();
         frameHeader  = new SerialHeader();
     }
     else
     {
         //commHandler = new EtherHandler();
         commHandler = new EtherHandler(new AsyncCallback(SendCallback));
         frameHeader = new EthHeader();
     }
 }