Esempio n. 1
0
        public void start()
        {
            if (!readConfig)
            {
                //等OPCSERVER启动
                Thread.Sleep(Program.waitMillionSecond);
                ReadConfig();
                readConfig = true;
            }

            if (getConfig && !started)
            {
                CreateMeters();

                started                       = true;
                UpdateCycle                   = new CycleTask();
                RemoteCtrl                    = new CycleTask();
                Program.RemoteCycle           = RemoteCtrl;
                UpdateCycle.WorkStateChanged += new CycleTask.dgtWorkStateChange(UpdateCycle_WorkStateChanged);
                RemoteCtrl.WorkStateChanged  += new CycleTask.dgtWorkStateChange(RemoteCtrl_WorkStateChanged);
                UpdateCycle.Run(update2, System.Threading.ThreadPriority.BelowNormal);
                RemoteCtrl.Run(remoteCtrl, System.Threading.ThreadPriority.BelowNormal);
                Start.SetExit = true;
            }
            Thread.Sleep(200);
        }
Esempio n. 2
0
        /// <summary>
        /// 使用多个ItemManage创建OpcGateway实例
        /// </summary>
        /// <param name="itemManager"></param>
        public OpcGateway(IList <MicroDAQ.DataItem.IDataItemManage> itemManager, IList <IDatabaseManage> databaseManager)
        {
            ItemManagers = itemManager;

            UpdateCycle     = new CycleTask();
            RemoteCtrlCycle = new CycleTask();
            UpdateCycle.WorkStateChanged += new CycleTask.dgtWorkStateChange(UpdateCycle_WorkStateChanged);
            //RemoteCtrlCycle.WorkStateChanged += new CycleTask.dgtWorkStateChange(RemoteCtrl_WorkStateChanged);
        }
Esempio n. 3
0
        /// <summary>
        /// 使用多个ItemManage创建OpcGateway实例
        /// </summary>
        /// <param name="itemManager"></param>
        public OpcGateway(IList<MicroDAQ.DataItem.IDataItemManage> itemManager, IList<IDatabaseManage> databaseManager)
        {
            ItemManagers = itemManager;

            UpdateCycle = new CycleTask();
            RemoteCtrlCycle = new CycleTask();
            UpdateCycle.WorkStateChanged += new CycleTask.dgtWorkStateChange(UpdateCycle_WorkStateChanged);
               //RemoteCtrlCycle.WorkStateChanged += new CycleTask.dgtWorkStateChange(RemoteCtrl_WorkStateChanged);
        }
Esempio n. 4
0
        public void start()
        {
            if (!readConfig)
            {
                //等OPCSERVER启动
                Thread.Sleep(Program.waitMillionSecond);
                ReadConfig();
                readConfig = true;
            }

            if (getConfig && !started)
            {

                CreateMeters();

                started = true;
                UpdateCycle = new CycleTask();
                RemoteCtrl = new CycleTask();
                Program.RemoteCycle = RemoteCtrl;
                UpdateCycle.WorkStateChanged += new CycleTask.dgtWorkStateChange(UpdateCycle_WorkStateChanged);
                RemoteCtrl.WorkStateChanged += new CycleTask.dgtWorkStateChange(RemoteCtrl_WorkStateChanged);
                UpdateCycle.Run(update2, System.Threading.ThreadPriority.BelowNormal);
                RemoteCtrl.Run(remoteCtrl, System.Threading.ThreadPriority.BelowNormal);
                Start.SetExit = true;
            }
            Thread.Sleep(200);
        }
Esempio n. 5
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     this.btnStart.Enabled = false;
     Start = new CycleTask();
     Start.Run(start, ThreadPriority.Lowest);
 }
Esempio n. 6
0
 /// <summary>
 /// 暂停参数指定的任务对象
 /// </summary>
 /// <param name="task">要暂停的任务对象</param>
 private void Stop(CycleTask task)
 {
     task.SetExit = true;
 }
Esempio n. 7
0
 /// <summary>
 /// 继续参数指定的任务对象
 /// </summary>
 /// <param name="task">要继续的任务对象</param>
 public void Continue(CycleTask task)
 {
     task.SetPause = false;
 }
Esempio n. 8
0
 /// <summary>
 /// 暂停参数指定的任务对象
 /// </summary>
 /// <param name="task">要暂停的任务对象</param>
 public void Pause(CycleTask task)
 {
     task.SetPause = true;
 }
Esempio n. 9
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     this.btnStart.Enabled = false;
     Start = new CycleTask();
     Start.Run(start, ThreadPriority.Lowest);
 }
Esempio n. 10
0
 /// <summary>
 /// 继续参数指定的任务对象
 /// </summary>
 /// <param name="task">要继续的任务对象</param>
 public void Continue(CycleTask task)
 {
     task.SetPause = false;
 }
Esempio n. 11
0
 /// <summary>
 /// 暂停参数指定的任务对象
 /// </summary>
 /// <param name="task">要暂停的任务对象</param>
 private void Stop(CycleTask task)
 {
     task.SetExit = true;
 }
Esempio n. 12
0
 /// <summary>
 /// 暂停参数指定的任务对象
 /// </summary>
 /// <param name="task">要暂停的任务对象</param>
 public void Pause(CycleTask task)
 {
     task.SetPause = true;
 }