private void InitializationSiteList() { siteInfo comm_site = CRainfallXmlHelper.getInstance().GetCommSiteInfo(); ASiteObj obj = InitializationComSite(comm_site); obj.DbHelper = m_pDbHelper; obj.InitializeComponent(); m_pSiteObjList.Add(obj); obj.SiteName = CRainfallXmlHelper.getInstance().siteName + "(" + obj.SiteKM + ")"; obj.SiteObserver = m_pSiteObserver; AddSiteObjToSectinObj(obj); List <siteInfo> psslist = CRainfallXmlHelper.getInstance().GetRTUSiteInfo(); foreach (siteInfo si in psslist) { ASiteObj asj = new CSiteObj(); asj.SiteID = si.id; asj.SiteKM = si.km; asj.SectionID = si.section_id; asj.Type = "ssl"; asj.DbHelper = m_pDbHelper; asj.InitializeComponent(); asj.SiteName = CRainfallXmlHelper.getInstance().siteName + "(" + si.km + ")"; asj.SiteObserver = m_pSiteObserver; asj.RTUdaemon = new rtu_daemon(); m_pSiteObjList.Add(asj); AddSiteObjToSectinObj(asj); } }
private void InitializationRainfalls() { List <ASectionObj> seclist = CRainfallXmlHelper.getInstance().GetSection(); if (seclist.Count <= 0) { MessageBox.Show("初始化区间配置信息错误,如有问题请联系我们!!!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { foreach (ASectionObj obj in seclist) { m_pSectionObjList.Add(obj); } m_pSiteObserver.SectionObjList = m_pSectionObjList; } try { InitializationSiteList(); } catch { MessageBox.Show("初始化采集点配置信息错误,如有问题请联系我们!!!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } m_pSiteObserver.SiteObjLists = m_pSiteObjList; m_pSiteObserver.StartTimer(); foreach (ASectionObj obj in m_pSectionObjList) { obj.InitializeComponent(); } foreach (ASiteObj obj in m_pSiteObjList) { obj.StartRTUdaemon(); } }
private void InitializationSiteList() { #region 添加本地Comm采集对象 siteInfo comm_site = CRainfallXmlHelper.getInstance().GetCommSiteInfo(); if (!string.IsNullOrEmpty(comm_site.id)) { ASiteObj obj = InitializationComSite(comm_site); obj.DbHelper = m_pDbHelper; obj.InitializeComponent(); m_pSiteObjList.Add(obj); obj.SiteName = string.Format("{0}", obj.SiteKM); obj.SiteObserver = m_pSiteObserver; AddSiteObjToSectinObj(obj); m_pDefaultSiteName = obj.SiteName; } #endregion List <siteInfo> psslist = CRainfallXmlHelper.getInstance().GetRTUSiteInfo(); foreach (siteInfo si in psslist) { ASiteObj asj = new CSiteObj(); asj.SiteID = si.id; asj.SiteKM = si.km; asj.SectionID = si.section_id; asj.Type = "ssl"; asj.DbHelper = m_pDbHelper; asj.InitializeComponent(); asj.SiteName = string.Format("{0}", si.km); asj.SiteObserver = m_pSiteObserver; asj.RTUdaemon = new rtu_daemon(); // aliyun_daemon.getInstance().AddRTUObj(asj); bool bIsExist = false; foreach (ASiteObj ObjExist in m_pSiteObjList) { if (ObjExist.SiteID.Equals(asj.SiteID)) { bIsExist = true; AddSiteObjTosectionObj(ObjExist, asj.SectionID); break; } } if (!bIsExist) { m_pSiteObjList.Add(asj); AddSiteObjToSectinObj(asj); } } }
void InitializeCtrl() { #region 工具栏 m_pRainfallsToolbar = new rainfallsToolBar(); m_pRainfallsToolbar.DbHelper = m_pDbHelper; m_pRainfallsToolbar.SiteRainCalc = m_pSiteRainCalc; addCtrl(m_pRainfallsToolbar, DockStyle.Top); #endregion #region 线路+站点 m_pSectionControl = new SectionControl(); m_pSectionControl.RainfallsDbHelper = m_pDbHelper; m_pSectionControl.SoundPlay = CAlarmSound.getInstance(); m_pSectionSource.DataSource = m_pSectionObjList; m_pSectionControl.BindingData(m_pSectionSource); m_pSectionControl.SectionObjList = m_pSectionObjList; addCtrl(m_pSectionControl, DockStyle.Top); m_pSectionControl.ControlHeight(); #endregion #region 雨量标题 m_pRainfallsCaption = new captionCtrl(); addCtrl(m_pRainfallsCaption, DockStyle.Top); m_pRainfallsCaption.setCaptionKm(CRainfallXmlHelper.getInstance().siteName + m_pDefaultKM); #endregion #region 监测点列表 // m_pRainfallStatueBar = new statueBarCtrl(); m_pSiteControl = new SiteControl(); m_pSiteSource.DataSource = m_pSiteObjList; m_pSiteControl.BindingData(m_pSiteSource); addCtrl(m_pSiteControl, DockStyle.Bottom); m_pSiteControl.ControlHeight(); #endregion #region 通知栏 m_pNotifyControl = new UITrackOpenNofityControl(); addCtrl(m_pNotifyControl, DockStyle.Bottom); #endregion mEvent.Set(); }