/// <summary> /// 产线配置初始化,解析LineSetting.xml /// </summary> private void LineSettingInit() { if (lineSettings == null || lineSettings.Count == 0) { string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data", "LineSetting.xml"); if (System.IO.File.Exists(path)) { try { lineSettings = new List <LineSetting>(); XmlDocument doc = new XmlDocument(); doc.Load(path); XmlNode node = doc.SelectSingleNode("LineSettings"); foreach (XmlNode xmlNode in node) { LineSetting lineSetting = new LineSetting(); lineSetting.LineNo = xmlNode.Attributes["LineNo"].Value.ToString(); lineSetting.ServerIP = xmlNode.Attributes["ServerIP"].Value.ToString(); lineSetting.DBName = xmlNode.Attributes["DBName"].Value.ToString(); lineSetting.DBType = (DBType)int.Parse(xmlNode.Attributes["DBType"].Value); lineSettings.Add(lineSetting); } } catch (Exception ex) { lineSettings = new List <LineSetting>(); } } } }
public LineSettingViewContent() : base() { //this.TitleName = StringParser.Parse("线别维护"); this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.BasicData.LineSetting.title}");//线别维护 //define panel Panel panel = new Panel(); //set panel dock style panel.Dock = DockStyle.Fill; //set panel BorderStyle panel.BorderStyle = BorderStyle.FixedSingle; LineSetting lineSetting = new LineSetting(); lineSetting.Dock = DockStyle.Fill; //add control to panle panel.Controls.Add(lineSetting); //set panel to view content this.control = panel; }
/// <summary> /// 加载公交数据 /// Add the bus data /// </summary> /// <returns></returns> public Boolean Load() { try { if (!m_isLoad) { // 公交线路环境设置 // Set the bus line environment LineSetting lineSetting = new LineSetting(); lineSetting.Dataset = m_datasetLine; lineSetting.LineIDField = "LINEID"; if (SuperMap.Data.Environment.CurrentCulture != "zh-CN") { lineSetting.NameField = "NAME_en"; } else { lineSetting.NameField = "NAME"; } lineSetting.LengthField = "SMLENGTH"; lineSetting.LineTypeField = "LINETYPE"; // 设置票价信息 // Set the price information FareFieldInfo fareFieldInfo = new FareFieldInfo(); fareFieldInfo.FareTypeField = "FARETYPE"; fareFieldInfo.StartFareField = "STARTFARE"; fareFieldInfo.StartFareRangeField = "STARTFARERANGE"; fareFieldInfo.FareStepField = "FARESTEP"; fareFieldInfo.FareStepRangeField = "FARESTEPRANGE"; lineSetting.FareFieldInfo = fareFieldInfo; // 公交站点环境设置 // Set the stop environment StopSetting stopSetting = new StopSetting(); stopSetting.Dataset = m_datasetStop; stopSetting.StopIDField = "STOPID"; if (SuperMap.Data.Environment.CurrentCulture != "zh-CN") { stopSetting.NameField = "NAME_en"; } else { stopSetting.NameField = "NAME"; } // 公交关系设置 // Set the bus line relations RelationSetting relationSetting = new RelationSetting(); relationSetting.Dataset = m_datasource.Datasets["LineStopRelation"] as DatasetVector; relationSetting.LineIDField = "LINEID"; relationSetting.StopIDField = "STOPID"; // 设置网络数据集的信息 // Set the network dataset information relationSetting.DatasetNetwork = m_datasetNetwork; relationSetting.EdgeIDField = "SMEDGEID"; relationSetting.NodeIDField = "SMNODEID"; relationSetting.FNodeIDField = "SMFNODE"; relationSetting.TNodeIDField = "SMTNODE"; // 公交分析环境设置 // Bus analysis environment settings TransferAnalystSetting transferAnalystSetting = new TransferAnalystSetting(); transferAnalystSetting.LineSetting = lineSetting; transferAnalystSetting.StopSetting = stopSetting; transferAnalystSetting.RelationSetting = relationSetting; // 设置站点捕捉容限 // Set the stop snapping tolerance transferAnalystSetting.SnapTolerance = 50.0; // 设置站点归并容限 // Set the stop merge tolerance transferAnalystSetting.MergeTolerance = 100.0; // 设置步行阈值 // Set the walking tolerance transferAnalystSetting.WalkingTolerance = 500.0; // 设置站点捕捉容限、归并容限及步行阈值的单位 // Set the units transferAnalystSetting.Unit = Unit.Meter; // 实例化一个TransferAnalyst对象 // Initialize a TransferAnalyst object m_transferAnalyst = new TransferAnalyst(); // 加载公交数据 // Load the bus data m_isLoad = m_transferAnalyst.Load(transferAnalystSetting); if (m_isLoad) { if (SuperMap.Data.Environment.CurrentCulture != "zh-CN") { MessageBox.Show("Load the bus data successfully!"); } else { MessageBox.Show("成功加载公交数据!"); } } else { if (SuperMap.Data.Environment.CurrentCulture != "zh-CN") { MessageBox.Show("Failed to load the bus data! Please check the environment settings or data."); } else { MessageBox.Show("公交数据加载失败!请检查公交分析环境设置或公交数据。"); } } } m_mapControl.Map.Refresh(); } catch (Exception ex) { Trace.WriteLine(ex.Message); } return(m_isLoad); }
public LineVerifySignatureFilter(IOptions <LineSetting> lineSetting) { _lineSetting = lineSetting.Value; }