Skip to content

Commit

Permalink
Add verbose to exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Kollinger committed Jul 31, 2023
1 parent 6113c0d commit ade3ab1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/ExcelExporter/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ where colorAttr.Value is Color

foreach (var attributeInfo in obj.GetAttributeInfos().Where(attributeInfo => definedAttributes == null || fullName + attributeInfo.Name == "Name" || definedAttributes.Find(x => x == fullName + attributeInfo.Name) != null))
{
Console.WriteLine(attributeInfo);
var test = obj.GetAttribute(attributeInfo.Name);
Console.WriteLine(test);
if (Program.verbose)
{
Console.WriteLine(attributeInfo);
var test = obj.GetAttribute(attributeInfo.Name);
Console.WriteLine(test);
}
}

if (!(obj is MultilingualText))
Expand Down
9 changes: 8 additions & 1 deletion src/ExcelExporter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace ExcelExporter
class Program
{
static string opennessDll;
static public bool verbose = false;
static private Assembly DomainAssemblyResolver(object sender, ResolveEventArgs args)
{
int index = args.Name.IndexOf("Siemens.Engineering,");
Expand Down Expand Up @@ -51,6 +52,7 @@ static void Work(string[] args)
Console.WriteLine("Please define a screen name (or set -all to export all screens):");
Console.WriteLine("If you want to export only defined attributes, please start this tool again with arguments like this: ");
Console.WriteLine("HMI_Panel/Screen_1 Left Top Authorization");
Console.WriteLine("You can also add the verbose flag like this for more output: HMI_Panel/Screen_1 Left Top Authorization --verbose");
args = Console.ReadLine().Split(' ');
}

Expand All @@ -68,6 +70,11 @@ static void Work(string[] args)
if (args.Length > 1)
{
definedAttributes = args.ToList();
if (definedAttributes.Contains("--verbose"))
{
verbose = true;
definedAttributes.Remove("--verbose");
}
definedAttributes.RemoveAt(0); // remove first input (Runtime/screenname)
setProperties = true;
}
Expand Down Expand Up @@ -212,7 +219,7 @@ private static List<Dictionary<string, object>> GetDifferences(List<Dictionary<s
}
else
{
Console.WriteLine(defaultObject.ToString());
if (verbose) Console.WriteLine(defaultObject.ToString());
var differencesScreenItem = new Dictionary<string, object>();
GetDifferencesScreenItem(attributes, defaultObject, ref differencesScreenItem);
differencesScreenItem.Add("Type", type); // type is always needed to create the object again
Expand Down

0 comments on commit ade3ab1

Please sign in to comment.