@@ -32,6 +32,7 @@ public class TaskMapper : BaseMapper, ITaskMapper
3232 {
3333 private Dictionary < string , int > _rxIDsByTask ;
3434 private Dictionary < int , string > _taskIDsByPrescription ;
35+
3536 public TaskMapper ( TaskDataMapper taskDataMapper ) : base ( taskDataMapper , "TSK" )
3637 {
3738 _rxIDsByTask = new Dictionary < string , int > ( ) ;
@@ -650,10 +651,26 @@ private LoggedData ImportLoggedData(ISOTask isoLoggedTask)
650651 loggedData . EquipmentConfigurationGroup = new EquipmentConfigurationGroup ( ) ;
651652 loggedData . EquipmentConfigurationGroup . EquipmentConfigurations = equipConfigs . ToList ( ) ;
652653
654+ var configsWithDevElementConfigIds = equipConfigs . Select ( equipConfig =>
655+ {
656+ return new
657+ {
658+ LeftElmentConfigId = DataModel . Catalog . Connectors . FirstOrDefault ( c => c . Id . ReferenceId == equipConfig . Connector1Id ) ? . DeviceElementConfigurationId ?? 0 ,
659+ RightElmentConfigId = DataModel . Catalog . Connectors . FirstOrDefault ( c => c . Id . ReferenceId == equipConfig . Connector2Id ) ? . DeviceElementConfigurationId ?? 0 ,
660+ EquipmentConfigId = equipConfig . Id . ReferenceId
661+ } ;
662+ } ) . Distinct ( ) . ToList ( ) ;
663+
653664 //Make a reference to the IDs on the OperationData
654665 foreach ( OperationData operationData in loggedData . OperationData )
655666 {
656- operationData . EquipmentConfigurationIds . AddRange ( equipConfigs . Select ( e => e . Id . ReferenceId ) ) ;
667+ var deviceConfigIds = operationData . GetAllSections ( )
668+ . Select ( x => x . DeviceConfigurationId )
669+ . ToList ( ) ;
670+
671+ operationData . EquipmentConfigurationIds . AddRange ( configsWithDevElementConfigIds
672+ . Where ( x => deviceConfigIds . Contains ( x . LeftElmentConfigId ) || deviceConfigIds . Contains ( x . RightElmentConfigId ) )
673+ . Select ( x => x . EquipmentConfigId ) ) ;
657674 }
658675
659676 DataModel . Catalog . EquipmentConfigurations . AddRange ( equipConfigs ) ;
0 commit comments