aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-16 17:05:56 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-16 17:05:56 +0300
commite47e602cd61bcca8eb7fbef40dc4aa8798510ccc (patch)
treeaed51794566ba837dcfcfb673e5d67b4ab716884 /Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs
parentf809df07060dc3a27167f68027eb03bdbc89221a (diff)
downloadTango-e47e602cd61bcca8eb7fbef40dc4aa8798510ccc.tar.gz
Tango-e47e602cd61bcca8eb7fbef40dc4aa8798510ccc.zip
Working on insights...
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs31
1 files changed, 30 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs
index c4c16b416..a86454e26 100644
--- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs
+++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs
@@ -56,6 +56,7 @@ namespace Tango.PMRGenerator.CLI
GenerateColorLabLiquidTypes(db, pmrFolder);
GenerateDiagnosticsValueComponents(db, pmrFolder);
GenerateDiagnosticsMonitors(db, pmrFolder);
+ GenerateInsightsMonitors(db, pmrFolder);
GenerateEventTypes(db, pmrFolder);
GenerateInterfaceIOs(db, pmrFolder);
}
@@ -641,7 +642,7 @@ namespace Tango.PMRGenerator.CLI
private static void GenerateDiagnosticsMonitors(ObservablesContext db, String pmrFolder)
{
- Console.WriteLine("Generating Monitors...");
+ Console.WriteLine("Generating Diagnostics Monitors...");
ProtoMessageFile messageFile = new ProtoMessageFile();
messageFile.Name = "DiagnosticsMonitors";
@@ -674,6 +675,34 @@ namespace Tango.PMRGenerator.CLI
File.WriteAllText(Path.Combine(pmrFolder, "Diagnostics", messageFile.Name + ".proto"), messageString);
}
+ private static void GenerateInsightsMonitors(ObservablesContext db, string pmrFolder)
+ {
+ Console.WriteLine("Generating Insights Monitors...");
+
+ ProtoMessageFile messageFile = new ProtoMessageFile();
+ messageFile.Name = "InsightsMonitors";
+ messageFile.Package = "Tango.PMR.Insights";
+
+ foreach (var monitor in db.TechMonitors.ToList().OrderBy(x => x.Code))
+ {
+ var prop = new ProtoProperty();
+ prop.Name = monitor.Name.Replace(" ", "");
+ prop.Description = monitor.Description;
+ prop.Type = "double";
+
+ if (monitor.MultiChannel)
+ {
+ prop.Repeated = true;
+ }
+
+ messageFile.Properties.Add(prop);
+ }
+
+ String messageString = messageFile.GenerateCode();
+
+ File.WriteAllText(Path.Combine(pmrFolder, "Insights", messageFile.Name + ".proto"), messageString);
+ }
+
private static void GenerateInterfaceIOs(ObservablesContext db, String pmrFolder)
{
Console.WriteLine("Generating Interface IOs...");