예제 #1
0
파일: FrmLED.cs 프로젝트: Strongc/sencond
 private void button1_Click(object sender, EventArgs e)
 {
     m_CoolLed = new LedScreen();
     m_CoolLed.Init("10.25.168.230,0,6666,9990");
     m_CoolLed.Open();
     m_CoolLed.SendText("C#客户端文本", "宋体", 12, 1, 1, 0);
 }
예제 #2
0
        private void ultraGrid2_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
        {
            try
            {
                if (m_iSelectedPound == ultraGrid2.ActiveRow.Index)
                {

                    return;
                }

                ultraGrid2.UpdateData();

                if (ultraGrid2.ActiveRow.Cells["XZ"].Text.ToUpper() == "FALSE")
                {
                    m_iSelectedPound = ultraGrid2.ActiveRow.Index;
                    MessageBox.Show("请选择已接管的计量点!");
                    return;
                }

                if (_measApp == null)
                {
                    MessageBox.Show("请先打开设备");
                    return;
                }

                //this.Cursor = Cursors.WaitCursor;
                //清空界面控件绑定
                ClearControl();
                //关闭前一个选择的计量点语音视频
                RecordClose(m_iSelectedPound);

                int iSelectIndex = ultraGrid2.ActiveRow.Index;
                m_iSelectedPound = iSelectIndex;

                //打开当前选择的计量点语音视频
                RecordOpen(iSelectIndex);

                //查询计量点基础数据并绑定到控件
                QueryPoundBaseInfo(iSelectIndex);

                //初始化接口程序
                if (_measApp != null)
                {
                    _measApp.Finit();
                }
                _measApp.Params = m_Points[m_iSelectedPound];
                _measApp.Params.FS_PRINTERNAME = new System.Drawing.Printing.PrintDocument().PrinterSettings.PrinterName;
                _measApp.Init();
                _measApp.Weight.WeightChanged += new Core.Sip.Client.Meas.WeightChangedEventHandler(OnWeightChanged);
                _measApp.Weight.WeightCompleted += new Core.Sip.Client.Meas.WeightCompletedEventHandler(OnWeightCompleted);
                _measApp.VideoChannel[0] = _measApp.Dvr.SDK_RealPlay(1, 0, (int)VideoChannel1.Handle);
                _measApp.VideoChannel[1] = _measApp.Dvr.SDK_RealPlay(2, 0, (int)VideoChannel2.Handle);
                _measApp.VideoChannel[2] = _measApp.Dvr.SDK_RealPlay(3, 0, (int)VideoChannel3.Handle);
                _measApp.VideoChannel[3] = _measApp.Dvr.SDK_RealPlay(4, 0, (int)VideoChannel4.Handle);
                _measApp.Run();

                _ledScreen = new LedScreen();
                _ledScreen.Init(_ledIP);
                if (_ledScreen != null) _ledScreen.Open();

                if (_measApp.Params.FS_POINTCODE == "K17") //80万吨棒材1#材秤为A区
                {
                    this.strStoreCode = "SH000098";
                }
                else //80万吨棒材2#材秤为B区
                {
                    this.strStoreCode = "SH000099";
                }

                //查询预报数据
                QueryPlanData();
                QueryWeightDataByBatchNo();
                QueryLastStoveNo();
                GetProductTheoryBaseInfo();

                //获取剩余纸张数和碳带数显示在界面
                txtUsedPrintPaper.Text = _measApp.Params.FN_USEDPRINTPAPER;
                txtUsedPrintTink.Text = _measApp.Params.FN_USEDPRINTINK;
                //this.Cursor = Cursors.Default;

            }
            catch (Exception exp)
            {
                WriteLog(exp.Message);
            }
        }
예제 #3
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;
        }
예제 #4
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;
        }
예제 #5
0
파일: FrmLED.cs 프로젝트: Strongc/sencond
 private void FrmLED_Load(object sender, EventArgs e)
 {
     m_CoolLed = new LedScreen();
     m_CoolLed.Open();
 }
예제 #6
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);
        }
예제 #7
0
        private void ultraGrid2_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
        {
            if (m_iSelectedPound == ultraGrid2.ActiveRow.Index)
            {
                return;
            }

            this.Cursor = Cursors.WaitCursor;
            //关闭前一个选择的计量点语音视频
            RecordClose(m_iSelectedPound);

            ClearControler();

            int iSelectIndex = ultraGrid2.ActiveRow.Index;
            m_iSelectedPound = iSelectIndex;

            //打开当前选择的计量点语音视频
            RecordOpen(iSelectIndex);

            //初始化接口程序
            if (_measApp != null)
            {
                _measApp.Finit();
            }
            if (_measApp == null)
            {
                _measApp = new CoreApp();
            }

            _measApp.Params = m_Points[m_iSelectedPound];
            _measApp.Params.FS_PRINTERNAME = new System.Drawing.Printing.PrintDocument().PrinterSettings.PrinterName;
            _measApp.Init();
            _measApp.Weight.WeightChanged += new Core.Sip.Client.Meas.WeightChangedEventHandler(OnWeightChanged);
            _measApp.Weight.WeightCompleted += new Core.Sip.Client.Meas.WeightCompletedEventHandler(OnWeightCompleted);
            //_measApp.Weight.WeightChanged += new Core.Sip.Client.Meas.WeightChangedEventHandler(OnWeightChanged);
            //_measApp.Weight.WeightCompleted += new Core.Sip.Client.Meas.WeightCompletedEventHandler(OnWeightCompleted);
            _measApp.VideoChannel[0] = _measApp.Dvr.SDK_RealPlay(1, 0, (int)VideoChannel1.Handle);
            _measApp.VideoChannel[1] = _measApp.Dvr.SDK_RealPlay(2, 0, (int)VideoChannel2.Handle);
            _measApp.VideoChannel[2] = _measApp.Dvr.SDK_RealPlay(3, 0, (int)VideoChannel3.Handle);
            _measApp.Run();

            _ledScreen=new LedScreen();
            _ledScreen.Init(_ledIP);
            if (_ledScreen != null) _ledScreen.Open();

            this.txtJLD.Text = _measApp.Params.FS_POINTNAME;
            pointcode = _measApp.Params.FS_POINTCODE;

            //辊道编号
            _rollerNo = "1";
            //ControlerInt();//绑定下拉框
            BandPointMaterial(pointcode);
            BandPointReceiver(pointcode);
            BandPointSender(pointcode);
            BandPointSteelType(pointcode);
            BandPointSpec(pointcode);
            QueryAndBindYBData();
            //this.txtLH1.Focus();

            this.Cursor = Cursors.Default;
            //启动线程
            BeginPoundRoomThread();
        }