Пример #1
0
        public INEAspectGroup(Dictionary <int, float> distributions, AspectType type)
        {
            if (distributions != null)
            {
                Type    = type;
                Aspects = new Dictionary <int, INEAspect>();
                bool distributionValid = false;

                foreach (KeyValuePair <int, float> item in distributions)
                {
                    if (INE.Char.ValidAspect(item.Key, type))
                    {
                        float distribution = item.Value <0 ? 0 : item.Value> INE.Char.MaxDistribution ? INE.Char.MaxDistribution : item.Value;

                        if (distribution > 0)
                        {
                            distributionValid = true;
                        }

                        Aspects.Add(item.Key, new INEAspect(1f, distribution, distribution));
                    }
                }

                DistributionValid = distributionValid;
            }
        }
Пример #2
0
        protected void DrawData(Graphics g)
        {
            if (OrbsData != null && OrbsData.Count > 0)
            {
                Font f = new Font(FontFamily.GenericSansSerif, 10);

                for (int index = 0; index < OrbsData.Count; index++)
                {
                    PlanetsAspectsOrbsPairsCollection paoc = OrbsData[index];
                    for (int j = 0; j < Constants._aspects.Count; ++j)
                    {
                        string         saspect = Constants._aspects[j];
                        AspectType     at      = Utilities.FromStringToEnumType <AspectType>(saspect, "AT_");
                        AspectOrbsPair aop     = paoc.AspectOrbsCollection.Where(x => x.AspectType == at).FirstOrDefault();
                        if (aop == null)
                        {
                            continue;
                        }

                        double dVal = aop.OrbValue;
                        float  Y    = (index + 1) * _painter._Height_Grid_Cell + 5;
                        float  X    = (j + 1) * _painter._Width_Grid_Cell + 5;
                        g.DrawString(dVal.ToString(), f, Brushes.Black, new PointF(X, Y));
                    }
                }
            }
        }
        protected AspectType GetAspectDataByvalue(int Devider, double angle, out double remainder)
        {
            remainder = 0;
            AspectType at     = AspectType.AT_NONE;
            int        aspect = ((int)(angle / Devider)) * Devider;

            remainder = angle % Devider;
            double rem2 = 0;

            if (remainder > Devider / 2)
            {
                int a2 = aspect + Devider;
                rem2 = a2 - Math.Abs(angle);
                if (Math.Abs(rem2) < remainder)
                {
                    aspect    = a2;
                    remainder = rem2;
                }
            }


            at = (AspectType)aspect;

            return(at);
        }
        public void CreateAspectsCollection(List <SpaceObjectData> lstSO1, List <SpaceObjectData> lstSO2)
        {
            InitRedBuletsStatic(lstSO1);
            _aspects = new List <Aspect>();
            foreach (SpaceObjectData sod1 in lstSO1)
            {
                SpaceObject so1 = sod1._so;
                foreach (SpaceObjectData sod2 in lstSO2)
                {
                    SpaceObject so2     = sod2._so;
                    double      dLambda = Math.Abs(so1.Lambda - so2.Lambda);
                    if (dLambda > 180)
                    {
                        dLambda = 360 - dLambda;
                    }

                    AspectType at = GetAspectType(dLambda, so1.PlanetType, so2.PlanetType);
                    if (at == AspectType.AT_CONJUNCTION)
                    {
                        sod1.IsRed = sod2.IsRed = true;
                    }

                    if (at != AspectType.AT_NONE)
                    {
                        _aspects.Add(new Aspect()
                        {
                            Angle        = Math.Abs(dLambda),
                            PlanetType1  = so1.PlanetType,
                            PlanetType2  = so2.PlanetType,
                            _aspect_data = (AspectData)_AspectsDataCollection.Where(x => x.Angle == ((decimal)at)).FirstOrDefault()
                        });
                    }
                }
            }
        }
Пример #5
0
        public static SortedDictionary <Double, Aspects> GetAspectsDictionary(ICollection <Double> concernedDegrees)
        {
            SortedDictionary <Double, Aspects> DegreesConcerned = new SortedDictionary <Double, Aspects>();

            double     maxOrb = 0;
            AspectType type   = AspectType.None;

            foreach (double degrees in concernedDegrees)
            {
                if (Angle.References.ContainsKey(degrees))
                {
                    type   = Angle.References[degrees];
                    maxOrb = AspectOrbs.ContainsKey(type) ? AspectOrbs[type] : DefaultMaxOrb;
                }
                else
                {
                    type   = AspectType.None;
                    maxOrb = DefaultMaxOrb;
                }

                if (!DegreesConcerned.ContainsKey(degrees))
                {
                    DegreesConcerned.Add(degrees, new Aspects((degrees > 360 ? degrees % 360 : degrees), type, maxOrb));
                }
            }

            return(DegreesConcerned);
        }
