EDA - StoragePaths

This commit is contained in:
Mike Phares 2022-05-17 08:29:19 -07:00
parent 0a2f97fd93
commit fd7fad62fb
4 changed files with 16 additions and 30 deletions

View File

@ -675,7 +675,6 @@ public class Background : Models.Properties.IBackground, IBackground, IDisposabl
string? modifiedDate;
string edaObjectFile;
string goldDirectory;
string unitDirectory;
string replace = "$$$";
string edaObjectDirectory;
DateTime lastModifiedDate;
@ -791,28 +790,15 @@ public class Background : Models.Properties.IBackground, IBackground, IDisposabl
{ File.SetCreationTime(fileName, lastModifiedDate); File.SetLastWriteTime(fileName, lastModifiedDate); }
catch (Exception) { }
}
if (string.IsNullOrEmpty(configuration.Settings.StoragePath) || !Directory.Exists(Path.GetPathRoot(configuration.Settings.StoragePath)))
if (!common.StoragePaths.Any())
continue;
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
if (!common.StoragePath.Contains(common.UnitName) && (common.StoragePath.Contains(@"01EquipmentIntegration") || common.StoragePath.Contains(@"02BusinessIntegration")))
foreach (string? storagePath in common.StoragePaths)
{
common.StoragePath = common.StoragePath.Replace("Traces", "Empty");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
if (common.UnitName != "PRF01")
{
unitDirectory = string.Concat(Path.GetDirectoryName(common.StoragePath), @"\", common.UnitName);
common.StoragePath = string.Concat(unitDirectory, @"\BadPath");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
common.StoragePath = string.Concat(unitDirectory, @"\LogFile");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
common.StoragePath = string.Concat(unitDirectory, @"\PollPath");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
}
if (string.IsNullOrEmpty(storagePath) || !Directory.Exists(Path.GetPathRoot(storagePath)))
continue;
if (Directory.Exists(storagePath))
continue;
_ = Directory.CreateDirectory(storagePath);
}
}
}

View File

@ -52,7 +52,7 @@ public partial class PDSFConfigurationSettings
private PDSFConfigurationSettingsTimePrevDiffSettings timePrevDiffSettingsField;
private string storagePathField;
private string[] storagePathsField;
private string filenameField;
@ -122,10 +122,10 @@ public partial class PDSFConfigurationSettings
}
/// <remarks/>
public string StoragePath
public string[] StoragePaths
{
get => this.storagePathField;
set => this.storagePathField = value;
get => this.storagePathsField;
set => this.storagePathsField = value;
}
/// <remarks/>

View File

@ -40,7 +40,7 @@ public partial class Background
_ = result.Append("<td nowrap>").Append(common.ConfigurationProductiveState).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.LogisticsEquipmentAlias).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.Source).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.StoragePath).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(string.Join("</br >", common.StoragePaths)).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.StartTimeFormat).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.Filename).AppendLine("</td>");
_ = result.AppendLine("</tr>");

View File

@ -14,7 +14,7 @@ public class Common
//
public string Filename { get; set; }
public string StartTimeFormat { get; set; }
public string StoragePath { get; set; }
public string[] StoragePaths { get; set; }
//
public List<string[]> GeneralTriggers { get; set; }
public List<string[]> LogisticsAttributes { get; set; }
@ -42,12 +42,12 @@ public class Common
LogisticsColumns = new();
StartTriggersDCP = new();
LogisticsTriggers = new();
StoragePath = string.Empty;
LogisticsAttributes = new();
ContainerName = string.Empty;
ParametersAsCsv = string.Empty;
StartTimeFormat = string.Empty;
ConfigurationState = string.Empty;
StoragePaths = Array.Empty<string>();
LogisticsEquipmentAlias = string.Empty;
ConfigurationProductiveState = string.Empty;
LogisticsTriggersKeysKeyMapping = new Dictionary<int, string[]>();
@ -65,11 +65,11 @@ public class Common
LogisticsColumns = new();
StartTriggersDCP = new();
LogisticsTriggers = new();
StoragePath = string.Empty;
LogisticsAttributes = new();
ParametersAsCsv = string.Empty;
StartTimeFormat = string.Empty;
UnitName = unitName.ToString();
StoragePaths = Array.Empty<string>();
LogisticsEquipmentAlias = string.Empty;
ContainerName = containerName.ToString();
ConfigurationState = configurationState.ToString();
@ -80,7 +80,7 @@ public class Common
public void Update(PDSFConfiguration configuration)
{
StoragePath = configuration.Settings.StoragePath;
StoragePaths = configuration.Settings.StoragePaths;
StartTimeFormat = configuration.Settings.StartTimeFormat;
Filename = configuration.Settings.Filename;
//