diff --git a/FeiYu/MainWindow.xaml b/FeiYu/MainWindow.xaml
index 02104ac..8020706 100644
--- a/FeiYu/MainWindow.xaml
+++ b/FeiYu/MainWindow.xaml
@@ -35,6 +35,7 @@
+
diff --git a/ViewModel/MainWindowVM.cs b/ViewModel/MainWindowVM.cs
index 7f5ac39..67c976f 100644
--- a/ViewModel/MainWindowVM.cs
+++ b/ViewModel/MainWindowVM.cs
@@ -19,6 +19,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
+using System.Windows.Media.Media3D;
using System.Windows.Threading;
using ViewModel.MotionControl;
using ViewModel.Robots;
@@ -229,7 +230,10 @@ namespace ViewModel
ManulFlow.Step = 0;
ZhuanPanList[4].State.StatusForeground = ColorStr.Blue;
ZhuanPanList[4].State.StatusBackground = ColorStr.Yellow;
-
+ break;
+ case "手动测试轴":
+ ManulFlow.Step = 0;
+
break;
}
Task.Run(() =>
@@ -266,6 +270,20 @@ namespace ViewModel
{
testing = false;
}
+ break;
+
+ case "手动测试轴":
+ try
+ {
+ TestAxisRun(ManulFlow);
+ }
+ catch (Exception)
+ {
+
+ testing = false;
+ }
+
+
break;
}
@@ -294,6 +312,27 @@ namespace ViewModel
return tempPoint;
+ }
+ private MotionPointModel GetMotionPoint(int pointType, bool copy = false)
+ {
+ var tempPoint = CurrentMachine.MotionPointList.Where(w => w.PointType == pointType).FirstOrDefault();
+
+ if (tempPoint != null)
+ {
+
+ if (copy)
+ {
+
+ tempPoint = Coper(tempPoint);
+ }
+
+ tempPoint.PointRunStep = GengralProcessEnum.Start;
+ }
+
+
+ return tempPoint;
+
+
}
bool testing;
private string gridWidth;
@@ -6887,6 +6926,116 @@ namespace ViewModel
}
#endregion
+
+ #region 手动测试轴
+
+ public int TestPos { get; set; }
+ public void TestAxisRun(FlowModel MyFlow)
+ {
+
+ switch (MyFlow.Step)
+ {
+ case 0:
+ TestPos = 1;
+ MyFlow.Step++;
+
+
+
+ break;
+
+ case 1:
+ PressPointTemp = GetMotionPoint(TestPos);
+ MyFlow.Step++;
+
+
+
+ break;
+ case 2:
+ if (PressPointTemp.PointRun(MCVM.AllShaftList))
+ {
+
+ MyFlow.Step++;
+
+
+ }
+ else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now)
+ {
+ PressPointTemp.PointRunStep = GengralProcessEnum.Start;
+ MyFlow.RunTime = DateTime.Now;
+
+ }
+ break;
+ case 3:
+
+ if (TestPos % 2 == 0) {
+
+ if (TestPos < 8)
+ {
+
+ TestPos++;
+ }
+ else
+ {
+
+ TestPos = 1;
+ }
+
+ MyFlow.Step = 1;
+ MyFlow.RunTime = DateTime.Now;
+ }
+
+ else if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now )
+ {
+ MyFlow.Step++;
+ MyFlow.RunTime = DateTime.Now;
+
+ }
+ break;
+
+ case 4:
+ VisualA.GetImage();
+ VisualA.SaveImage2(TestPos.ToString());
+ MyFlow.Step++;
+ MyFlow.RunTime = DateTime.Now;
+ break;
+ case 5:
+
+ if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now)
+ {
+
+
+ MyFlow.Step = 1;
+ MyFlow.RunTime = DateTime.Now;
+
+ if (TestPos < 8)
+ {
+
+ TestPos++;
+ }
+ else {
+
+ TestPos = 1;
+ }
+
+ }
+ break;
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+
+ #endregion
}
}
diff --git a/ViewModel/Vision/HalconVisual.cs b/ViewModel/Vision/HalconVisual.cs
index b118d54..aec1773 100644
--- a/ViewModel/Vision/HalconVisual.cs
+++ b/ViewModel/Vision/HalconVisual.cs
@@ -4258,7 +4258,7 @@ namespace ViewModel.Vision
/// 保存图像的名称
public void SaveImage2(string ImageName)
{
- string path = @"D:/MotorInfo/" + Camera.CamName + "/" + DateTime.Now.ToString("D") + "/";
+ string path = @"D:/MotorInfo/" + ImageName + "/";
//创建文件夹
if (!Directory.Exists(path))
@@ -4266,7 +4266,7 @@ namespace ViewModel.Vision
Directory.CreateDirectory(path);
}
- string filePath = path + ImageName + ".jpeg"; //图片存放路径 //保存模板图片
+ string filePath = path + DateTime.Now.ToString("ddMMss") + ".jpeg"; //图片存放路径 //保存模板图片
HOperatorSet.WriteImage(Ho_Image, "jpeg 60", 0, filePath);
}
diff --git a/Views/Motion/MotionControWindow.xaml b/Views/Motion/MotionControWindow.xaml
index d9f3bde..98ffe2d 100644
--- a/Views/Motion/MotionControWindow.xaml
+++ b/Views/Motion/MotionControWindow.xaml
@@ -74,7 +74,8 @@
-
+