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

View File

@ -52,7 +52,7 @@ public partial class PDSFConfigurationSettings
private PDSFConfigurationSettingsTimePrevDiffSettings timePrevDiffSettingsField; private PDSFConfigurationSettingsTimePrevDiffSettings timePrevDiffSettingsField;
private string storagePathField; private string[] storagePathsField;
private string filenameField; private string filenameField;
@ -122,10 +122,10 @@ public partial class PDSFConfigurationSettings
} }
/// <remarks/> /// <remarks/>
public string StoragePath public string[] StoragePaths
{ {
get => this.storagePathField; get => this.storagePathsField;
set => this.storagePathField = value; set => this.storagePathsField = value;
} }
/// <remarks/> /// <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.ConfigurationProductiveState).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.LogisticsEquipmentAlias).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.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.StartTimeFormat).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.Filename).AppendLine("</td>"); _ = result.Append("<td nowrap>").Append(common.Filename).AppendLine("</td>");
_ = result.AppendLine("</tr>"); _ = result.AppendLine("</tr>");

View File

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