Пример #6
0
        private void compareIt(double radixPos, double progPos, int rIndex, int pIndex)
        {
            double actOrbis;
            double long1     = Math.Min(radixPos, progPos);
            double long2     = Math.Max(radixPos, progPos);
            double distance1 = long2 - long1;
            double distance2 = long1 - long2 + 360;

            for (int k = 0; k < aspectTypes.Count; k++)
            {
                AspectType aspectType   = (AspectType)aspectTypes[k];
                double     normDistance = aspectType.distance;
                if ((Math.Abs(distance1 - normDistance)) <= progOrb)     // aspect found
                {
                    actOrbis = (Math.Abs(distance1 - normDistance));
                    transitAspectMatches.Add(new ProgAspect(rIndex, 0, pIndex, progPos, actOrbis, (AspectType)aspectTypes[k]));
                }
                else
                if ((Math.Abs(distance2 - normDistance)) <= progOrb)         // aspect found
                {
                    actOrbis = (Math.Abs(distance2 - normDistance));
                    transitAspectMatches.Add(new ProgAspect(rIndex, 0, pIndex, progPos, actOrbis, (AspectType)aspectTypes[k]));
                }
            }
        }
Пример #7
0
 /// <summary>
 /// Constructor of Aspect
 /// </summary>
 /// <param name="angle">Corresponding angle</param>
 /// <param name="kind">Type of the aspect</param>
 /// <param name="maxOrb">Acceptable Orb</param>
 private Aspects(double degrees, AspectType kind, double maxOrb) // : base(degrees)
 {
     Degrees        = degrees;                                   //To avoid normalize() of the Angle base class
     Kind           = kind;
     Name           = kind.ToString();
     PermissibleOrb = maxOrb;
 }
Пример #8
0
        private void OnCopyOrbsByAspect(object sender, EventArgs e)
        {
            bool               isOK   = false;
            AspectType         atFrom = Utilities.FromStringToEnumType <AspectType>(cmbAspectFrom.SelectedValue.ToString(), "AT_");
            AspectType         atTo   = Utilities.FromStringToEnumType <AspectType>(cmbAspectTo.SelectedValue.ToString(), "AT_");
            OrbsCollectionData ocd    = OrbsCollection.Where(x => x.OrbsSystemName == CurrentSystem).FirstOrDefault();
            OrbsMapCollection  omc    = ocd.OrbsMapCollection.Where(x => x.MapType == MapType).FirstOrDefault();

            foreach (PlanetsAspectsOrbsPairsCollection papc in omc.PlanetsAspectsOrbsCollection)
            {
                tPlanetType    pt   = papc.PlanetType;
                AspectOrbsPair aop1 = papc.AspectOrbsCollection.Where(x => x.AspectType == atFrom).FirstOrDefault();
                if (aop1 != null)
                {
                    AspectOrbsPair aop2 = papc.AspectOrbsCollection.Where(x => x.AspectType == atTo).FirstOrDefault();
                    if (aop2 == null)
                    {
                        aop2            = new AspectOrbsPair();
                        aop2.AspectType = atTo;
                        papc.AspectOrbsCollection.Add(aop2);
                    }
                    aop2.OrbValue = aop1.OrbValue;
                    isOK          = true;
                }
            }
            if (isOK)
            {
                InitTable();
            }
        }
Пример #9
0
 /// <summary>
 /// Construct a new Aspect from with defined type, degree and maxOrb.
 /// </summary>
 /// <param name="degs">theAngle measurement</param>
 private Aspect(AspectType type, double degrees, char symbol, double maxOrb)
 {
     this.type    = type;
     this.degrees = degrees;
     this.symbol  = symbol;
     //this.degrees = (degrees != 360.0) ? Normalize(degrees) : 360.0;
     this.maxOrb = maxOrb;
 }
Пример #10
0
 public static char SymbolOf(AspectType type)
 {
     if (typeDict.ContainsKey(type))
     {
         return(typeDict[type].Symbol);
     }
     else
     {
         return('\uFF1F');
     }
 }
Пример #11
0
        public INEAspectGroup(AspectType type)
        {
            Type    = type;
            Aspects = new Dictionary <int, INEAspect>();
            for (int i = 0; i < 6; i++)
            {
                Aspects.Add(i, new INEAspect());
            }

            DistributionValid = false;
        }
