Beispiel #1
0
 public static void Load()
 {
     ccdDoc                 = CCDCommunication.LoadDocument();
     ccdClient              = new CCDClient(ccdDoc);
     ccdClient.C1TaskEvent += CcdClient_C1TaskEvent;
     ccdClient.C2TaskEvent += CcdClient_C2TaskEvent;
     ccdClient.C3TaskEvent += CcdClient_C3TaskEvent;
 }
Beispiel #2
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            CCDCommunication ccdCommunication = new CCDCommunication();

            ccdCommunication.IP   = IPAddress.Parse(txtIP.Text);
            ccdCommunication.Port = int.Parse(txtPort.Text);
            ccdClient             = new CCDClient(ccdCommunication, txtRecieve);
        }
Beispiel #3
0
        public static CCDCommunication LoadDocument()
        {
            CCDCommunication m_Doc;
            XmlSerializer    xmlSerializer = new XmlSerializer(typeof(CCDCommunication));
            FileStream       fsReader      = null;

            try
            {
                fsReader = File.OpenRead(@".//Parameter/CCDCommunication.xml");
                m_Doc    = (CCDCommunication)xmlSerializer.Deserialize(fsReader);
                m_Doc.IP = System.Net.IPAddress.Parse(m_Doc.IPAddress);
                fsReader.Close();
            }
            catch
            {
                if (fsReader != null)
                {
                    fsReader.Close();
                }
                m_Doc = new CCDCommunication();
            }
            return(m_Doc);
        }
Beispiel #4
0
 public CCDClient(CCDCommunication ccdCommunication, TextBox textBox)
 {
     this.ccdCommunication = ccdCommunication;
     this.textBox          = textBox;
     Init();
 }
Beispiel #5
0
 public CCDClient(CCDCommunication ccdCommunication)
 {
     this.ccdCommunication = ccdCommunication;
     Init();
 }