这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2f274bb
Merge pull request #1 from xibosignage/develop
dasgarner Feb 28, 2015
747906e
Built 1.7.1
dasgarner Feb 28, 2015
73f9162
1.7.1 Scr
dasgarner Feb 28, 2015
fafd0cb
Call PerformLayout when disposing the videoplayer to remove cached la…
dasgarner Mar 2, 2015
3bcc89e
Wrote a new LogAgent thread to manage sending stat and log files. Red…
dasgarner Mar 3, 2015
acb63fd
Adjust screenshot to use active form bounds.
dasgarner Mar 4, 2015
ebb42fc
Separate calls for stat/log (regression, not released)
dasgarner Mar 11, 2015
8d31089
Complicated commit. Patch to ensure that media without an update inte…
dasgarner Mar 11, 2015
1eb5b00
Change update interval comparison to AddMinutes rather than AddHours …
dasgarner Mar 11, 2015
c9f7cee
Modify the message filter to be aware of use in screen saver mode. Sh…
dasgarner Mar 12, 2015
eac4f29
Fixed an issue where the screen shot wasn't correctly taken (active f…
dasgarner Mar 12, 2015
bb78736
Fixed screen saver not closing on keyboard entry (and being unreliabl…
dasgarner Mar 13, 2015
4e2de31
Implemented Download Window for Required Files.
dasgarner Mar 13, 2015
053a440
Update SCR
dasgarner Mar 13, 2015
6cb6ae1
Merge pull request #9 from dasgarner/develop
dasgarner Mar 13, 2015
0f23db6
Used global keyboard and mouse listener when running as a screensaver.
dasgarner Mar 14, 2015
1c05105
Built for 1.7.2 release.
dasgarner Mar 16, 2015
0229d90
Merge pull request #10 from dasgarner/develop
dasgarner Mar 16, 2015
d34f56f
1.7.2 scr
dasgarner Mar 16, 2015
6003a98
Merge pull request #11 from dasgarner/develop
dasgarner Mar 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Control/Region.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,22 @@ private void ParseOptionsForMediaNode(XmlNode mediaNode, XmlAttributeCollection
}
}

// Media Types without an update interval should be set to something rather high
// Media Types without an update interval should have a sensible default (xibosignage/xibo#404)
// This means that items which do not provide an update interval will still refresh.
if (!updateIntervalProvided)
_options.updateInterval = int.MaxValue;
{
// Special handling for text/webpages because we know they should never have a default update interval applied
if (_options.type == "webpage" || _options.type == "text")
{
// Very high (will expire eventually, but shouldn't cause a routine request for a new resource
_options.updateInterval = int.MaxValue;
}
else
{
// Default to 5 minutes for those items that do not provide an update interval
_options.updateInterval = 5;
}
}
}

/// <summary>
Expand Down Expand Up @@ -662,6 +675,7 @@ protected override void Dispose(bool disposing)
{
try
{
_media.DurationElapsedEvent -= media_DurationElapsedEvent;
_media.Dispose();
_media = null;

Expand Down
16 changes: 0 additions & 16 deletions Forms/OptionForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,6 @@ public OptionForm()

// XMDS completed event
xmds1.RegisterDisplayCompleted += new XiboClient.xmds.RegisterDisplayCompletedEventHandler(xmds1_RegisterDisplayCompleted);

// Library Path
if (ApplicationSettings.Default.LibraryPath == "DEFAULT")
{
Debug.WriteLine("Getting the Library Path", "OptionForm");
ApplicationSettings.Default.LibraryPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Xibo Library";
ApplicationSettings.Default.Save();
}

// Computer name if the display name hasnt been set yet
if (ApplicationSettings.Default.DisplayName == "COMPUTERNAME")
{
Debug.WriteLine("Getting the display Name", "OptionForm");
ApplicationSettings.Default.DisplayName = Environment.MachineName;
ApplicationSettings.Default.Save();
}

// Set global proxy information
OptionForm.SetGlobalProxy();
Expand Down
78 changes: 0 additions & 78 deletions Log/StatLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ public void Flush()
// Flush to File
FlushToFile();

// See if there are any records to flush to XMDS
Thread logSubmit = new Thread(new ThreadStart(ProcessQueueToXmds));
logSubmit.Start();

Debug.WriteLine(new LogMessage("Flush", String.Format("OUT")), LogType.Audit.ToString());
}

Expand Down Expand Up @@ -189,80 +185,6 @@ private void FlushToFile()

Debug.WriteLine(new LogMessage("FlushToFile", String.Format("OUT")), LogType.Audit.ToString());
}

