diff --git a/skyscraper8/Skyscraper/Drawing/RfFrequencyChartData.cs b/skyscraper8/Skyscraper/Drawing/RfFrequencyChartData.cs
index 2a13e01..4e0f001 100644
--- a/skyscraper8/Skyscraper/Drawing/RfFrequencyChartData.cs
+++ b/skyscraper8/Skyscraper/Drawing/RfFrequencyChartData.cs
@@ -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;
}
}
}
diff --git a/skyscraper8/Skyscraper/FrequencyListGenerator/CoopBlindscanStreamReaderProxy.cs b/skyscraper8/Skyscraper/FrequencyListGenerator/CoopBlindscanStreamReaderProxy.cs
index 394d2b0..1ebba15 100644
--- a/skyscraper8/Skyscraper/FrequencyListGenerator/CoopBlindscanStreamReaderProxy.cs
+++ b/skyscraper8/Skyscraper/FrequencyListGenerator/CoopBlindscanStreamReaderProxy.cs
@@ -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();
}
diff --git a/skyscraper8/Skyscraper/FrequencyListGenerator/SatIpWithStreamReaderProxy.cs b/skyscraper8/Skyscraper/FrequencyListGenerator/SatIpWithStreamReaderProxy.cs
index f0b167c..04a19df 100644
--- a/skyscraper8/Skyscraper/FrequencyListGenerator/SatIpWithStreamReaderProxy.cs
+++ b/skyscraper8/Skyscraper/FrequencyListGenerator/SatIpWithStreamReaderProxy.cs
@@ -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();
}
diff --git a/skyscraper8/Skyscraper/IO/IStreamReader.cs b/skyscraper8/Skyscraper/IO/IStreamReader.cs
index f7e6fe9..cf31871 100644
--- a/skyscraper8/Skyscraper/IO/IStreamReader.cs
+++ b/skyscraper8/Skyscraper/IO/IStreamReader.cs
@@ -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);
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Set this to 5. This is a value known to work.
+ /// Set this to 255. This is a value known to work.
+ ///
+ ///
+ ///
+ ///
+ 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);
///
/// Given an approximate satellite frequency, tune to the nearest channel.
diff --git a/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderClient.cs b/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderClient.cs
index c234777..61f01df 100644
--- a/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderClient.cs
+++ b/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderClient.cs
@@ -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,
diff --git a/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderConstants.cs b/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderConstants.cs
index 73f52a6..7c4a498 100644
--- a/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderConstants.cs
+++ b/skyscraper8/Skyscraper/IO/RemoteStreamReader/RemoteStreamReaderConstants.cs
@@ -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
+ }
}
diff --git a/skyscraper8/Skyscraper/IO/TunerInterface/NullTunerFactory.cs b/skyscraper8/Skyscraper/IO/TunerInterface/NullTunerFactory.cs
index c244cc4..e88a579 100644
--- a/skyscraper8/Skyscraper/IO/TunerInterface/NullTunerFactory.cs
+++ b/skyscraper8/Skyscraper/IO/TunerInterface/NullTunerFactory.cs
@@ -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();
}
diff --git a/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs b/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs
index 50dafb0..7b8c393 100644
--- a/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs
+++ b/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs
@@ -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,