コード例 #1
0
ファイル: Program.cs プロジェクト: ufjl0683/Center
        public static void RGS_Test_Task()
        {
            Protocol protocol=new Protocol();
            protocol.Parse(System.IO.File.ReadAllText(System.AppDomain.CurrentDomain.BaseDirectory+"protocol.txt"));
            Comm.TC.RGSTC tc = new Comm.TC.RGSTC(protocol, "RGSTest", "59.120.20.153", 4660,0xffff, new byte[] { 0, 0, 0, 0 },0,0,0);
            // Comm.TC.RGSTC tc = (Comm.TC.RGSTC)this.manager["RGS232"];

            while (!tc.IsConnected) ;
            tc.m_device.OnAck += new OnAckEventHandler(m_device_OnAck);
            tc.m_device.OnSendingPackage += new OnSendPackgaeHandler(m_device_OnSendingPackage);
            tc.m_device.OnReceiveText += new OnTextPackageEventHandler(m_device_OnReceiveText);
            while (true)
            {

                System.Drawing.Color[][] color;
                color = new System.Drawing.Color[1][];
                color[0] = new System.Drawing.Color[4] { System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red };
                try
                {
                    if (tc.IsConnected)
                        tc.SetTravelDisplay(new byte[0], new string[] { "系統測試" }, color);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }