tamaki.mes.backup.compare.resultsToDataSets
Description
Takes the three return values of compareEntityLists and builds Ignition
datasets for display. The result is a dictionary containing a "Summary" dataset (from
createSummaryDataSet) plus one detail dataset per entity type that has
at least one change.
Each detail dataset has the columns: Entity, the entity type's key fields (converted to Title Case
via tamaki.mes.utils.camelToTitle), Field, Old Value, New Value,
and Change Type.
Syntax
tamaki.mes.backup.compare.resultsToDataSets(removedEntityTypes, addedEntityTypes, updatedEntityTypes)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
removedEntityTypes | List | False | The removed-entity-types list returned by compareEntityLists. |
addedEntityTypes | List | False | The added-entity-types list returned by compareEntityLists. |
updatedEntityTypes | Dict | False | The updated-entity-types dictionary returned by compareEntityLists. |
Returns
A Dict mapping names to Datasets: a "Summary" dataset plus one dataset per changed entity type.
Code Examples
# Run the comparison and store the result datasets for display
removed, added, updated = tamaki.mes.backup.compare.compareEntityLists(oldJsonData, newJsonData)
self.view.custom.resultDatasets = tamaki.mes.backup.compare.resultsToDataSets(removed, added, updated)
# resultDatasets["Summary"] holds the per-entity-type counts; the other keys are per-type detail datasets