Commit d297a789 LN

1

1 个父辈 3274cda8
......@@ -568,15 +568,36 @@ namespace TSA_V
{
string defPath = Path.GetPathRoot(Application.StartupPath) + @"image\";
//List<string> newFiles = FileUtil.FileProcess(openFileDialog.FileNames);
bool result = GerberVS.AGerberController.OpenLayers(openFileDialog.FileNames,defPath, out string filename);
if (result && File.Exists(filename))
GerberVS.BoundingBox boxBound = GerberVS.AGerberController.OpenLayers(openFileDialog.FileNames,defPath, out string filename);
if (boxBound!=null && File.Exists(filename))
{
double x = boxBound.Right - boxBound.Left;
double y = boxBound.Top - boxBound.Bottom;
string msg = $"位置左下角({Math.Round(boxBound.Left, 2)},{Math.Round(boxBound.Bottom, 2)})," +
$"右上角({Math.Round(boxBound.Right, 2)},{Math.Round(boxBound.Top, 2)}):尺寸:{Math.Round(x, 2)}X{Math.Round(y, 2)}";
LogUtil.info($"gerber文件【{string.Join(",", openFileDialog.FileNames) }】成功导入到文件:{filename},{msg}");
FrmImageViewer imageViewer = new FrmImageViewer(filename);
DialogResult sureresult = imageViewer.ShowDialog();
if (!sureresult.Equals(DialogResult.Cancel))
{
{
int l =(int) Math.Round(x);
int w = (int)Math.Round(y);
if (x <= 10 || w <= 10)
{
l = (int)(x * 25.4);
w = (int)(y * 25.4);
}
this.txtImagePath.Text = filename;
int currl = FormUtil.GetIntValue(txtBoardL);
int currw = FormUtil.GetIntValue(txtBoardW);
if (currl <= 0)
{
txtBoardL.Text = l.ToString();
}
if (currw <= 0)
{
txtBoardW.Text = w.ToString();
}
}
}
else
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!