Example #1
0
 public SVWSTC(Comm.Protocol protocol,string ip,int port)
 {
     this.protocol = protocol;
     new System.Threading.Thread(Communication_Task).Start();
     this.ip = ip;
     this.port = port;
 }
Example #2
0
 // System.Net.Sockets.TcpClient tcp;
 public MFCC_SVWS()
 {
     protocol = new Comm.Protocol();
     protocol.Parse(System.IO.File.ReadAllText("protocol.txt"),false);
     ConsoleServer.Start((int)RemoteInterface.ConsolePortEnum.MFCC_SVWS);
     new SVWSTC(protocol, "192.168.22.130", 6013);
     new SVWSTC(protocol, "10.21.16.18", 1001);
 }
Example #3
0
        // System.Net.Sockets.TcpClient tcp;
        public MFCC_SVWS()
        {
            protocol = new Comm.Protocol();
            protocol.Parse(System.IO.File.ReadAllText(RemoteInterface.Util.CPath(AppDomain.CurrentDomain.BaseDirectory+  "protocol.txt")),false);
            ConsoleServer.Start((int)RemoteInterface.ConsolePortEnum.MFCC_SVWS);
            new SVWSTC(protocol, "192.168.22.130", 6013);
            new SVWSTC(protocol, "10.21.50.87", 1001);

            //SVWS_Status status = new SVWS_Status();
            //status.place = 21;
            //status.group = 1;
            //status.kind = 14;
            //status.dir = 1;
            //status.run_status = 0;
            //status.hw_status = 1;
            //status.type = "D";
            //stausmgr.AddSVWS_Status(status);
        }
Example #4
0
        //private void Hw_StatusToDb(RemoteInterface.I_HW_Status_Desc desc)
        //{
        //}
        private void load_protocol()
        {
            string protocol_source = "";
            if (r_host_comm != null)
            {
                try
                {
                   protocol_source = r_host_comm.getScriptSource(devType);
                }
                catch (Exception ex)
                {
                    ConsoleServer.WriteLine(ex.Message+ex.StackTrace);
                    ConsoleServer.WriteLine("read local protocol.txt");
                    protocol_source = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + "protocol.txt").ReadToEnd();

                }

                try
                {
                    protocol = new Protocol();
                    protocol.Parse(protocol_source,false);
                    System.IO.StreamWriter sw = new System.IO.StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "protocol.txt");
                    sw.Write(protocol_source);
                    sw.Close();
                    return;
                }
                catch (Exception ex)
                {
                    ConsoleServer.WriteLine(ex.Message+ex.StackTrace);
                }

            }

            else  //r_host_comm fail
            {
                // read local protocol.txt
                protocol_source = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + "protocol.txt").ReadToEnd();
            }

            protocol = new Protocol();
            protocol.Parse(protocol_source,false);
        }