コード例 #1
0
ファイル: CoreCabinet.cs プロジェクト: Strongc/sencond
        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;
        }
コード例 #2
0
ファイル: CoreApp.cs プロジェクト: Strongc/sencond
        public int Init()
        {
            int ret = -1;
            string [] strParams = new string [5];
            //_params = new BT_POINT();

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

            if (_params.FS_RTUIP != "")
            {
                _rtu = new CoreRtu();
                _rtu.IP = _params.FS_RTUIP;
                if (_params.FS_RTUPORT != "") _rtu.Port = Convert.ToUInt16(_params.FS_RTUPORT);
            }
            if (_params.FS_READERPARA != "")
            {
                _card = new IcCard();
                strParams = _params.FS_READERPARA.Split(new char[] { ',' });
                _card.Port = Convert.ToInt16(strParams[0]);
                _card.BaudRate = Convert.ToInt32(strParams[1]);
            }
            if (_params.FS_LEDIP != "")
            {
                _led = new LedScreen();
                _led.Init(_params.FS_LEDIP);

                //_led.RemotePort = Convert.ToInt32(_params.FS_LEDPORT);
            }

            if (_params.FS_DISPLAYPARA != "")
            {
                _lcd = new LCDScreen();
                _lcd.init(_params.FS_DISPLAYPARA);
            }
            if (_params.FS_MOXAIP != "")
            {
                _iologic = new CoreIoLogik();
                _iologic.IP = _params.FS_MOXAIP;
                if (_params.FS_MOXAPORT != "") _iologic.Port = Convert.ToInt32(_params.FS_MOXAPORT);
            }
            if (_params.FS_VIEDOIP != "")
            {
                //**************************************************************
                strParams = _params.FS_VIEDOIP.Split(new char[] { ',' });
                if (strParams.Length < 2)
                {
                    _dvr = new SDK_Com.HKDVR();
                    _dvr.SDK_Init();
                    _dvr.SDK_Login(_params.FS_VIEDOIP, Convert.ToInt32(_params.FS_VIEDOPORT), _params.FS_VIEDOUSER, _params.FS_VIEDOPWD);
                }
                else
                {
                    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                    Cameras = new SsIpCamera[strParams.Length];
                    for (int i = 0; i < Cameras.Length; i++)
                    {
                        Cameras[i] = new SsIpCamera();
                        Cameras[i].Init(strParams[i]);
                    }
                    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                }
            }

            if (_params.FS_METERPARA != "")
            {
                _weight = new CoreWeight();
                _weight.DeviceName = _params.FS_METERTYPE;
                _weight.init(_params.FS_METERPARA);
            }
            if (_params.FS_PRINTERIP != "")
            {
                _printer = new CorePrinter();
                _printer.Init(_params.FS_PRINTERNAME);
            }
            // 初始化视频通道
            _video_channel = new int[8];
            for (int i = 0; i < _video_channel.Length; i++) _video_channel[i] = -1;
            ret = 0;
            return ret;
        }
コード例 #3
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);
        }