Exemplo n.º 1
0
 public int BindAnalyDiscreteLayerData(GeoDiscreteEventArgs args)
 {
     int transparency = 200;
     List<GeoRasterStyle> newStyles = new List<GeoRasterStyle>();
     foreach (KeyValuePair<short, Color> pair in args.m_DiscreteColorDict)
     {
         GeoDiscreteSytle item = new GeoDiscreteSytle("name", pair.Value, pair.Key);
         newStyles.Add(item);
         transparency = pair.Value.A;
     }
     if (this.m_DataDic.ContainsKey(args.LayerId))
     {
         this.m_GeoMapMgr.UpdateRasterLayerStyles(args.LayerId, newStyles, transparency);
         return args.LayerId;
     }
     IGeoDemData geoDemData = args.m_GeoDemData;
     Dictionary<short, string> discreteValues = new Dictionary<short, string>();
     foreach (KeyValuePair<short, Color> pair2 in args.m_DiscreteColorDict)
     {
         discreteValues.Add(pair2.Key, pair2.Key.ToString());
     }
     GeoDemDiscreteData dataSource = new GeoDemDiscreteData(geoDemData.FilePath, discreteValues, geoDemData.Bound, geoDemData.Resolution);
     int key = this.m_GeoMapMgr.AddApplicationRasterLayer(dataSource, newStyles, transparency);
     this.m_DataDic.Add(key, dataSource);
     return key;
 }
Exemplo n.º 2
0
 private void GeoDiscreteShow(PredictionGroup pg, PredictionStudy ps)
 {
     this.m_ValueCollectionShort = ps.StudyValueMatrix as ValueMatrixShortCollection;
     this.m_ValueCollectionShort.Open(this.m_SubSysInterface.ProjectManager);
     this.m_DefaultColor = Color.FromArgb(0, Color.White);
     if (ps.StudyType == PredictionStudyType.Best_Server)
     {
         this.GeoBestServerShow(pg, ps, this.m_DefaultColor);
     }
     else
     {
         this.ClearDiscreteMapLayer(ps);
         DiscreteValueLegend legend = ps.StudyLegend.DiscreteValue[ps.StudyLegend.FieldItem[ps.StudyLegend.DisplayTypeIndex]];
         Dictionary<short, Color> discreteValueField = legend.DiscreteValueField;
         List<short> list = new List<short>(discreteValueField.Keys);
         foreach (short num in list)
         {
             discreteValueField[num] = CheckColorTransparence.CheckColor(discreteValueField[num], ps.StudyLegend.Transparence);
         }
         string str = Enum.GetName(typeof(PredictionStudyType), ps.StudyType).Replace('_', ' ');
         foreach (ValueMatrixShort @short in this.m_ValueCollectionShort.Values)
         {
             GeoDiscreteEventArgs args = new GeoDiscreteEventArgs(@short, discreteValueField, this.m_DefaultColor);
             args.m_PolygonRegion = this.m_PredictionGroup.Region;
             int layerId = this.m_SubSysInterface.AnalyDispEvent.AnalyGeoDiscreteLayerMsgChanged(args);
             ps.StudyLegend.MapLever = layerId;
             this.UpdateTreeNodeTag(pg, ps, layerId);
         }
         this.m_ValueCollectionShort.Close(false);
     }
 }
Exemplo n.º 3
0
 private void ThroughputShow(PredictionGroup pg, PredictionStudy ps)
 {
     this.ClearDiscreteMapLayer(ps);
     string savePath = this.GetSavePath(ps);
     this.m_ValueCollectionInt = ps.StudyValueMatrix as ValueMatrixIntCollection;
     this.m_ValueCollectionInt.Open(this.m_SubSysInterface.ProjectManager);
     Dictionary<short, Color> discreteColorDict = new Dictionary<short, Color>();
     this.m_DefaultColor = Color.FromArgb(0, Color.White);
     List<MaxMinValue> maxMinValueList = this.GenerateColorDict(ps, discreteColorDict);
     foreach (ValueMatrixInt num in this.m_ValueCollectionInt.Values)
     {
         ValueMatrixShort throughputValueMatrix = new ValueMatrixShort(savePath, string.Empty, num.RowsCount, num.ColumnsCount);
         throughputValueMatrix.SetParam(num.NorthwestX, num.NorthwestY, (float) num.Resolution);
         throughputValueMatrix.SetValue(num.InvalidValue, num.NotCalcValue, num.DefaultValue);
         this.GenerateValueMatrixForGeo(maxMinValueList, num, throughputValueMatrix);
         string str2 = Enum.GetName(typeof(PredictionStudyType), ps.StudyType).Replace('_', ' ');
         GeoDiscreteEventArgs args = new GeoDiscreteEventArgs(throughputValueMatrix, discreteColorDict, this.m_DefaultColor);
         args.m_PolygonRegion = this.m_PredictionGroup.Region;
         int layerId = this.m_SubSysInterface.AnalyDispEvent.AnalyGeoDiscreteLayerMsgChanged(args);
         ps.StudyLegend.MapLever = layerId;
         this.UpdateTreeNodeTag(pg, ps, layerId);
         throughputValueMatrix.Close(false);
     }
     this.m_ValueCollectionInt.Close(false);
 }
Exemplo n.º 4
0
 private void GeoBestServerShow(PredictionGroup pg, PredictionStudy ps, Color defaultColor)
 {
     string str = Enum.GetName(typeof(PredictionStudyType), ps.StudyType).Replace('_', ' ');
     TreeNode node = this.m_PredictionGroupsManager.RootNode.Nodes[this.m_PredictionGroup.Name].Nodes[str];
     this.ClearBestServerMapLayer(ps, this.m_PredictionGroup);
     int num = (node.Nodes.Count - 1) / 0xff;
     for (short i = 0; i <= num; i = (short) (i + 1))
     {
         Dictionary<short, Color> tag = node.Nodes[(short) (i * 0xff)].Tag as Dictionary<short, Color>;
         List<short> list = new List<short>(tag.Keys);
         foreach (short num3 in list)
         {
             tag[num3] = CheckColorTransparence.CheckColor(tag[num3], ps.StudyLegend.Transparence);
         }
         foreach (ValueMatrixShort @short in this.m_ValueCollectionShort.Values)
         {
             GeoDiscreteEventArgs args = new GeoDiscreteEventArgs(@short, tag, this.m_DefaultColor);
             args.m_PolygonRegion = this.m_PredictionGroup.Region;
             int layerId = this.m_SubSysInterface.AnalyDispEvent.AnalyGeoDiscreteLayerMsgChanged(args);
             ps.StudyLegend.MapLever = layerId - i;
             this.UpdateTreeNodeTag(pg, ps, layerId);
         }
     }
     this.m_ValueCollectionShort.Close(false);
 }