diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-01 12:01:46 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-01 12:01:46 +0200 |
| commit | 93e915dd3fc06ae20b29aa927966676b9f8b7c5a (patch) | |
| tree | f5c5d5e47513e474c68f295c6abd18f3d18a9c6b /Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI | |
| parent | 9823b433c62ed173671923c32ccccadc1d06c0bd (diff) | |
| download | Tango-93e915dd3fc06ae20b29aa927966676b9f8b7c5a.tar.gz Tango-93e915dd3fc06ae20b29aa927966676b9f8b7c5a.zip | |
Lots of work !
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs index 21ba63461..c78cdbf7a 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs @@ -31,6 +31,7 @@ namespace Tango.PMRGenerator.CLI GenerateLiquidTypes(db, pmrFolder); GenerateWindingMethods(db, pmrFolder); GenerateSpoolTypes(db, pmrFolder); + GenerateProcessParameters(db, pmrFolder); } Console.WriteLine("Done"); @@ -311,6 +312,23 @@ namespace Tango.PMRGenerator.CLI File.WriteAllText(Path.Combine(pmrFolder, "Printing", messageFile.Name + ".proto"), messageString); } + private static void GenerateProcessParameters(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Process Parameters..."); + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "ProcessParameters"; + messageFile.Package = "Tango.PMR.Printing"; + + foreach (var prop in typeof(ProcessParametersTable).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) + { + messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + } + + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Printing", messageFile.Name + ".proto"), messageString); + } + private static String CoercePropertyType(Type type) { if (type == typeof(bool)) |
