58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using skyscraper5.Skyscraper.Scraper.Storage;
|
|
using skyscraper8.Skyscraper.Scraper.Storage;
|
|
|
|
namespace skyscraper5.Skyscraper.Equipment
|
|
{
|
|
public static class EquipmentUtilities
|
|
{
|
|
public static void InsertDefaultLnbTypes(DataStorage storage)
|
|
{
|
|
List<LnbEntity> knownLnbTypes = storage.UiLnbTypesListAll();
|
|
foreach (LnbEntity defaultLnbType in GetDefaultLnbTypes())
|
|
{
|
|
if (!knownLnbTypes.Contains(defaultLnbType))
|
|
storage.UiLnbTypesAdd(defaultLnbType);
|
|
}
|
|
}
|
|
|
|
private static IEnumerable<LnbEntity> GetDefaultLnbTypes()
|
|
{
|
|
LnbEntity lnbType = new LnbEntity();
|
|
lnbType.Lof1 = 9750;
|
|
lnbType.Lof2 = 10600;
|
|
lnbType.LofSw = 11700;
|
|
lnbType.MinimumFrequency = 10700;
|
|
lnbType.MaximumFrequency = 12750;
|
|
lnbType.Manufacturer = "Generic";
|
|
lnbType.Name = "Universal LNB";
|
|
yield return lnbType;
|
|
}
|
|
|
|
public static void InsertDefaultDishTypes(DataStorage storage)
|
|
{
|
|
List<DishEntity> knownDishTypes = storage.UiDishTypesListAll();
|
|
foreach (DishEntity defaultDishType in GetDefaultDishTypes())
|
|
{
|
|
if (!knownDishTypes.Contains(defaultDishType))
|
|
storage.UiDishTypesAdd(defaultDishType);
|
|
}
|
|
}
|
|
|
|
private static IEnumerable<DishEntity> GetDefaultDishTypes()
|
|
{
|
|
int[] commonSizes = new int[] { 60, 80, 85, 100 };
|
|
foreach (int commonSize in commonSizes)
|
|
{
|
|
DishEntity dishType = new DishEntity();
|
|
dishType.Diameter = commonSize;
|
|
dishType.Shape = DishShape.Offset;
|
|
dishType.Manufacturer = "Generic";
|
|
dishType.Name = String.Format("{0} cm Offset dish antenna", commonSize);
|
|
yield return dishType;
|
|
}
|
|
}
|
|
}
|
|
}
|