Exemple #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string jxDB        = ConfigurationManager.AppSettings["JXDataBase"];
            string jxDBUserPwd = ConfigurationManager.AppSettings["JXDataBaseUserPwd"];

            jxDBUserPwd = EncAndDec.Decode(jxDBUserPwd, "zwx", "xwz");
            if (string.IsNullOrEmpty(jxDBUserPwd))
            {
                MessageBox.Show("数据库连接信息错误");
                return;
            }
            PubConstant.ConnectionString = jxDB + jxDBUserPwd;

            this.comboBoxPlcObjList.SelectedIndex = 0;


            //  this.tabPage1.Enabled = false;
            devBll                   = new DeviceBll();
            ctlTaskBll               = new ControlTaskBll();
            ctlTaskIFBll             = new ControlInterfaceBll();
            palletBll                = new OCVPalletBll();
            batteryBll               = new OCVBatteryBll();
            manTaskBll               = new ManageTaskBll();
            makeCardBll              = new MakeCardRecordBll();
            plcRwObj                 = new PLCRW();
            plcRwObj.eventLinkLost  += PlcLostConnectHandler;
            plcRwObj2                = new PLCRWNet();
            plcRwObj2.eventLinkLost += PlcLostConnectHandler;
            if (this.comboBoxPlcObjList.Text == "PLC控件")
            {
                plcRwIF = plcRwObj;
            }
            else if (this.comboBoxPlcObjList.Text == "重新实现MC协议")
            {
                plcRwIF = plcRwObj2;
            }

            plcFx485 = new PlcRW485BD();
            plcFx485.StationNumber = 1;
            HFReaderIF readerIF = new HFReaderIF();

            rfidRW          = new SgrfidRW(1);
            rfidRW.ReaderIF = readerIF;
            this.comboBoxComports.Items.Clear();

            string[] ports = System.IO.Ports.SerialPort.GetPortNames();
            foreach (string port in ports)
            {
                this.comboBoxComports.Items.Add(port);
                this.comboBoxFXComs.Items.Add(port);
            }
            if (ports != null && ports.Count() > 0)
            {
                this.comboBoxComports.Text = ports[0];
                this.comboBoxFXComs.Text   = ports[0];
            }
            makeCardCount = makeCardBll.GetRecordCount(" ");
            this.labelMakeCardCount.Text = "计数:" + makeCardCount.ToString();
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ctlManager = new ECAMWCS();
            ctlManager.AttachErrorHandler(ErrorEventHandler);
            ctlManager.AttachLogHandler(LogEventHandler);
            this.buttonStart.Enabled = false;
            this.buttonStop.Enabled  = false;
            //  this.tabPage1.Enabled = false;
            devBll                  = new DeviceBll();
            ctlTaskBll              = new ControlTaskBll();
            ctlTaskIFBll            = new ControlInterfaceBll();
            palletBll               = new OCVPalletBll();
            batteryBll              = new OCVBatteryBll();
            manTaskBll              = new ManageTaskBll();
            plcRwObj                = new PLCRW();
            plcRwObj.eventLinkLost += PlcLostConnectHandler;
            HFReaderIF readerIF = new HFReaderIF();

            rfidRW = new SgrfidRW(1);

            this.comboBoxComports.Items.Clear();
            int i = 0;

            string[] ports = System.IO.Ports.SerialPort.GetPortNames();
            foreach (string port in ports)
            {
                this.comboBoxComports.Items.Add(port);
                i++;
            }
            if (ports != null && ports.Count() > 0)
            {
                this.comboBoxComports.Text = ports[0];
            }

            rfidWorkingThread = new Thread(new ThreadStart(SysWorkingProc));
            rfidWorkingThread.IsBackground = true;
            rfidWorkingThread.Name         = "RFID读写卡测试线程";
        }
