Beispiel #1
0
        private decimal m_ZEROVALUE; //复位值

        #endregion Fields

        #region Constructors

        public ProductPoundRoom()
        {
            m_POINTID = "";//计量点编码
            m_POINTNAME = "";//计量点名称
            m_POINTTYPE = "";//计量点称重类型

            m_VIEDOIP = "";//硬盘录像机IP
            m_VIEDOPORT = "";//硬盘录像机端口
            m_VIEDOUSER = "";//硬盘录像机用户名
            m_VIEDOPWD = "";//硬盘录像机密码

            m_MOXAIP = "";//MOXA卡IP

            m_METERTYPE = "";//仪表类型
            m_METERPARA = "";//仪表参数
            m_MOXAPORT = "";//计量仪表MOXA卡端口
            m_MeterPreData = 0;//仪表前一次重量
            m_nMeterStabTimes = 0;//仪表稳定次数

            m_RTUIP = "";//RTUIP
            m_RTUPORT = "";//RTU端口

            m_PRINTERIP = "";//打印服务器IP
            m_PRINTERNAME = "";//打印机名称
            m_PRINTTYPECODE = "";//打印机类型代码
            m_USEDPAPER = 0;//已用纸张量
            m_TOTALPAPAR = 0;//打印纸总数量
            m_STATUS = "";//计量点状态
            m_ACCEPTTERMINAL = "";//接管的终端IP

            m_LEDPORT = "";//电子屏MOXA卡端口
            m_LEDPARA = "";//电子屏MOXA卡参数
            m_LEDTYPE = "";//电子屏类型

            m_READERPORT = "";//读卡器MOXA卡端口
            m_READERPARA = "";//读卡器MOXA卡参数
            m_READERTYPE = "";//读卡器类型

            m_DISPLAYPORT = "";//液晶屏MOXA卡端口
            m_DISPLAYPARA = "";//液晶屏MOXA卡参数
            m_DISPLAYTYPE = "";//液晶屏类型

            //使用何种设备标志
            m_bUseMeter = false;//采集仪表数据
            m_bUseLED = false;//使用LED
            m_bUseReader = false;//使用读卡器
            m_bUseDisplay = false;//使用液晶屏
            m_bUseRtu = false;//使用rtu

            //MOXA
            m_CoolSerialForMeter = null;//仪表
            m_CoolLed = null;//LED
            m_CoolDisplay = null;//液晶屏

            //rtu
            m_CoolRtu = null;//rtu data collect
            m_CoolRtuForCommand = null;//rtu command send

            //线程
            m_hThread = null;//线程
            m_bRunning = false;//线程运行开关

            //数据
            m_szMeterData = "";//仪表采集数据
            m_szReaderGUID = "";//读卡器全球唯一号
            m_szReaderCardNo = "";//读卡器卡号
            m_szRtuData = null;//rtu data

            //接管
            m_bSigned = false;

            //播放声音
            m_SoundPlayer = null;

            //硬盘录像机
            m_VideoRecord = null;
            m_VideoHandle = 0;
            m_Channel1 = 0;//通道1句柄
            m_Channel2 = 0;//通道2句柄
            m_Channel3 = 0;//通道3句柄
            m_Channel4 = 0;//通道4句柄
            m_Channel5 = 0;//通道5句柄
            m_Channel6 = 0;//通道6句柄
            m_bTalk = false;//是否正在对讲
            m_TalkID = 0;//对讲句柄
            m_AudioNum = 1; //可使用音频数

            m_bSaved = false;
            m_PreState = false;
            m_CurState = false;
        }
Beispiel #2
0
        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;
        }