private void ProcessData(TreeNode treeNode) { var objectWithIndex = (ObjectWithIndex)treeNode.Tag; var element = objectWithIndex.Element; if (element is FieldBoundary) { _boundaryProcessor.ProcessBoundary(element as FieldBoundary); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidanceGroup) { _guidanceProcessor.ProcessGuidance(element as GuidanceGroup, _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex].Catalog.GuidancePatterns); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidancePattern) { _guidanceProcessor.ProccessGuidancePattern(element as GuidancePattern); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is OperationData) { _dataGridViewRawData.DataSource = _operationDataProcessor.ProcessOperationData(element as OperationData); _tabControlViewer.SelectedTab = _tabPageRawData; } }
public void GivenOperationDataWhenProcessOperationDataThenColumnsAreAdded() { _workingDatas.Add(new NumericWorkingData { Representation = RepresentationInstanceList.vrHarvestMoisture.ToModelRepresentation() }); _deviceElementUses.Add(0, new List <DeviceElementUse> { new DeviceElementUse { Depth = 0, GetWorkingDatas = () => _workingDatas, } }); _spatialRecords.Add(new SpatialRecord()); var dataTable = _operationDataProcessor.ProcessOperationData(_operationData, _spatialRecords); Assert.AreEqual(5, dataTable.Columns.Count); Assert.AreEqual(_workingDatas.First().Representation.Code + "-" + _workingDatas.First().Id.ReferenceId + "-0", dataTable.Columns[4].ColumnName); }
private void ProcessData(TreeNode treeNode) { var objectWithIndex = (ObjectWithIndex)treeNode.Tag; var element = objectWithIndex.Element; workingDataComboBox.Visible = false; if (element is FieldBoundary) { _boundaryProcessor.ProcessBoundary(element as FieldBoundary); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidanceGroup) { _guidanceProcessor.ProcessGuidance(element as GuidanceGroup, _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex].Catalog.GuidancePatterns); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidancePattern) { _guidanceProcessor.ProccessGuidancePattern(element as GuidancePattern); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is OperationData) { OperationData operation = element as OperationData; List <SpatialRecord> spatialRecords = new List <SpatialRecord>(); if (operation.GetSpatialRecords != null) { spatialRecords = operation.GetSpatialRecords().ToList(); //Iterate the records once here for multiple consumers below } _dataGridViewRawData.DataSource = _operationDataProcessor.ProcessOperationData(operation, spatialRecords); ApplicationDataModel.ADM.ApplicationDataModel model = _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex]; _spatialRecordProcessor.ProcessOperation(operation, spatialRecords, _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex].Catalog); workingDataComboBox.Visible = true; workingDataComboBox.DataSource = _spatialRecordProcessor.WorkingDataList; } else if (element is Prescription) { _prescriptionProcessor.ProcessPrescription(element as Prescription); } }