Пример #12
0
 public static double DegreesOf(AspectType type)
 {
     if (typeDict.ContainsKey(type))
     {
         return(typeDict[type].Degrees);
     }
     else
     {
         return(-1);
     }
 }
Пример #13
0
 public static Aspect AspectOf(AspectType type)
 {
     if (typeDict.ContainsKey(type))
     {
         return(typeDict[type]);
     }
     else
     {
         return(null);
     }
 }
Пример #14
0
        public static Rect drawTexture(Rect drawRect, Texture2D texture, AspectType aspectType)
        {
            Rect useRect = getUseRect(drawRect, texture, aspectType);

            if (texture != null)
            {
                GUIX.drawTexture(useRect, texture);
            }

            return((aspectType == AspectType.CROP_IN_REGION) ? drawRect : useRect);
        }
Пример #15
0
        public async Task <ActionResult <AspectType> > GetAspectType()
        {
            var assetClient = _mindSphereSdkService.GetAssetManagementClient();
            var request     = new GetAspectTypeRequest()
            {
                Id = "iiotdgli.acceleration"
            };
            AspectType aspectTypes = await assetClient.GetAspectTypeAsync(request);

            return(StatusCode(200, aspectTypes));
        }
Пример #16
0
        public static Rect getUseRect(Rect drawRect, Vector2 contentSize, AspectType aspectType)
        {
            float x = drawRect.x, y = drawRect.y, w = drawRect.width, h = drawRect.height;
            float texAspect, regionAspect;

            texAspect = getAspectRatio(contentSize);

            if (h == 0)
            {
                regionAspect = 1;
            }
            else
            {
                regionAspect = w / h;
            }

            if (aspectType == AspectType.FIT_IN_REGION)
            {
                if (texAspect < regionAspect)
                {
                    x += w / 2;
                    w  = h * texAspect;
                    x -= w / 2;
                }
                else
                {
                    y += h / 2;
                    h  = w / texAspect;
                    y -= h / 2;
                }
            }
            else if (aspectType == AspectType.CROP_IN_REGION)
            {
                if (texAspect > regionAspect)
                {
                    x += w / 2;
                    w  = h * texAspect;
                    x -= w / 2;
                }
                else
                {
                    y += h / 2;
                    h  = w / texAspect;
                    y -= h / 2;
                }
            }
            else if (aspectType == AspectType.HEIGHT_DEPENDENT_ON_WIDTH)
            {
                h = w / texAspect;
            }

            return(new Rect(x, y, w, h));
        }
Пример #17
0
 /// <summary>
 /// Constructor, defines all variables.
 /// </summary>
 /// <param name="pos1">Radix body</param>
 /// <param name="pos2">Dummy for pos2</param>///
 /// <param name="idProg">Progressive body</param>
 /// <param name="posProg">Progressive position</param>
 /// <param name="actOrbis">Actual orbis for progression</param>
 /// <param name="aspectType">Type of aspect</param>
 public ProgAspect(int pos1, int pos2, int idProg,
                   double posProg, double actOrbis, AspectType aspectType
                   )
     : base(pos1, pos2, actOrbis, aspectType)
 {
     this.pos1       = pos1;
     this.pos2       = -1; // pos2 is not used    TODO refactor
     this.idProg     = idProg;
     this.posProg    = posProg;
     this.actOrbis   = actOrbis;
     this.aspectType = aspectType;
 }
Пример #18
0
 public AspectData(AspectType type, decimal angle, string name, string acr, int r, int g, int b, float w = 1.5F, DashStyle dstyle = DashStyle.Solid)
 {
     Angle   = angle;
     Name    = name;
     Acronym = acr;
     Type    = type;
     R       = r;
     G       = g;
     B       = b;
     Width   = w;
     DStyle  = dstyle;
 }
        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);
        }
Пример #20
0
        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;
            }
        }
Пример #21
0
        public static Rect getUseRect(Rect drawRect, Texture2D texture, AspectType aspectType)
        {
            Vector2 contentSize;

            if (texture != null)
            {
                contentSize = new Vector2(texture.width, texture.height);
            }
            else
            {
                contentSize = new Vector2(1, 1);
            }

            return(getUseRect(drawRect, contentSize, aspectType));
        }
