|
@@ -14,6 +14,7 @@ using System.IO;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
using System.Windows;
|
|
|
|
|
+using System.Windows.Shapes;
|
|
|
using Team.FFFeederService.Interfaces;
|
|
using Team.FFFeederService.Interfaces;
|
|
|
using TeamAAS_VP.Core;
|
|
using TeamAAS_VP.Core;
|
|
|
using TeamAAS_VP.Enums;
|
|
using TeamAAS_VP.Enums;
|
|
@@ -144,7 +145,7 @@ namespace TeamAAS_VP.ViewModels.Calibration
|
|
|
{
|
|
{
|
|
|
Camera = _cameraService.GetCamera(value.Id);
|
|
Camera = _cameraService.GetCamera(value.Id);
|
|
|
SelectCalibration.FixedUpCameraFindP0Info.CameraId = value.Id;
|
|
SelectCalibration.FixedUpCameraFindP0Info.CameraId = value.Id;
|
|
|
- SelectCalibration.FixedUpCameraFindP0Info.CameraId = value.Id;
|
|
|
|
|
|
|
+ SelectCalibration.FixedUpCameraFindP0Info.CameraName = value.CameraName;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -163,6 +164,11 @@ namespace TeamAAS_VP.ViewModels.Calibration
|
|
|
set
|
|
set
|
|
|
{
|
|
{
|
|
|
SetProperty(ref _SelectedCalibration, value);
|
|
SetProperty(ref _SelectedCalibration, value);
|
|
|
|
|
+ if (value!=null)
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectCalibration.FixedUpCameraFindP0Info.CalibrationId = value.Id;
|
|
|
|
|
+ SelectCalibration.FixedUpCameraFindP0Info.CalibrationName = value.Name;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -240,6 +246,10 @@ namespace TeamAAS_VP.ViewModels.Calibration
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
string prcPath = FilePath.CalibrationPath + "//" + SelectCalibration.Name + "//" + "FixedUpCameraTool.vpp";
|
|
string prcPath = FilePath.CalibrationPath + "//" + SelectCalibration.Name + "//" + "FixedUpCameraTool.vpp";
|
|
|
|
|
+ if (!Directory.Exists(System.IO.Path.GetDirectoryName(prcPath)))
|
|
|
|
|
+ {
|
|
|
|
|
+ Directory.CreateDirectory(System.IO.Path.GetDirectoryName(prcPath));
|
|
|
|
|
+ }
|
|
|
CogSerializer.SaveObjectToFile(ToolBlockEdit.Subject, prcPath);
|
|
CogSerializer.SaveObjectToFile(ToolBlockEdit.Subject, prcPath);
|
|
|
NavigationParameters param = new NavigationParameters();
|
|
NavigationParameters param = new NavigationParameters();
|
|
|
param.Add("SelectCalibration", SelectCalibration);
|
|
param.Add("SelectCalibration", SelectCalibration);
|
|
@@ -277,6 +287,11 @@ namespace TeamAAS_VP.ViewModels.Calibration
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
|
|
+ if (Camera == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ MessageBox.Show("请先选择相机!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
ToolBlockEdit.Subject.Inputs["InputImage"].Value = Camera.Grab();
|
|
ToolBlockEdit.Subject.Inputs["InputImage"].Value = Camera.Grab();
|
|
|
ToolBlockEdit.Subject.Run();
|
|
ToolBlockEdit.Subject.Run();
|
|
|
}
|
|
}
|
|
@@ -411,7 +426,7 @@ namespace TeamAAS_VP.ViewModels.Calibration
|
|
|
CalibrationList = new ObservableCollection<CalibrationInfo>(_calibrationServvice.GetAllCalibrations());
|
|
CalibrationList = new ObservableCollection<CalibrationInfo>(_calibrationServvice.GetAllCalibrations());
|
|
|
if (SelectCalibration.FixedUpCameraFindP0Info.CalibrationId != Guid.Empty)
|
|
if (SelectCalibration.FixedUpCameraFindP0Info.CalibrationId != Guid.Empty)
|
|
|
{
|
|
{
|
|
|
- SelectCalibration = CalibrationList.FirstOrDefault(c => c.Id == SelectCalibration.FixedUpCameraFindP0Info.CalibrationId);
|
|
|
|
|
|
|
+ SelectedCalibration = CalibrationList.FirstOrDefault(c => c.Id == SelectCalibration.FixedUpCameraFindP0Info.CalibrationId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ExposureTime = SelectCalibration.ExposureTime;
|
|
ExposureTime = SelectCalibration.ExposureTime;
|