Skip to content

Commit

Permalink
Merge pull request #21 from xibosignage/develop
Browse files Browse the repository at this point in the history
Release 1.7.5
  • Loading branch information
dasgarner committed Nov 5, 2015
2 parents 202912b + 7fdd25a commit ad2484c
Show file tree
Hide file tree
Showing 22 changed files with 361 additions and 108 deletions.
207 changes: 205 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,205 @@
obj/
bin/Debug/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt
20 changes: 16 additions & 4 deletions Logic/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public class ApplicationSettings
private static string _default = "default";

// Application Specific Settings we want to protect
private string _clientVersion = "1.7.4";
private string _clientVersion = "1.7.5";
private string _version = "4";
private int _clientCodeVersion = 108;
private int _clientCodeVersion = 109;

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);
private static readonly DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local);

public static ApplicationSettings Default
{
Expand Down Expand Up @@ -121,6 +121,7 @@ public object this[string propertyName]
}

public int XmdsResetTimeout { get; set; }
public double CmsTimeOffset { get; set; }

public decimal SizeX { get; set; }
public decimal SizeY { get; set; }
Expand Down Expand Up @@ -173,9 +174,14 @@ public DateTime DownloadStartWindowTime
// Get the local time now and add our Unix timestamp to it.
// We know that the DownloadStartWindow is saved in UTC (GMT to be precise, but no biggie)
DateTime now = DateTime.Now;
DateTime start = unixEpoch.AddMilliseconds(DownloadStartWindow);

// start is now UTC download window start.
DateTime start = unixEpoch.AddMilliseconds(DownloadStartWindow);
if (CmsTimeOffset != null && CmsTimeOffset != 0)
{
// Adjust for the timezone
start = start.AddHours(CmsTimeOffset);
}

// Reset to local time, using the H:m:i from the Unix Time.
// This gives us a local time
Expand All @@ -191,6 +197,12 @@ public DateTime DownloadEndWindowTime
DateTime now = DateTime.Now;
DateTime end = unixEpoch.AddMilliseconds(DownloadEndWindow);

if (CmsTimeOffset != null && CmsTimeOffset != 0)
{
// Adjust for the timezone
end = end.AddHours(CmsTimeOffset);
}

// Reset to today
return new DateTime(now.Year, now.Month, now.Day, end.Hour, end.Minute, end.Second, DateTimeKind.Local);
}
Expand Down
2 changes: 1 addition & 1 deletion Logic/CacheManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public bool IsValidLayout(string layoutFile)
case "video":
case "image":
case "flash":
case "ppt":
case "powerpoint":

// Get the path and see if its
if (!IsValidPath(GetUri(media)))
Expand Down
23 changes: 22 additions & 1 deletion Logic/ScheduleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ private Collection<LayoutSchedule> LoadNewSchdule()
continue;
}

// Check dependents
foreach (string dependent in layout.Dependents)
{
if (!_cacheManager.IsValidPath(dependent))
{
Trace.WriteLine(new LogMessage("ScheduleManager - LoadNewSchedule", "Layout has invalid dependent: " + dependent), LogType.Info.ToString());
continue;
}
}

// If this is the default, skip it
if (layout.NodeName == "default")
{
Expand Down Expand Up @@ -388,6 +398,15 @@ private void LoadScheduleFromFile()

// Add it to the layout schedule
if (scheduleId != "") temp.scheduleid = int.Parse(scheduleId);

// Dependents
if (attributes["dependents"] != null)
{
foreach (string dependent in attributes["dependents"].Value.Split(','))
{
temp.Dependents.Add(dependent);
}
}
}

_layoutSchedule.Add(temp);
Expand Down Expand Up @@ -522,7 +541,7 @@ private string LayoutsInSchedule()
/// A LayoutSchedule
/// </summary>
[Serializable]
public struct LayoutSchedule
public class LayoutSchedule
{
public string NodeName;
public string layoutFile;
Expand All @@ -533,5 +552,7 @@ public struct LayoutSchedule

public DateTime FromDt;
public DateTime ToDt;

public List<string> Dependents = new List<string>();
}
}
27 changes: 19 additions & 8 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,28 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
// We want to tidy up some stuff as this form closes.
Trace.Listeners.Remove("ClientInfo TraceListener");

// Close the client info screen
_clientInfoForm.Hide();
try
{
// Close the client info screen
if (_clientInfoForm != null)
_clientInfoForm.Hide();

// Stop the schedule object
_schedule.Stop();
// Stop the schedule object
if (_schedule != null)
_schedule.Stop();

// Flush the stats
_statLog.Flush();
// Flush the stats
if (_statLog != null)
_statLog.Flush();

// Write the CacheManager to disk
_cacheManager.WriteCacheManager();
// Write the CacheManager to disk
if (_cacheManager != null)
_cacheManager.WriteCacheManager();
}
catch (NullReferenceException)
{
// Stopped before we really started, nothing to do
}

// Flush the logs
Trace.Flush();
Expand Down
Loading

0 comments on commit ad2484c

Please sign in to comment.