Exemple #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Console.SetOut(new TextBoxWriter(this.richTextBoxLog));
            plcForm2.MdiParent = this;
            this.panelPlc2.Controls.Clear();
            this.panelPlc2.Controls.Add(plcForm2);
            plcForm2.Dock = DockStyle.Fill;
            plcForm2.Show();

            rfidWQForm.MdiParent = this;
            this.panelWqrfid.Controls.Clear();
            this.panelWqrfid.Controls.Add(rfidWQForm);
            rfidWQForm.Dock = DockStyle.Fill;
            rfidWQForm.Show();

            rfidSgUrb3Form.MdiParent = this;
            this.panelSgUrb3.Controls.Clear();
            this.panelSgUrb3.Controls.Add(rfidSgUrb3Form);
            rfidSgUrb3Form.Dock = DockStyle.Fill;
            rfidSgUrb3Form.Show();


            // 隐藏不用 的tabpage
            //this.tabControl1.TabPages.Remove(this.tabPage1);
            // this.tabControl1.TabPages.Remove(this.tabPage3);
            this.tabControl1.TabPages.Remove(this.tabPage5);
            // this.comboBoxPlcObjList.SelectedIndex = 0;
            //  this.tabPage1.Enabled = false;
            this.comboBoxDatabitSel.Items.AddRange(new string[] { "32位整数", "64位整数" });
            this.comboBoxDatabitSel.SelectedIndex = 0;

            #region PLC相关
            this.cbxPlcCata.Items.AddRange(new string[] { "FX5U", "Q系列", "Fx3uNET模块" });
            this.cbxPlcCata.SelectedIndex = 0;
            plcRwObj2 = new PLCRwMCPro(EnumPlcCata.FX5U, 1000, 1000);
            plcRwObj2.eventLinkLost += PlcLostConnectHandler;
            plcRwIF = plcRwObj2;

            plcFx485 = new PlcRW485BD();
            plcFx485.StationNumber = 1;
            #endregion


            HFReaderIF readerIF = new HFReaderIF();
            rfidRW          = new SgrfidRW(1);
            rfidRW.ReaderIF = readerIF;
            this.comboBoxComports.Items.Clear();

            barcodeReader = new BarcodeRWHonevor(1);

            string[] ports = System.IO.Ports.SerialPort.GetPortNames();
            foreach (string port in ports)
            {
                this.comboBoxComports.Items.Add(port);
                this.comboBoxFXComs.Items.Add(port);
                this.comboBoxBarcode.Items.Add(port);
                this.comboBoxAirdetect.Items.Add(port);
            }
            if (ports != null && ports.Count() > 0)
            {
                this.comboBoxComports.Text = ports[0];
                this.comboBoxFXComs.Text   = ports[0];
            }
            rfidWorkingThread = new Thread(new ThreadStart(SysWorkingProc));
            rfidWorkingThread.IsBackground = true;

            this.printer = new PrinterRW(1, "", 8000);
            string dbConn = string.Format("Data Source ={0}\\SQLEXPRESS;Initial Catalog=FangTAIZaojuA;User ID=sa;Password=123456;", this.textBoxPrinterIP.Text);

            this.printerDB = new PrinterRWdb(dbConn);

            //MES 测试初始化
            this.textBoxMESwsAddr.Text = "http://192.168.100.90:8188/soap/EventService?wsdl";
            this.comboBoxInterfaces.Items.AddRange(new string[] { "assembleDown", "assembleRepair" });
            this.comboBoxInterfaces.SelectedIndex = 0;
            this.comboBoxDTs.Items.AddRange(new string[] { "FT_MES_STEP_INFO", "FT_MES_STEP_INFO_DETAIL" });
            this.comboBoxDTs.SelectedIndex = 0;
            this.textBoxMesParams.Text     = "1002002100086L451607280194,L45";
            this.richTextBoxMesDBConn.Text = @"Data Source=(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.94)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PRQMESDB)
    )
  )
;User Id=prqminda1;Password=prqminda1;Connection Timeout=5;";
//            this.richTextBoxMesDBConn.Text =  @"Data Source=(DESCRIPTION =
//    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.94)(PORT = 1521))
//    (CONNECT_DATA =
//      (SERVER = DEDICATED)
//      (SERVICE_NAME = PRQMESDB)
//    )
//  )
//;User Id=prqminda1;Password=prqminda1;"; //这个也可以放到Web.Config中。

            //气密
            airDetecter = new AirDetectFL295CRW(1, "");
        }