protected PlanetsVisibility GetPlanetsVisibility(tAstroMapType mt, tPlanetType pt) { _justcreated = false; if (Data == null) { Data = new List <MapPlanetsVisibility>(); } MapPlanetsVisibility mpv = Data.Where(x => x.MapType == mt).FirstOrDefault(); if (mpv.PlanetsVisibilityList == null) { mpv.PlanetsVisibilityList = new List <PlanetsVisibility>(); } PlanetsVisibility pv = mpv.PlanetsVisibilityList.Where(x => x.PlanetsType == pt).FirstOrDefault(); if (pv == null) { pv = new PlanetsVisibility() { IsVisible = true, PlanetsType = pt }; mpv.PlanetsVisibilityList.Add(pv); } return(pv); }
protected void UpdateVisibility(tPlanetsGroup pg, tAstroMapType mt, tPlanetType pt) { GroupMapPlanetsVisibilityCollection gmpvc = GroupMapPlanetsVisibilityCollectionLst.Where(x => x.PlanetGroup == pg).First(); MapPlanetsVisibilityCollectionProcessor proc = new MapPlanetsVisibilityCollectionProcessor(); proc.Data = gmpvc.MapPlanetsVisibilityCollection; proc.ToggleValue(mt, pt); }
public AspectsCollectionComplex(List <SpaceObjectData> lstStatic, List <SpaceObjectData> lstDynamic, tAstroMapType type) : base(lstStatic) { AstroMapType = type; UserPreferncesDataFactory _upfact = new UserPreferncesDataFactory(); _ocdp = new OrbsCollectionDataProcessor(_upfact.Data.OrbsSystemName); CreateAspectsCollection(lstStatic, lstDynamic); }
public AstroMapDynamic(MDynamicMapUpdateInfo info) { _geometry = new AstromapGeometryDynamic(); DynamicDate = info.DynamicDate; DynamicType = info.MapType; EventPlace = info.EventPlace; AdditionalHour = info.AdditionalHour; GetJD(); CreateMap(); }
public void ToggleValue(tAstroMapType mt, tPlanetType pt) { if (mt != tAstroMapType.UNKNOWN) { PlanetsVisibility obj = GetPlanetsVisibility(mt, pt); if (!_justcreated) { obj.IsVisible = !obj.IsVisible; } } }
protected void RecalculateDynamic(DateTime dt) { tAstroMapType t = (tAstroMapType)Convert.ToInt32(cmbDynamicMapType.SelectedValue); MDynamicMapUpdateInfo info = new MDynamicMapUpdateInfo() { MapType = t, DynamicDate = dt }; MyParent.UpdateMap(info); }
public double GetOrb(tAstroMapType amt, tPlanetType pt, AspectType at) { double orb = 1; AspectOrbsPair aop = GetAspectOrbsPair(amt, pt, at); if (aop != null) { orb = aop.OrbValue; } return(orb); }
public void SetOrb(tAstroMapType amt, tPlanetType pt1, AspectType at, double value) { OrbsMapCollection omc = null; omc = Data.OrbsMapCollection.Where(x => x.MapType == amt).FirstOrDefault(); PlanetsAspectsOrbsPairsCollection paoc = omc.PlanetsAspectsOrbsCollection.Where(x => x.PlanetType == pt1).FirstOrDefault(); if (paoc != null) { AspectOrbsPair aop = paoc.AspectOrbsCollection.Where(x => x.AspectType == at).FirstOrDefault(); aop.OrbValue = value; } }
protected AspectOrbsPair GetAspectOrbsPair(tAstroMapType amt, tPlanetType pt, AspectType at) { AspectOrbsPair aop = null; OrbsMapCollection omc = Data.OrbsMapCollection.Where(x => x.MapType == amt).First(); if (omc != null) { PlanetsAspectsOrbsPairsCollection paopc = omc.PlanetsAspectsOrbsCollection.Where(x => x.PlanetType == pt).FirstOrDefault(); if (paopc != null) { aop = paopc.AspectOrbsCollection.Where(x => x.AspectType == at).First(); } } return(aop); }
protected void CreateSmallObjectsCollection(tAstroMapType at = tAstroMapType.NATAL) { for (int t = (int)NPTypes.tPlanetType.PT_SUN; t <= (int)NPTypes.tPlanetType.PT_TRUE_NODE; ++t) { bool isVisible = MapPlanetsVisibility.GetValue(at, (NPTypes.tPlanetType)t); if (t == (int)NPTypes.tPlanetType.PT_MEAN_NODE || !isVisible) { continue; } SpaceObject so = new BigObject(JD, (NPTypes.tPlanetType)t); _space_objects.Add(new SpaceObjectData() { _so = so }); } }
protected List <SpaceObjectData> GreateListSOData(tAstroMapType at, tPlanetType tFrom, tPlanetType tTo) { List <SpaceObjectData> lst_objects = new List <SpaceObjectData>(); for (int t = (int)tFrom; t <= (int)tTo; ++t) { bool isVisible = MapPlanetsVisibility.GetValue(at, (NPTypes.tPlanetType)t); if (!isVisible) { continue; } SpaceObject so = new BigObject(JD, (tPlanetType)t); lst_objects.Add(new SpaceObjectData() { _so = so }); } return(lst_objects); }
public List <PlanetsVisibility> GetSimpleVisibilityCollection(tAstroMapType mt) { MapPlanetsVisibility mpv = Data.Where(x => x.MapType == mt).First(); return(mpv.PlanetsVisibilityList); }
private void OnCopyOrbsByMap(object sender, EventArgs e) { bool isOK = false; tAstroMapType typeFrom = Utilities.FromStringToEnumType <tAstroMapType>(cmbMapFrom.SelectedValue.ToString()); tAstroMapType typeTo = Utilities.FromStringToEnumType <tAstroMapType>(cmbMapTo.SelectedValue.ToString()); OrbsCollectionData ocd = OrbsCollection.Where(x => x.OrbsSystemName == CurrentSystem).FirstOrDefault(); OrbsMapCollection mapFrom = ocd.OrbsMapCollection.Where(x => x.MapType == typeFrom).FirstOrDefault(); OrbsMapCollection mapTo = ocd.OrbsMapCollection.Where(x => x.MapType == typeTo).FirstOrDefault(); if (mapFrom != null) { if (mapTo == null) { mapTo = new OrbsMapCollection(); mapTo.MapType = typeTo; mapFrom.PlanetsAspectsOrbsCollection = new List <PlanetsAspectsOrbsPairsCollection>(); ocd.OrbsMapCollection.Add(mapTo); } foreach (PlanetsAspectsOrbsPairsCollection collectionFrom in mapFrom.PlanetsAspectsOrbsCollection) { tPlanetType ptypeFrom = collectionFrom.PlanetType; PlanetsAspectsOrbsPairsCollection collectionTo = mapTo.PlanetsAspectsOrbsCollection.Where(x => x.PlanetType == ptypeFrom).FirstOrDefault(); if (collectionTo == null) { collectionTo = new PlanetsAspectsOrbsPairsCollection(); collectionTo.PlanetType = ptypeFrom; collectionTo.AspectOrbsCollection = new List <AspectOrbsPair>(); mapTo.PlanetsAspectsOrbsCollection.Add(collectionTo); } foreach (AspectOrbsPair orbs in collectionFrom.AspectOrbsCollection) { AspectType at = orbs.AspectType; double dorbval = orbs.OrbValue; AspectOrbsPair orb2 = collectionTo.AspectOrbsCollection.Where(x => x.AspectType == at).FirstOrDefault(); if (orb2 == null) { orb2 = new AspectOrbsPair() { AspectType = at }; collectionTo.AspectOrbsCollection.Add(orb2); } orb2.OrbValue = dorbval; } } isOK = true; } if (isOK) { InitTable(); string tabname = Utilities.FromUpperCaseToLowerWithFirstCapital <tAstroMapType>(mapTo.MapType); int ipos = tabname.IndexOf(" "); if (ipos >= 0) { tabname = tabname.Replace(" ", ""); } tabname = $"tab{tabname}"; TabPage tp = tabCollectionsOrbs.TabPages[tabname]; tabCollectionsOrbs.SelectedTab = tp; } }
protected virtual List <SpaceObjectData> CreateMainCollection(tAstroMapType at) { return(GreateListSOData(at, tPlanetType.PT_SUN, tPlanetType.PT_PLUTO)); }
protected virtual List <SpaceObjectData> CreateFictitiousCollection(tAstroMapType at) { return(GreateListSOData(at, tPlanetType.PT_TRUE_NODE, tPlanetType.PT_MEAN_APOG)); }
public void SetValue(tAstroMapType mt, tPlanetType pt, bool isVisible) { PlanetsVisibility obj = GetPlanetsVisibility(mt, pt); obj.IsVisible = isVisible; }
public bool GetValue(tAstroMapType mt, tPlanetType pt) { PlanetsVisibility obj = GetPlanetsVisibility(mt, pt); return(obj.IsVisible); }
public void SetOrb(tAstroMapType amt, tPlanetType pt, AspectType at, double orb) { AspectOrbsPair aop = GetAspectOrbsPair(amt, pt, at); aop.OrbValue = orb; }