Example #1
0
        public int Init()
        {
            int ret = -1;
            string [] strParams = new string [20];
            //_params = new BT_POINT();
            foreach (BTDevice devParam in _params)
            {
                switch (devParam.FS_TYPE)
                {
                    case "WGT":
                        _weight = new CoreWeight();
                        _weight.init(devParam.FS_PARAM);
                        break;
                    case "LCD":
                        _lcd = new LCDScreen();
                        _lcd.init(devParam.FS_PARAM);
                        break;
                    case "LED":
                        _led = new LedScreen();
                        _led.Init(devParam.FS_PARAM);
                        break;
                    case "ZPL":
                        _printer = new LablePrinter();
                        _printer.Init(devParam.FS_PARAM);
                        break;
                    case "DVR":
                        _dvr = new SDK_Com.HKDVR();
                        _dvr.SDK_Init();
                        strParams = devParam.FS_PARAM.Split(new char[] { ',' });
                        _dvr.SDK_Login(strParams[0]
                            ,Convert.ToInt32(strParams[1])
                            ,strParams[2]
                            , strParams[3]);
                        break;
                    case "RTU":
                        _rtu = new CoreRtu();
                        _rtu.init(devParam.FS_PARAM);
                        break;
                    case "IOLOGIK":
                        _iologic = new CoreIoLogik();
                        _iologic.Init(devParam.FS_PARAM);
                        break;
                    case"CARD":
                        _card = new IcCard();
                        _card.Init(devParam.FS_PARAM);
                        break;
                }
            }

            _thread = null;//new System.Threading.Thread();

            // 初始化视频通道
            _video_channel = new int[8];
            for (int i = 0; i < _video_channel.Length; i++) _video_channel[i] = -1;
            ret = 0;
            return ret;
        }
Example #2
0
        public int Init()
        {
            int ret = -1;

            string [] strParams = new string [20];
            //_params = new BT_POINT();
            foreach (BTDevice devParam in _params)
            {
                switch (devParam.FS_TYPE)
                {
                case "WGT":
                    _weight = new CoreWeight();
                    _weight.init(devParam.FS_PARAM);
                    break;

                case "LCD":
                    _lcd = new LCDScreen();
                    _lcd.init(devParam.FS_PARAM);
                    break;

                case "LED":
                    _led = new LedScreen();
                    _led.Init(devParam.FS_PARAM);
                    break;

                case "ZPL":
                    _printer = new LablePrinter();
                    _printer.Init(devParam.FS_PARAM);
                    break;

                case "DVR":
                    _dvr = new SDK_Com.HKDVR();
                    _dvr.SDK_Init();
                    strParams = devParam.FS_PARAM.Split(new char[] { ',' });
                    _dvr.SDK_Login(strParams[0]
                                   , Convert.ToInt32(strParams[1])
                                   , strParams[2]
                                   , strParams[3]);
                    break;

                case "RTU":
                    _rtu = new CoreRtu();
                    _rtu.init(devParam.FS_PARAM);
                    break;

                case "IOLOGIK":
                    _iologic = new CoreIoLogik();
                    _iologic.Init(devParam.FS_PARAM);
                    break;

                case "CARD":
                    _card = new IcCard();
                    _card.Init(devParam.FS_PARAM);
                    break;
                }
            }

            _thread = null;//new System.Threading.Thread();

            // 初始化视频通道
            _video_channel = new int[8];
            for (int i = 0; i < _video_channel.Length; i++)
            {
                _video_channel[i] = -1;
            }
            ret = 0;
            return(ret);
        }