BaseUnitFormattingSettingsProvider Class

This abstract class reacts to changes in the "active" iModel and updates the QuantityFormatter overrides and active presentation unit system based on stored preferences. In addition, monitors the QuantityFormatter for changes to format overrides and the active unit system and stores these changes. The "active" iModel is determined by listening to the IModelApp.viewManager.onSelectedViewportChanged event and gets the iModel from the selected viewport.

Extended by

Implements

Methods

Name Description
constructor(_quantityFormatter: QuantityFormatter, _maintainOverridesPerIModel?: boolean): BaseUnitFormattingSettingsProvider    
applyQuantityFormattingSettingsForIModel(imodel?: IModelConnection): Promise<void> Protected    
buildQuantityFormatOverridesMap(): Promise<Map<UnitSystemKey, Map<string, FormatProps>>> Protected function to convert from serialized JSON format for Quantity Type overrides to build a map compatible with QuantityManager  
loadOverrides(imodel?: IModelConnection): Promise<void> Function to load overrides for a specific IModelConnection.  
remove(quantityTypeKey: string): Promise<boolean> Abstract Removes the override formats for a specific quantity type.  
retrieve(quantityTypeKey: string): Promise<undefined | OverrideFormatEntry> Abstract Retrieves serialized JSON object containing format overrides for a specific quantity type.  
retrieveUnitSystem(defaultKey: UnitSystemKey): Promise<UnitSystemKey> Abstract Retrieves the active unit system typically based on the "active" iModelConnection.  
store(quantityTypeKey: string, overrideProps: OverrideFormatEntry): Promise<boolean> Abstract Serializes JSON object containing format overrides for a specific quantity type.  
storeFormatOverrides(__namedParameters: QuantityFormatOverridesChangedArgs): Promise<void> function called to save format overrides  
storeUnitSystemKey(unitSystemKey: UnitSystemKey): Promise<boolean> Abstract Store the active unit system typically for the "active" iModelConnection.  
storeUnitSystemSetting(__namedParameters: FormattingUnitSystemChangedArgs): Promise<void> save UnitSystem for active iModel  

Properties

Name Type Description
_imodelConnection Protected undefined | IModelConnection    
imodelConnection Accessor ProtectedReadOnly undefined | IModelConnection    
maintainOverridesPerIModel Accessor ReadOnly boolean property that is set by the implementation to inform the BaseUnitFormattingSettingsProvider if the provider  

Defined in

Last Updated: 16 April, 2024