Exemple #1
0
        private TLG Map(OperationData operationData, string taskDataPath, TaskDocumentWriter taskDocumentWriter)
        {
            var tlgId = operationData.Id.FindIsoId() ?? "TLG" + operationData.Id.ReferenceId;

            taskDocumentWriter.Ids.Add(tlgId, operationData.Id);

            var tlg = new TLG {
                A = tlgId
            };
            var sections       = operationData.GetAllSections();
            var meters         = sections.SelectMany(x => x.GetWorkingDatas()).ToList();
            var spatialRecords = operationData.GetSpatialRecords != null?operationData.GetSpatialRecords() : null;

            var timHeader = _timHeaderMapper.Map(meters);

            _xmlReader.WriteTlgXmlData(taskDataPath, tlg.A + ".xml", timHeader);

            var binFilePath = Path.Combine(taskDataPath, tlg.A + ".bin");

            _binaryWriter.Write(binFilePath, meters, spatialRecords);

            return(tlg);
        }