1- // Copyright (c) 2024, Phoenix Contact GmbH & Co. KG
1+ // Copyright (c) 2024, Phoenix Contact GmbH & Co. KG
22// Licensed under the Apache License, Version 2.0
33
44using System ;
55using System . Collections . Generic ;
66using System . Linq ;
77using System . Reflection ;
8+ using System . Reflection . Metadata ;
89using Moryx . AbstractionLayer ;
910using Moryx . ControlSystem . Cells ;
1011
@@ -24,7 +25,9 @@ public static long Display(this IVisualInstructor instructor, string title, IVis
2425 return instructor . Display ( new ActiveInstruction
2526 {
2627 Title = title ,
27- Instructions = parameter . Instructions
28+ Instructions = parameter . Instructions ,
29+ //TODO: remove the casting in MORYX 10
30+ Inputs = ( parameter as VisualInstructionParameters ) ? . Inputs ,
2831 } ) ;
2932 }
3033
@@ -37,7 +40,9 @@ public static void Display(this IVisualInstructor instructor, string title, IVis
3740 instructor . Display ( new ActiveInstruction
3841 {
3942 Title = title ,
40- Instructions = parameter . Instructions
43+ Instructions = parameter . Instructions ,
44+ //TODO: remove the casting in MORYX 10
45+ Inputs = ( parameter as VisualInstructionParameters ) ? . Inputs ,
4146 } , autoClearMs ) ;
4247 }
4348
@@ -50,7 +55,9 @@ public static long Display(this IVisualInstructor instructor, string title, Acti
5055 return instructor . Display ( new ActiveInstruction
5156 {
5257 Title = title ,
53- Instructions = instructions
58+ Instructions = instructions ,
59+ //TODO: remove the casting in MORYX 10
60+ Inputs = ( activityStart . Activity . Parameters as VisualInstructionParameters ) ? . Inputs ,
5461 } ) ;
5562 }
5663
@@ -122,7 +129,10 @@ public static long Execute(this IVisualInstructor instructor, string title, IVis
122129 {
123130 Title = title ,
124131 Instructions = parameter . Instructions ,
125- PossibleResults = results
132+ PossibleResults = results ,
133+ Results = results . Select ( r => new InstructionResult { Key = r , DisplayValue = r } ) . ToArray ( ) ,
134+ //TODO: remove the casting in MORYX 10
135+ Inputs = ( parameter as VisualInstructionParameters ) ? . Inputs ,
126136 } , callback ) ;
127137 }
128138
@@ -157,7 +167,9 @@ public static long Execute(this IVisualInstructor instructor, string title, Acti
157167 Title = title ,
158168 Instructions = instructions ,
159169 PossibleResults = results ,
160- Results = results . Select ( r => new InstructionResult { Key = r , DisplayValue = r } ) . ToArray ( )
170+ Results = results . Select ( r => new InstructionResult { Key = r , DisplayValue = r } ) . ToArray ( ) ,
171+ //TODO: remove the casting in MORYX 10
172+ Inputs = ( activityStart . Activity . Parameters as VisualInstructionParameters ) ? . Inputs ,
161173 } , callback ) ;
162174 }
163175
0 commit comments