Ejemplo n.º 1
0
 /// <summary>
 /// TCP/IP 연결용 객체 생성
 /// </summary>
 /// <param name="strIP"></param>
 /// <param name="intPort"></param>
 public clsBarcodePrinter(string strIP, int intPort)
 {
     clsTcp             = new  Function.Comm.SocketClient(strIP, intPort);
     clsTcp.evtReceived = new Function.Comm.SocketClient.delReceive(ReceiveAck);
     clsSn = null;
     Init();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Serial 연결용 객체 생성
 /// </summary>
 /// <param name="portName"></param>
 /// <param name="baudRate"></param>
 /// <param name="parity"></param>
 /// <param name="dataBits"></param>
 /// <param name="stopBits"></param>
 public clsBarcodePrinter(string portName, int baudRate, string parity, int dataBits, string stopBits)
 {
     strCom = portName;
     clsSn  = new      Function.Comm.Serial(portName, baudRate, parity, dataBits, stopBits);
     clsSn.OnDataReceived += new  Function.Comm.Serial.delReceive(ReceiveAck);
     clsTcp = null;
     Init();
 }
Ejemplo n.º 3
0
        public void Dispose()
        {
            this.Close();

            if (clsSn == null)
            {
                clsTcp = null;
            }
            else
            {
                clsSn = null;
            }
        }
Ejemplo n.º 4
0
        private void InitXml(string strNode, XML xml)
        {
            Init();


            xml.chNode2Root();
            xml.chSingleNode(strNode);

            LoadFormatFromXml(xml.GetSingleNodeValue("FORMAT"));

            if (xml.GetSingleNodeValue("TYPE") == "TCP")
            {
                xml.chSingleNode(@"TCP");
                string strIP   = xml.GetSingleNodeValue("IP");
                int    intPort = int.Parse(xml.GetSingleNodeValue("PORT"));


                clsTcp              = new  Function.Comm.SocketClient(strIP, intPort);
                clsTcp.evtReceived += new  Function.Comm.SocketClient.delReceive(ReceiveAck);
                clsSn = null;
            }
            else
            {
                xml.chSingleNode(@"SERIAL");
                strCom = xml.GetSingleNodeValue("COMPORT");
                string strBaudrate = xml.GetSingleNodeValue("BAUDRATE");
                string strPARITY   = xml.GetSingleNodeValue("PARITY");
                string strDATABITS = xml.GetSingleNodeValue("DATABITS");
                string strSTOPBITS = xml.GetSingleNodeValue("STOPBITS");

                clsSn = new  Function.Comm.Serial(strCom, int.Parse(strBaudrate), strPARITY, int.Parse(strDATABITS), strSTOPBITS);
                clsSn.OnDataReceived += new  Function.Comm.Serial.delReceive(ReceiveAck);
                clsTcp = null;

                Open();
            }
        }