/// <summary>
/// Send the Stats to XMDS
/// </summary>
private void ProcessQueueToXmds()
{
try
{
// If we haven't had a successful connection recently, then don't log
if (ApplicationSettings.Default.XmdsLastConnection.AddSeconds((int)ApplicationSettings.Default.CollectInterval) < DateTime.Now)
return;

lock (_locker)
{
// Get a list of all the log files waiting to be sent to XMDS.
string[] logFiles = Directory.GetFiles(ApplicationSettings.Default.LibraryPath, "*" + ApplicationSettings.Default.StatsLogFile + "*");

// Track processed files
int filesProcessed = 0;

// Loop through each file
foreach (string fileName in logFiles)
{
// Only process as many files in one go as configured
if (filesProcessed >= ApplicationSettings.Default.MaxLogFileUploads)
break;

// If we have some, create an XMDS object
using (xmds.xmds logtoXmds = new xmds.xmds())
{
logtoXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds;

// construct the log message
StringBuilder builder = new StringBuilder();
builder.Append("<log>");

foreach (string entry in File.ReadAllLines(fileName))
builder.Append(entry);

builder.Append("</log>");

try
{
logtoXmds.SubmitStats(ApplicationSettings.Default.ServerKey, _hardwareKey.Key, builder.ToString());

// Delete the file we are on
File.Delete(fileName);
}
catch (WebException webEx)
{
// Increment the quantity of XMDS failures and bail out
ApplicationSettings.Default.IncrementXmdsErrorCount();

// Log this message, but dont abort the thread
Trace.WriteLine(new LogMessage("ProcessQueueToXmds", "WebException: " + webEx.Message), LogType.Error.ToString());

// Drop out the loop
break;
}
catch (Exception e)
{
Trace.WriteLine(new LogMessage("FlushToXmds", string.Format("Exception when submitting to XMDS: {0}", e.Message)), LogType.Error.ToString());
}

filesProcessed++;
}
}
}
}
catch (Exception e)
{
Trace.WriteLine(new LogMessage("FlushToXmds", string.Format("Unknown Exception: {0}", e.Message)), LogType.Error.ToString());
}
}
}

class Stat
Expand Down
79 changes: 0 additions & 79 deletions Log/XiboTraceListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,81 +142,6 @@ private void FlushToFile()
}
}

/// <summary>
/// Flush the log to XMDS
/// </summary>
public void ProcessQueueToXmds()
{
try
{
// If we haven't had a successful connection recently, then don't log
if (ApplicationSettings.Default.XmdsLastConnection.AddSeconds((int)ApplicationSettings.Default.CollectInterval) < DateTime.Now)
return;

lock (_locker)
{
// Get a list of all the log files waiting to be sent to XMDS.
string[] logFiles = Directory.GetFiles(ApplicationSettings.Default.LibraryPath, "*" + ApplicationSettings.Default.LogLocation + "*");

// Track processed files
int filesProcessed = 0;

// Loop through each file
foreach (string fileName in logFiles)
{
// Only process as many files in one go as configured
if (filesProcessed >= ApplicationSettings.Default.MaxLogFileUploads)
break;

// If we have some, create an XMDS object
using (xmds.xmds logtoXmds = new xmds.xmds())
{
logtoXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds;

// construct the log message
StringBuilder builder = new StringBuilder();
builder.Append("<log>");

foreach (string entry in File.ReadAllLines(fileName))
builder.Append(entry);

builder.Append("</log>");

try
{
logtoXmds.SubmitLog(ApplicationSettings.Default.ServerKey, _hardwareKey.Key, builder.ToString());

// Delete the file we are on
File.Delete(fileName);
}
catch (WebException webEx)
{
// Increment the quantity of XMDS failures and bail out
ApplicationSettings.Default.IncrementXmdsErrorCount();

// Log this message, but dont abort the thread
Trace.WriteLine(new LogMessage("ProcessQueueToXmds", "WebException: " + webEx.Message), LogType.Error.ToString());

// Drop out the loop
break;
}
catch (Exception e)
{
Trace.WriteLine(new LogMessage("ProcessQueueToXmds", string.Format("Exception when submitting to XMDS: {0}", e.Message)), LogType.Error.ToString());
}

filesProcessed++;
}
}
}
}
catch (Exception e)
{
// Do nothing - we just have an unknown exception in logging
Trace.WriteLine(new LogMessage("ProcessQueueToXmds", string.Format("Unknown Exception: {0}", e.Message)), LogType.Error.ToString());
}
}

