public PrepareWeatherRessources(MultiMedia multiMediaDb, String pictureInputDirectoryName = null) { MultiMediaDb = multiMediaDb; if (String.IsNullOrEmpty(pictureInputDirectoryName)) pictureInputDirectoryName = @"D:\DEV\WPMediaProgrammPlayer\WPMediaRunWeatherDisplay\WeatherPictures"; PictureInputDirectoryName = pictureInputDirectoryName; WeatherForeignElementTypId = MultiMediaDb.MMForeignElementTypen.Find_By_Name("Wetter").Id; }
public BalancerUsage(MultiMedia dataContext, Dictionary<MMSlot, Dictionary<MMUnit, List<MMUnitTiming>>> todayActiveMMUnitsPerMMSlot) { this.dataContext = dataContext; TodayActiveMMUnitsPerMMSlot = todayActiveMMUnitsPerMMSlot; }
public WeatherModell(MultiMedia multiMediaDb) { MultiMediaDb = multiMediaDb; MultiMediaDb.LoadAll_IfHasNotBeenLoaded(); List<Guid> idsForPictureGroups = MultiMediaDb.MMPictureSources.Get_via_GroupId("Weather") .Select(sel => sel.Id).ToList(); WeatherPictures = MultiMediaDb.MMPictures.Load_All_ShortData_for_PictureSourceIds (idsForPictureGroups); }
public RefreshWeather(MultiMedia multiMediaDb, int numberOfNonPurgedMMUnits = 3, double requiredWeatherDuration = 0) { if (requiredWeatherDuration != 0) RequiredWeatherDuration = requiredWeatherDuration; if (numberOfNonPurgedMMUnits != 3) NumberOfNonPurgedMMUnits = numberOfNonPurgedMMUnits; MultiMediaDb = multiMediaDb; WeatherModell = new WeatherModell(MultiMediaDb); }
public DistributionRoot(MultiMedia multiMediaDb, DateTime targetDate, DateTime? toDate = null, bool runAsFullClient = false) { this.MultiMediaDb = multiMediaDb; RunAsFullClient = runAsFullClient; MultiMediaDb.DefaultRangeFrom = targetDate; if (toDate != null) MultiMediaDb.DefaultRangeTo = (DateTime) toDate; else MultiMediaDb.DefaultRangeTo = MultiMediaDb.DefaultRangeFrom.AddDays(1); }
/// <summary> /// Generates a complete new ring into the provided <paramref name="ring" /> dataset. This should produce a complete 24 hour active ring which has no /// other logic then playing the right things at the right time, independet of the past. /// </summary> /// <param name="db">The source database</param> /// <param name="computerName">The name of the computer this ring is generated for.</param> /// <param name="ring">The target ring where all the generated data should be inserted at.</param> /// <remarks> /// Things which need to be done: /// <para>Set <see cref="RingMetaData.SenderId" /> to the targeting sender id.</para> /// <para>Generate <see cref="PageGroup" />s inside the database.</para> /// <para> /// Generate <see cref="Page" />s with the associated content (<see cref="Text" />, <see cref="Image" /> <see cref="Video" />, /// <see cref="DoubleTransition" />). /// </para> /// <para> /// Generate <see cref="PageSchedule" />s. <see cref="PageSchedule" />s in sequence which belongs to the same <see cref="PageGroup" /> needs to /// have the same <see cref="PageSchedule.PageGroupScheduleId" />. /// </para> /// </remarks> public void Generate(MultiMedia db, string computerName, RingMetaData ring) { MMSender sender = GetMMSenderFromSenderOrComputerName(db, computerName); ring.SenderId = sender.Id; sender.DataSet.SetHasBeenLoaded(); DistributionRoot DistributionRootInstance = new DistributionRoot(db,ring.TargetDate); DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded(); BalancerUsage balancerUsage = new BalancerUsage(sender, ring, ring.TargetDate) { TodaysActiveMMUnitsPerMMSlot = DistributionRootInstance.TodayActiveMMUnitsPerMMSlot }; balancerUsage.LoadActuallBalancers(sender); RingGenerator ringGenerator = new RingGenerator(sender, ring, ring.TargetDate) { DistributionRootInstance = DistributionRootInstance, TodaysBalancers = balancerUsage.TodaysBalancersPerSender[sender] }; ringGenerator.Generate(); }
private static MultiMedia LoadAndDeSerialize() { lock (lockObject) { FileInfo SerializedParameter = new FileInfo($"\\\\{ComputerName}\\WPMediaSender\\RuntimeParameter.ser"); MultiMedia multiMediaDb = new MultiMedia(); foreach (DataTable dataTable in SerializedParameter.LoadAs_Object_From_SerializedBinary<DataSet>().Tables) { CsDbTable mmTable = multiMediaDb.GetTableByName(dataTable.TableName); mmTable.Merge(dataTable); } multiMediaDb.SetHasBeenLoaded(); return multiMediaDb; } }
public MMUnitExtensions(MultiMedia mmDataContext, bool doFileCopy) { DoFileCopy = doFileCopy; this.MMDataContext = mmDataContext; }
public RingUpdater(RingPlayerDb ringPlayerDb, MultiMedia sourceDatabase) { Player = ringPlayerDb; MultimediaDb = sourceDatabase; }
public ProgrammSchemaModell(MultiMedia db = null) { HasBeenInitialized = false; if (db != null) { dataContext = db; DistributionRootInstance.MultiMediaDb = db; } else { dataContext = Data.DbServer3.MultiMedia; Data.DbServer3_Connect_Direct(); } }
public void Initialize(MultiMedia db) { db.LoadAll(); //DistributionRoot DistributionRootInstance = new DistributionRoot(db, TargetRing); //DistributionRootInstance DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded(); }
public Stream GetImageStream(MultiMedia db, Guid imageId) { byte[] data = (byte[]) db.DbProxy.ExecuteCommand( $"SELECT {MMPicturesTable.ValueCol} FROM {MMPicturesTable.NativeName} WHERE {MMPicturesTable.IdCol} = '{imageId}'") .Rows[0][0]; return new MemoryStream(data); //var bytes = new MemoryStream(); //MMPicture picture = db.MMPictures.FindOrLoad(imageId); //if (picture == null) // throw new KeyNotFoundException($"Für die ImageId {imageId} konnte kein Eintrag in der Datenbank gefunden werden"); //return new MemoryStream(picture.Value); }
public FileInfo GetVideoFilePath(MultiMedia db, Guid id) { MMVideo video = db.MMVideos.FindOrLoad(id); if (video == null) throw new KeyNotFoundException($"Für die VideoId {id} konnte kein Eintrag in der Datenbank gefunden werden"); if (String.IsNullOrEmpty(video.PlayerBestFittingSourceReference)) throw new FileNotFoundException($"Der VideoFile {video.PlayerBestFittingSourceReference} ist nicht vorbereitet"); return VisualBasics.GetPlayerArchiveFileInfo(video.OriginalDirectoryNameReference, video.PlayerBestFittingSourceReference); }
public FileInfo GetImageFilePath(MultiMedia db, Guid id) { MMPicture picture = db.MMPictures.FindOrLoad(id); if (picture == null) throw new KeyNotFoundException($"Für die ImageId {id} konnte kein Eintrag in der Datenbank gefunden werden"); if (String.IsNullOrEmpty(picture.PlayerFileNameReference)) throw new FileNotFoundException($"Der ImageFile {picture.PlayerFileNameReference} ist nicht vorbereitet"); return VisualBasics.GetCentralCacheFileInfo(picture.PlayerFileNameReference); }
private MMSender GetMMSenderFromSenderOrComputerName(MultiMedia multiMedia, String senderOrComputerName) { MMPlayer player = multiMedia.MMPlayers.FindOrLoad_via_NameId(senderOrComputerName); if (player != null) return player.MMSender; MMSender sender = multiMedia.MMSenders.FindOrLoad_via_NameId(senderOrComputerName); if (sender != null) return sender; return multiMedia.MMSenders.FindOrLoad_via_NameId("WohnPark"); }
/// <summary> /// Loads the complete data bundle of the current row into a target data set. /// <para>A data bundle is defined as a set of all rows inside a database which are connected via relations.</para> /// <para>The currently selected row is the root of the bundle</para> /// </summary> public void Copy_BundledData_Into_DataSet(MultiMedia target) { base.Copy_BundledData_Into_DataSet(target); }
public Forecast(MultiMedia multiMediaDb, String city, XmlNode forecastNode, DateTime dateReaded, DateTime versionFrom) { MultiMediaDb = multiMediaDb; ForecastNode = forecastNode; City = city; DateReaded = dateReaded; VersionFrom = versionFrom; }