public cGatherManage()
 {
     m_list_Task = new List<cGatherTask>();
     m_TaskDataList = new cTaskDataList();
     m_GatherTaskList = new cGatherTaskList();
     m_EventProxy = new cEventProxy();
 }
Esempio n. 2
0
 public cGatherManage()
 {
     m_list_Task      = new List <cGatherTask>();
     m_TaskDataList   = new cTaskDataList();
     m_GatherTaskList = new cGatherTaskList();
     m_EventProxy     = new cEventProxy();
 }
        /// �����������������
        public bool AddGatherTask(cTaskDataList taskDataList)
        {
            //�������������ݽ��вɼ���������
            //�����������س��������Դ��󣬼������أ�ȷ�����е����񶼿��Լ��سɹ�
            bool IsSucceed = true;

            for (int i=0 ;i<taskDataList.TaskCount;i++)
            {
                try
                {
                    m_TaskManage.Add(taskDataList.TaskDataList[i]);
                }
                catch (System.Exception ex)
                {
                    IsSucceed = false;
                }
            }

            return IsSucceed;
        }
Esempio n. 4
0
        /// 增加运行区所有的任务
        public bool AddGatherTask(cTaskDataList taskDataList)
        {
            //根据运行区数据进行采集任务的添加
            //如果有任务加载出错,则忽略错误,继续加载,确保所有的任务都可以加载成功
            bool IsSucceed = true;

            for (int i = 0; i < taskDataList.TaskCount; i++)
            {
                try
                {
                    m_TaskManage.Add(taskDataList.TaskDataList[i]);
                }
                catch (System.Exception ex)
                {
                    IsSucceed = false;
                }
            }

            return(IsSucceed);
        }
Esempio n. 5
0
        //�˷�����Ҫ�dz�ʼ��ϵͳ����,������Ҫ��ʼ����Ϣ�¼�,��ʼ���ɼ�
        //���������,������������������,���������������,���ʼ��һ����
        //�Ķ���
        public void UserIni()
        {
            //��ʼ��һ���ɼ�����Ŀ�����,�ɼ������ɴ˿�����������ɼ�����
            //����
            m_GatherControl = new cGatherControl();

            //�ɼ��������¼���,�󶨺�,ҳ�������Ӧ�ɼ����������¼�
            m_GatherControl.TaskManage.TaskCompleted += tManage_Completed;
            m_GatherControl.TaskManage.TaskStarted += tManage_TaskStart;
            m_GatherControl.TaskManage.TaskInitialized += tManage_TaskInitialized;
            m_GatherControl.TaskManage.TaskStateChanged += tManage_TaskStateChanged;
            m_GatherControl.TaskManage.TaskStopped += tManage_TaskStop;
            m_GatherControl.TaskManage.TaskError += tManage_TaskError;
            m_GatherControl.TaskManage.TaskFailed += tManage_TaskFailed;
            m_GatherControl.TaskManage.TaskAborted += tManage_TaskAbort;
            m_GatherControl.TaskManage.Log += tManage_Log;
            m_GatherControl.TaskManage.GData += tManage_GData;

            m_GatherControl.TaskManage.RunTask += this.On_RunSoukeyTask;

            m_GatherControl.Completed += m_Gather_Completed;

            //����������������,��������������Ҫ�Ǹ���taskrun.xml(Ĭ����Tasks\\TaskRun.xml)�ļ���
            //�����ݽ��м���,

            //�����ж�TaskRun.xml�ļ��Ƿ����,����������һ��
            if (!System.IO.File.Exists(Program.getPrjPath() + "Tasks\\taskrun.xml"))
            {
                CreateTaskRun();
            }

            cTaskDataList gList = new cTaskDataList();

            //���ݼ��ص���������������Ϣ,��ʼ��ʼ���ɼ�����
            try
            {
                gList.LoadTaskRunData();
                bool IsAddRTaskSucceed=m_GatherControl.AddGatherTask(gList);

                if (IsAddRTaskSucceed==false )
                    MessageBox.Show(rm.GetString("Error23") , rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
            catch (System.Exception ex)
            {
                MessageBox.Show(rm.GetString("Error15") + ex.Message, rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //��ʼ�������ڵ�����������Ϣ
            m_PublishControl = new cPublishControl();

            //ע�ᷢ��������¼�
            m_PublishControl.PublishManage.PublishCompleted += this.Publish_Complete;
            m_PublishControl.PublishManage.PublishError += this.Publish_Error;
            m_PublishControl.PublishManage.PublishFailed += this.Publish_Failed;
            m_PublishControl.PublishManage.PublishStarted  += this.Publish_Started;
            m_PublishControl.PublishManage.PublishTempDataCompleted += this.Publish_TempDataCompleted;
            m_PublishControl.PublishManage.PublishLog += this.Publish_Log;
            m_PublishControl.PublishManage.RunTask += On_RunSoukeyTask;

            //����ѡ��ġ��������С����νڵ㣬������Ӧ����Ϣ
            try
            {
                LoadRunTask();
            }
            catch (System.IO.IOException)
            {
                if (MessageBox.Show(rm.GetString("Quaere3"), rm.GetString ("MessageboxQuaere"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    CreateTaskRun();
                }
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString ("Error16"),rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

            SetDataShow();

            //�����Ƿ��Զ�����ϵͳ��־��־
            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                m_IsAutoSaveLog = Config.AutoSaveLog;
                Config = null;
            }
            catch (System.Exception)
            {
                //��ʾ�����ļ����������Ҫ��������
            }

            //���ʱ�������ڸ���������ʾ�Ľ���
            this.timer1.Enabled = true;

            //����״̬����Ϣ
            UpdateStatebarTask();
        }