-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathFileId.cs
31 lines (27 loc) · 1.08 KB
/
FileId.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Text;
namespace BppLib.CIDFile
{
///<summary>Class <c>FileId</c> models ID section in the CID program.</summary>
public class FileId
{
///<value> Property <c>FileName</c> represents the name of the CID program.</value>
public string FileName { get; set; } = "Panel";
///<value>Property <c>Rel</c> represents the release of CID programme.</value>
public string Rel { get; set; } = "3.0";
///<value>Property <c>Axis</c> represents the machine axes direction.</value>
public string Axis { get; set; } = "x+,y-,z-";
/// <summary>This method serializes an object as Cid code.</summary>
/// <returns>A string is coded as Cid code.</returns>
public string AsCidCode()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("BEGIN ID CID3");
sb.AppendLine("'\"" + FileName + "\"");
sb.AppendLine(" REL= " + Rel);
sb.AppendLine(" AXIS=" + Axis);
sb.Append("END ID");
return sb.ToString();
}
}
}