Ejemplo n.º 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 HkDvr();
                    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, 1);
                    break;
                }
            }

            _thread = null;//new System.Threading.Thread();
            return(0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 窗体初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WeighMeasureInfo_Load(object sender, EventArgs e)
        {
            card = new IcCard();
            card.PortName = "COM1";

            getImage.ob = this.ob;
            getImage.SynServerTime();//同步服务器时间
            //InphaseServerTime cc = new InphaseServerTime();
            //cc.Check_Before_Login();
            //m_SerialPort1 = new SerialPort();
            //m_SerialPort2 = new SerialPort();
            //m_SerialPort7 = new SerialPort();
            //m_SerialPort = new SerialPort[10] { m_SerialPort1, m_SerialPort2, m_SerialPort3, m_SerialPort4, m_SerialPort5, m_SerialPort6, m_SerialPort7, m_SerialPort8, m_SerialPort9, m_SerialPort10 };
            m_MainThreadCapPicture= new CapPicture (MainThreadCapPicture);
            //构建计量点曲线图列表与动态列
            dtQXT = new DataTable[10] { dtQXT0, dtQXT1, dtQXT2, dtQXT3, dtQXT4, dtQXT5, dtQXT6, dtQXT7, dtQXT8, dtQXT9 };
            curveColumns = new int[10] { curveColumns0, curveColumns1, curveColumns2, curveColumns3, curveColumns4, curveColumns5, curveColumns6, curveColumns7, curveColumns8, curveColumns9 };
            strBackZero = new int[10] { strBackZero0, strBackZero1, strBackZero2, strBackZero3, strBackZero4, strBackZero5, strBackZero6, strBackZero7, strBackZero8, strBackZero9 };
            BackZeroSign = new int[10] { BackZeroSign0, BackZeroSign1, BackZeroSign2, BackZeroSign3, BackZeroSign4, BackZeroSign5, BackZeroSign6, BackZeroSign7, BackZeroSign8, BackZeroSign9 };
            BackZero = new int[10] { BackZero0, BackZero1, BackZero2, BackZero3, BackZero4, BackZero5, BackZero6, BackZero7, BackZero8, BackZero9 };
            s_toZore = new decimal[10] { s_toZore0, s_toZore1, s_toZore2, s_toZore3, s_toZore4, s_toZore5, s_toZore6, s_toZore7, s_toZore8, s_toZore9 };

            b_daozha = new bool[10] { b_daozha0, b_daozha1, b_daozha2, b_daozha3, b_daozha4, b_daozha5, b_daozha6, b_daozha7, b_daozha8, b_daozha9 };

            ifControlDaozha = new int[10] { ifControlDaozha0, ifControlDaozha1, ifControlDaozha2, ifControlDaozha3, ifControlDaozha4, ifControlDaozha5, ifControlDaozha6, ifControlDaozha7, ifControlDaozha8, ifControlDaozha9 };

            stRunPath = System.Environment.CurrentDirectory;//当前界面自己定义路径

            Constant.RunPath = System.Environment.CurrentDirectory;//Core.KgMcms.PublicComponent带的定义路径

            //Constant.SetViewStyle(this);

            ControlerInit();
            //GetLXData();
            DataGridInit();
            QueryJLDData();
               // QueryYYBBData(); 该方法为语音播报方法  Load调用该方法时ultraToolbarsManager冲突 ultraToolbarsManager 不显示
            panelYCJL.Width = 652;
            panelYCJL.Visible = false;//一次计量图片
            //panelYCSP.Height = 209;
            picFDTP.Visible = false;//双击放大图片
            panel22.Visible = true;//查询出一次计量车号图片
            txtJLY.Text = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
            txtBC.Text = Table_CA02_UserOrder.Static_T_CA02_UserOrder.GetUserOrderName(CoreFS.SA06.CoreUserInfo.UserInfo.GetUserOrder());
            //chbQXPZ.Enabled = false;

            sdk = new SDK_Com.HKDVR();//硬盘录像机实例化
            sdk.SDK_Init();//必须要初始化
            //ConnectYPLXJ();

            DataRow dro = dataTable6.NewRow();
            dro[0] = 0;
            dataTable6.Rows.Add(dro);
            ultraChart1.DataSource = dataTable6;

            lbYS.ForeColor = Color.Red;

            //GetLXData();
            //for (int i = 1; i <= 6; i++)
            //{
            //    Button btnItemName = (Button)panelYYBF.Controls.Find("btn" + Convert.ToString(i), true)[0];
            //    btnItemName.Enabled = false;
            //}
            //for (int i = 1; i <= 15; i++)
            //{
            //    if (i != 9)
            //    {
            //        Button btnItemName = (Button)panelSPKZ.Controls.Find("button" + Convert.ToString(i), true)[0];
            //        btnItemName.Enabled = false;
            //    }
            //}

            s_SerialPort = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One); //屏幕显示数据实例化

            m_SerialPort1 = new SerialPort();
            m_SerialPort2 = new SerialPort();
            m_SerialPort3 = new SerialPort();
            m_SerialPort4 = new SerialPort();
            m_SerialPort5 = new SerialPort();
            m_SerialPort6 = new SerialPort();
            m_SerialPort7 = new SerialPort();
            m_SerialPort8 = new SerialPort();
            m_SerialPort9 = new SerialPort();
            m_SerialPort10 = new SerialPort();
            m_SerialPort11 = new SerialPort();
            m_SerialPort12 = new SerialPort();
            m_SerialPort13 = new SerialPort();
            m_SerialPort14 = new SerialPort();

            QueryYCBData();
            ClearYBData();
            ClearYCBData();

            InitConfig();
            this.BuildMyTable();//构建内存表格式
            this.DownLoadMaterial(); //下载磅房对应物料信息到内存表
            this.DownLoadReceiver();  //下载磅房对应收货单位信息到内存表
            this.DownLoadSender();  //下载磅房对应发货单位信息到内存表
            this.DownLoadTrans();  //下载磅房对应承运单位信息到内存表
            this.DownLoadCarNo(); //下载磅房对应车号信息到内存表
            //this.DownLoadFlow();  //下载流向信息
            this.DownLoadProvider();  //下载磅房对应供应单位信息内存表

            printInfoClear();
        }
Ejemplo n.º 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 HkDvr();
                        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,1);
                        break;
                }
            }

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