Example #1
0
        public List <LoadPosition> GetLoadPositions(SearchZone zone)
        {
            List <LoadPosition> loadPositions = new List <LoadPosition>();

            int deltaFrom = zone.DEFrom > 0 ? 1 : 0;
            int deltaTo   = zone.DETo > 0 ? 1 : 0;

            int fromZone = Math.Max(1, (int)(zone.DEFrom * 2) + 180 + deltaFrom);
            int toZone   = Math.Min(360, (int)(zone.DETo * 2) + 180 + deltaTo);

            for (int zoneId = fromZone; zoneId <= toZone; zoneId++)
            {
                LoadPosition loadPos = new LoadPosition();
                loadPos.ZoneId           = zoneId;
                loadPos.FirstStarNoInBin = 0;
                int raFrom = Math.Max(0, (int)Math.Floor(zone.RAFrom));
                int raTo   = Math.Min(359, (int)Math.Ceiling(zone.RATo));
                loadPos.FromRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raFrom];
                loadPos.ToRecordId   = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raTo];
                loadPositions.Add(loadPos);
            }

            return(loadPositions);
        }
Example #2
0
        public List<LoadPosition> GetLoadPositions(SearchZone zone)
        {
            List<LoadPosition> loadPositions = new List<LoadPosition>();

            int deltaFrom = zone.DEFrom > 0 ? 1 : 0;
            int deltaTo = zone.DETo > 0 ? 1 : 0;

            int fromZone = Math.Max(1, (int)(zone.DEFrom * 2) + 180 + deltaFrom);
            int toZone = Math.Min(360, (int)(zone.DETo * 2) + 180 + deltaTo);

            for (int zoneId = fromZone; zoneId <= toZone; zoneId++)
            {
                LoadPosition loadPos = new LoadPosition();
                loadPos.ZoneId = zoneId;
                loadPos.FirstStarNoInBin = 0;
                int raFrom = Math.Max(0, (int)Math.Floor(zone.RAFrom));
                int raTo = Math.Min(359, (int)Math.Ceiling(zone.RATo));
                loadPos.FromRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raFrom];
                loadPos.ToRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raTo];
                loadPositions.Add(loadPos);
            }

            return loadPositions;
        }