aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs6
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs26
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj3
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml13
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml15
5 files changed, 56 insertions, 7 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs
index 6d771099a..2bcdac8b4 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs
+++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs
@@ -6,14 +6,18 @@ using System.Threading.Tasks;
namespace Tango.CodeGeneration
{
- public class ProtoMessageFile : Class
+ public class ProtoMessageFile : CodeObject
{
+ public String Name { get; set; }
public String Package { get; set; }
public List<String> Imports { get; set; }
+ public List<ProtoProperty> Properties { get; set; }
+
public ProtoMessageFile()
{
Imports = new List<string>();
+ Properties = new List<ProtoProperty>();
}
}
}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs
new file mode 100644
index 000000000..d63348b6b
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.CodeGeneration
+{
+ public class ProtoProperty : Property
+ {
+ public bool Repeated { get; set; }
+
+ public String Description { get; set; }
+
+ public ProtoProperty()
+ {
+
+ }
+
+ public ProtoProperty(String name, String type) : this()
+ {
+ Name = name;
+ Type = type;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
index d622bd6a0..3c6c9d085 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
@@ -28,7 +28,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\Build\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -70,6 +70,7 @@
<Compile Include="ObservablesContextCodeFile.cs" />
<Compile Include="ProtoEnumFile.cs" />
<Compile Include="ProtoMessageFile.cs" />
+ <Compile Include="ProtoProperty.cs" />
<Compile Include="TangoDAOJavaFile.cs" />
<Compile Include="EnumerationFileJava.cs" />
<Compile Include="EnumerationFile.cs" />
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml
index 790e5dd93..d659a028e 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml
@@ -1,6 +1,14 @@
-syntax = "proto3";
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Tango PMR Generator
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated. Do not modify!
+// </auto-generated>
+//------------------------------------------------------------------------------
-//This file is auto-generated. Do not modify!
+syntax = "proto3";
@foreach (var import in Model.Imports)
{
@@ -17,6 +25,7 @@ enum @(Model.Name)
@foreach (var prop in Model.Fields)
{
<div>
+ @(prop.Description != null ? ("//" + prop.Description) : "")
@(prop.Name) = @(prop.Value);
</div>
}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml
index 7452db6e6..c1aa28fb1 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml
@@ -1,6 +1,14 @@
-syntax = "proto3";
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Tango PMR Generator
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated. Do not modify!
+// </auto-generated>
+//------------------------------------------------------------------------------
-//This file is auto-generated. Do not modify!
+syntax = "proto3";
@foreach (var import in Model.Imports)
{
@@ -18,7 +26,8 @@ message @(Model.Name)
@for (int i = 0; i < Model.Properties.Count; i++)
{
<div>
- @(Model.Properties[i].Type) @(Model.Properties[i].Name) = @(i + 1);
+ @(Model.Properties[i].Description != null ? ("//" + Model.Properties[i].Description) : "")
+ @(Model.Properties[i].Repeated ? "repeated" : "") @(Model.Properties[i].Type) @(Model.Properties[i].Name) = @(i + 1);
</div>
}
}