public override void Write(string message)
{
AddToCollection(message, LogType.Audit.ToString());
Expand Down Expand Up @@ -296,10 +221,6 @@ public override void Flush()
return;

FlushToFile();

// See if there are any records to flush to XMDS
Thread logSubmit = new Thread(new ThreadStart(ProcessQueueToXmds));
logSubmit.Start();
}
}

Expand Down
81 changes: 76 additions & 5 deletions Logic/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -36,14 +37,16 @@ public class ApplicationSettings
private static string _default = "default";

// Application Specific Settings we want to protect
private string _clientVersion = "1.7.1";
private string _clientVersion = "1.7.2";
private string _version = "4";
private int _clientCodeVersion = 105;
private int _clientCodeVersion = 106;

public string ClientVersion { get { return _clientVersion; } }
public string Version { get { return _version; } }
public int ClientCodeVersion { get { return _clientCodeVersion; } }

private static readonly DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

public static ApplicationSettings Default
{
get
Expand Down Expand Up @@ -136,10 +139,14 @@ public object this[string propertyName]
public string RequiredFilesFile { get; set; }
public string VideoRenderingEngine { get; set; }

public string LibraryPath { get; set; }
private string _libraryPath;
public string LibraryPath { get { return (_libraryPath == "DEFAULT") ? (Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + Application.ProductName + " Library") : _libraryPath; } set { _libraryPath = value; } }
public string XiboClient_xmds_xmds { get; set; }
public string ServerKey { get; set; }
public string DisplayName { get; set; }

private string _displayName;
public string DisplayName { get { return (_displayName == "COMPUTERNAME") ? Environment.MachineName : _displayName; } set { _displayName = value; } }

public string ServerUri { get; set; }
public string ProxyUser { get; set; }
public string ProxyPassword { get; set; }
Expand All @@ -154,6 +161,56 @@ public object this[string propertyName]
public string CursorStartPosition { get; set; }
public string ClientInformationKeyCode { get; set; }

// Download window

public long DownloadStartWindow { get; set; }
public long DownloadEndWindow { get; set; }

public DateTime DownloadStartWindowTime
{
get
{
DateTime now = DateTime.Now;
DateTime start = unixEpoch.AddMilliseconds(DownloadStartWindow);

// Reset to today
return new DateTime(now.Year, now.Month, now.Day, start.Hour, start.Minute, start.Second);
}
}

public DateTime DownloadEndWindowTime
{
get
{
DateTime now = DateTime.Now;
DateTime end = unixEpoch.AddMilliseconds(DownloadEndWindow);

// Reset to today
return new DateTime(now.Year, now.Month, now.Day, end.Hour, end.Minute, end.Second);
}
}

/// <summary>
/// Is the player in the download window
/// </summary>
public bool InDownloadWindow
{
get
{
try
{
if (DownloadStartWindow == 0 && DownloadEndWindow == 0)
return true;

return (DownloadStartWindowTime <= DateTime.Now && DownloadEndWindowTime >= DateTime.Now);
}
catch
{
return true;
}
}
}

public int Licensed { get; set; }
public int StatsFlushCount { get; set; }
public int CollectInterval { get; set; }
Expand All @@ -173,7 +230,21 @@ public object this[string propertyName]
public bool ClientInfomationCtrlKey { get; set; }
public bool UseCefWebBrowser { get; set; }
public bool SendCurrentLayoutAsStatusUpdate { get; set; }
public bool ScreenShotRequested { get; set; }

private bool _screenShotRequested = false;
public bool ScreenShotRequested
{
get
{
return _screenShotRequested;
}
set
{
_screenShotRequested = value;
// Reset the Hash so that the next update is taken into account.
Hash = "0";
}
}

// XMDS Status Flags
private DateTime _xmdsLastConnection;
Expand Down
Loading