Refactored FFTScan in the StreamReader interface.
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 33s

This commit is contained in:
Fey 2026-05-10 12:23:41 +02:00
parent 8808dc92e0
commit b75bd3c4dd
8 changed files with 77 additions and 18 deletions

View File

@ -119,11 +119,14 @@ namespace skyscraper8.Skyscraper.Drawing
public double[] Data { get; private set; }
public void Push(int i, double rf)
public bool Push(int i, double rf)
{
i -= MinimumFrequency;
i /= Step;
if (i >= Data.Length)
return false;
Data[i] = rf;
return true;
}
}
}

View File

@ -250,8 +250,7 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
throw new NotImplementedException();
}
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, nint pTab,
nint pBegin, nint pNum)
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, uint[] pTab, ref uint pBegin, ref uint pNum)
{
throw new NotImplementedException();
}

View File

@ -322,11 +322,10 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
public bool FFTInit()
{
throw new NotImplementedException();
}
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, nint pTab,
nint pBegin, nint pNum)
{
}
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, uint[] pTab, ref uint pBegin, ref uint pNum)
{
throw new NotImplementedException();
}

View File

@ -236,7 +236,22 @@ namespace skyscraper5.Skyscraper.IO
bool FFTInit();
bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, IntPtr pTab, IntPtr pBegin, IntPtr pNum);
/// <summary>
///
/// </summary>
/// <param name="freq"></param>
/// <param name="pol"></param>
/// <param name="lof1"></param>
/// <param name="lof2"></param>
/// <param name="lofsw"></param>
/// <param name="range"></param>
/// <param name="mode">Set this to 5. This is a value known to work.</param>
/// <param name="nb_acc">Set this to 255. This is a value known to work.</param>
/// <param name="pTab"></param>
/// <param name="pBegin"></param>
/// <param name="pNum"></param>
/// <returns></returns>
bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, uint[] pTab, ref uint pBegin, ref uint pNum);
/// <summary>
/// Given an approximate satellite frequency, tune to the nearest channel.

View File

@ -524,13 +524,50 @@ namespace skyscraper5.Skyscraper.IO.RemoteStreamReader
public bool FFTInit()
{
throw new NotImplementedException();
TcpStream.WriteUInt32BE((uint)RemoteStreamReaderConstants.REQUEST_FFT_INIT);
RemoteStreamReaderConstants result = (RemoteStreamReaderConstants)(TcpStream.ReadUInt32BE());
switch(result)
{
case RemoteStreamReaderConstants.COMMAND_SUCCESSFUL:
return true;
case RemoteStreamReaderConstants.COMMAND_FAILED:
return false;
default:
throw new NotImplementedException(result.ToString());
}
}
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, IntPtr pTab,
IntPtr pBegin, IntPtr pNum)
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, uint[] pTab, ref uint pBegin, ref uint pNum)
{
throw new NotImplementedException();
TcpStream.WriteUInt32BE((uint)RemoteStreamReaderConstants.REQUEST_FFT_SCAN);
TcpStream.WriteInt32BE(freq);
TcpStream.WriteInt32BE(pol);
TcpStream.WriteInt32BE(lof1);
TcpStream.WriteInt32BE(lof2);
TcpStream.WriteInt32BE(lofsw);
TcpStream.WriteUInt32BE(range);
TcpStream.WriteUInt8(mode);
TcpStream.WriteUInt8(nb_acc);
TcpStream.WriteInt32BE(pTab.Length);
RemoteStreamReaderConstants result = (RemoteStreamReaderConstants)(TcpStream.ReadUInt32BE());
switch (result)
{
case RemoteStreamReaderConstants.COMMAND_SUCCESSFUL:
pBegin = TcpStream.ReadUInt32BE();
pNum = TcpStream.ReadUInt32BE();
for (uint i = pBegin; i < pNum; i++)
{
pTab[i] = TcpStream.ReadUInt32BE();
}
return true;
case RemoteStreamReaderConstants.COMMAND_FAILED:
return false;
default:
throw new NotImplementedException();
}
}
public bool BLScan(int freq, int freq_range, int pol, int lof1, int lof2, int lofsw, int minsr,

View File

@ -42,6 +42,8 @@
REQUEST_SKYSCRAPER_ENGINE_NAME,
REQUEST_SKYSCRAPER_ENGINE_VERSION,
REQUEST_RF_SCAN_2,
REQUEST_FFT_TERM
}
REQUEST_FFT_TERM,
REQUEST_FFT_INIT,
REQUEST_FFT_SCAN
}
}

View File

@ -157,8 +157,7 @@ namespace skyscraper5.Skyscraper.IO.TunerInterface
throw new NotImplementedException();
}
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, IntPtr pTab,
IntPtr pBegin, IntPtr pNum)
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, uint[] pTab, ref uint pBegin, ref uint pNum)
{
throw new NotImplementedException();
}

View File

@ -1396,7 +1396,12 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
public void DeleteRfSpectrum(Guid selectedGuid)
{
throw new NotImplementedException();
string filename = Path.Combine(rootDirectory.FullName, "rf", selectedGuid.ToString() + ".rf");
FileInfo fi = new FileInfo(filename);
if (fi.Exists)
{
fi.Delete();
}
}
public bool OtvSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int sourcePid, ushort tableIdExtension,