Exemplo n.º 1
0
 public void LoadCartonDataTable()
 {
     try
     {
         this.cartonDataTable = this.CartonTableAdapter.GetDataByCatonDate(this.CartonDateFrom, this.CartonDateTo);
         this.NotifyPropertyChanged("CartonList");
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Exemplo n.º 2
0
        public BarcodeScannerBLL(FillingLineData fillingLineData)
        {
            try
            {
                timerTest.Enabled  = true;
                timerTest.Elapsed += new System.Timers.ElapsedEventHandler(timerTest_Elapsed);

                base.FillingLineData        = fillingLineData;
                this.privateFillingLineData = this.FillingLineData.ShallowClone();

                this.barcodeScannerName = GlobalVariables.BarcodeScannerName.MatchingScanner;

                this.ipAddress = IPAddress.Parse(GlobalVariables.IpAddress(this.BarcodeScannerName));



                this.barcodeScannerStatus = new BarcodeScannerStatus[3];
                this.barcodeScannerStatus[(int)GlobalVariables.BarcodeScannerName.QualityScanner - 1]  = new BarcodeScannerStatus(GlobalVariables.BarcodeScannerName.QualityScanner);
                this.barcodeScannerStatus[(int)GlobalVariables.BarcodeScannerName.MatchingScanner - 1] = new BarcodeScannerStatus(GlobalVariables.BarcodeScannerName.MatchingScanner);
                this.barcodeScannerStatus[(int)GlobalVariables.BarcodeScannerName.CartonScanner - 1]   = new BarcodeScannerStatus(GlobalVariables.BarcodeScannerName.CartonScanner);



                this.serialPort          = new SerialPort();
                this.serialPort.PortName = GlobalVariables.ImageS8PortName;
                this.serialPort.BaudRate = 9600;
                this.serialPort.NewLine  = GlobalVariables.charETX.ToString();


                this.serialPort.ReadTimeout = 500;
                //this.serialPort.WriteTimeout = 500;
                //this.serialPort.Parity = value;
                //this.serialPort.DataBits = value;
                //this.serialPort.StopBits = value;
                //this.serialPort.Handshake = value;

                this.serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived);
                this.serialPort.PinChanged   += new SerialPinChangedEventHandler(serialPort_PinChanged);



                this.matchingPackList = new MessageQueue(GlobalVariables.NoItemDiverter());
                this.packInOneCarton  = new MessageQueue();
                this.cartonDataTable  = new DataDetail.DataDetailCartonDataTable();
            }
            catch (Exception exception)
            {
                this.MainStatus = exception.Message;
            }
        }
Exemplo n.º 3
0
        public void Initialize()
        {
            try
            {
                //return;

                ////////////--------------DON'T LOAD. THIS IS VERY OK, AND READY TO LOAD PACK IF NEEDED.
                //////////////Initialize MatchingPackList and PackInOneCarton (of the this.FillingLineData.FillingLineID ONLY)
                //this.PackDataTable = this.PackTableAdapter.GetData();
                //foreach (DataDetail.DataDetailPackRow packRow in this.PackDataTable)
                //{
                //    if (packRow.FillingLineID == (int)this.FillingLineData.FillingLineID)
                //    {
                //        MessageData messageData = new MessageData(packRow.PackBarcode);
                //        messageData.PackID = packRow.PackID;
                //        messageData.PackSubQueueID = packRow.PackSubQueueID;

                //        if (packRow.PackStatus == (byte)GlobalVariables.BarcodeStatus.Normal)
                //            this.matchingPackList.AddPack(messageData);
                //        else if (packRow.PackStatus == (byte)GlobalVariables.BarcodeStatus.ReadyToCarton)
                //            this.packInOneCarton.AddPack(messageData);
                //    }
                //}
                //this.PackDataTable = null;

                //this.NotifyPropertyChanged("MatchingPackList");
                //this.NotifyPropertyChanged("PackInOneCarton");
                ////////////--------------


                //Initialize CartonList
                this.cartonDataTable = this.CartonTableAdapter.GetDataByCartonStatus((byte)GlobalVariables.BarcodeStatus.BlankBarcode);
                this.NotifyPropertyChanged("CartonList");


                this.CartonDateFrom = DateTime.Today;
                this.CartonDateTo   = DateTime.Today.AddHours(24).AddSeconds(-1);
                this.LoadCartonDataTable();
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }