Compare commits
No commits in common. "d1ba3976cb0328c83b11af4163f10382de964dc4" and "4bb26cef25689ab0c3a2fd0db1521e28ed6be8b2" have entirely different histories.
d1ba3976cb
...
4bb26cef25
@ -107,12 +107,12 @@ namespace skyscraper5.Data.MySql
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UiSatellitesAdd(SatellitePositionEntity newPosition)
|
||||
public void UiSatellitesAdd(SatellitePosition newPosition)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UiSatellitesDelete(SatellitePositionEntity satellitePosition)
|
||||
public void UiSatellitesDelete(SatellitePosition satellitePosition)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@ -233,22 +233,22 @@ namespace skyscraper5.Data.MySql
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public List<LnbEntity> UiLnbTypesListAll()
|
||||
public List<LnbType> UiLnbTypesListAll()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UiLnbTypesAdd(LnbEntity defaultLnbType)
|
||||
public void UiLnbTypesAdd(LnbType defaultLnbType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public List<DishEntity> UiDishTypesListAll()
|
||||
public List<DishType> UiDishTypesListAll()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UiDishTypesAdd(DishEntity defaultDishType)
|
||||
public void UiDishTypesAdd(DishType defaultDishType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@ -50,9 +50,9 @@ namespace skyscraper5.Data.MySql
|
||||
}
|
||||
|
||||
|
||||
public List<SatellitePositionEntity> UiSatellitesListAll()
|
||||
public List<SatellitePosition> UiSatellitesListAll()
|
||||
{
|
||||
List<SatellitePositionEntity> result = new List<SatellitePositionEntity>();
|
||||
List<SatellitePosition> result = new List<SatellitePosition>();
|
||||
using (MySqlConnection connection = new MySqlConnection(_mcsb.ToString()))
|
||||
{
|
||||
connection.Open();
|
||||
@ -62,9 +62,9 @@ namespace skyscraper5.Data.MySql
|
||||
MySqlDataReader dataReader = command.ExecuteReader();
|
||||
while (dataReader.Read())
|
||||
{
|
||||
SatellitePositionEntity satellitePosition = new SatellitePositionEntity();
|
||||
SatellitePosition satellitePosition = new SatellitePosition();
|
||||
satellitePosition.angle = dataReader.GetFloat(2);
|
||||
//satellitePosition.cardinalDirection = dataReader.GetBoolean(3) ? 0 : 1;
|
||||
satellitePosition.cardinalDirection = dataReader.GetBoolean(3) ? 0 : 1;
|
||||
satellitePosition.name = dataReader.GetString(4);
|
||||
result.Add(satellitePosition);
|
||||
}
|
||||
|
||||
@ -328,7 +328,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
string note = null;
|
||||
if (!dataReader.IsDBNull(15))
|
||||
note = dataReader.GetString(15);
|
||||
result = new DbBlindscanJob(uuid, tuner_mac, (STD_TYPE)tuner_std, diseqc_index, new DummyGpsReceiver(true,(float)gps_lat,(float)gps_lon), SatellitePositionEntity.FromChecksum(sat_position));
|
||||
result = new DbBlindscanJob(uuid, tuner_mac, (STD_TYPE)tuner_std, diseqc_index, new DummyGpsReceiver(true,(float)gps_lat,(float)gps_lon), SatellitePosition.FromChecksum(sat_position));
|
||||
result.DateAdded = date_added;
|
||||
result.HorizontalHighState = (DbBlindscanJobPolarizationStatus)horizontal_high;
|
||||
result.HorizontalLowState = (DbBlindscanJobPolarizationStatus)horizontal_low;
|
||||
@ -546,11 +546,11 @@ namespace skyscraper5.Data.PostgreSql
|
||||
dgr = new DummyGpsReceiver(true, gpsLat, gpsLon);
|
||||
}
|
||||
|
||||
SatellitePositionEntity satPositionObj = null;
|
||||
SatellitePosition satPositionObj = null;
|
||||
if (!dataReader.IsDBNull("sat_position"))
|
||||
{
|
||||
int satPosition = dataReader.GetInt32("sat_position");
|
||||
satPositionObj = SatellitePositionEntity.FromChecksum(satPosition);
|
||||
satPositionObj = SatellitePosition.FromChecksum(satPosition);
|
||||
}
|
||||
int diseqcIndex = dataReader.GetInt32("diseqc_index");
|
||||
int version = dataReader.GetInt32("version");
|
||||
|
||||
@ -19,9 +19,9 @@ namespace skyscraper5.Data.PostgreSql
|
||||
this.uiVersion = version;
|
||||
}
|
||||
|
||||
public List<LnbEntity> UiLnbTypesListAll()
|
||||
public List<LnbType> UiLnbTypesListAll()
|
||||
{
|
||||
List<LnbEntity> lnbTypes = new List<LnbEntity>();
|
||||
List<LnbType> lnbTypes = new List<LnbType>();
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
conn.Open();
|
||||
@ -38,7 +38,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
int lofSw = dataReader.GetInt32(5);
|
||||
int minFreq = dataReader.GetInt32(6);
|
||||
int maxFreq = dataReader.GetInt32(7);
|
||||
lnbTypes.Add(new LnbEntity("", name, lof1, lof2, lofSw, minFreq, maxFreq) { DateAdded = added, Id = id });
|
||||
lnbTypes.Add(new LnbType(name, lof1, lof2, lofSw, minFreq, maxFreq) { DateAdded = added, Id = id });
|
||||
}
|
||||
|
||||
dataReader.Close();
|
||||
@ -49,7 +49,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
return lnbTypes;
|
||||
}
|
||||
|
||||
public void UiLnbTypesAdd(LnbEntity defaultLnbType)
|
||||
public void UiLnbTypesAdd(LnbType defaultLnbType)
|
||||
{
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
@ -69,9 +69,9 @@ namespace skyscraper5.Data.PostgreSql
|
||||
}
|
||||
}
|
||||
|
||||
public List<DishEntity> UiDishTypesListAll()
|
||||
public List<DishType> UiDishTypesListAll()
|
||||
{
|
||||
List<DishEntity> result = new List<DishEntity>();
|
||||
List<DishType> result = new List<DishType>();
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
conn.Open();
|
||||
@ -85,14 +85,14 @@ namespace skyscraper5.Data.PostgreSql
|
||||
string name = dataReader.GetString(2);
|
||||
int diameter = dataReader.GetInt32(3);
|
||||
DishShape shape = (DishShape)dataReader.GetInt32(4);
|
||||
result.Add(new DishEntity("", name, diameter, shape) { DateAdded = added, Id = id });
|
||||
result.Add(new DishType(name, diameter, shape) { DateAdded = added, Id = id });
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void UiDishTypesAdd(DishEntity defaultDishType)
|
||||
public void UiDishTypesAdd(DishType defaultDishType)
|
||||
{
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
@ -109,9 +109,9 @@ namespace skyscraper5.Data.PostgreSql
|
||||
}
|
||||
|
||||
|
||||
public List<SatellitePositionEntity> UiSatellitesListAll()
|
||||
public List<SatellitePosition> UiSatellitesListAll()
|
||||
{
|
||||
List<SatellitePositionEntity> positions = new List<SatellitePositionEntity>();
|
||||
List<SatellitePosition> positions = new List<SatellitePosition>();
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
conn.Open();
|
||||
@ -123,7 +123,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
float angle = (float)reader.GetDouble(0);
|
||||
int cardinal = reader.GetInt32(1);
|
||||
string name = reader.GetString(2);
|
||||
SatellitePositionEntity child = new SatellitePositionEntity(angle, name);
|
||||
SatellitePosition child = new SatellitePosition(angle, cardinal, name);
|
||||
positions.Add(child);
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
return positions;
|
||||
}
|
||||
|
||||
public void UiSatellitesAdd(SatellitePositionEntity newPosition)
|
||||
public void UiSatellitesAdd(SatellitePosition newPosition)
|
||||
{
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
@ -145,7 +145,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
"insert into skyscraper5_satellite_positions (angle, cardinal, name, keyversion, key) " +
|
||||
"values (@angle, @cardinal, @name, @keyversion, @key)";
|
||||
cmd.Parameters.AddWithValue("@angle", NpgsqlDbType.Real, newPosition.angle);
|
||||
cmd.Parameters.AddWithValue("@cardinal", NpgsqlDbType.Integer, newPosition.GetCardinalDirectionAsInt());
|
||||
cmd.Parameters.AddWithValue("@cardinal", NpgsqlDbType.Integer, newPosition.cardinalDirection);
|
||||
cmd.Parameters.AddWithValue("@name", NpgsqlDbType.Text, newPosition.name);
|
||||
cmd.Parameters.AddWithValue("@keyversion", NpgsqlDbType.Integer, uiVersion);
|
||||
cmd.Parameters.AddWithValue("@key", NpgsqlDbType.Text, newPosition.Checksum.ToString());
|
||||
@ -155,7 +155,7 @@ namespace skyscraper5.Data.PostgreSql
|
||||
}
|
||||
}
|
||||
|
||||
public void UiSatellitesDelete(SatellitePositionEntity satellitePosition)
|
||||
public void UiSatellitesDelete(SatellitePosition satellitePosition)
|
||||
{
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
|
||||
@ -127,7 +127,7 @@ namespace skyscraper5.UI.Overrides
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult, LnbEntity lnbType)
|
||||
public void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult, LnbType lnbType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@ -21,9 +21,9 @@ namespace skyscraper8.UI.MonoGame
|
||||
public DataStorage DataStorage { get; set; }
|
||||
public ObjectStorage ObjectStorage { get; set; }
|
||||
public IGpsReceiver Gps { get; set; }
|
||||
public List<SatellitePositionEntity> SatellitePositions { get; set; }
|
||||
public List<LnbEntity> LnbTypes { get; set; }
|
||||
public List<DishEntity> DishTypes { get; set; }
|
||||
public List<SatellitePosition> SatellitePositions { get; set; }
|
||||
public List<LnbType> LnbTypes { get; set; }
|
||||
public List<DishType> DishTypes { get; set; }
|
||||
public ReadOnlyCollection<KeyValuePair<TunerFactoryIdAttribute, ITunerFactory>> AllTunerFactories { get; set; }
|
||||
public IStreamReader StreamReader { get; set; }
|
||||
public List<TunerMetadata> Tuners { get; set; }
|
||||
|
||||
@ -14,14 +14,13 @@ namespace SDL2Demo.Forms
|
||||
internal class ConfigureDishTypes : IRenderable
|
||||
{
|
||||
private readonly DataStorage _scraperStroage;
|
||||
private List<DishEntity> dishTypes;
|
||||
private List<DishType> dishTypes;
|
||||
private string tableUuid;
|
||||
|
||||
private string manufacturer;
|
||||
private string name;
|
||||
private int diameter;
|
||||
private DishShape shape;
|
||||
public ConfigureDishTypes(DataStorage scraperStroage, List<DishEntity> dishTypes)
|
||||
public ConfigureDishTypes(DataStorage scraperStroage, List<DishType> dishTypes)
|
||||
{
|
||||
_scraperStroage = scraperStroage;
|
||||
this.dishTypes = dishTypes;
|
||||
@ -38,14 +37,12 @@ namespace SDL2Demo.Forms
|
||||
if (justSaved)
|
||||
{
|
||||
name = "";
|
||||
manufacturer = "";
|
||||
diameter = 0;
|
||||
shape = DishShape.Offset;
|
||||
justSaved = false;
|
||||
}
|
||||
if (ImGui.TreeNode("Add Dish Type"))
|
||||
{
|
||||
ImGui.InputText("Manufacturer", ref manufacturer, 255);
|
||||
ImGui.InputText("Name", ref name, 255);
|
||||
ImGui.InputInt("Diameter", ref diameter, 5, 10);
|
||||
|
||||
@ -66,7 +63,7 @@ namespace SDL2Demo.Forms
|
||||
ImGui.BeginDisabled(!SaveButtonEnabled());
|
||||
if (ImGui.Button("Add"))
|
||||
{
|
||||
DishEntity newDish = new DishEntity(manufacturer, name, diameter, shape);
|
||||
DishType newDish = new DishType(name, diameter, shape);
|
||||
dishTypes.Add(newDish);
|
||||
_scraperStroage.UiDishTypesAdd(newDish);
|
||||
justSaved = true;
|
||||
@ -87,7 +84,7 @@ namespace SDL2Demo.Forms
|
||||
ImGui.TableSetColumnIndex(2);
|
||||
ImGui.Text("Type");
|
||||
|
||||
foreach (DishEntity dishType in dishTypes)
|
||||
foreach (DishType dishType in dishTypes)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableSetColumnIndex(0);
|
||||
@ -123,7 +120,7 @@ namespace SDL2Demo.Forms
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (DishEntity dishType in dishTypes)
|
||||
foreach (DishType dishType in dishTypes)
|
||||
{
|
||||
if (dishType.Name.Equals(name))
|
||||
return false;
|
||||
|
||||
@ -16,21 +16,19 @@ namespace SDL2Demo.Forms
|
||||
internal class ConfigureLnbTypes : IRenderable
|
||||
{
|
||||
private readonly DataStorage _scraperStroage;
|
||||
private List<LnbEntity> lnbTypes;
|
||||
private List<LnbType> lnbTypes;
|
||||
private string tableUuid;
|
||||
private string lnbPopupUuid;
|
||||
|
||||
private string manufacturer;
|
||||
private string name;
|
||||
private int lof1, lof2, lofSw, minFreq, maxFreq;
|
||||
|
||||
public ConfigureLnbTypes(DataStorage scraperStroage, List<LnbEntity> lnbTypes)
|
||||
public ConfigureLnbTypes(DataStorage scraperStroage, List<LnbType> lnbTypes)
|
||||
{
|
||||
_scraperStroage = scraperStroage;
|
||||
this.lnbTypes = lnbTypes;
|
||||
this.tableUuid = Guid.NewGuid().ToString();
|
||||
this.name = "";
|
||||
this.manufacturer = "";
|
||||
this.lnbPopupUuid = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
@ -41,8 +39,6 @@ namespace SDL2Demo.Forms
|
||||
ImGui.Begin("Configure LNB Types", ref pOpen, windowFlags);
|
||||
if (ImGui.TreeNode("Add LNB Type"))
|
||||
{
|
||||
ImGui.InputText("Manufacturer", ref this.manufacturer, 64);
|
||||
ImGui.SameLine();
|
||||
ImGui.InputText("Name", ref name, 255);
|
||||
|
||||
ImGui.InputInt("LOF1", ref lof1, 50, 100);
|
||||
@ -59,7 +55,7 @@ namespace SDL2Demo.Forms
|
||||
ImGui.BeginDisabled(!SaveButtonEnabled());
|
||||
if (ImGui.Button("Add"))
|
||||
{
|
||||
LnbEntity newLnb = new LnbEntity(manufacturer, name, lof1, lof2, lofSw, minFreq, maxFreq);
|
||||
LnbType newLnb = new LnbType(name, lof1, lof2, lofSw, minFreq, maxFreq);
|
||||
lnbTypes.Add(newLnb);
|
||||
_scraperStroage.UiLnbTypesAdd(newLnb);
|
||||
}
|
||||
@ -102,7 +98,7 @@ namespace SDL2Demo.Forms
|
||||
|
||||
ImGui.TableSetColumnIndex(2);
|
||||
ImGui.Text("Frequency Range");
|
||||
foreach (LnbEntity lnbType in lnbTypes)
|
||||
foreach (LnbType lnbType in lnbTypes)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableSetColumnIndex(0);
|
||||
@ -140,7 +136,7 @@ namespace SDL2Demo.Forms
|
||||
if (lof1 == 0)
|
||||
return false;
|
||||
|
||||
foreach (LnbEntity lnbType in lnbTypes)
|
||||
foreach (LnbType lnbType in lnbTypes)
|
||||
{
|
||||
if (lnbType.MinimumFrequency == minFreq &&
|
||||
lnbType.MaximumFrequency == maxFreq &&
|
||||
|
||||
@ -10,9 +10,9 @@ namespace SDL2Demo.Forms
|
||||
internal class ConfigureTunersWindow : IRenderable
|
||||
{
|
||||
private readonly DataStorage _scraperStroage;
|
||||
private List<SatellitePositionEntity> satPositions;
|
||||
private List<LnbEntity> lnbTypes;
|
||||
private List<DishEntity> dishTypes;
|
||||
private List<SatellitePosition> satPositions;
|
||||
private List<LnbType> lnbTypes;
|
||||
private List<DishType> dishTypes;
|
||||
|
||||
public ConfigureTunersWindow(List<TunerMetadata> tuners, DataStorage scraperStroage)
|
||||
{
|
||||
|
||||
@ -2102,7 +2102,7 @@ namespace SDL2Demo.Forms
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult,LnbEntity lnbType)
|
||||
public void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult,LnbType lnbType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ namespace SDL2Demo.Forms
|
||||
|
||||
private string lnbPopupUuid;
|
||||
private string memoryTableUuid;
|
||||
private List<SatellitePositionEntity> allPositions;
|
||||
private List<SatellitePosition> allPositions;
|
||||
private readonly DataStorage _storage;
|
||||
|
||||
|
||||
@ -50,8 +50,8 @@ namespace SDL2Demo.Forms
|
||||
if (allPositions.Count == 0)
|
||||
return true;
|
||||
|
||||
int currentChecksum = SatellitePositionEntity.GetChecksum(degrees);
|
||||
foreach (SatellitePositionEntity satellitePosition in allPositions)
|
||||
int currentChecksum = SatellitePosition.GetChecksum(degrees, cardinalDirection);
|
||||
foreach (SatellitePosition satellitePosition in allPositions)
|
||||
{
|
||||
if (currentChecksum == satellitePosition.Checksum)
|
||||
return false;
|
||||
@ -68,6 +68,9 @@ namespace SDL2Demo.Forms
|
||||
{
|
||||
ImGui.InputText("Name", ref name, 255);
|
||||
ImGui.InputFloat("Position", ref degrees, 0.1f);
|
||||
ImGui.RadioButton("East", ref cardinalDirection, 0);
|
||||
ImGui.SameLine();
|
||||
ImGui.RadioButton("West", ref cardinalDirection, 1);
|
||||
|
||||
CheckBounds();
|
||||
|
||||
@ -75,7 +78,7 @@ namespace SDL2Demo.Forms
|
||||
ImGui.BeginDisabled(!SaveButtonEnabled());
|
||||
if (ImGui.Button("Add"))
|
||||
{
|
||||
SatellitePositionEntity newPosition = new SatellitePositionEntity(degrees, name);
|
||||
SatellitePosition newPosition = new SatellitePosition(degrees, cardinalDirection, name);
|
||||
allPositions.Add(newPosition);
|
||||
_storage.UiSatellitesAdd(newPosition);
|
||||
}
|
||||
@ -86,13 +89,13 @@ namespace SDL2Demo.Forms
|
||||
ImGui.Separator();
|
||||
|
||||
ImGui.BeginTable(memoryTableUuid, 4);
|
||||
foreach (SatellitePositionEntity satellitePosition in allPositions)
|
||||
foreach (SatellitePosition satellitePosition in allPositions)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableSetColumnIndex(0);
|
||||
ImGui.Text(satellitePosition.name);
|
||||
ImGui.TableSetColumnIndex(1);
|
||||
ImGui.Text(String.Format("{0:0.0}° {1}", satellitePosition.angle, satellitePosition.GetCardinalDirectionAsChar()));
|
||||
ImGui.Text(String.Format("{0:0.0}° {1}", satellitePosition.angle, satellitePosition.cardinalDirection == 0 ? "E" : "W"));
|
||||
ImGui.TableSetColumnIndex(2);
|
||||
ImGui.Text("");
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ namespace SDL2Demo.Jobs
|
||||
public class BlindscanTarget
|
||||
{
|
||||
public BlindscanTarget(string name, int tunerIndex, STD_TYPE tunerStandard, int diseqcType,
|
||||
SatellitePositionEntity satPosition, int satIndex, LnbEntity lnbType, PhysicalAddress tunerMetadataMacAddress)
|
||||
SatellitePosition satPosition, int satIndex, LnbType lnbType, PhysicalAddress tunerMetadataMacAddress)
|
||||
{
|
||||
this.name = name;
|
||||
this.tunerIndex = tunerIndex;
|
||||
@ -50,10 +50,10 @@ namespace SDL2Demo.Jobs
|
||||
public int tunerIndex;
|
||||
public STD_TYPE tunerStandard;
|
||||
public int diseqcType;
|
||||
public SatellitePositionEntity satPosition;
|
||||
public SatellitePosition satPosition;
|
||||
public int satIndex;
|
||||
public string buttonUuid;
|
||||
public LnbEntity lnbType;
|
||||
public LnbType lnbType;
|
||||
public readonly PhysicalAddress macAddress;
|
||||
|
||||
public bool IsTorC()
|
||||
@ -84,7 +84,7 @@ namespace SDL2Demo.Jobs
|
||||
private DbBlindscanJob jobInDb;
|
||||
private IDbBlindscanJobStorage jobStorage;
|
||||
|
||||
public Blindscan(List<TunerMetadata> tuners, List<SatellitePositionEntity> satellitePositions, List<LnbEntity> lnbTypes, DataStorage dataStorage)
|
||||
public Blindscan(List<TunerMetadata> tuners, List<SatellitePosition> satellitePositions, List<LnbType> lnbTypes, DataStorage dataStorage)
|
||||
{
|
||||
this.jobStorage = dataStorage;
|
||||
continuationDataExists = jobStorage.TestForIncompleteJob();
|
||||
@ -98,8 +98,8 @@ namespace SDL2Demo.Jobs
|
||||
int numSatsFromDiseqcType = tunerMetadata.GetNumSatsFromDiseqcType();
|
||||
for (int i = 0; i < numSatsFromDiseqcType; i++)
|
||||
{
|
||||
SatellitePositionEntity satellitePosition = satellitePositions.Find(x => x.Checksum == tunerMetadata.Satellites[i]);
|
||||
LnbEntity lnbType = lnbTypes.Find(x => x.Id == tunerMetadata.Lnbs[i]);
|
||||
SatellitePosition satellitePosition = satellitePositions.Find(x => x.Checksum == tunerMetadata.Satellites[i]);
|
||||
LnbType lnbType = lnbTypes.Find(x => x.Id == tunerMetadata.Lnbs[i]);
|
||||
if (satellitePosition == null)
|
||||
continue;
|
||||
if (lnbType == null)
|
||||
@ -835,7 +835,7 @@ namespace SDL2Demo.Jobs
|
||||
now.Year, now.Month, now.Day, now.Hour, now.Minute, blindscanResult.sr1.Freq / 1000,
|
||||
blindscanResult.sr1.Pol == 0 ? "H" : "V", blindscanResult.sr1.SR / 1000,
|
||||
(int)(SelectedBlindscanTarget.satPosition.angle * 10),
|
||||
SelectedBlindscanTarget.satPosition.GetCardinalDirectionAsChar());
|
||||
SelectedBlindscanTarget.satPosition.cardinalDirection == 0 ? "E" : "W");
|
||||
break;
|
||||
case STD_TYPE.STD_DVBC:
|
||||
JobContext.Puppets[1].AutoMoveTo(blindscanResult.Position);
|
||||
|
||||
@ -31,10 +31,10 @@ namespace SDL2Demo.Jobs
|
||||
private IDbBlindscanJobStorage jobStorage;
|
||||
private List<TunerMetadata> tunerMetadataList;
|
||||
private JobContext jobContext;
|
||||
private List<SatellitePositionEntity> satellites;
|
||||
private List<LnbEntity> lnbs;
|
||||
private List<SatellitePosition> satellites;
|
||||
private List<LnbType> lnbs;
|
||||
|
||||
public CoopBlindscan(List<TunerMetadata> tuners, List<SatellitePositionEntity> satellitePositions, List<LnbEntity> lnbTypes, IDbBlindscanJobStorage jobStorage)
|
||||
public CoopBlindscan(List<TunerMetadata> tuners, List<SatellitePosition> satellitePositions, List<LnbType> lnbTypes, IDbBlindscanJobStorage jobStorage)
|
||||
{
|
||||
this.jobStorage = jobStorage;
|
||||
this.tunerMetadataList = tuners.Where(x => x.Type == STD_TYPE.STD_DVBS || x.Type == STD_TYPE.STD_DVBS2).ToList();
|
||||
@ -166,8 +166,8 @@ namespace SDL2Demo.Jobs
|
||||
{
|
||||
settingsWindowOpen = false;
|
||||
int lnbIndex = tunerMetadataList[settingsWindowTunerAselection].Lnbs[settingsWindowDiseqc - 1];
|
||||
LnbEntity lnb = lnbs.Find(x => x.Id == lnbIndex);
|
||||
Configuration = new CoopBlindscanConfiguration(tunerMetadataList[settingsWindowTunerAselection], tunerMetadataList[settingsWindowTunerBselection], settingsWindowScanHorizontalLow, settingsWindowScanHorizontalHigh, settingsWindowScanVerticalLow, settingsWindowScanVerticalHigh, settingsWindowDiseqc, settingsWindowSatellite, SatellitePositionEntity.FromChecksum(satellites[settingsWindowSatellite].Checksum), lnb, settingsWindowCaptureFile);
|
||||
LnbType lnb = lnbs.Find(x => x.Id == lnbIndex);
|
||||
Configuration = new CoopBlindscanConfiguration(tunerMetadataList[settingsWindowTunerAselection], tunerMetadataList[settingsWindowTunerBselection], settingsWindowScanHorizontalLow, settingsWindowScanHorizontalHigh, settingsWindowScanVerticalLow, settingsWindowScanVerticalHigh, settingsWindowDiseqc, settingsWindowSatellite, SatellitePosition.FromChecksum(satellites[settingsWindowSatellite].Checksum), lnb, settingsWindowCaptureFile);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
|
||||
@ -185,7 +185,7 @@ namespace SDL2Demo.Jobs
|
||||
|
||||
public class CoopBlindscanConfiguration
|
||||
{
|
||||
public CoopBlindscanConfiguration(TunerMetadata tunerA, TunerMetadata tunerB, bool doHorizontalLow, bool doHorizontalHigh, bool doVerticalLow, bool doVerticalHigh, int diseqc, int satelliteId, SatellitePositionEntity direction, LnbEntity lnbType, bool recordingEnabled)
|
||||
public CoopBlindscanConfiguration(TunerMetadata tunerA, TunerMetadata tunerB, bool doHorizontalLow, bool doHorizontalHigh, bool doVerticalLow, bool doVerticalHigh, int diseqc, int satelliteId, SatellitePosition direction, LnbType lnbType, bool recordingEnabled)
|
||||
{
|
||||
TunerA = tunerA;
|
||||
TunerB = tunerB;
|
||||
@ -208,8 +208,8 @@ namespace SDL2Demo.Jobs
|
||||
public bool DoVerticalHigh { get; }
|
||||
public int Diseqc { get; }
|
||||
public int SatelliteId { get; }
|
||||
public SatellitePositionEntity Direction { get; }
|
||||
public LnbEntity LnbType { get; }
|
||||
public SatellitePosition Direction { get; }
|
||||
public LnbType LnbType { get; }
|
||||
public bool RecordingEnabled { get; }
|
||||
}
|
||||
#endregion
|
||||
@ -689,7 +689,7 @@ namespace SDL2Demo.Jobs
|
||||
now.Year, now.Month, now.Day, now.Hour, now.Minute, blindscanResult.sr1.Freq / 1000,
|
||||
blindscanResult.sr1.Pol == 0 ? "H" : "V", blindscanResult.sr1.SR / 1000,
|
||||
(int)(Configuration.Direction.angle * 10),
|
||||
Configuration.Direction.GetCardinalDirectionAsChar());
|
||||
Configuration.Direction.cardinalDirection == 0 ? "E" : "W");
|
||||
|
||||
|
||||
RunSkyscraper(blindscanResult);
|
||||
|
||||
@ -13,9 +13,9 @@ namespace SDL2Demo.Jobs
|
||||
{
|
||||
private bool windowOpen;
|
||||
private List<TunerMetadata> tuners;
|
||||
private List<SatellitePositionEntity> satellites;
|
||||
private List<LnbEntity> lnbs;
|
||||
private List<DishEntity> dishes;
|
||||
private List<SatellitePosition> satellites;
|
||||
private List<LnbType> lnbs;
|
||||
private List<DishType> dishes;
|
||||
private readonly TaskQueue _taskQueue;
|
||||
|
||||
public int settingsWindowBLScanTunerSelection;
|
||||
@ -52,7 +52,7 @@ namespace SDL2Demo.Jobs
|
||||
settingsWindowScanVerticalLow, settingsWindowScanVerticalHigh);
|
||||
}
|
||||
public InheritedBlindscanConfigWindow(List<TunerMetadata> tunerMetadatas,
|
||||
List<SatellitePositionEntity> satellitePositions, List<LnbEntity> lnbTypes, List<DishEntity> dishTypes,
|
||||
List<SatellitePosition> satellitePositions, List<LnbType> lnbTypes, List<DishType> dishTypes,
|
||||
DataStorage dataStorage, ObjectStorage objectStorage, IGpsReceiver gps, Ini ini, IStreamReader streamReader,
|
||||
TaskQueue taskQueue)
|
||||
{
|
||||
|
||||
@ -1657,7 +1657,7 @@ namespace SDL2Demo.Jobs
|
||||
return position;
|
||||
}
|
||||
|
||||
public void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult, LnbEntity lnb)
|
||||
public void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult, LnbType lnb)
|
||||
{
|
||||
Point point = GetFrequencyPosition(blindscanResult.SearchResult, lnb.MinimumFrequency, lnb.MaximumFrequency);
|
||||
jobContext.Puppets[2 + blindscanResult.SearchResult.Pol].AutoMoveTo(point);
|
||||
|
||||
@ -211,9 +211,9 @@ namespace SkyscraperUI
|
||||
private ConfigureDataStorageWindow configureDataStorageWindow;
|
||||
private ConfigureObjectStorageWindow configureObjectStorageWindow;
|
||||
private SatellitesConfigurationWindow satellitesConfigurationWindow;
|
||||
private List<SatellitePositionEntity> satellitePositions;
|
||||
private List<LnbEntity> lnbTypes;
|
||||
private List<DishEntity> dishTypes;
|
||||
private List<SatellitePosition> satellitePositions;
|
||||
private List<LnbType> lnbTypes;
|
||||
private List<DishType> dishTypes;
|
||||
//private LogWindow logWindow;
|
||||
private ScrapeFromTcp scrapeFromTcpWindow;
|
||||
private JobContext jobContext;
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Docsis;
|
||||
@ -1000,7 +998,7 @@ public class DocsisTests : Feyllure
|
||||
9, 0, 4, 0, 0, 0, 1,
|
||||
10, 0, 1, 1,
|
||||
|
||||
23, 0, 5 + 5 + 5, //length f<EFBFBD>E den SA descriptor
|
||||
23, 0, 5 + 5 + 5, //length für den SA descriptor
|
||||
|
||||
//Hier fängt der SA descriptor an
|
||||
12, 0, 2, 0, 1,
|
||||
@ -1060,10 +1058,10 @@ public class DocsisTests : Feyllure
|
||||
{
|
||||
5,
|
||||
1,
|
||||
0, 7, //Länge f<EFBFBD>E darauffolgendes
|
||||
0, 7, //Länge für darauffolgendes
|
||||
|
||||
23,
|
||||
0, 4, //Länge f<EFBFBD>E darauffolgendes
|
||||
0, 4, //Länge für darauffolgendes
|
||||
8, 0, 1, 1
|
||||
};
|
||||
AssertTargetInvocation<NotImplementedException>(() => docsisEnvironment.PushMacManagementMessage(null, 1, 13, srcAddr, dstAddr, payload));
|
||||
@ -1072,13 +1070,13 @@ public class DocsisTests : Feyllure
|
||||
{
|
||||
8, //Code
|
||||
1, //Identifier
|
||||
0, 4 + 7 + 5 + 1 + 2 + 4 + 7 + 4 + 4, //Length f<EFBFBD>E alles darauf folgende
|
||||
0, 4 + 7 + 5 + 1 + 2 + 4 + 7 + 4 + 4, //Length für alles darauf folgende
|
||||
|
||||
10, 0, 1, 1,
|
||||
11, 0, 4, 0, 0, 0, 1,
|
||||
12, 0, 2, 0, 1,
|
||||
13, //TEK parameters
|
||||
0, 4 + 7 + 4 + 4, //Length f<EFBFBD>E alles darauf folgende
|
||||
0, 4 + 7 + 4 + 4, //Length für alles darauf folgende
|
||||
8, 0, 1, 1,
|
||||
9, 0, 4, 0, 0, 0, 1,
|
||||
10, 0, 1, 1,
|
||||
@ -1211,108 +1209,7 @@ public class DocsisTests : Feyllure
|
||||
nullDocsisEventHandler.OnUpstreamChannel(ucd);
|
||||
object dequeue = nullDocsisEventHandler.GetQueue().Dequeue();
|
||||
Assert.AreEqual(ucd, dequeue);
|
||||
|
||||
|
||||
nullDocsisEventHandler = new NullDocsisEventHandler();
|
||||
MacDomainDescriptor.DownstreamActiveChannel dac = new MacDomainDescriptor.DownstreamActiveChannel(new byte[] {} );
|
||||
nullDocsisEventHandler.OnDownstreamChannel(dstAddr, dac);
|
||||
dequeue = nullDocsisEventHandler.GetQueue().Dequeue();
|
||||
Assert.AreEqual(dac, dequeue);
|
||||
|
||||
nullDocsisEventHandler.OnLearnedIpFromMac(PhysicalAddress.None, IPAddress.None);
|
||||
ReadOnlyDictionary<PhysicalAddress, IPAddress> readOnlyDictionary = nullDocsisEventHandler.GetKnownIps();
|
||||
Assert.AreEqual(IPAddress.None, readOnlyDictionary[PhysicalAddress.None]);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MacDomainDescriptorTest()
|
||||
{
|
||||
Random rng = new Random();
|
||||
byte[] srcAddrBuffer = new byte[6];
|
||||
byte[] dstAddrBuffer = new byte[6];
|
||||
rng.NextBytes(srcAddrBuffer);
|
||||
rng.NextBytes(dstAddrBuffer);
|
||||
PhysicalAddress srcAddr = new PhysicalAddress(srcAddrBuffer);
|
||||
PhysicalAddress dstAddr = new PhysicalAddress(dstAddrBuffer);
|
||||
|
||||
byte[] testBuffer = new byte[]
|
||||
{
|
||||
1,1,1,1, //Header
|
||||
1,0, //Downstream Active Channel
|
||||
2,0, //Downstream Service Group
|
||||
3,4,0,0,0,0, //DownstreamAmbiguityResolutionFrequencyList
|
||||
4,0, //ReceiveChannelProfileReportingControlObject
|
||||
5,0, //IpInitalizationParameters
|
||||
6,1,1, //EarlyAuthentication
|
||||
7,0, //ActiveUpstreamChannelList
|
||||
8,1,1, //UpstreamChannelIds
|
||||
9,1,1, //UpstreamFrequencyRange
|
||||
10,1,1, //SymbolClockLocking
|
||||
11,0, //EventControlEncoding
|
||||
12,1,1, //UpstreamTransmitPowerReporting
|
||||
15,2,255,255, //SequenceOutOfRange
|
||||
16,1,1, //ExtendedUpstreamTransmitPowerSupport
|
||||
17,0, //CmtsDocsisVersion
|
||||
18,1,1, //CmPeriodicMaintenanceTimeout
|
||||
20,4,0,0,255,255, //DownstreamOfdmProfileFailure
|
||||
};
|
||||
|
||||
MacDomainDescriptor mmd = new MacDomainDescriptor(srcAddr,dstAddr,testBuffer);
|
||||
Assert.AreEqual(1, mmd.ConfigurationChangeCount);
|
||||
Assert.AreEqual(1, mmd.NumberOfFragments);
|
||||
Assert.AreEqual(1, mmd.FragmentSequenceNumber);
|
||||
Assert.AreEqual(1, mmd.CurrentChannelDcid);
|
||||
Assert.IsNotNull(mmd.DownstreamServiceGroup);
|
||||
Assert.HasCount(1, mmd.DownstreamAmbiguityResolutionFrequencyList);
|
||||
Assert.IsNotNull(mmd.ReceiveChannelProfileReportingControl);
|
||||
Assert.IsNotNull(mmd.IpInitalizationParameters);
|
||||
Assert.AreEqual(1, mmd.EarlyAuthentication.Value);
|
||||
Assert.HasCount(1, mmd.ActiveUpstreamChannelList);
|
||||
Assert.AreEqual(1, mmd.UpstreamChannelIds[0]);
|
||||
Assert.AreEqual(1, mmd.UpstreamFrequencyRange.Value);
|
||||
Assert.IsTrue(mmd.SymbolClockLocking);
|
||||
Assert.HasCount(1, mmd.EventControlEncoding);
|
||||
Assert.AreEqual(1, mmd.UpstreamTransmitPowerReporting.Value);
|
||||
Assert.IsTrue(mmd.SequenceOutOfRange);
|
||||
Assert.IsTrue(mmd.CmOperatingOnBatteryBackup);
|
||||
Assert.IsTrue(mmd.CmReturnedToAcPower);
|
||||
Assert.IsTrue(mmd.CmMacAddressRemoval);
|
||||
Assert.AreEqual(1, mmd.ExtendedUpstreamTransmitPowerSupport.Value);
|
||||
Assert.IsNotNull(mmd.CmtsDocsisVersion);
|
||||
Assert.AreEqual(MacDomainDescriptor.CmPeriodicMaintenanceTimeoutEnum.UseProbe, mmd.CmPeriodicMaintenanceTimeout.Value);
|
||||
Assert.IsTrue(mmd.DownstreamOfdmProfileFailure);
|
||||
Assert.IsTrue(mmd.PrimaryDownstreamChannelChange);
|
||||
Assert.IsTrue(mmd.DpdMismatch);
|
||||
Assert.IsTrue(mmd.NcpProfileFailure);
|
||||
Assert.IsTrue(mmd.PlcFailure);
|
||||
Assert.IsTrue(mmd.NcpProfileRecovery);
|
||||
Assert.IsTrue(mmd.PlcRecovery);
|
||||
Assert.IsTrue(mmd.OfdmProfileRecovery);
|
||||
Assert.IsTrue(mmd.OfdmaProfileFailure);
|
||||
Assert.IsTrue(mmd.MapStorageOverflowIndicator);
|
||||
Assert.IsTrue(mmd.MapStorageAlmostFullIndicator);
|
||||
|
||||
byte[] expTestBuffer = new byte[]
|
||||
{
|
||||
1, 1, 1, 1, //Header
|
||||
254, 0 //Invalid
|
||||
};
|
||||
Assert.Throws<NotImplementedException>(() => new MacDomainDescriptor(srcAddr,dstAddr,expTestBuffer));
|
||||
|
||||
byte[] cdvoBuffer = new byte[]
|
||||
{
|
||||
1, 1, 1,
|
||||
2, 1, 1
|
||||
};
|
||||
MacDomainDescriptor.CmtsDocsisVersionObject cdvo = new MacDomainDescriptor.CmtsDocsisVersionObject(cdvoBuffer);
|
||||
Assert.AreEqual(1, cdvo.MajorVersion.Value);
|
||||
Assert.AreEqual(1, cdvo.MinorVersion.Value);
|
||||
|
||||
cdvoBuffer = new byte[]
|
||||
{
|
||||
254, 0,
|
||||
};
|
||||
Assert.Throws<NotImplementedException>(() => new MacDomainDescriptor.CmtsDocsisVersionObject(cdvoBuffer));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,17 +40,17 @@
|
||||
<Assembly Path="/home/schiemas/.nuget/packages/allure.net.commons/2.14.1/lib/netstandard2.0/Allure.Net.Commons.dll" />
|
||||
</AssemblyExplorer></s:String>
|
||||
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">/home/schiemas/.cache/JetBrains/Rider2025.1/resharper-host/temp/Rider/vAny/CoverageData/_skyscraper8.1808907683/Snapshot/snapshot.utdcvr</s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=145b05c0_002D83b0_002D4386_002Db9fb_002De55ec3152557/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from &lt;skyscraper8.Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<And>
|
||||
<Namespace>skyscraper8.Tests</Namespace>
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
</And>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=145b05c0_002D83b0_002D4386_002Db9fb_002De55ec3152557/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from &lt;skyscraper8.Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<And>
|
||||
<Namespace>skyscraper8.Tests</Namespace>
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
</And>
|
||||
</SessionState></s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=58c56b00_002Df81e_002D48fd_002Da74f_002Dc8e84271fcf4/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Continuous Testing" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=58c56b00_002Df81e_002D48fd_002Da74f_002Dc8e84271fcf4/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="Continuous Testing" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
</SessionState></s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ce70f33b_002D9024_002D4750_002Da24e_002D78f4e8e5e879/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;skyscraper8.Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Solution />
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ce70f33b_002D9024_002D4750_002Da24e_002D78f4e8e5e879/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from &lt;skyscraper8.Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
</SessionState></s:String>
|
||||
|
||||
|
||||
@ -61,7 +61,4 @@
|
||||
<s:String x:Key="/Default/Profiling/Configurations/=1/@EntryIndexedValue"><data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="TimelineInfo" /><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data></s:String>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=skyscraper8_002ETests_002FResources1/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/ShowOnlyErrors/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UnloadedProject/UnloadedProjects/=46caca1c_002Df9b2_002D2fe0_002D2068_002D716f381325e9_0023skyscraper5_002EUI_002EWindowsForms/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UnloadedProject/UnloadedProjects/=ebb6b1cf_002D2597_002D4962_002Daa31_002D2b42b4c28c7d_0023skyscraper8_002EAnagramViewer/@EntryIndexedValue">True</s:Boolean>
|
||||
</wpf:ResourceDictionary>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/ShowOnlyErrors/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
using System.Collections.Frozen;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using skyscraper5.Docsis.AnnexC;
|
||||
@ -84,9 +82,4 @@ public class NullDocsisEventHandler : IDocsisEventHandler
|
||||
{
|
||||
return timing.Value;
|
||||
}
|
||||
|
||||
public ReadOnlyDictionary<PhysicalAddress, IPAddress> GetKnownIps()
|
||||
{
|
||||
return knownIps.AsReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ namespace skyscraper5
|
||||
public ObjectStorage ObjectStorage { get; set; }
|
||||
private IStreamReader streamReader;
|
||||
private List<TunerMetadata> tuners;
|
||||
private List<SatellitePositionEntity> satellitePositions;
|
||||
private List<SatellitePosition> satellitePositions;
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public Passing()
|
||||
|
||||
@ -88,7 +88,7 @@ namespace skyscraper5
|
||||
logger.DebugFormat("I'm a {0}-bit Process.", Environment.Is64BitProcess ? 64 : 32);
|
||||
|
||||
PluginManager.GetInstance();
|
||||
SoftcamKeyset.GetInstance().AutoInitalize();
|
||||
SoftcamKeyset.GetInstance().InitializeFromFile();
|
||||
|
||||
if (args.Length != 0)
|
||||
{
|
||||
|
||||
@ -1,20 +1,11 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace skyscraper5.Skyscraper.Equipment
|
||||
{
|
||||
public class BaseEquipment
|
||||
{
|
||||
[XmlIgnore]
|
||||
public int Id { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public DateTime DateAdded { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,29 +1,25 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace skyscraper5.Skyscraper.Equipment
|
||||
{
|
||||
public class DishEntity : BaseEquipment
|
||||
public class DishType : BaseEquipment
|
||||
{
|
||||
public DishEntity(string manufac, string name, int diameter, DishShape shape)
|
||||
public DishType(string name, int diameter, DishShape shape)
|
||||
{
|
||||
this.Manufacturer = manufac;
|
||||
this.Name = name;
|
||||
this.Diameter = diameter;
|
||||
this.Shape = shape;
|
||||
}
|
||||
|
||||
public DishEntity()
|
||||
public DishType()
|
||||
{
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public int Diameter { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public DishShape Shape { get; set; }
|
||||
|
||||
protected bool Equals(DishEntity other)
|
||||
protected bool Equals(DishType other)
|
||||
{
|
||||
return Diameter == other.Diameter && Shape == other.Shape;
|
||||
}
|
||||
@ -33,7 +29,7 @@ namespace skyscraper5.Skyscraper.Equipment
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((DishEntity)obj);
|
||||
return Equals((DishType)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@ -52,6 +48,7 @@ namespace skyscraper5.Skyscraper.Equipment
|
||||
Offset,
|
||||
PrimeFocus,
|
||||
Mesh,
|
||||
Other
|
||||
Mobisat,
|
||||
Selfsat
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
namespace skyscraper5.Skyscraper.Equipment;
|
||||
|
||||
public class EquipmentCollection
|
||||
{
|
||||
public EquipmentCollection()
|
||||
{
|
||||
Dishes = new List<DishEntity>();
|
||||
LNBs = new List<LnbEntity>();
|
||||
SatellitePositions = new List<SatellitePositionEntity>();
|
||||
}
|
||||
|
||||
public List<DishEntity> Dishes { get; set; }
|
||||
public List<LnbEntity> LNBs { get; set; }
|
||||
public List<SatellitePositionEntity> SatellitePositions { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{0} dishes, {1} LNBs, {2} satellite positions", Dishes.Count, LNBs.Count, SatellitePositions.Count);
|
||||
}
|
||||
}
|
||||
@ -9,47 +9,45 @@ namespace skyscraper5.Skyscraper.Equipment
|
||||
{
|
||||
public static void InsertDefaultLnbTypes(DataStorage storage)
|
||||
{
|
||||
List<LnbEntity> knownLnbTypes = storage.UiLnbTypesListAll();
|
||||
foreach (LnbEntity defaultLnbType in GetDefaultLnbTypes())
|
||||
List<LnbType> knownLnbTypes = storage.UiLnbTypesListAll();
|
||||
foreach (LnbType defaultLnbType in GetDefaultLnbTypes())
|
||||
{
|
||||
if (!knownLnbTypes.Contains(defaultLnbType))
|
||||
storage.UiLnbTypesAdd(defaultLnbType);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<LnbEntity> GetDefaultLnbTypes()
|
||||
private static IEnumerable<LnbType> GetDefaultLnbTypes()
|
||||
{
|
||||
LnbEntity lnbType = new LnbEntity();
|
||||
LnbType lnbType = new LnbType();
|
||||
lnbType.Lof1 = 9750;
|
||||
lnbType.Lof2 = 10600;
|
||||
lnbType.LofSw = 11700;
|
||||
lnbType.MinimumFrequency = 10700;
|
||||
lnbType.MaximumFrequency = 12750;
|
||||
lnbType.Manufacturer = "Generic";
|
||||
lnbType.Name = "Universal LNB";
|
||||
lnbType.Name = "Generic Universal LNB";
|
||||
yield return lnbType;
|
||||
}
|
||||
|
||||
public static void InsertDefaultDishTypes(DataStorage storage)
|
||||
{
|
||||
List<DishEntity> knownDishTypes = storage.UiDishTypesListAll();
|
||||
foreach (DishEntity defaultDishType in GetDefaultDishTypes())
|
||||
List<DishType> knownDishTypes = storage.UiDishTypesListAll();
|
||||
foreach (DishType defaultDishType in GetDefaultDishTypes())
|
||||
{
|
||||
if (!knownDishTypes.Contains(defaultDishType))
|
||||
storage.UiDishTypesAdd(defaultDishType);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<DishEntity> GetDefaultDishTypes()
|
||||
private static IEnumerable<DishType> GetDefaultDishTypes()
|
||||
{
|
||||
int[] commonSizes = new int[] { 60, 80, 85, 100 };
|
||||
foreach (int commonSize in commonSizes)
|
||||
{
|
||||
DishEntity dishType = new DishEntity();
|
||||
DishType dishType = new DishType();
|
||||
dishType.Diameter = commonSize;
|
||||
dishType.Shape = DishShape.Offset;
|
||||
dishType.Manufacturer = "Generic";
|
||||
dishType.Name = String.Format("{0} cm Offset dish antenna", commonSize);
|
||||
dishType.Name = String.Format("Generic {0} cm Offset dish antenna", commonSize);
|
||||
yield return dishType;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace skyscraper5.Skyscraper.Equipment
|
||||
{
|
||||
public class LnbEntity : BaseEquipment
|
||||
public class LnbType : BaseEquipment
|
||||
{
|
||||
public LnbEntity() { }
|
||||
public LnbType() { }
|
||||
|
||||
public LnbEntity(string manufac, string name, int lof1, int lof2, int lofSw, int minFreq, int maxFreq)
|
||||
public LnbType(string name, int lof1, int lof2, int lofSw, int minFreq, int maxFreq)
|
||||
{
|
||||
this.Manufacturer = manufac;
|
||||
this.Name = name;
|
||||
this.Lof1 = lof1;
|
||||
this.Lof2 = lof2;
|
||||
@ -18,22 +16,14 @@ namespace skyscraper5.Skyscraper.Equipment
|
||||
this.MaximumFrequency = maxFreq;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public int Lof1 { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int Lof2 { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int LofSw { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int MinimumFrequency { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int MaximumFrequency { get; set; }
|
||||
|
||||
protected bool Equals(LnbEntity other)
|
||||
protected bool Equals(LnbType other)
|
||||
{
|
||||
return Lof1 == other.Lof1 && Lof2 == other.Lof2 && LofSw == other.LofSw && MinimumFrequency == other.MinimumFrequency && MaximumFrequency == other.MaximumFrequency;
|
||||
}
|
||||
@ -43,7 +33,7 @@ namespace skyscraper5.Skyscraper.Equipment
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((LnbEntity)obj);
|
||||
return Equals((LnbType)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@ -53,7 +43,7 @@ namespace skyscraper5.Skyscraper.Equipment
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{0} {1}", Manufacturer, Name);
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,108 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper5.Skyscraper
|
||||
{
|
||||
public class SatellitePositionEntity
|
||||
{
|
||||
public SatellitePositionEntity()
|
||||
{
|
||||
}
|
||||
|
||||
public SatellitePositionEntity(float angle, string name)
|
||||
{
|
||||
this.angle = angle;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public float angle;
|
||||
public string name;
|
||||
|
||||
public int Checksum => GetChecksum(angle);
|
||||
|
||||
public static int GetChecksum(float angle)
|
||||
{
|
||||
int result = (int)(angle * 10.0f);
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (angle > 0)
|
||||
{
|
||||
return String.Format("{0}°E {1}", angle, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
float tmpAngle = angle;
|
||||
tmpAngle *= -1;
|
||||
return String.Format("{0}°W {1}", tmpAngle, name);
|
||||
}
|
||||
}
|
||||
|
||||
public static SatellitePositionEntity FromChecksum(int checksum)
|
||||
{
|
||||
float newAngle = checksum;
|
||||
newAngle /= 10.0f;
|
||||
return new SatellitePositionEntity(newAngle, "???");
|
||||
}
|
||||
|
||||
protected bool Equals(SatellitePositionEntity other)
|
||||
{
|
||||
return angle.Equals(other.angle);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((SatellitePositionEntity)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(angle);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns an integer value for the cardinal direction.
|
||||
/// </summary>
|
||||
/// <returns>Returns 0 for east, 1 for west, 2 if satellite is at 0.0</returns>
|
||||
public int GetCardinalDirectionAsInt()
|
||||
{
|
||||
if (angle > 0)
|
||||
return 0;
|
||||
else if (angle < 0)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the letter matching the cardinal direction of the satellite.
|
||||
/// </summary>
|
||||
/// <returns>Returns either 'E' or 'W' depending on the angle.</returns>
|
||||
public char GetCardinalDirectionAsChar()
|
||||
{
|
||||
int cardinalDirectionAsInt = GetCardinalDirectionAsInt();
|
||||
return cardinalDirectionAsInt == 0 ? 'E' : 'W';
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a filename-safe number of the angle. Meaning the angle stripped of its sign and decimal separator.
|
||||
/// </summary>
|
||||
/// <returns>For example: For 19.2°E, this will return 192, For 34.5°W, this will return 345</returns>
|
||||
public int GetCleanAngle()
|
||||
{
|
||||
int cleanAngle = (int)(angle * 10.0f);
|
||||
if (cleanAngle < 0)
|
||||
cleanAngle /= -1;
|
||||
return cleanAngle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -707,21 +707,12 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
|
||||
if (tsRecorder.PrepareRecording())
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
int cardinalDirection = 0;
|
||||
int angle = config.SatellitePosition.Checksum;
|
||||
if (angle < 0)
|
||||
{
|
||||
angle *= -1;
|
||||
cardinalDirection = 1;
|
||||
}
|
||||
|
||||
string recordingFilename = string.Format(
|
||||
"skyscraper_{0:D4}{1:D2}{2:D2}_{3:D2}{4:D2}_{8:D4}{9}_{5}_{6}_{7}.ts",
|
||||
now.Year, now.Month, now.Day, now.Hour, now.Minute, result.GetFrequency() / 1000,
|
||||
result.GetPolarity(config.LnbType.LofSw), result.GetSymbolRate() / 1000,
|
||||
config.SatellitePosition.GetCleanAngle(),
|
||||
config.SatellitePosition.GetCardinalDirectionAsChar());
|
||||
(int)(config.SatellitePosition.angle * 10),
|
||||
config.SatellitePosition.cardinalDirection == 0 ? "E" : "W");
|
||||
tsRecorder.SetNextFilename(recordingFilename);
|
||||
tsRecorder.CreateBufferedStream();
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
|
||||
public TunerMetadata TunerMetadata { get; set; }
|
||||
public int DiseqcIndex { get; set; }
|
||||
public IGpsReceiver Gps { get; set; }
|
||||
public SatellitePositionEntity SatellitePosition { get; set; }
|
||||
public SatellitePosition SatellitePosition { get; set; }
|
||||
|
||||
public bool DoHorizontalHigh { get; set; }
|
||||
public bool DoHorizontalLow { get; set; }
|
||||
@ -29,7 +29,7 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
|
||||
public ObjectStorage ObjectStorage { get; set; }
|
||||
public ISkyscraperUiJunction Ui { get; set; }
|
||||
public bool DoCollectRfSpectrum { get; set; }
|
||||
public LnbEntity LnbType { get; set; }
|
||||
public LnbType LnbType { get; set; }
|
||||
public bool DoCollectIqGraphs { get; set; }
|
||||
public bool DoRecordTs { get; set; }
|
||||
public Ini Ini { get; set; }
|
||||
|
||||
@ -15,7 +15,7 @@ namespace skyscraper5.src.Skyscraper.FrequencyListGenerator
|
||||
public class DbBlindscanJob
|
||||
{
|
||||
public DbBlindscanJob(Guid jobGuid, PhysicalAddress tunerMac, STD_TYPE tunerStandard, int diseqCIndex,
|
||||
IGpsReceiver jobContextGps, SatellitePositionEntity satellitePosition)
|
||||
IGpsReceiver jobContextGps, SatellitePosition satellitePosition)
|
||||
{
|
||||
this.JobGuid = jobGuid;
|
||||
this.TunerMAC = tunerMac;
|
||||
@ -37,7 +37,7 @@ namespace skyscraper5.src.Skyscraper.FrequencyListGenerator
|
||||
}
|
||||
|
||||
|
||||
public SatellitePositionEntity SatPosition { get; private set; }
|
||||
public SatellitePosition SatPosition { get; private set; }
|
||||
|
||||
public GpsCoordinate? GpsCoordinate { get; private set; }
|
||||
|
||||
@ -69,7 +69,7 @@ namespace skyscraper5.src.Skyscraper.FrequencyListGenerator
|
||||
{
|
||||
case 1:
|
||||
if (SatPosition != null)
|
||||
return String.Format("{0:0.0}° {1}", SatPosition.angle, SatPosition.GetCardinalDirectionAsChar());
|
||||
return String.Format("{0:0.0}° {1}", SatPosition.angle, SatPosition.cardinalDirection == 0 ? "E" : "W");
|
||||
return TunerStandard.ToString();
|
||||
case 2:
|
||||
return String.Format("({0}/{1}/{2}/{3})", (int)HorizontalLowState, (int)HorizontalHighState, (int)VerticalLowState, (int)VerticalHighState);
|
||||
|
||||
@ -88,7 +88,7 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
/// Called before a SetChannel operation is performed.
|
||||
/// </summary>
|
||||
/// <param name="blindscanResult"></param>
|
||||
void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult, LnbEntity lnbType);
|
||||
void OnBlindscanBeforeSetChannel(BlindscanSearchResult blindscanResult, LnbType lnbType);
|
||||
|
||||
/// <summary>
|
||||
/// Called after a band (meaning e.g. Horizontal High) has been scraped.
|
||||
|
||||
@ -86,9 +86,9 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
void T2MiSetTimestamp(int currentNetworkId, int currentTransportStreamId, int pid, DateTime resolveTime);
|
||||
bool TestForRelatedContent(EitEvent lEvent, RctLinkInfo rctLinkInfo);
|
||||
void SetRelatedContent(EitEvent lEvent, RctLinkInfo rctLinkInfo);
|
||||
List<SatellitePositionEntity> UiSatellitesListAll();
|
||||
void UiSatellitesAdd(SatellitePositionEntity newPosition);
|
||||
void UiSatellitesDelete(SatellitePositionEntity satellitePosition);
|
||||
List<SatellitePosition> UiSatellitesListAll();
|
||||
void UiSatellitesAdd(SatellitePosition newPosition);
|
||||
void UiSatellitesDelete(SatellitePosition satellitePosition);
|
||||
bool UiTunerTestFor(TunerMetadata tuner);
|
||||
void UiTunerUpdate(TunerMetadata tuner);
|
||||
void UiTunerInsert(TunerMetadata tuner);
|
||||
@ -108,10 +108,10 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
bool T2MiTestForTransmitter(int? currentNetworkId, int? currentTransportStreamId, int relatedPid, ushort txIdentifier);
|
||||
void T2MiRememberTransmitter(int? currentNetworkId, int? currentTransportStreamId, int relatedPid, ushort txIdentifier);
|
||||
void T2MiSetTransmitterTimeOffset(int? currentNetworkId, int? currentTransportStreamId, int relatedPid, ushort txIdentifier, ushort timeOffset);
|
||||
List<LnbEntity> UiLnbTypesListAll();
|
||||
void UiLnbTypesAdd(LnbEntity defaultLnbType);
|
||||
List<DishEntity> UiDishTypesListAll();
|
||||
void UiDishTypesAdd(DishEntity defaultDishType);
|
||||
List<LnbType> UiLnbTypesListAll();
|
||||
void UiLnbTypesAdd(LnbType defaultLnbType);
|
||||
List<DishType> UiDishTypesListAll();
|
||||
void UiDishTypesAdd(DishType defaultDishType);
|
||||
|
||||
IEnumerable<Tuple<int, int, ProgramMapping>> SelectAllPmt();
|
||||
SdtService SelectSdtById(int networkId, int tsId, ushort programMappingProgramNumber);
|
||||
|
||||
@ -818,30 +818,30 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
}
|
||||
}
|
||||
|
||||
public List<SatellitePositionEntity> UiSatellitesListAll()
|
||||
public List<SatellitePosition> UiSatellitesListAll()
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "satellites.json");
|
||||
FileInfo fi = new FileInfo(path);
|
||||
if (!fi.Exists)
|
||||
return new List<SatellitePositionEntity>();
|
||||
return new List<SatellitePosition>();
|
||||
else
|
||||
{
|
||||
return JsonConvert.DeserializeObject<List<SatellitePositionEntity>>(File.ReadAllText(fi.FullName));
|
||||
return JsonConvert.DeserializeObject<List<SatellitePosition>>(File.ReadAllText(fi.FullName));
|
||||
}
|
||||
}
|
||||
|
||||
public void UiSatellitesAdd(SatellitePositionEntity newPosition)
|
||||
public void UiSatellitesAdd(SatellitePosition newPosition)
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "satellites.json");
|
||||
FileInfo fi = new FileInfo(path);
|
||||
List<SatellitePositionEntity> satellites;
|
||||
List<SatellitePosition> satellites;
|
||||
if (!fi.Exists)
|
||||
{
|
||||
satellites = new List<SatellitePositionEntity>();
|
||||
satellites = new List<SatellitePosition>();
|
||||
}
|
||||
else
|
||||
{
|
||||
satellites = JsonConvert.DeserializeObject<List<SatellitePositionEntity>>(File.ReadAllText(fi.FullName));
|
||||
satellites = JsonConvert.DeserializeObject<List<SatellitePosition>>(File.ReadAllText(fi.FullName));
|
||||
}
|
||||
|
||||
satellites.Add(newPosition);
|
||||
@ -849,11 +849,11 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
File.WriteAllText(fi.FullName, JsonConvert.SerializeObject(satellites, Formatting.Indented));
|
||||
}
|
||||
|
||||
public void UiSatellitesDelete(SatellitePositionEntity satellitePosition)
|
||||
public void UiSatellitesDelete(SatellitePosition satellitePosition)
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "satellites.json");
|
||||
FileInfo fi = new FileInfo(path);
|
||||
List<SatellitePositionEntity> satellites = JsonConvert.DeserializeObject<List<SatellitePositionEntity>>(File.ReadAllText(fi.FullName));
|
||||
List<SatellitePosition> satellites = JsonConvert.DeserializeObject<List<SatellitePosition>>(File.ReadAllText(fi.FullName));
|
||||
|
||||
satellites.RemoveAll(x => x.Checksum == satellitePosition.Checksum);
|
||||
|
||||
@ -964,16 +964,16 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
File.WriteAllText(path, timeOffset.ToString());
|
||||
}
|
||||
|
||||
public List<LnbEntity> UiLnbTypesListAll()
|
||||
public List<LnbType> UiLnbTypesListAll()
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "0-UI", "LnbTypes");
|
||||
DirectoryInfo di = new DirectoryInfo(path);
|
||||
if (!di.Exists)
|
||||
{
|
||||
return new List<LnbEntity>();
|
||||
return new List<LnbType>();
|
||||
}
|
||||
|
||||
List<LnbEntity> result = new List<LnbEntity>();
|
||||
List<LnbType> result = new List<LnbType>();
|
||||
FileInfo[] fileInfos = di.GetFiles("*.json");
|
||||
foreach (FileInfo fileInfo in fileInfos)
|
||||
{
|
||||
@ -983,7 +983,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
int iid = int.Parse(fid);
|
||||
|
||||
string json = File.ReadAllText(fileInfo.FullName);
|
||||
LnbEntity deserializeObject = JsonConvert.DeserializeObject<LnbEntity>(json);
|
||||
LnbType deserializeObject = JsonConvert.DeserializeObject<LnbType>(json);
|
||||
if (deserializeObject.Id != iid)
|
||||
continue;
|
||||
if (result.Contains(deserializeObject))
|
||||
@ -1017,7 +1017,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
return result;
|
||||
}
|
||||
|
||||
public void UiLnbTypesAdd(LnbEntity defaultLnbType)
|
||||
public void UiLnbTypesAdd(LnbType defaultLnbType)
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "0-UI", "LnbTypes");
|
||||
DirectoryInfo di = new DirectoryInfo(path);
|
||||
@ -1030,16 +1030,16 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
File.WriteAllText(path, json);
|
||||
}
|
||||
|
||||
public List<DishEntity> UiDishTypesListAll()
|
||||
public List<DishType> UiDishTypesListAll()
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "0-UI", "DishTypes");
|
||||
DirectoryInfo di = new DirectoryInfo(path);
|
||||
if (!di.Exists)
|
||||
{
|
||||
return new List<DishEntity>();
|
||||
return new List<DishType>();
|
||||
}
|
||||
|
||||
List<DishEntity> result = new List<DishEntity>();
|
||||
List<DishType> result = new List<DishType>();
|
||||
FileInfo[] fileInfos = di.GetFiles("*.json");
|
||||
foreach (FileInfo fileInfo in fileInfos)
|
||||
{
|
||||
@ -1049,7 +1049,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
int iid = int.Parse(fid);
|
||||
|
||||
string json = File.ReadAllText(fileInfo.FullName);
|
||||
DishEntity deserializeObject = JsonConvert.DeserializeObject<DishEntity>(json);
|
||||
DishType deserializeObject = JsonConvert.DeserializeObject<DishType>(json);
|
||||
if (deserializeObject.Id != iid)
|
||||
continue;
|
||||
if (result.Contains(deserializeObject))
|
||||
@ -1060,7 +1060,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
return result;
|
||||
}
|
||||
|
||||
public void UiDishTypesAdd(DishEntity defaultDishType)
|
||||
public void UiDishTypesAdd(DishType defaultDishType)
|
||||
{
|
||||
string path = Path.Combine(rootDirectory.FullName, "0-UI", "DishTypes");
|
||||
DirectoryInfo di = new DirectoryInfo(path);
|
||||
|
||||
@ -771,23 +771,23 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private List<SatellitePositionEntity> satellitePositions;
|
||||
private List<SatellitePosition> satellitePositions;
|
||||
|
||||
public List<SatellitePositionEntity> UiSatellitesListAll()
|
||||
public List<SatellitePosition> UiSatellitesListAll()
|
||||
{
|
||||
if (satellitePositions == null)
|
||||
satellitePositions = new List<SatellitePositionEntity>();
|
||||
satellitePositions = new List<SatellitePosition>();
|
||||
return satellitePositions.ToList();
|
||||
}
|
||||
|
||||
public void UiSatellitesAdd(SatellitePositionEntity newPosition)
|
||||
public void UiSatellitesAdd(SatellitePosition newPosition)
|
||||
{
|
||||
if (satellitePositions == null)
|
||||
satellitePositions = new List<SatellitePositionEntity>();
|
||||
satellitePositions = new List<SatellitePosition>();
|
||||
satellitePositions.Add(newPosition);
|
||||
}
|
||||
|
||||
public void UiSatellitesDelete(SatellitePositionEntity satellitePosition)
|
||||
public void UiSatellitesDelete(SatellitePosition satellitePosition)
|
||||
{
|
||||
satellitePositions.RemoveAll(x => x.Checksum == satellitePosition.Checksum);
|
||||
}
|
||||
@ -905,37 +905,37 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
|
||||
t2miTransmitters[t2miTransmitterId].TimeOffset = timeOffset;
|
||||
}
|
||||
|
||||
private List<LnbEntity> _lnbTypes;
|
||||
private List<LnbType> _lnbTypes;
|
||||
|
||||
public List<LnbEntity> UiLnbTypesListAll()
|
||||
public List<LnbType> UiLnbTypesListAll()
|
||||
{
|
||||
if (_lnbTypes == null)
|
||||
_lnbTypes = new List<LnbEntity>();
|
||||
_lnbTypes = new List<LnbType>();
|
||||
return _lnbTypes;
|
||||
}
|
||||
|
||||
public void UiLnbTypesAdd(LnbEntity defaultLnbType)
|
||||
public void UiLnbTypesAdd(LnbType defaultLnbType)
|
||||
{
|
||||
if (_lnbTypes == null)
|
||||
_lnbTypes = new List<LnbEntity>();
|
||||
_lnbTypes = new List<LnbType>();
|
||||
if (!_lnbTypes.Contains(defaultLnbType))
|
||||
_lnbTypes.Add(defaultLnbType);
|
||||
}
|
||||
|
||||
private List<DishEntity> _dishTypes;
|
||||
private List<DishType> _dishTypes;
|
||||
|
||||
public List<DishEntity> UiDishTypesListAll()
|
||||
public List<DishType> UiDishTypesListAll()
|
||||
{
|
||||
if (_dishTypes == null)
|
||||
_dishTypes = new List<DishEntity>();
|
||||
_dishTypes = new List<DishType>();
|
||||
return _dishTypes;
|
||||
|
||||
}
|
||||
|
||||
public void UiDishTypesAdd(DishEntity defaultDishType)
|
||||
public void UiDishTypesAdd(DishType defaultDishType)
|
||||
{
|
||||
if (_dishTypes == null)
|
||||
_dishTypes = new List<DishEntity>();
|
||||
_dishTypes = new List<DishType>();
|
||||
if (!_dishTypes.Contains(defaultDishType))
|
||||
_dishTypes.Add(defaultDishType);
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.Plugins;
|
||||
|
||||
namespace skyscraper8.Skyscraper.Security.AccessControl
|
||||
{
|
||||
@ -22,24 +21,45 @@ namespace skyscraper8.Skyscraper.Security.AccessControl
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
public bool AutoInitalize()
|
||||
private FileInfo TryFindSoftcamKey()
|
||||
{
|
||||
PluginManager pluginManager = PluginManager.GetInstance();
|
||||
Ini ini = pluginManager.Ini;
|
||||
bool softcamEnabled = ini.ReadValue("softcam", "enable", false);
|
||||
if (!softcamEnabled)
|
||||
return false;
|
||||
foreach (FileInfo fi in GetPossibleLocations())
|
||||
{
|
||||
if (fi.Exists)
|
||||
{
|
||||
return fi;
|
||||
}
|
||||
}
|
||||
|
||||
string softcamKeyPath = ini.ReadValue("softcam", "path", FILE_NAME);
|
||||
FileInfo softcamKeyFileInfo = new FileInfo(softcamKeyPath);
|
||||
if (!softcamKeyFileInfo.Exists)
|
||||
return false;
|
||||
|
||||
int result = LoadSoftcamKey(softcamKeyFileInfo);
|
||||
return result > 0;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private const string FILE_NAME = "SoftCam.Key";
|
||||
private IEnumerable<FileInfo> GetPossibleLocations()
|
||||
{
|
||||
FileInfo self = new FileInfo(FILE_NAME);
|
||||
yield return self;
|
||||
|
||||
string assemblyLocation = this.GetType().Assembly.Location;
|
||||
FileInfo assemblyLocationFileInfo = new FileInfo(assemblyLocation);
|
||||
DirectoryInfo assemblyLocationDirectory = assemblyLocationFileInfo.Directory;
|
||||
string assemblyLocationKeyfileName = Path.Combine(assemblyLocationDirectory.FullName, FILE_NAME);
|
||||
yield return new FileInfo(assemblyLocationKeyfileName);
|
||||
|
||||
DirectoryInfo rootDirectory = self.Directory.Root;
|
||||
DirectoryInfo selfDirectory = self.Directory;
|
||||
do
|
||||
{
|
||||
selfDirectory = selfDirectory.Parent;
|
||||
if (selfDirectory == null)
|
||||
break;
|
||||
string possibleName = Path.Combine(selfDirectory.FullName, FILE_NAME);
|
||||
yield return new FileInfo(possibleName);
|
||||
} while (!selfDirectory.Equals(rootDirectory));
|
||||
|
||||
yield return new FileInfo("C:\\FT\\SoftCam_Emu\\SoftCam.Key");
|
||||
}
|
||||
|
||||
private int LoadSoftcamKey(FileInfo fi)
|
||||
{
|
||||
int result = 0;
|
||||
@ -161,6 +181,24 @@ namespace skyscraper8.Skyscraper.Security.AccessControl
|
||||
return result;
|
||||
}
|
||||
|
||||
private bool doneFileInitalization;
|
||||
public void InitializeFromFile()
|
||||
{
|
||||
if (doneFileInitalization)
|
||||
{
|
||||
throw new AccessControlException("Softcam.key Keyset already initalized.");
|
||||
}
|
||||
|
||||
doneFileInitalization = true;
|
||||
FileInfo keyLocation = TryFindSoftcamKey();
|
||||
if (keyLocation != null)
|
||||
{
|
||||
logger.InfoFormat("Loading keys from: {0}", keyLocation.FullName);
|
||||
int numKeysLoaded = LoadSoftcamKey(keyLocation);
|
||||
logger.InfoFormat("I suppose you are legally entitled to use those {0} keys I just loaded, You are, right?",numKeysLoaded);
|
||||
}
|
||||
}
|
||||
|
||||
private List<ViaccessKey> _viaccessKeys;
|
||||
public IReadOnlyList<ViaccessKey> ViaccessKeys => _viaccessKeys;
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ namespace skyscraper8.Skyscraper.Security.AccessControl
|
||||
public void Run()
|
||||
{
|
||||
SoftcamKeyset softcamKeyset = SoftcamKeyset.GetInstance();
|
||||
softcamKeyset.AutoInitalize();
|
||||
softcamKeyset.InitializeFromFile();
|
||||
byte[] bissKey = softcamKeyset.FindBissKey(2, 85);
|
||||
|
||||
BissDescrambleFilter descrambler = new BissDescrambleFilter(bissKey);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user