Пример #22
0
 public float GetScoreByID(AspectType ID)
 {
     return(ID switch
     {
         AspectType.ProcessingPowerScore => ProcessingPowerScore,
         AspectType.MainCameraScore => MainCameraScore,
         AspectType.SelfieCameraScore => SelfieCameraScore,
         AspectType.StorageScore => StorageScore,
         AspectType.BatteryLifeScore => BatteryLifeScore,
         AspectType.DurabilityScore => DurabilityScore,
         AspectType.PopularityScore => PopularityScore,
         AspectType.ScreenSizeScore => ScreenSizeScore,
         AspectType.PriceScore => PriceScore,
         _ => 0,
     });
Пример #23
0
        protected override void ConsiderDefaultData()
        {
            if (Data == null || Data.Count == 0)
            {
                AspectType value = AspectType.AT_CONJUNCTION;

                Data = new List <AspectData>();
                Data.Add(new AspectData(AspectType.AT_CONJUNCTION, (int)value, "Conjunction", "con", 0, 0, 0, 0));

                value = AspectType.AT_SEMISEXTILE;
                Data.Add(new AspectData(AspectType.AT_SEMISEXTILE, (int)value, "Semi-sextile", "ssxt", 232, 102, 79, 1.5F, DashStyle.Dash));

                value = AspectType.AT_SEXTILE;
                Data.Add(new AspectData(AspectType.AT_SEXTILE, (int)value, "Sextile", "sxt", 38, 34, 213));

                value = AspectType.AT_QUADRO;
                Data.Add(new AspectData(AspectType.AT_QUADRO, (int)value, "Quadro", "qdr", 255, 40, 40));

                value = AspectType.AT_TRINE;
                Data.Add(new AspectData(AspectType.AT_TRINE, (int)value, "Trin", "trn", 0, 0, 255));

                value = AspectType.AT_QUINCUNX;
                Data.Add(new AspectData(AspectType.AT_QUINCUNX, (int)value, "Quincunx", "qcx", 187, 49, 206, 1.5F, DashStyle.Dash));

                value = AspectType.AT_OPPOSITION;
                Data.Add(new AspectData(AspectType.AT_OPPOSITION, (int)value, "Opposition", "opp", 208, 34, 51));

                //======= Minor ====
                //72
                value = AspectType.AT_QUINTILE;
                Data.Add(new AspectData(AspectType.AT_QUINTILE, (int)value, "Quintile", "qtl", 132, 184, 92, 1.5F, DashStyle.DashDot));
                //144
                value = AspectType.AT_BIQUINTILE;
                Data.Add(new AspectData(AspectType.AT_BIQUINTILE, (int)value, "Biquintile", "qtl", 95, 140, 62, 1.5F, DashStyle.DashDot));
                //45
                value = AspectType.AT_OCTILE;
                Data.Add(new AspectData(AspectType.AT_OCTILE, (int)value, "Octile", "oct", 189, 132, 53, 1.5F, DashStyle.DashDot));
                //135
                value = AspectType.AT_TRIOCTILE;
                Data.Add(new AspectData(AspectType.AT_TRIOCTILE, (int)value, "Trioctile", "tct", 151, 105, 43, 1.5F, DashStyle.DashDot));
                //36
                value = AspectType.AT_DECILE;
                Data.Add(new AspectData(AspectType.AT_DECILE, (int)value, "Decile", "dcl", 181, 84, 245, 1.5F, DashStyle.DashDot));
                //108
                value = AspectType.AT_TRIDECILE;
                Data.Add(new AspectData(AspectType.AT_TRIDECILE, (int)value, "Tridecile", "tdc", 149, 13, 240, 1.5F, DashStyle.DashDot));
            }
        }
Пример #24
0
        public void CreateAspectsCollection(List <SpaceObjectData> lstSO1)
        {
            InitRedBuletsStatic(lstSO1);
            _aspects = new List <Aspect>();
            for (int i = 0; i < lstSO1.Count; ++i)
            {
                SpaceObject so1 = lstSO1[i]._so;
                for (int j = i + 1; j < lstSO1.Count; ++j)
                {
                    SpaceObject so2     = lstSO1[j]._so;
                    double      dLambda = Math.Abs(so1.Lambda - so2.Lambda);
                    if (dLambda > 180)
                    {
                        dLambda = 360 - dLambda;
                    }

                    AspectType at = GetAspectType(dLambda, so1.PlanetType, so2.PlanetType);
                    if (at == AspectType.AT_CONJUNCTION)
                    {
                        lstSO1[i].IsRed = lstSO1[j].IsRed = true;
                    }

                    if (at != AspectType.AT_NONE)
                    {
                        double   l10            = so1.Lambda;
                        double   l20            = so2.Lambda;
                        double[] do1            = so1.GetDynPosition();
                        double[] do2            = so2.GetDynPosition();
                        double   delta2         = Math.Abs((int)at - Math.Abs(do1[0] - do2[0]));
                        double   delta1         = Math.Abs((int)at - Math.Abs(l10 - l20));
                        bool     IsConvergative = false;
                        if (delta2 < delta1)
                        {
                            IsConvergative = true;
                        }

                        _aspects.Add(new Aspect()
                        {
                            Angle          = Math.Abs(dLambda),
                            PlanetType1    = so1.PlanetType,
                            PlanetType2    = so2.PlanetType,
                            IsConvergative = IsConvergative,
                            _aspect_data   = (AspectData)_AspectsDataCollection.Where(x => x.Angle == ((decimal)at)).FirstOrDefault()
                        });
                    }
                }
            }
        }
Пример #25
0
        public Relation(PlanetPosition ppA, PlanetPosition ppB)
        {
            this.apart = ppA.Rectascension - ppB.Rectascension;
            AspectType type = Aspect.AspectTypeOf(apart);

            this.kind = new RelationKind(ppA.Id, ppB.Id, type);
            if (ppA.Id <= ppB.Id)
            {
                this.inLongitude  = ppA.Rectascension.Degrees;
                this.outLongitude = ppB.Rectascension.Degrees;
            }
            else
            {
                this.inLongitude  = ppB.Rectascension.Degrees;
                this.outLongitude = ppA.Rectascension.Degrees;
            }
        }
Пример #26
0
        protected AspectType GetAspectType(double angle, tPlanetType pt1, tPlanetType pt2)
        {
            AspectType at = AspectType.AT_NONE;

            double remainder = 0;

            at = GetAspectDataByvalue(30, angle, out remainder);
            double o1 = _ocdp.GetOrb(AstroMapType, pt1, at);
            double o2 = _ocdp.GetOrb(AstroMapType, pt2, at);
            double o  = Math.Max(o1, o2);

            if (o < remainder)
            {
                at = AspectType.AT_NONE;
            }

            return(at);
        }
Пример #27
0
    public void OnRefreshContent(int _Index)
    {
        if (DataManager.Instance == null)
        {
            return;
        }
        if (DataManager.Instance.CurDataSelectState.CurAspectModel == null)
        {
            MainUICtr.Instance?.OnMessageBox("DataManager.Instance.CurAspectModel data error");
            return;
        }

        AspectContenView.SetActive(true);
        MView.SetActive(false);
        JView.SetActive(false);
        ReferenceDetails.SetActive(false);
        AspectDescription.SetActive(false);

        Content.text = DataManager.Instance.CurDataSelectState.CurAspectModel.Description;

        curAspectType = DataManager.Instance.CurDataSelectState.CurAspectModel.Type;

        Debug.Log(curAspectType);

        switch (curAspectType)
        {
        case AspectType.NA:
            break;

        case AspectType.Measurement:
            MView.SetActive(true);
            break;

        case AspectType.Judge:
            JView.SetActive(true);
            break;

        default:
            break;
        }

        CurAspectIndex.text = (_Index + 1).ToString();
    }
Пример #28
0
 protected void CreateDefaultData()
 {
     Data = new OrbsCollectionData()
     {
         OrbsSystemName    = _system,
         OrbsMapCollection = new List <OrbsMapCollection>()
     };
     for (int imap = (int)tAstroMapType.NATAL; imap < (int)tAstroMapType.NUMBER_DYNAMIC_TYPES; imap++)
     {
         Data.OrbsMapCollection.Add(
             new OrbsMapCollection()
         {
             MapType = (tAstroMapType)imap,
             PlanetsAspectsOrbsCollection = new List <PlanetsAspectsOrbsPairsCollection>()
         }
             );
         for (int pt = (int)tPlanetType.PT_SUN; pt <= (int)tPlanetType.PT_PLUTO; ++pt)
         {
             PlanetsAspectsOrbsPairsCollection poc = new PlanetsAspectsOrbsPairsCollection()
             {
                 PlanetType           = (tPlanetType)pt,
                 AspectOrbsCollection = new List <AspectOrbsPair>()
             };
             for (int iasp = 0; iasp < Constants._aspects.Count; ++iasp)
             {
                 AspectType at = Utilities.FromStringToEnumType <AspectType>(Constants._aspects[iasp], "AT_");
                 poc.AspectOrbsCollection.Add(
                     new AspectOrbsPair()
                 {
                     AspectType = at,
                     OrbValue   = 1
                 }
                     );
             }
             Data.OrbsMapCollection[0].PlanetsAspectsOrbsCollection.Add(poc);
         }
     }
     InitDefaults();
 }
Пример #29
0
        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;
            }
        }
Пример #30
0
        public async Task <AspectType> Put([FromBody] AspectType type)
        {
            await DbContext.AspectTypes.ReplaceOneAsync(a => a.AspectTypeId == type.AspectTypeId, type);

            return(type);
        }