fix bug of wpf mission initialization.

This commit is contained in:
unknown 2025-08-30 15:31:52 +08:00
parent 6c111a7553
commit 103092e10b
2 changed files with 8 additions and 8 deletions

View File

@ -134,7 +134,7 @@ namespace Sample.Common
} }
#region ShowStepPresent #region ShowStepPresent
internal static void ShowStepPresent( internal static void ShowStepPresent(
UserService userEnv, MachiningStep machiningStep) AppService userEnv, MachiningStep machiningStep)
{ {
foreach (var entry in userEnv.DisplayedStepPresentAccessList) foreach (var entry in userEnv.DisplayedStepPresentAccessList)
{ {

View File

@ -43,7 +43,7 @@ namespace Sample.Machining
}; };
Console.WriteLine($"Set machining step event."); Console.WriteLine($"Set machining step event.");
//show MRR. //show MRR.
machiningProject.RuntimeController.MachiningStepBuilt += (preStep, curStep) => machiningProject.RuntimeApi.MachiningStepBuilt += (preStep, curStep) =>
{ {
var sourceCommand = curStep.SourceCommand; var sourceCommand = curStep.SourceCommand;
if (curStep.Mrr_mm3ds > 500) //show only the step that contains large MRR. if (curStep.Mrr_mm3ds > 500) //show only the step that contains large MRR.
@ -57,13 +57,13 @@ namespace Sample.Machining
Console.WriteLine($"Session begin."); Console.WriteLine($"Session begin.");
machiningProject.BeginSession(); machiningProject.BeginSession();
machiningProject.RuntimeController.MachiningResolution_mm = 1; machiningProject.RuntimeApi.MachiningResolution_mm = 1;
machiningProject.RuntimeController.EnableCollisionDetection = true; machiningProject.RuntimeApi.EnableCollisionDetection = true;
machiningProject.RuntimeController.EnablePauseOnFailure = false; machiningProject.RuntimeApi.EnablePauseOnFailure = false;
machiningProject.RuntimeController.EnablePhysics = false; machiningProject.RuntimeApi.EnablePhysics = false;
//the path from Shell-API is relative by project directory. //the path from Shell-API is relative by project directory.
machiningProject.RuntimeController.PlayNcFile("NC/side.ptp"); machiningProject.RuntimeApi.PlayNcFile("NC/side.ptp");
machiningProject.RuntimeController.PlayNcFile("NC/circle.ptp"); machiningProject.RuntimeApi.PlayNcFile("NC/circle.ptp");
machiningProject.EndSession(); machiningProject.EndSession();
Console.WriteLine($"Session end."); Console.WriteLine($"Session end.");
#endregion #endregion