Recognize drawing numbers with dash symbol and letters on end.
This commit is contained in:
@@ -2,48 +2,48 @@
|
|||||||
|
|
||||||
namespace ExportDXF
|
namespace ExportDXF
|
||||||
{
|
{
|
||||||
public class DrawingInfo
|
public class DrawingInfo
|
||||||
{
|
{
|
||||||
public string JobNo { get; set; }
|
public string JobNo { get; set; }
|
||||||
|
|
||||||
public string DrawingNo { get; set; }
|
public string DrawingNo { get; set; }
|
||||||
|
|
||||||
public string Source { get; set; }
|
public string Source { get; set; }
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return string.Format("{0} {1}", JobNo, DrawingNo);
|
return string.Format("{0} {1}", JobNo, DrawingNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return obj.ToString() == ToString();
|
return obj.ToString() == ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return ToString().GetHashCode();
|
return ToString().GetHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DrawingInfo Parse(string input)
|
public static DrawingInfo Parse(string input)
|
||||||
{
|
{
|
||||||
const string pattern = @"(?<jobNo>[34]\d{3})\s?(?<dwgNo>[ABEP]\d+)";
|
const string pattern = @"(?<jobNo>[34]\d{3})\s?(?<dwgNo>[ABEP]\d+(-\d+|[A-Z])?)";
|
||||||
|
|
||||||
var match = Regex.Match(input, pattern);
|
var match = Regex.Match(input, pattern);
|
||||||
|
|
||||||
if (match.Success == false)
|
if (match.Success == false)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var dwg = new DrawingInfo();
|
var dwg = new DrawingInfo();
|
||||||
|
|
||||||
dwg.JobNo = match.Groups["jobNo"].Value;
|
dwg.JobNo = match.Groups["jobNo"].Value;
|
||||||
dwg.DrawingNo = match.Groups["dwgNo"].Value;
|
dwg.DrawingNo = match.Groups["dwgNo"].Value;
|
||||||
dwg.Source = input;
|
dwg.Source = input;
|
||||||
|
|
||||||
return dwg;
|
return dwg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -542,16 +542,7 @@ namespace ExportDXF.Forms
|
|||||||
|
|
||||||
if (distinctComponents.Count() > 1)
|
if (distinctComponents.Count() > 1)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
continue;
|
||||||
|
|
||||||
//foreach (var comp in distinctComponents)
|
|
||||||
//{
|
|
||||||
// items.Add(new Item
|
|
||||||
// {
|
|
||||||
// Name = itemNumber + rev++,
|
|
||||||
// Component = comp
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user