Now deleting IQ Graphics and RF Spectrums when deleting a Blindscan job.
This commit is contained in:
parent
0049af0476
commit
c07efd58d1
@ -17,6 +17,7 @@ using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using Minio.DataModel.Response;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
|
||||
namespace skyscraper5.Data
|
||||
{
|
||||
@ -330,5 +331,30 @@ namespace skyscraper5.Data
|
||||
|
||||
WriteObject(fullName, ms);
|
||||
}
|
||||
|
||||
private bool DeleteFile(string fullname)
|
||||
{
|
||||
RemoveObjectArgs removeObject = new RemoveObjectArgs();
|
||||
removeObject.WithObject(fullname);
|
||||
removeObject.WithBucket(_minioBucket);
|
||||
Task task = _minioClient.RemoveObjectAsync(removeObject);
|
||||
task.Wait();
|
||||
if (task.Exception != null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void DeleteIqGraph(Guid selectedGuid, int frequencyItem1, SatelliteDeliverySystemDescriptor.PolarizationEnum frequencyItem2)
|
||||
{
|
||||
char polarityChar = frequencyItem2.ToString()[0];
|
||||
string fullName = String.Format("/iq/{0}/{1}_{2}.iq", selectedGuid.ToString("D"), frequencyItem1, polarityChar);
|
||||
DeleteFile(fullName);
|
||||
}
|
||||
|
||||
public void DeleteRfSpectrum(Guid selectedGuid)
|
||||
{
|
||||
string fullName = String.Format("/rf/{0}.rf", selectedGuid.ToString("D"));
|
||||
DeleteFile(fullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
using skyscraper5.Skyscraper.IO.CrazycatStreamReader;
|
||||
using Npgsql;
|
||||
using NpgsqlTypes;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.Gps;
|
||||
using skyscraper5.Skyscraper.IO.CrazycatStreamReader;
|
||||
using skyscraper5.src.Skyscraper.FrequencyListGenerator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -8,10 +13,6 @@ using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Npgsql;
|
||||
using NpgsqlTypes;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.Gps;
|
||||
|
||||
namespace skyscraper5.Data.PostgreSql
|
||||
{
|
||||
@ -568,5 +569,27 @@ namespace skyscraper5.Data.PostgreSql
|
||||
connection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>> GetBlindscanResultFrequencies(Guid selectedGuid)
|
||||
{
|
||||
using (NpgsqlConnection connection = new NpgsqlConnection(connectionStringBuilder.ToString()))
|
||||
{
|
||||
connection.Open();
|
||||
NpgsqlCommand command = connection.CreateCommand();
|
||||
command.CommandText = "SELECT freq, pol FROM skyscraper5_blindscan_search_results WHERE related_job = @job";
|
||||
command.Parameters.AddWithValue("@job", NpgsqlDbType.Uuid, selectedGuid);
|
||||
NpgsqlDataReader dataReader = command.ExecuteReader();
|
||||
while (dataReader.Read())
|
||||
{
|
||||
int freq = dataReader.GetInt32(0);
|
||||
int pol = dataReader.GetInt32(1);
|
||||
Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum> child = new Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>(freq, (SatelliteDeliverySystemDescriptor.PolarizationEnum)pol);
|
||||
yield return child;
|
||||
}
|
||||
dataReader.Close();
|
||||
dataReader.Dispose();
|
||||
connection.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
using skyscraper8.DvbNip;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
@ -351,6 +352,8 @@ namespace skyscraper5.Data.PostgreSql
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private Dictionary<string, DateTime> _knownDvbiServiceListUpdateDates;
|
||||
public DateTime GetDvbiServiceListLastUpdateDate(string id)
|
||||
|
||||
@ -8,34 +8,45 @@ using System.Linq;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace SDL2Demo.Forms
|
||||
{
|
||||
class BlindscanJobDeleter : IRenderable
|
||||
{
|
||||
private readonly DataStorage storage;
|
||||
private readonly DataStorage dataStorage;
|
||||
private readonly ObjectStorage objectStorage;
|
||||
private List<DbBlindscanJob> blindscanJobs;
|
||||
private Guid selectedGuid;
|
||||
private string tableGuid;
|
||||
public bool Closed { get; private set; }
|
||||
|
||||
public BlindscanJobDeleter(DataStorage storage)
|
||||
public BlindscanJobDeleter(DataStorage dataStorage,ObjectStorage objectStorage)
|
||||
{
|
||||
this.storage = storage;
|
||||
this.dataStorage = dataStorage;
|
||||
this.objectStorage = objectStorage;
|
||||
this.LoadPastBlindscans();
|
||||
this.tableGuid = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
private void LoadPastBlindscans()
|
||||
{
|
||||
blindscanJobs = storage.GetDbBlindscanJobs().ToList();
|
||||
blindscanJobs = dataStorage.GetDbBlindscanJobs().ToList();
|
||||
selectedGuid = Guid.Empty;
|
||||
}
|
||||
|
||||
private void DeleteSelectedJob()
|
||||
{
|
||||
storage.DeleteBlindscanJob(selectedGuid);
|
||||
IEnumerable<Tuple<int,SatelliteDeliverySystemDescriptor.PolarizationEnum>> frequencies = dataStorage.GetBlindscanResultFrequencies(selectedGuid);
|
||||
foreach (Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum> frequency in frequencies)
|
||||
{
|
||||
objectStorage.DeleteIqGraph(selectedGuid, frequency.Item1, frequency.Item2);
|
||||
}
|
||||
|
||||
objectStorage.DeleteRfSpectrum(selectedGuid);
|
||||
|
||||
dataStorage.DeleteBlindscanJob(selectedGuid);
|
||||
LoadPastBlindscans();
|
||||
}
|
||||
|
||||
|
||||
@ -818,7 +818,12 @@ namespace SDL2Demo.Jobs
|
||||
*/
|
||||
IqChartData result = IqChartData.Create();
|
||||
IqWindow iqWindow = new IqWindow(JobContext.ImgUiDevice, result);
|
||||
|
||||
Monitor.Enter(JobContext.Renderables);
|
||||
JobContext.Renderables.Add(iqWindow);
|
||||
Monitor.Exit(JobContext.Renderables);
|
||||
|
||||
|
||||
sbyte[] buffer = new sbyte[400];
|
||||
DateTime started = DateTime.Now;
|
||||
while (!result.IsComplete)
|
||||
|
||||
@ -555,7 +555,7 @@ namespace SkyscraperUI
|
||||
{
|
||||
if (ImGui.MenuItem("Delete Blindscan Jobs", CanOpenJobDeleter()))
|
||||
{
|
||||
jobDeleter = new BlindscanJobDeleter(dataStorage);
|
||||
jobDeleter = new BlindscanJobDeleter(dataStorage, objectStorage);
|
||||
}
|
||||
ImGui.EndMenu();
|
||||
}
|
||||
@ -749,13 +749,12 @@ namespace SkyscraperUI
|
||||
{
|
||||
if (jobContext.Renderables.Count > 0)
|
||||
{
|
||||
lock (jobContext.Renderables)
|
||||
{
|
||||
foreach (IRenderable jobContextRenderable in jobContext.Renderables)
|
||||
{
|
||||
jobContextRenderable.Render();
|
||||
}
|
||||
}
|
||||
Monitor.Enter(jobContext.Renderables);
|
||||
foreach (IRenderable jobContextRenderable in jobContext.Renderables)
|
||||
{
|
||||
jobContextRenderable.Render();
|
||||
}
|
||||
Monitor.Exit(jobContext.Renderables);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -190,5 +190,6 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
object[] GetPluginConnector();
|
||||
|
||||
void Ping();
|
||||
IEnumerable<Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>> GetBlindscanResultFrequencies(Guid selectedGuid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1116,6 +1116,11 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>> GetBlindscanResultFrequencies(Guid selectedGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, int, ProgramMapping>> SelectAllPmt()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@ -1465,6 +1470,16 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteIqGraph(Guid selectedGuid, int frequencyItem1, SatelliteDeliverySystemDescriptor.PolarizationEnum frequencyItem2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteRfSpectrum(Guid selectedGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool DvbNipPrivateDataSpecifier(NipActualCarrierInformation currentCarrierInformation, DateTime versionUpdate,
|
||||
uint privateDataSpecifier, List<string> privateDataSessions)
|
||||
{
|
||||
|
||||
@ -924,6 +924,11 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>> GetBlindscanResultFrequencies(Guid selectedGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, int, ProgramMapping>> SelectAllPmt()
|
||||
{
|
||||
for (int x = 0; x < pmtEntries.Length; x++)
|
||||
|
||||
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.DataBroadcasting.SkyscraperVfs;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
using skyscraper8.DvbNip;
|
||||
using skyscraper8.Ietf.FLUTE;
|
||||
using skyscraper8.Skyscraper.Drawing;
|
||||
@ -88,5 +89,15 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteIqGraph(Guid selectedGuid, int frequencyItem1, SatelliteDeliverySystemDescriptor.PolarizationEnum frequencyItem2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteRfSpectrum(Guid selectedGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.DataBroadcasting.SkyscraperVfs;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
using skyscraper5.Teletext;
|
||||
using skyscraper8.DvbNip;
|
||||
using skyscraper8.Ietf.FLUTE;
|
||||
@ -28,5 +29,7 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener);
|
||||
void StoreIqGraph(Guid jobGuid, long frequency, char polarity, IqChartData plot);
|
||||
void StoreRfSpectrum(Guid jobGuid, RfSpectrumData rfSpectrum);
|
||||
void DeleteIqGraph(Guid selectedGuid, int frequencyItem1, SatelliteDeliverySystemDescriptor.PolarizationEnum frequencyItem2);
|
||||
void DeleteRfSpectrum(Guid selectedGuid);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user