diff --git a/zaaReloaded2/Controller/Settings.cs b/zaaReloaded2/Controller/Settings.cs index 80e391f..c3b27c0 100755 --- a/zaaReloaded2/Controller/Settings.cs +++ b/zaaReloaded2/Controller/Settings.cs @@ -108,6 +108,11 @@ namespace zaaReloaded2.Controller /// public AbnormalStyle AbnormalStyle { get; set; } + /// + /// Indicates whether to prefer the more verbose "mmol/l" over "mM". + /// + public bool PreferVerboseMolar { get; set; } + /// /// Gets the list of controlling elements. /// diff --git a/zaaReloaded2/Formatter/Formatter.cs b/zaaReloaded2/Formatter/Formatter.cs index 653de74..0603b6b 100755 --- a/zaaReloaded2/Formatter/Formatter.cs +++ b/zaaReloaded2/Formatter/Formatter.cs @@ -57,7 +57,8 @@ namespace zaaReloaded2.Formatter foreach (TimePoint tp in _laboratory.TimePoints.Values) { _timePointFormatters[tp.TimeStamp] = - new TimePointFormatter(tp, Settings.ReferenceStyle, Settings.AbnormalStyle); + new TimePointFormatter(tp, Settings.ReferenceStyle, + Settings.AbnormalStyle, Settings.PreferVerboseMolar); } } } diff --git a/zaaReloaded2/Formatter/ItemFormatter.cs b/zaaReloaded2/Formatter/ItemFormatter.cs index 408f344..baa76a9 100755 --- a/zaaReloaded2/Formatter/ItemFormatter.cs +++ b/zaaReloaded2/Formatter/ItemFormatter.cs @@ -47,6 +47,11 @@ namespace zaaReloaded2.Formatter /// public AbnormalStyle AbnormalStyle { get; set; } + /// + /// Indicates whether to prefer the more verbose "mmol/l" over "mM". + /// + public bool PreferVerboseMolar { get; set; } + /// /// Gets or sets a flag that indicates whether this ItemFormatter /// has been used, i.e. whether the LabItem was written to a @@ -86,12 +91,14 @@ namespace zaaReloaded2.Formatter /// LabItem to wrap in this ItemFormatter. public ItemFormatter(LabItem labItem, ReferenceStyle referenceStyle, - AbnormalStyle abnormalStyle) + AbnormalStyle abnormalStyle, + bool preferVerboseMolar) { IncludeMaterial = true; LabItem = labItem; ReferenceStyle = referenceStyle; AbnormalStyle = abnormalStyle; + PreferVerboseMolar = preferVerboseMolar; } #endregion @@ -147,7 +154,12 @@ namespace zaaReloaded2.Formatter if (LabItem.HasUnit) { string space = LabItem.Unit.StartsWith("/") ? String.Empty : " "; - unit = String.Format("{0}{1}", space, LabItem.Unit); + unit = LabItem.Unit; + if (PreferVerboseMolar) + { + unit = LabItem.Unit.Replace("mM", "mmol/l"); + } + unit = String.Format("{0}{1}", space, unit); } else { diff --git a/zaaReloaded2/Formatter/TimePointFormatter.cs b/zaaReloaded2/Formatter/TimePointFormatter.cs index 19312d4..0ad7ff0 100755 --- a/zaaReloaded2/Formatter/TimePointFormatter.cs +++ b/zaaReloaded2/Formatter/TimePointFormatter.cs @@ -105,14 +105,15 @@ namespace zaaReloaded2.Formatter /// used to create ItemFormatter objects. public TimePointFormatter(TimePoint timePoint, ReferenceStyle referenceStyle, - AbnormalStyle abnormalStyle) + AbnormalStyle abnormalStyle, + bool preferVerboseMolar) { TimeStamp = timePoint.TimeStamp; ItemFormatters = new ItemFormatterDictionary(); foreach (LabItem item in timePoint.Items.Values) { ItemFormatters[item.QualifiedName] = new ItemFormatter( - item, referenceStyle, abnormalStyle); + item, referenceStyle, abnormalStyle, preferVerboseMolar); } } diff --git a/zaaReloaded2/ViewModels/SettingsViewModel.cs b/zaaReloaded2/ViewModels/SettingsViewModel.cs index 244a576..c874e25 100755 --- a/zaaReloaded2/ViewModels/SettingsViewModel.cs +++ b/zaaReloaded2/ViewModels/SettingsViewModel.cs @@ -185,6 +185,19 @@ namespace zaaReloaded2.ViewModels } } + public bool PreferVerboseMolar + { + get + { + return _settings.PreferVerboseMolar; + } + set + { + _settings.PreferVerboseMolar = value; + OnPropertyChanged("PreferVerboseMolar"); + } + } + #endregion #region Constructors diff --git a/zaaReloaded2/Views/SettingsView.xaml b/zaaReloaded2/Views/SettingsView.xaml index 85c2369..ca77cc4 100755 --- a/zaaReloaded2/Views/SettingsView.xaml +++ b/zaaReloaded2/Views/SettingsView.xaml @@ -63,8 +63,8 @@ SelectedItem="{Binding ReferenceStyle.SelectedItem}" x:Name="ReferenceStyleChooser" HorizontalAlignment="Stretch" /> - - + + mmol/l statt mM + +