Skip to content

Commit 64de64b

Browse files
committed
0311
1 parent 5b9091d commit 64de64b

File tree

8 files changed

+20
-48
lines changed

8 files changed

+20
-48
lines changed

src/Kuka/CVEL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class CVEL : GH_Component
44
{
55
public CVEL()
6-
: base("Speed Approximation", "CVEL",
6+
: base("Speed approximation", "CVEL",
77
"Commands the robot to maintain defined speed percentage by zoning (Custom Command)\r\nShould be the first command if in a command group",
88
"Robots", "Commands")
99
{ }

src/Util/DeconstructTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public class DeconstructTool : GH_Component
44
{
5-
public DeconstructTool() : base("Deconstruct Tool", "DeTool", "Retrieves properties of an exsisting tool", "Robots", "Utility") { }
5+
public DeconstructTool() : base("Deconstruct tool", "DeTool", "Retrieves properties of an exsisting tool", "Robots", "Utility") { }
66
protected override Bitmap Icon => Properties.Resources.DeTool;
77
public override Guid ComponentGuid => new("753CDC90-7278-45C4-91D4-B476BA34D396");
88
readonly string tName = nameof(tName);

src/Util/DefineJoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class DefJoints : GH_Component, IGH_VariableParameterComponent
44
{
55
public DefJoints()
6-
: base("Define Joints", "DefJoints",
6+
: base("Define joints", "DefJoints",
77
"Define joint angle of each axis of the robot in degrees and outputs it as string of radians",
88
"Robots", "Utility")
99
{ }

src/Util/LoadCommand.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ namespace RobotsExtended.Util
55
{
66
public class LoadCommand : GH_Component
77
{
8-
public LoadCommand() : base("Load Command", "Com", "Load predefined commands on the xml config", "Robots", "Utility") { }
8+
public LoadCommand() : base("Load command", "Com", "Load predefined commands on the xml config", "Robots", "Components") { }
99
public override Guid ComponentGuid => new("{56C786AD-B863-4D81-87FE-6B7F233295A1}");
1010
protected override Bitmap Icon => Properties.Resources.Command;
11-
private static readonly int _Type = 3;
1211

1312
protected override void RegisterInputParams(GH_InputParamManager pManager)
1413
{
@@ -121,7 +120,7 @@ static RC.Custom Load(string name, string val)
121120
var manu = command.Attribute(XName.Get("manufacturer"))?.Value;
122121
if (input == "true")
123122
{
124-
name += val;
123+
name += val ?? throw new Exception("Value (V) requires input");
125124
code = code.Replace("?", val);
126125
}
127126

src/Util/RenderColour.cs

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public RenderColour()
99
//{ }
1010
: base()
1111
{
12-
Name = "Render Colour";
12+
Name = "Render colour";
1313
NickName = "Colour";
14-
Description = "Creates colour list for custom preview";
14+
Description = "Adds colour to robot mesh";
1515
Category = "Robots";
1616
SubCategory = "Utility";
1717
}
@@ -53,7 +53,6 @@ protected override void BeforeSolveInstance()
5353
{
5454
_items = [];
5555
_boundingBox = BoundingBox.Empty;
56-
//meshes.Clear();
5756
//base.BeforeSolveInstance();
5857
}
5958
override protected void AfterSolveInstance()
@@ -141,68 +140,42 @@ void Append(GH_Mesh m, Color c)
141140
{
142141
if (!m.IsValid) return;
143142
GH_Material material = new(c);
144-
GH_CustomPreviewItem item = default;
145-
item.Geometry = m;
146-
item.Shader = material.Value;
147-
item.Colour = material.Value.Diffuse;
148-
item.Material = material;
143+
GH_CustomPreviewItem item = new()
144+
{
145+
Geometry = m,
146+
Shader = material.Value,
147+
Colour = material.Value.Diffuse,
148+
Material = material,
149+
};
149150
_items.Add(item);
150151
_boundingBox.Union(m.Boundingbox);
151152
}
152153
}
153154
public override void DrawViewportMeshes(IGH_PreviewArgs args)
154155
{
155-
if (this.Locked || _items.Count == 0 || args.Document.IsRenderMeshPipelineViewport(args.Display))
156+
if (this.Locked || _items.Count == 0)
156157
return;
157158
if (this.Attributes.Selected)
158159
{
159160
GH_PreviewMeshArgs args2 = new(args.Viewport, args.Display, args.ShadeMaterial_Selected, args.MeshingParameters);
160161
foreach (GH_CustomPreviewItem item in _items)
161162
item.Geometry.DrawViewportMeshes(args2);
162-
//for (int i = 0; i < meshes.Count; i++)
163-
// meshes[i].DrawViewportMeshes(args2);
164163
return;
165164
}
166165
foreach (GH_CustomPreviewItem item in _items)
167166
{
168167
GH_PreviewMeshArgs args2 = new(args.Viewport, args.Display, item.Shader, args.MeshingParameters);
169168
item.Geometry.DrawViewportMeshes(args2);
170169
}
171-
//for (int i = 0; i < meshes.Count; i++)
172-
//{
173-
// GH_PreviewMeshArgs args2 = new(args.Viewport, args.Display, new DisplayMaterial(colors[i]), args.MeshingParameters);
174-
// meshes[i].DrawViewportMeshes(args2);
175-
//}
176-
//for(int i = 0; i<meshes.Count; i++)
177-
// args.Display.DrawMeshShaded(meshes[i].Value, new DisplayMaterial(colors[i]));
178-
//base.DrawViewportMeshes(args);
179170
}
180-
//public void AppendCustomGeometry(GH_RenderArgs args)
181-
//{
182-
// if (_items == null || _items.Count == 0)
183-
// {
184-
// return;
185-
// }
186-
187-
// GH_Document gH_Document = OnPingDocument();
188-
// if (gH_Document != null && (gH_Document.PreviewMode == GH_PreviewMode.Disabled || _items.Count == 0 || gH_Document.PreviewMode == GH_PreviewMode.Wireframe))
189-
// return;
190171

191-
// foreach (var item in _items)
192-
// item.PushToRenderPipeline(args);
193-
//}
194-
195-
[Obsolete] // For Rhino 7
172+
[Obsolete]
196173
public override void AppendRenderGeometry(GH_RenderArgs args)
197174
{
198-
GH_Document gH_Document = OnPingDocument();
199-
if (gH_Document != null && (gH_Document.PreviewMode == GH_PreviewMode.Disabled || _items.Count == 0 || gH_Document.PreviewMode == GH_PreviewMode.Wireframe))
175+
if (_items != null || _items.Count == 0)
200176
return;
201177
foreach (var item in _items)
202178
item.PushToRenderPipeline(args);
203-
//args.Geomety.Add(item.Value,args.MaterialNormal);
204-
//base.AppendRenderGeometry(args);
205179
}
206-
207180
}
208181
}

src/Util/RobotLibrary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class RobotLibrary : GH_Component
55
public override Guid ComponentGuid => new("{73D053CD-4013-40D2-BE10-C62F999AB60C}");
66
override public GH_Exposure Exposure => GH_Exposure.secondary;
77
protected override Bitmap Icon => Properties.Resources.Library;
8-
public RobotLibrary() : base("Robot Library", "Library", "Double click to open Robot Library directory", "Robots", "Utility") { }
8+
public RobotLibrary() : base("Robot library", "Library", "Double click to open Robot Library directory", "Robots", "Utility") { }
99
bool Open = false;
1010
private static readonly string localPath = FileIO.LocalLibraryPath, downloadPath = FileIO.OnlineLibraryPath;
1111

src/Util/UpdateFrame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public class UpdateFrame : GH_Component
44
{
5-
public UpdateFrame() : base("Update Frame", "newBase", "Update frame info", "Robots", "Utility") { }
5+
public UpdateFrame() : base("Update frame", "newBase", "Update frame info", "Robots", "Utility") { }
66
public override Guid ComponentGuid => new("{3BAA462A-7D1B-401A-B789-2E12B878B6AD}");
77
protected override System.Drawing.Bitmap Icon => Properties.Resources.UpdateFrame;
88

src/Util/UpdateTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public class UpdateTool : GH_Component, IGH_VariableParameterComponent
44
{
5-
public UpdateTool() : base("Update Tool", "newTCP", "Update the TCP of an exsisting tool", "Robots", "Utility") { }
5+
public UpdateTool() : base("Update tool", "newTCP", "Update the TCP of an exsisting tool", "Robots", "Utility") { }
66
//public override GH_Exposure Exposure => GH_Exposure.hidden;
77
protected override System.Drawing.Bitmap Icon => Properties.Resources.UpdateTool;
88
public override Guid ComponentGuid => new("92915A29-8636-4670-B21C-756D681789E4");

0 commit comments

Comments
 (0)