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X,qCCxEM,IAAKrD,EAIX,MAJD,OAAYA,QAAY,KACtBA,mCACAA,mDACAA,qDAHUA,EAAZ,IAAYA,GAIX,qCCLM,IAAKD,EAGX,MAHD,OAAYA,QAAkB,KAC5BA,qDACAA,uDAFUA,EAAZ,IAAYA,GAGX","names":["ApDynformsConfigBase","constructor","options","super","this","ApDynformsControltype","rightToLeft","right_to_left","highlight","dataCy","data_cy","src","srcWidth","src_width","srcHeight","src_height","label1","label2","text1","text2","GetOperationModeService","applicationModeStore","operationModeStore","translationStore","GetApplicationMode","mode","Key","OperationModesEnum","Listen","s","data","value","Find","a","e","ApplicationModesEnum","GetOperationModeByLoggerId","id","o","LoggerId","GetOperationMode","FindTranslationForSelectedLanguage","d","getOperationModeById","getValue","find","x","Id","getOperationModeByKey","key","getOperationModeByLoggerId","loggerId","i0","factory","ApShowPointsOnMapService","mapStore","mapViewStore","EventEmitter","Layers","NRaster","legend","selectionLists","selectedValue","subscribe","val","_band","Mutate","layer","nRasterUrl","JSON","stringify","Object","keys","_rasterMap","map","PpRaster","ppRasterUrl","showPoints","selectedItems","farmId","_pointMap","_collectPoints","DatasetId","FieldGeomId","url","values","v","fieldGeomId","nSensorLogPointsUrl","showAllRaster","type","_rasterReset","forEach","FieldId","PlanBookId","_showRaster","showRaster","fieldId","planId","isRasterShown","datasetId","getMapViewMode","MapViewMode","showMapView","hasOwnProperty","_removeId","SensorPoints","Visibility","_toggleLayer","length","onMapClear","emit","isActive","includes","clear","visibility","OnLayerChange","MapFactoryStyler","ApNFertilizationCommonService","fertilizerStore","translationService","fieldStore","cropTypeStore","cropApplicationStore","fertilizerService","dateService","operationModeService","nFertilizationService","fertilizationManagementService","roundNumericService","getOperationMode","getApplSum","planBooks","planBook","p","OperationMode","_a","h","_b","E","_c","S","_d","productAmount","calculateProductAmountFromPlanBooks","Number","isFinite","undefined","getProductUnit","product","getFertilizer","ProductId","unit","Unit","BaseUnit","translate","getContentNPlanBooks","field","nFertPlanBooks","logfiles","baseFertPlanBooks","contentNPlanBooks","getContentNRelatedPlanBooks","contentNPlanBook","fieldGeom","getFieldGeomById","cropType","getDefaultCroptype","CropTypeId","operationMode","OperationModeId","fertilizer","status","getStatusForApplication","i","NFertilization","NUptake","D","EcValue","L","Eppocode","area","R","K","AreaHa","productTotal","calculateProductAmountN","Average","productTotalUnit","getFertilizerUnit","Status","StatusClass","getStatusClassForApplication","StatusDesc","getStatusDescriptionForApplication","SourceType","ProductName","_getProductName","CropKey","WorkArea","roundAsNumber","Administration","_getAdministration","Application","GetApplication","EC","Date","ApplicationDate","MidnightDate","getDateMidnight","ProductTotal","ProductTotalUnit","AlreadyApplied","getAlreadyApplied","T","FertilizerEfficiency","B","Efficiency","Absorption","_getContentRangeValue","Fertilization","nApplication","nUptake","ecValue","eppoCode","sourceType","statusDescription","ContentNRelatedPlanBookSourceType","calculateAreaWeightedAverage","items","filteredItems","filter","totalArea","reduce","areaSum","Create","Area","averageWithFieldsArea","sensorAvgSum","item","productId","Prodname","getApplicationRateName","Min","Max","Avg","ScanService","ndiStore","sensorStore","ndiService","cropService","licenseService","sensorDataService","getBestScanData","defaultScanStatus","defaultBestScanData","getCurrentFieldGeom","sensorFieldData","SensorFieldData","ndiScanData","_getNdiScanData","daysDiff","getDateDiff","Created","DateDiffType","getBestScanObjectFromNdiScan","getBestScanObjectFromSensor","fieldCrop","getFieldCrop","ndiScanStatistics","NdiStatistics","getValidSatelliteLicense","nData","getSatelliteNValues","NUptakeAvg","NUptakeMin","NUptakeMax","Ec","SatId","PlanId","ScanType","SatelliteScan","sensorData","planBookInfo","getPlanBookInfoFromSensorFieldData","getStatusSensorFieldData","CroptypeId","Type","SensorPlanBookType","BestScanType","satelliteNValues","getStatusForNdiRecord","ActiveUsersStore","Store","backend","loaded","loading","registerObservable","ActiveUsersLoadSuccess","Data","SetLoadFinishState","loadActiveUsers","SetLoadState","DispatchBackend","ActiveUsersLoad","refreshActiveUsers","kickUser","userId","ActiveUsersKick","Name","NetTypes","Value","globalLogoutUser","username","password","ActiveUsersGlobalLogout","ApBase64Util","ApSensorDataService","_mapStateService","_backend","_importStore","getListenerByActionType","MapActions","result","Error","FungiDetectLayer","appendSource","ZoomIn","finishLoadMapPreview","loadByDataset","startLoadMapPreview","send","MapLoadFungiDetect","r","ValidForCampaignYear","description","state","class","NfPlanBookId","ApGuidUtil","PpPlanBookId","TaskManagementWizardOpenConfigType","TaskManagementAction"],"sources":["./src/app/ap-dynforms/config/ap-dynforms-config-label-icon.ts","./src/app/ap-utils/service/ap-get-operationmode.service.ts","./src/app/ap-utils/service/ap-show-points-on-map.service.ts","./src/app/n-fertilization/services/ap-n-fertilization.common.service.ts","./src/app/services/data/scan.service.ts","./src/app/stores/administration/active-users.store.ts","./src/app/stores/services/ap-sensor-data.service.ts","./src/app/task-management/task-management.types.ts","./src/app/types/scan.types.ts","./src/app/types/sensor.types.ts"],"sourcesContent":["import {ApDynformsConfigBase, ApDynformsControltype} from './ap-dynforms-config-base';\nimport {ApDynformsValidator} from '../ap-dynforms-validator';\nimport {AsyncValidatorFn, ValidatorFn} from '@angular/forms';\n\n/**\n * configuration for label with icon control\n */\nexport class ApDynformsConfigLabelIcon extends ApDynformsConfigBase {\n controlType = ApDynformsControltype.LabelIcon;\n src: string;\n srcWidth: number;\n srcHeight: number;\n label1: string;\n label2: string;\n text1: string;\n text2: string;\n highlight: boolean;\n rightToLeft: boolean;\n\n constructor(options: {\n data_cy?: string,\n key?: string,\n src?: any,\n src_width?: number,\n src_height?: number,\n label1?: string,\n label2?: string,\n text1?: string,\n text2?: string,\n validators?: ApDynformsValidator[],\n asyncValidators?: ApDynformsValidator[],\n highlight?: boolean,\n right_to_left?: boolean,\n } = {}) {\n super(options);\n this.rightToLeft = options.right_to_left || false;\n this.highlight = options.highlight || false;\n this.dataCy = options.data_cy || '';\n this.src = options.src || '';\n this.srcWidth = options.src_width || 50;\n this.srcHeight = options.src_height || 50;\n this.label1 = options.label1 || '';\n this.label2 = options.label2 || '';\n this.text1 = options.text1 || '';\n this.text2 = options.text2 || '';\n }\n}\n","import {Injectable} from '@angular/core';\nimport {TranslationStore} from '../../stores/translation/translation.store';\nimport {OperationModesEnum, OperationModesStore} from '../../stores/common/operation-modes.store';\nimport {ApplicationModesEnum, ApplModesStore} from '../../stores/common/appl-modes.store';\nimport IOperationMode = Data.Common.IOperationMode;\nimport IApplicationMode = Data.Common.IApplicationMode;\n\n@Injectable({providedIn: 'root'})\nexport class GetOperationModeService {\n constructor(private applicationModeStore: ApplModesStore,\n private operationModeStore: OperationModesStore,\n private translationStore: TranslationStore) {\n }\n\n public GetApplicationMode(mode: IOperationMode): IApplicationMode {\n if (mode.Key === OperationModesEnum.Constant) {\n return this.applicationModeStore.Listen(s => s.data).value.Find(a => a?.Key === ApplicationModesEnum.Constant);\n } else {\n return this.applicationModeStore.Listen(s => s.data).value.Find(a => a?.Key === ApplicationModesEnum.Variable);\n }\n }\n\n public GetOperationModeByLoggerId(id: number): IOperationMode {\n return this.operationModeStore.Listen(s => s.data).value.Find(o => o?.LoggerId === id);\n }\n\n public GetOperationMode(mode: IOperationMode): string {\n return this.translationStore.FindTranslationForSelectedLanguage(mode?.Key);\n }\n\n public getOperationModeById(id: number): IOperationMode {\n return this.operationModeStore.Listen(s => s.data).getValue().find(x => x.Id === id);\n }\n\n public getOperationModeByKey(key: string): IOperationMode {\n return this.operationModeStore.Listen(s => s.data).getValue().find(x => x.Key === key);\n }\n\n public getOperationModeByLoggerId(loggerId: number): IOperationMode {\n return this.operationModeStore.Listen(s => s.data).getValue().find(x => x.LoggerId === loggerId);\n }\n}\n","import {EventEmitter, Injectable} from '@angular/core';\nimport {MapViewMode} from '../../ap-interface';\nimport {MapViewStore} from '../../stores/layout/mapview.store';\nimport {MapStore} from '../../stores/map/map.store';\nimport {MapFactoryLayer} from '../../ap-map/layers/map-factory-layer';\nimport {MapFactoryStyler} from '../../map-factory/style';\nimport IGuid = System.IGuid;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApShowPointsOnMapService {\n onMapClear = new EventEmitter();\n private _pointMap: { [key: string]: { datasetId: string, fieldGeomId: string } } = {};\n private _rasterMap: { [key: string]: string } = {};\n private _rasterReset = true;\n private _band = 0;\n\n constructor(private mapStore: MapStore,\n private mapViewStore: MapViewStore) {\n this.mapStore.Layers.NRaster.legend().selectionLists[0].selectedValue.subscribe((val) => {\n this._band = +val.value;\n this.mapStore.Mutate(s => s.layer.nRasterUrl, () =>\n `/map/pro_nd/map_nd/{z}/{x}/{y}?params=${JSON.stringify(Object.keys(this._rasterMap).map((key) => this._rasterMap[key]))}#${this._band}`\n );\n });\n this.mapStore.Layers.PpRaster.legend().selectionLists[0].selectedValue.subscribe((val) => {\n this._band = +val.value;\n this.mapStore.Mutate(s => s.layer.ppRasterUrl, () =>\n `/map/pro_pp/map_pp/{z}/{x}/{y}?params=${JSON.stringify(Object.keys(this._rasterMap).map((key) => this._rasterMap[key]))}#${this._band}`\n );\n });\n }\n\n showPoints(selectedItems: { DatasetId: string, FieldGeomId: string }[], farmId: number): void {\n this._pointMap = {};\n for (const d of selectedItems) {\n this._collectPoints(d.DatasetId, d.FieldGeomId);\n }\n\n let url = '';\n const values = Object.values(this._pointMap).map((v) => {\n if (v.fieldGeomId == null) {\n delete v.fieldGeomId;\n }\n return v;\n });\n\n url = `/map/pro_n_sensor_log_points/map_n_sensor_log_points/{z}/{x}/{y}?params=${JSON.stringify(values)}#${farmId}`;\n this.mapStore.Mutate(s => s.layer.nSensorLogPointsUrl, () => url);\n }\n\n showAllRaster(data: { FieldId: string, PlanBookId: string }[], type: 'nd' | 'pp'): void {\n this._rasterReset = true;\n this._rasterMap = {};\n data.forEach((d) => this._rasterMap[d.FieldId] = d.PlanBookId);\n this._showRaster(type);\n }\n\n showRaster(fieldId: string, planId: string, type: 'nd' | 'pp'): void {\n if (this._rasterReset) {\n this._rasterMap = {};\n this._rasterReset = false;\n }\n if (this._rasterMap[fieldId] === planId) {\n delete this._rasterMap[fieldId];\n } else {\n this._rasterMap = {};\n this._rasterMap[fieldId] = planId;\n }\n this._showRaster(type);\n }\n\n isRasterShown(fieldId: IGuid | string, planId: IGuid | string): boolean {\n return this._rasterMap[fieldId as string] === planId as string;\n }\n\n private _collectPoints(datasetId: string, fieldGeomId: string): void {\n const id = `${datasetId}-${fieldGeomId}`;\n if (this.mapViewStore.getMapViewMode() !== MapViewMode.NORMAL) {\n this.mapViewStore.showMapView();\n }\n if (this._pointMap.hasOwnProperty(id)) {\n this._removeId(id);\n } else {\n if (!this.mapStore.Layers.SensorPoints.Visibility) {\n this._toggleLayer(this.mapStore.Layers.SensorPoints, true);\n }\n this._pointMap[id] = {datasetId, fieldGeomId};\n }\n }\n\n private _removeId(id: string | IGuid): void {\n delete this._pointMap[id as string];\n if (Object.keys(this._pointMap).length === 0) {\n this.onMapClear.emit();\n this._toggleLayer(this.mapStore.Layers.SensorPoints, false);\n }\n }\n\n isActive(datasetId: string, fieldGeomId: string): boolean {\n return Object.keys(this._pointMap).includes(`${datasetId}-${fieldGeomId}`);\n }\n\n clear(): void {\n this._pointMap = {};\n this._rasterMap = {};\n this.mapStore.Mutate(s => s.layer.nSensorLogPointsUrl, () => ``);\n this.mapStore.Layers.SensorPoints.clear();\n this.mapStore.Mutate(s => s.layer.nRasterUrl, () => ``);\n this.mapStore.Layers.NRaster.clear();\n this.mapStore.Mutate(s => s.layer.ppRasterUrl, () => ``);\n this.mapStore.Layers.PpRaster.clear();\n }\n\n private _toggleLayer(layer: MapFactoryLayer, visibility: boolean): void {\n layer.Visibility = visibility;\n this.mapStore.Layers.OnLayerChange.emit();\n }\n\n private _showRaster(type: 'nd' | 'pp'): void {\n const values = Object.keys(this._rasterMap).map((key) => this._rasterMap[key]);\n if (this.mapViewStore.getMapViewMode() !== MapViewMode.NORMAL) {\n this.mapViewStore.showMapView();\n }\n MapFactoryStyler.Instance.clearStyleCache();\n switch (type) {\n case 'nd':\n if (!this.mapStore.Layers.NRaster.Visibility) {\n this._toggleLayer(this.mapStore.Layers.NRaster, true);\n }\n this.mapStore.Mutate(s => s.layer.nRasterUrl, () =>\n `/map/pro_nd/map_nd/{z}/{x}/{y}?params=${JSON.stringify(values)}#${this._band}`\n );\n break;\n case 'pp':\n if (!this.mapStore.Layers.PpRaster.Visibility) {\n this._toggleLayer(this.mapStore.Layers.PpRaster, true);\n }\n this.mapStore.Mutate(s => s.layer.ppRasterUrl, () =>\n `/map/pro_pp/map_pp/{z}/{x}/{y}?params=${JSON.stringify(values)}#${this._band}`\n );\n break;\n }\n }\n}\n","import {Injectable} from '@angular/core';\nimport {\n OperationModesEnum\n} from '../../stores/common/operation-modes.store';\nimport {\n FertilizerStore\n} from '../../stores/base-data/fertilizer.store';\nimport {\n ApTranslationService\n} from '../../ap-utils/service/ap-translation.service';\nimport {\n TranslationStore\n} from '../../stores/translation/translation.store';\nimport {\n FieldStore\n} from '../../stores/farm/field.store';\nimport {\n GetRoundNumericService\n} from '../../ap-utils/service/get-round-numeric.service';\nimport {\n CropTypeStore\n} from '../../stores/base-data/crop.types.store';\nimport {\n ApDateService\n} from '../../ap-core/services/ap-date-service';\nimport {\n NFertilizationService\n} from '../../services/data/n-fertilization.service';\nimport {\n FertilizerService\n} from '../../services/data/fertilizer.service';\nimport {\n FertilizationManagementService\n} from '../../services/data/fertilization-management.service';\nimport {\n GetOperationModeService\n} from '../../ap-utils/service/ap-get-operationmode.service';\nimport {\n ContentNRelatedPlanBookSourceType,\n IContentNRelatedPlanBook,\n IContentNRelatedPlanBookStatisticValue\n} from '../../types/n-fertilization.types';\nimport {\n CropApplicationStore\n} from '../../stores/task-management/crop-application.store';\nimport {\n IGridDetailsItemContentRange,\n INFertilizationOverviewGridDetailsItem\n} from '../types/n-fertilization-overview.types';\nimport {\n Create\n} from 'ts-tooling';\nimport INFertilizationPlanBook = Data.TaskManagement.INFertilizationPlanBook;\nimport IOperationMode = Data.Common.IOperationMode;\nimport IDatasetFieldMap = Data.Sensor.IDatasetFieldMap;\nimport IField = Data.FieldManagement.IField;\nimport IBasicFertilisationPlanBooks = Data.TaskManagement.IBasicFertilisationPlanBooks;\n\n@Injectable({providedIn: 'root'})\nexport class ApNFertilizationCommonService {\n constructor(private fertilizerStore: FertilizerStore,\n private translationService: ApTranslationService,\n private translationStore: TranslationStore,\n private fieldStore: FieldStore,\n private cropTypeStore: CropTypeStore,\n private cropApplicationStore: CropApplicationStore,\n private fertilizerService: FertilizerService,\n private dateService: ApDateService,\n private operationModeService: GetOperationModeService,\n private nFertilizationService: NFertilizationService,\n private fertilizationManagementService: FertilizationManagementService,\n private roundNumericService: GetRoundNumericService) {\n }\n\n public getOperationMode(mode: IOperationMode): string {\n return this.translationStore.FindTranslationForSelectedLanguage(mode?.Key);\n }\n\n /*\n * Berechnet die Summe der Ausbringmenge über alle Einzelplanungen\n */\n public getApplSum(planBooks: INFertilizationPlanBook[]): number {\n if (!planBooks || planBooks.length === 0) {\n return undefined;\n }\n const planBook = planBooks[0];\n // APV49-1517: Bei den N-Düngung varianten N-Dünugn und Abs. Raps. bitte keine Summe berechnen.\n // Dies ist in der N-Düngung nur bei Zielwert und Streukarte möglich.\n if (planBook.OperationMode?.Key !== OperationModesEnum.TargetValue\n && planBook.OperationMode?.Key !== OperationModesEnum.ApplicationMap\n && planBook.OperationMode?.Key !== OperationModesEnum.ApplicationMapAbsolute\n && planBook.OperationMode?.Key !== OperationModesEnum.Constant) {\n return undefined;\n }\n const productAmount = this.nFertilizationService.calculateProductAmountFromPlanBooks(planBooks);\n return Number.isFinite(productAmount) ? productAmount : undefined;\n }\n\n /*\n * Ermittelt die Einheit des verwendeten Produkts/Dünger\n */\n public getProductUnit(planBook: INFertilizationPlanBook): string {\n if (!planBook) {\n return '';\n }\n // APV49-1517: Bei den N-Düngung varianten N-Dünugn und Abs. Raps. bitte keine Summe berechnen.\n // Dies ist in der N-Düngung nur bei Zielwert und Streukarte möglich.\n if (planBook.OperationMode?.Key !== OperationModesEnum.TargetValue\n && planBook.OperationMode?.Key !== OperationModesEnum.ApplicationMap\n && planBook.OperationMode?.Key !== OperationModesEnum.ApplicationMapAbsolute\n && planBook.OperationMode?.Key !== OperationModesEnum.Constant) {\n return '';\n }\n const product = this.fertilizerStore.getFertilizer(planBook.ProductId);\n let unit = 'Global__Unit_kg'; // fallback\n if (product && product.Unit && product.Unit.BaseUnit) {\n unit = product.Unit.BaseUnit.Key;\n } else if (product && product.Unit) {\n unit = product.Unit.Key;\n }\n return this.translationService.translate(unit);\n }\n\n /**\n * Retrieves and processes N fertilization applications for a field\n * @param field - Target field\n * @param nFertPlanBooks - N fertilization plan books\n * @param logfiles - Dataset field mappings for N fertilization\n * @param baseFertPlanBooks - Basic fertilization plan books\n * @returns Processed N fertilization applications\n * @public\n */\n public getContentNPlanBooks(field: IField,\n nFertPlanBooks: INFertilizationPlanBook[],\n logfiles: IDatasetFieldMap[],\n baseFertPlanBooks: IBasicFertilisationPlanBooks[]): INFertilizationOverviewGridDetailsItem[] {\n const contentNPlanBooks = this.nFertilizationService.getContentNRelatedPlanBooks(field, nFertPlanBooks, logfiles, baseFertPlanBooks);\n if (!contentNPlanBooks || contentNPlanBooks.length <= 0) {\n return [];\n }\n return contentNPlanBooks.map(contentNPlanBook => {\n const fieldGeom = this.fieldStore.getFieldGeomById(contentNPlanBook.FieldGeomId);\n const cropType = this.cropTypeStore.getDefaultCroptype(contentNPlanBook.CropTypeId);\n const operationMode = this.operationModeService.getOperationModeById(contentNPlanBook.OperationModeId);\n const fertilizer = this.fertilizerStore.getFertilizer(contentNPlanBook.ProductId);\n const status = this.getStatusForApplication(contentNPlanBook?.NFertilization, contentNPlanBook?.NUptake,\n contentNPlanBook?.EcValue ?? 0, cropType?.Eppocode, operationMode);\n const area = fieldGeom?.AreaHa ?? 0;\n const productTotal = contentNPlanBook.NFertilization\n ? this.fertilizationManagementService.calculateProductAmountN(contentNPlanBook.ProductId, contentNPlanBook.NFertilization.Average, area)\n : null;\n const productTotalUnit = this.fertilizerService.getFertilizerUnit(fertilizer, false);\n const item: INFertilizationOverviewGridDetailsItem = {\n Id: contentNPlanBook.PlanBookId,\n PlanBookId: contentNPlanBook.PlanBookId,\n FieldId: field.Id,\n Status: status,\n StatusClass: this.getStatusClassForApplication(status),\n StatusDesc: this.getStatusDescriptionForApplication(contentNPlanBook.SourceType, status, operationMode),\n ProductName: this._getProductName(operationMode, contentNPlanBook.ProductId),\n ProductId: contentNPlanBook.ProductId,\n CropKey: cropType?.CropKey,\n WorkArea: this.roundNumericService.roundAsNumber(area, 4),\n Administration: this._getAdministration(contentNPlanBook, cropType?.Eppocode, operationMode),\n Application: this.cropApplicationStore.GetApplication(cropType?.Eppocode, contentNPlanBook.EcValue),\n EC: contentNPlanBook.EcValue,\n Date: contentNPlanBook.ApplicationDate,\n MidnightDate: this.dateService.getDateMidnight(contentNPlanBook.ApplicationDate),\n ProductTotal: productTotal,\n ProductTotalUnit: Number.isFinite(productTotal) && productTotalUnit ? productTotalUnit : '-',\n AlreadyApplied: this.nFertilizationService.getAlreadyApplied(contentNPlanBook?.NFertilization?.Average, contentNPlanBook.ProductId),\n FertilizerEfficiency: fertilizer?.Efficiency,\n Absorption: this._getContentRangeValue(contentNPlanBook?.NUptake),\n Fertilization: this._getContentRangeValue(contentNPlanBook?.NFertilization)\n };\n return item;\n });\n }\n\n public getStatusForApplication(nApplication: IContentNRelatedPlanBookStatisticValue | undefined,\n nUptake: IContentNRelatedPlanBookStatisticValue | undefined,\n ecValue: number, eppoCode: string, operationMode: IOperationMode | null): number {\n if (!nApplication && !nUptake) {\n return -1;\n }\n const isApplicationRateNScan = this.cropApplicationStore.GetApplication(eppoCode, ecValue, operationMode) === -1;\n if (isApplicationRateNScan) {\n return 2;\n }\n if (operationMode && operationMode.Key === OperationModesEnum.Constant) {\n return 0;\n }\n return 1;\n }\n\n public getStatusClassForApplication(status: number): string {\n switch (status) {\n case -1:\n return 'ap-status-red';\n case 0:\n return 'ap-status-yellow';\n case 1:\n return 'ap-status-green';\n case 2:\n return 'ap-status-grey';\n default:\n return '';\n }\n }\n\n public getStatusDescriptionForApplication(sourceType: ContentNRelatedPlanBookSourceType | undefined,\n status: number, operationMode?: IOperationMode): string {\n if (status === -1) {\n return this.translationService.translate('Global__Please_Contact_The_Support');\n }\n let statusDescription = this.translationService.translate(operationMode.Key);\n if (sourceType && sourceType === ContentNRelatedPlanBookSourceType.BaseFertPlanBook) {\n statusDescription = `${this.translationStore.FindTranslationForSelectedLanguage('Global__BasicFertilization')} / ${statusDescription}`;\n }\n return statusDescription;\n }\n\n public calculateAreaWeightedAverage(items: { Area: number | undefined, Average: number | undefined }[]): number {\n const filteredItems = items.filter(x => !!x.Average);\n const totalArea = filteredItems.reduce((areaSum, field) => areaSum + Create(field?.Area, 0), 0);\n const averageWithFieldsArea = filteredItems.reduce((sensorAvgSum, item) => {\n const sensorAvg = item.Average > -1 ? item.Average * Create(item?.Area, 0) : 0;\n return sensorAvgSum + sensorAvg;\n }, 0);\n if (!averageWithFieldsArea || !totalArea) {\n return 0;\n }\n return averageWithFieldsArea / totalArea;\n }\n\n private _getProductName(operationMode: IOperationMode, productId: number | null): string {\n if (!operationMode || operationMode.Key === OperationModesEnum.Bonitur) {\n return '-';\n }\n if (productId === null || productId === 0) {\n return this.translationStore.FindTranslationForSelectedLanguage('Nutrient__PureNutrient');\n }\n const product = this.fertilizerStore.getFertilizer(productId);\n if (!product) {\n return '-';\n }\n return product.Prodname;\n }\n\n private _getAdministration(contentNPlanBook: IContentNRelatedPlanBook, eppoCode: string, operationMode: IOperationMode | null): string {\n if (contentNPlanBook.SourceType === ContentNRelatedPlanBookSourceType.BaseFertPlanBook) {\n return 'Global__N0';\n }\n return this.nFertilizationService.getApplicationRateName(eppoCode, contentNPlanBook.EcValue, operationMode, true);\n }\n\n private _getContentRangeValue(values: IContentNRelatedPlanBookStatisticValue | null): IGridDetailsItemContentRange {\n if (!values) {\n return null;\n }\n return {\n Min: values.Min,\n Max: values.Max,\n Avg: values.Average\n };\n }\n}\n","import {Injectable} from '@angular/core';\nimport {SensorStore} from '../../stores/sensor/sensor.store';\nimport {NdiStore} from '../../stores/ndi/ndi.store';\nimport {LicenseService} from './license/license.service';\nimport {ApDateService, DateDiffType} from '../../ap-core/services/ap-date-service';\nimport {NdiService} from '../../field-management/services/ndi.service';\nimport {FieldStore} from '../../stores/farm/field.store';\nimport {BestScanData, BestScanType} from '../../types/scan.types';\nimport {ApGetCropService} from '../../stores/services/ap-get-crop.service';\nimport {ApSensorDataService} from '../../stores/services/ap-sensor-data.service';\nimport {IGridStatus} from '../../ap-interface/interfaces/ap-grid-status.interface';\nimport {SensorPlanBookType} from '../../types/sensor.types';\nimport INdiStatistic = Data.NDI.INdiStatistic;\nimport IField = Data.FieldManagement.IField;\nimport ISensorFieldData = Data.Sensor.ISensorFieldData;\n\n/**\n * Service for managing and retrieving scan data from different sources\n */\n@Injectable({providedIn: 'root'})\nexport class ScanService {\n constructor(private ndiStore: NdiStore,\n private fieldStore: FieldStore,\n private sensorStore: SensorStore,\n private ndiService: NdiService,\n private dateService: ApDateService,\n private cropService: ApGetCropService,\n private licenseService: LicenseService,\n private sensorDataService: ApSensorDataService) {\n }\n\n /**\n * Gets the best available scan data for a field by comparing sensor and NDI data\n * @param field Field to get scan data for\n * @param defaultScanStatus Optional default status to use if no scan data available\n * @returns Best available scan data or default if none found\n * @private\n */\n public getBestScanData(field: IField | undefined, defaultScanStatus?: IGridStatus): BestScanData | undefined {\n if (!field) {\n return this.defaultBestScanData(defaultScanStatus);\n }\n const fieldGeom = this.fieldStore.getCurrentFieldGeom(field);\n if (!fieldGeom) {\n return this.defaultBestScanData(defaultScanStatus);\n }\n const sensorFieldData = this.sensorStore.SensorFieldData.find(x => x.FieldGeomId === fieldGeom.Id);\n const ndiScanData = this._getNdiScanData(field);\n if (!!sensorFieldData && !!ndiScanData) {\n const daysDiff = this.dateService.getDateDiff(new Date(ndiScanData.Created),\n new Date(sensorFieldData.Created), DateDiffType.Days);\n if (daysDiff > 5) {\n return this.getBestScanObjectFromNdiScan(ndiScanData, field);\n }\n return this.getBestScanObjectFromSensor(sensorFieldData);\n }\n if (ndiScanData && !sensorFieldData) {\n return this.getBestScanObjectFromNdiScan(ndiScanData, field);\n }\n if (sensorFieldData && !ndiScanData) {\n return this.getBestScanObjectFromSensor(sensorFieldData);\n }\n return this.defaultBestScanData(defaultScanStatus);\n }\n\n /**\n * Retrieves NDI scan data for a field if available and valid\n * Checks license validity and data completeness\n * @param field Field to get NDI scan data for\n * @returns NDI statistics if available and valid, undefined otherwise\n * @private\n */\n private _getNdiScanData(field: IField): INdiStatistic | undefined {\n const fieldGeom = this.fieldStore.getCurrentFieldGeom(field);\n const fieldCrop = this.cropService.getFieldCrop(field);\n const ndiScanStatistics = this.ndiStore.NdiStatistics.find(x => x.FieldGeomId === fieldGeom.Id);\n if (!ndiScanStatistics) {\n return undefined;\n }\n const satelliteLicense = this.licenseService.getValidSatelliteLicense();\n if (!satelliteLicense) {\n return undefined;\n }\n const nData = this.ndiService.getSatelliteNValues(ndiScanStatistics, fieldCrop);\n if (!Number.isFinite(nData.NUptakeAvg) || !Number.isFinite(nData.NUptakeMin) || !Number.isFinite(nData.NUptakeMax)) {\n return undefined;\n }\n return ndiScanStatistics;\n }\n\n /**\n * Creates a default scan data object with optional status\n * @param defaultScanStatus Optional status to include\n * @returns Basic scan data object with status\n * @private\n */\n private defaultBestScanData(defaultScanStatus?: IGridStatus): BestScanData {\n return {\n Status: defaultScanStatus,\n Ec: undefined,\n SatId: undefined,\n PlanId: undefined,\n CropTypeId: undefined,\n Created: undefined,\n NUptakeMin: undefined,\n NUptakeMax: undefined,\n NUptakeAvg: undefined,\n ScanType: undefined,\n SatelliteScan: undefined\n } as BestScanData;\n }\n\n /**\n * Creates scan data object from sensor field data\n * Includes plan book info and sensor measurements\n * @param sensorData Raw sensor field data\n * @returns Formatted scan data object with sensor values\n * @private\n */\n private getBestScanObjectFromSensor(sensorData: ISensorFieldData): BestScanData {\n const planBookInfo = this.sensorDataService.getPlanBookInfoFromSensorFieldData(sensorData);\n return {\n Status: this.sensorDataService.getStatusSensorFieldData(sensorData),\n Ec: sensorData.Ec,\n SatId: undefined,\n PlanId: planBookInfo.PlanBookId,\n CropTypeId: sensorData.CroptypeId,\n Created: new Date(sensorData.Created),\n NUptakeMin: sensorData.Min,\n NUptakeMax: sensorData.Max,\n NUptakeAvg: sensorData.Avg,\n ScanType: planBookInfo.Type === SensorPlanBookType.NFertilizationPlanBook\n ? BestScanType.NFertilizationSensor\n : BestScanType.PlantProtectionSensor,\n SatelliteScan: undefined\n } as BestScanData;\n }\n\n /**\n * Creates scan data object from NDI scan statistics\n * Includes field crop info and satellite measurements\n * @param ndiScanStatistics NDI scan statistics\n * @param field Associated field\n * @returns Formatted scan data object with NDI values\n * @private\n */\n private getBestScanObjectFromNdiScan(ndiScanStatistics: INdiStatistic, field: IField): BestScanData {\n const fieldCrop = this.cropService.getFieldCrop(field);\n const satelliteNValues = this.ndiService.getSatelliteNValues(ndiScanStatistics, fieldCrop);\n return {\n Status: this.ndiService.getStatusForNdiRecord(ndiScanStatistics),\n Ec: fieldCrop.EcValue,\n SatId: ndiScanStatistics.FieldGeomId,\n PlanId: undefined,\n CropTypeId: fieldCrop.CroptypeId,\n Created: new Date(ndiScanStatistics.Created),\n NUptakeMin: satelliteNValues.NUptakeMin,\n NUptakeMax: satelliteNValues.NUptakeMax,\n NUptakeAvg: satelliteNValues.NUptakeAvg,\n ScanType: BestScanType.SatelliteScan,\n SatelliteScan: ndiScanStatistics.ScanType\n } as BestScanData;\n }\n}\n","import {IStateStore} from '../../ap-interface';\nimport {Store} from '../index';\nimport {Injectable} from '@angular/core';\nimport {\n ActiveUsersGlobalLogout,\n ActiveUsersKick,\n ActiveUsersLoad,\n ActiveUsersLoadSuccess,\n NetTypes\n} from 'invoker-transport';\nimport IActiveUser = Data.Authentication.IActiveUser;\nimport {ApSignalrService} from '../../ap-core/services/ap-signalr.service';\nimport {ApBase64Util} from '../../ap-utils/static/ap-base64-util';\n\n@Injectable({providedIn: 'root'})\nexport class ActiveUsersStore extends Store> {\n constructor(public backend: ApSignalrService) {\n super(backend, {\n loaded: false,\n loading: false,\n data: []\n });\n\n backend.registerObservable(ActiveUsersLoadSuccess).subscribe(d => {\n super.Mutate(s => s.data, () => d.Data);\n super.SetLoadFinishState();\n });\n }\n\n public loadActiveUsers(): void {\n super.SetLoadState();\n super.Mutate(d => d.data, () => []);\n this.DispatchBackend(new ActiveUsersLoad());\n }\n\n public refreshActiveUsers(): void {\n this.DispatchBackend(new ActiveUsersLoad());\n }\n\n public kickUser(userId: number): void {\n this.DispatchBackend(new ActiveUsersKick(\n [{Name: 'userId', Type: NetTypes.INT, Value: userId}]));\n }\n\n public globalLogoutUser(username: string, password: string): void {\n\n this.DispatchBackend(new ActiveUsersGlobalLogout(\n [\n {Name: 'username', Type: NetTypes.STRING, Value: username},\n {Name: 'password', Type: NetTypes.STRING, Value: ApBase64Util.stringToBase64(password)}]));\n }\n}\n","import {Injectable} from '@angular/core';\nimport {MapActions, MapLoadFungiDetect} from 'invoker-transport';\nimport {ImportStore} from '../import/import.store';\nimport {MapStore} from '../map/map.store';\nimport {ApSignalrService} from '../../ap-core/services/ap-signalr.service';\nimport {IGridStatus} from '../../ap-interface/interfaces/ap-grid-status.interface';\nimport {ApGuidUtil} from '../../ap-utils';\nimport {SensorPlanBookType, SensorDataPlanBookInfo} from '../../types/sensor.types';\nimport ISensorFieldData = Data.Sensor.ISensorFieldData;\n\n@Injectable({providedIn: 'root'})\nexport class ApSensorDataService {\n constructor(private _mapStateService: MapStore,\n private _backend: ApSignalrService,\n private _importStore: ImportStore) {\n this._backend.getListenerByActionType(MapActions.LOAD_FUNGI_DETECT_BY_DATASET)\n .subscribe((result) => {\n if (result.Error) {\n throw result.Error;\n }\n this._mapStateService.Layers.FungiDetectLayer.appendSource(result.Data);\n this._mapStateService.Layers.FungiDetectLayer.ZoomIn(500);\n this._importStore.finishLoadMapPreview();\n });\n }\n\n public loadByDataset(datasetId: string): void {\n this._importStore.startLoadMapPreview(datasetId);\n this._backend.send(new MapLoadFungiDetect([\n {Name: 'datasetId', Type: 'System.Guid', Value: datasetId}\n ]));\n }\n\n public getStatusSensorFieldData(sensorData: ISensorFieldData): IGridStatus {\n if (sensorData?.ValidForCampaignYear === true) {\n let description = 'Global__ApplMap_Can_Be_Created';\n const planBookInfo = this.getPlanBookInfoFromSensorFieldData(sensorData);\n if (!!planBookInfo) {\n if (planBookInfo.Type === SensorPlanBookType.NFertilizationPlanBook) {\n description = 'Global__NFertilization';\n } else if (planBookInfo.Type === SensorPlanBookType.PlanProtectionPlanBook) {\n description = 'Global__PlantProtection';\n }\n }\n return {\n state: 1,\n class: 'ap-status-green',\n description\n };\n }\n return {\n state: -1,\n class: 'ap-status-grey',\n description: ''\n };\n }\n\n public getPlanBookInfoFromSensorFieldData(sensorData: ISensorFieldData): SensorDataPlanBookInfo | undefined {\n if (!sensorData) {\n return undefined;\n }\n if (sensorData.NfPlanBookId != null && sensorData.NfPlanBookId !== ApGuidUtil.getEmptyGuid()) {\n return {\n PlanBookId: sensorData.NfPlanBookId,\n Type: SensorPlanBookType.NFertilizationPlanBook\n } as SensorDataPlanBookInfo;\n }\n if (sensorData.PpPlanBookId != null && sensorData.PpPlanBookId !== ApGuidUtil.getEmptyGuid()) {\n return {\n PlanBookId: sensorData.PpPlanBookId,\n Type: SensorPlanBookType.PlanProtectionPlanBook\n } as SensorDataPlanBookInfo;\n }\n return undefined;\n }\n}\n","import {IRouterStateUrl} from '../stores/router/router.store';\nimport {IGridStatus} from '../ap-interface/interfaces/ap-grid-status.interface';\nimport IGuid = System.IGuid;\nimport IDriver = Data.DocuContext.Driver.IDriver;\nimport IInstrument = Data.DocuContext.Instrument.IInstrument;\nimport IMachine = Data.DocuContext.Machine.IMachine;\nimport IExportTarget = Data.Common.IExportTarget;\nimport IFieldBase = Data.FieldManagement.IFieldBase;\nimport TaskManagementModule = Data.TaskManagement.TaskManagementModule;\nimport ITaskManagementPlanSummary = Data.TaskManagement.ITaskManagementPlanSummary;\nimport ITaskManagementPlanBook = Data.TaskManagement.ITaskManagementPlanBook;\n\nexport interface ITaskManagementPlanSummaryGridData {\n Id: IGuid;\n Status: IGridStatus;\n Module: TaskManagementModule;\n ModuleText: string;\n ApplicationModeText: string;\n OperationModeText: string;\n ElementName: string;\n ProductName: string;\n AreaHaSum: number;\n UserApplRate: number;\n UserApplSum: number;\n ProductUnit: string;\n ApplUnitPerHa: string;\n ProductUnitPerHa: string;\n AlreadyExported: string;\n ApplDate: Date;\n FieldsTooltip: string;\n Note: string;\n SourceItem: ITaskManagementPlanSummary;\n}\n\nexport interface ITaskManagementPlanBookGridData {\n Id: IGuid;\n Status: IGridStatus;\n Field: IFieldBase;\n ModuleText: string;\n ApplicationModeText: string;\n OperationModeText: string;\n ElementName: string;\n ProductName: string;\n ProductUnitPerHa: string;\n ProductTooltip: string;\n CropName: string;\n AreaHa: number;\n ApplRate: number;\n ApplMin: number;\n ApplMax: number;\n ApplSum: number;\n ApplDate: Date;\n ExportedAt: Date;\n ExportTargetText: string;\n ExportDriver: IDriver;\n ExportInstrument: IInstrument;\n ExportMachine: IMachine;\n SelectedExportTargetObject: IExportTarget;\n SourceItem: ITaskManagementPlanBook;\n}\n\nexport class TaskManagementWizardOpenConfig {\n PlanSummary: ITaskManagementPlanSummaryGridData;\n Type: TaskManagementWizardOpenConfigType;\n RouterData: IRouterStateUrl;\n}\n\nexport enum TaskManagementWizardOpenConfigType {\n Export = 0,\n Show = 1\n}\n\nexport enum TaskManagementAction {\n Booking = '0',\n Edit = '1'\n}\n","import {IGridStatus} from '../ap-interface/interfaces/ap-grid-status.interface';\nimport ScanType = Data.NDI.Enums.ScanType;\n\nexport enum BestScanType {\n SatelliteScan = 0,\n NFertilizationSensor = 1,\n PlantProtectionSensor = 2\n}\n\nexport type BestScanData = {\n Status: IGridStatus | undefined;\n SatId: string | undefined;\n PlanId: string | undefined;\n Ec: number | undefined;\n CropTypeId: number | undefined;\n Created: Date | undefined;\n NUptakeMax: number | undefined;\n NUptakeMin: number | undefined;\n NUptakeAvg: number | undefined;\n ScanType: BestScanType | undefined;\n SatelliteScan: ScanType | undefined;\n};\n","import IGuid = System.IGuid;\n\nexport enum SensorPlanBookType {\n NFertilizationPlanBook = 0,\n PlanProtectionPlanBook = 1\n}\n\nexport type SensorDataPlanBookInfo = {\n PlanBookId: IGuid | undefined;\n Type: SensorPlanBookType | undefined;\n};\n\n"],"sourceRoot":"webpack:///","file":"common.cb826699f0256387.js"}