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();
        }
 public CtlNodeBaseModel()
 {
     NextNodes        = new List <CtlNodeBaseModel>();
     nextNodeids      = new List <string>();
     productOnlineBll = new MesDBAccess.BLL.ProductOnlineBll();
     productRecordBll = new MesDBAccess.BLL.ProduceRecordBll();
     ctlTaskBll       = new ControlTaskBll();
 }
Exemple #3
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读写卡测试线程";
        }
 public CtlNodeBaseModel()
 {
     productOnlineBll = new MesDBAccess.BLL.ProductOnlineBll();
     productRecordBll = new MesDBAccess.BLL.ProduceRecordBll();
     ctlTaskBll       = new ControlTaskBll();
 }
Exemple #5
0
 public NodeGrasp()
 {
     ctlTaskBll = new ControlTaskBll();
 }
Exemple #6
0
        public ECAMSTransPort(ECAMSDataAccess.DeviceModel devModel, IPlcRW plcRW, DeviceBll devBll, ControlInterfaceBll ctlInterfaceBll, ControlTaskBll ctlTaskBll, LogBll logBll)
            : base(devModel, plcRW, devBll, ctlInterfaceBll, ctlTaskBll, logBll)
        {
            switch (devModel.DeviceID)
            {
            case "2002":
            {
                devName = "A1库入库口";
                break;
            }

            case "2003":
            {
                devName = "A1库分容出口";
                break;
            }

            case "2004":
            {
                devName = "A1库分容入口";
                break;
            }

            case "2005":
            {
                devName = "A1库出口";
                break;
            }

            case "2006":
            {
                devName = "B1库入口";
                break;
            }

            case "2007":
            {
                devName = "B1库二次检测出口";
                break;
            }

            case "2008":
            {
                devName = "B1库的空筐入口";
                break;
            }

            case "2009":
            {
                devName = "B1库的出口";
                break;
            }

            default:
                break;
            }
        }
Exemple #7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="devModel"></param>
 /// <param name="plcRW"></param>
 /// <param name="ctlInterfaceBll"></param>
 /// <param name="ctlTaskBll"></param>
 public ECAMSDevBase(ECAMSDataAccess.DeviceModel devModel, IPlcRW plcRW, DeviceBll devBll, ControlInterfaceBll ctlInterfaceBll, ControlTaskBll ctlTaskBll, LogBll logBll)
 {
     this.devModel        = devModel;
     this.plcRW           = plcRW;
     this.devBll          = devBll;
     this.ctlInterfaceBll = ctlInterfaceBll;
     this.ctlTaskBll      = ctlTaskBll;
     this.logBll          = logBll;
     this.rfidRecordBll   = new RfidRdRecordBll();
     this.palletTraceBll  = new PalletHistoryRecordBll();
     //plcDataDb1 = new byte[devModel.BytesLenDB1];
     //plcDataDb2 = new byte[devModel.BytesLenDB2];
     //plcDataDb1Last = new byte[devModel.BytesLenDB1];
     //plcDataDb2Last = new byte[devModel.BytesLenDB2];
     this.dicCommuDataDB1 = new Dictionary <int, DevCommDatatype>();
     this.dicCommuDataDB2 = new Dictionary <int, DevCommDatatype>();
     dicDataDB1Last       = new Dictionary <int, object>();
     dicDataDB2Last       = new Dictionary <int, object>();
     dicDB1Read           = new Dictionary <int, object>();
     //DebugMode = true; //模拟调试用
 }