@@ -408,7 +408,9 @@ protected IEnumerable<OperationData> ImportTimeLog(ISOTask loggedTask, ISOTimeLo
408408 operationData . DeviceElementUses = sectionMapper . ConvertToBaseTypes ( sections . ToList ( ) ) ;
409409 operationData . GetDeviceElementUses = x => operationData . DeviceElementUses . Where ( s => s . Depth == x ) . ToList ( ) ;
410410 operationData . PrescriptionId = prescriptionID ;
411- operationData . OperationType = GetOperationTypeFromProductCategory ( productIDs ) ?? GetOperationTypeFromLoggingDevices ( time ) ;
411+ operationData . OperationType = GetOperationTypeFromProductCategory ( productIDs ) ??
412+ GetOperationTypeFromWorkingDatas ( workingDatas ) ??
413+ GetOperationTypeFromLoggingDevices ( time ) ;
412414 operationData . ProductIds = productIDs ;
413415 if ( ! useDeferredExecution )
414416 {
@@ -426,6 +428,24 @@ protected IEnumerable<OperationData> ImportTimeLog(ISOTask loggedTask, ISOTimeLo
426428 return null ;
427429 }
428430
431+ private OperationTypeEnum ? GetOperationTypeFromWorkingDatas ( List < WorkingData > workingDatas )
432+ {
433+ //Harvest/ForageHarvest omitted intentionally to be determined from machine type vs. working data
434+ if ( workingDatas . Any ( w => w . Representation . Code . Contains ( "Seed" ) ) )
435+ {
436+ return OperationTypeEnum . SowingAndPlanting ;
437+ }
438+ else if ( workingDatas . Any ( w => w . Representation . Code . Contains ( "Tillage" ) ) )
439+ {
440+ return OperationTypeEnum . Tillage ;
441+ }
442+ if ( workingDatas . Any ( w => w . Representation . Code . Contains ( "AppRate" ) ) )
443+ {
444+ return OperationTypeEnum . Unknown ; //We can't differentiate CropProtection from Fertilizing, but prefer unkonwn to letting implement type set to SowingAndPlanting
445+ }
446+ return null ;
447+ }
448+
429449 private List < List < string > > SplitElementsByProductProperties ( Dictionary < string , List < ISOProductAllocation > > productAllocations , HashSet < string > loggedDeviceElementIds , ISODevice dvc )
430450 {
431451 //This function splits device elements logged by single TimeLog into groups based
0 commit comments