Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parseResult"></param>
        private void ProcessXGUploadRecordResult(XGDevice xgdevice, IParseResult pr)
        {
            ProcessXGDeviceRecordHelp(xgdevice, pr, false);

            IOperaFactory operaFactory = xgdevice.Dpu.OperaFactory;
            IOpera        op           = operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.RemoveUpload);
            //ITaskFactory taskFactory = xgdevice.Dpu.TaskFactory;

            Task task = new Task(xgdevice, op, new ImmediateStrategy(), 1);

            xgdevice.TaskManager.Tasks.Enqueue(task);
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="st"></param>
        /// <param name="parseResult"></param>
        private void ProcessXGReadRecordCountResult(XGDevice xgdevice, IParseResult pr)
        {
            IOperaFactory operaFactory = xgdevice.Dpu.OperaFactory;
            int           count        = Convert.ToInt32(pr.Results["recordcount"]);

            if (count > 0)
            {
                for (int i = 1; i < count + 1; i++)
                {
                    Opera op = (Opera)operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.ReadRecord);
                    op.SendPart["recordidx"] = i;

                    Task task = new Task(xgdevice, op, new ImmediateStrategy(), 2);
                    xgdevice.TaskManager.Tasks.Enqueue(task);
                }

                Opera clearOP = (Opera)operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.ClearRecord);

                Task clearTask = new Task(xgdevice, clearOP, new ImmediateStrategy(), 1);
                xgdevice.TaskManager.Tasks.Enqueue(clearTask);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="parseResult"></param>
        private void ProcessXGUploadRecordResult(XGDevice xgdevice, IParseResult pr)
        {
            ProcessXGDeviceRecordHelp(xgdevice, pr, false);

            IOperaFactory operaFactory = xgdevice.Dpu.OperaFactory;
            IOpera op = operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.RemoveUpload);
            //ITaskFactory taskFactory = xgdevice.Dpu.TaskFactory;

            TimeSpan tsTimeout = TimeSpan.FromMilliseconds(xgdevice.Station.CommuniPortConfig.TimeoutMilliSecond);
            Task task = new Task(xgdevice, op, new ImmediateStrategy(), tsTimeout,1);

            xgdevice.TaskManager.Tasks.Enqueue(task);
        }
Beispiel #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="st"></param>
        /// <param name="parseResult"></param>
        private void ProcessXGReadRecordCountResult(XGDevice xgdevice, IParseResult pr)
        {
            IOperaFactory operaFactory = xgdevice.Dpu.OperaFactory;
            TimeSpan timeout = TimeSpan.FromMilliseconds(xgdevice.Station.CommuniPortConfig.TimeoutMilliSecond);
            int count = Convert.ToInt32(pr.Results["recordcount"]);
            if (count > 0)
            {
                for (int i = 1; i < count + 1; i++)
                {
                    Opera op = (Opera)operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.ReadRecord);
                    op.SendPart["recordidx"] = i;

                    Task task = new Task(xgdevice, op, new ImmediateStrategy(), timeout, 2);
                    xgdevice.TaskManager.Tasks.Enqueue(task);
                }

                Opera clearOP = (Opera)operaFactory.Create(xgdevice.GetType().Name, XGOperaNames.ClearRecord);

                Task clearTask = new Task(xgdevice, clearOP, new ImmediateStrategy(), timeout, 1);
                xgdevice.TaskManager.Tasks.Enqueue(clearTask);

            }
        }