Index: DamClients/DamUI/trunk/src/Dam/Forms/LocationJobSymbol.cs =================================================================== diff -u -r6750 -r6768 --- DamClients/DamUI/trunk/src/Dam/Forms/LocationJobSymbol.cs (.../LocationJobSymbol.cs) (revision 6750) +++ DamClients/DamUI/trunk/src/Dam/Forms/LocationJobSymbol.cs (.../LocationJobSymbol.cs) (revision 6768) @@ -33,18 +33,6 @@ [Impact(Impact.None)] public class LocationJobSymbol : Symbol, IVisibleEnabled { - private readonly Func bad = f => f <= 1.0 && f > 0; - private readonly Func warning = f => f > 1.0 && f <= 1.05; - private readonly Func good = f => f > 1.05 && f < 1.17; - private readonly Func excellent = f => f >= 1.17 && f < DamGlobalConstants.NoRunValue; - private readonly Func failed = f => double.IsNaN(f) || f <= 0; - private readonly Func notCalculated = f => f >= DamGlobalConstants.NoRunValue; - - private int currentView; - private DateTime currentDateTime = DateTime.Today; - private DateTime minDateTime = DateTime.Today; - private DateTime maxDateTime = DateTime.Today; - private string currentProfileName; private string currentScenarioName; private string currentCalculation; @@ -53,13 +41,6 @@ public LocationJobSymbol() { - RegisterColorAndLabel("f >= 1.17", Color.Lime, excellent); - RegisterColorAndLabel("1.05 < f < 1.17", Color.Yellow, good); - RegisterColorAndLabel("1.0 < f <= 1.05", Color.Orange, warning); - RegisterColorAndLabel("f <= 1.0", Color.Red, bad); - RegisterColorAndLabel("failed calculation", Color.White, failed); - RegisterColorAndLabel("not yet calculated", Color.Gray, notCalculated); - DataEventPublisher.OnAfterChange += DataEventPublisher_OnAfterChange; } @@ -116,40 +97,6 @@ } } - [XmlIgnore] - public DateTime CurrentDateTime - { - get - { - return currentDateTime; - } - set - { - DataEventPublisher.BeforeChange(this, "CurrentDateTime"); - currentDateTime = value; - UpdateView(); - LocationJob.CurrentTime = value; - DataEventPublisher.DataListModified(DamProjectData.LocationJobs); - DataEventPublisher.AfterChange(this, "CurrentDateTime"); - } - } - - [XmlIgnore] - public int CurrentView - { - get - { - return currentView; - } - set - { - DataEventPublisher.BeforeChange(this, "CurrentView"); - currentView = value; - UpdateCurrentDateTime(); - DataEventPublisher.AfterChange(this, "CurrentView"); - } - } - public DamProjectData DamProjectData { get @@ -163,49 +110,6 @@ } } - public void Update(IEnumerable locationJobs) - { - minDateTime = DateTime.MaxValue; - maxDateTime = DateTime.MinValue; - //Todo Why is this timeserie part of ..Symbol and not part of LocationJob itself - foreach (LocationJob locationJob in locationJobs) - { - if (locationJob.LocationResult != null) - { - foreach (TimeSerieEntry entry in locationJob.LocationResult.StabilityTimeSerie.Entries) - { - if (entry.DateTime < minDateTime) - { - minDateTime = entry.DateTime; - } - - if (entry.DateTime > maxDateTime) - { - maxDateTime = entry.DateTime; - } - } - - if (locationJob.LocationResult.StabilityTimeSerie.Entries.Count == 0 && locationJob.WaterLevelTimeSerie != null) - { - foreach (TimeSerieEntry entry in locationJob.WaterLevelTimeSerie.Entries) - { - if (entry.DateTime < minDateTime) - { - minDateTime = entry.DateTime; - } - - if (entry.DateTime > maxDateTime) - { - maxDateTime = entry.DateTime; - } - } - } - } - } - - UpdateCurrentDateTime(); - } - private void DataEventPublisher_OnAfterChange(object sender, PublishEventArgs e) { if (sender == damProjectData) @@ -214,33 +118,6 @@ } } - private void UpdateCurrentDateTime() - { - TimeSpan span = maxDateTime - minDateTime; - if (span.TotalSeconds >= 0) - { - CurrentDateTime = minDateTime.AddSeconds(currentView * span.TotalSeconds / 100); - } - } - - private void UpdateView() - { - TimeSpan span = maxDateTime - minDateTime; - TimeSpan spanUntilView = currentDateTime - minDateTime; - - if (span.TotalSeconds == 0) - { - currentView = 0; - } - else - { - currentView = Convert.ToInt32(100 * spanUntilView.TotalSeconds / span.TotalSeconds); - - currentView = Math.Max(0, currentView); - currentView = Math.Min(100, currentView); - } - } - #region IVisibleEnabled Members public bool IsVisible(string property) @@ -249,9 +126,6 @@ { switch (property) { - case "CurrentView": - case "CurrentDateTime": - return DamProjectData.DamProjectType == DamProjectType.DamLiveConfiguration; case "CurrentProfileName": return false; case "CurrentScenarioName": return false; case "CurrentCalculation": return false; @@ -270,10 +144,6 @@ { switch (property) { - case "CurrentView": - case "CurrentDateTime": - return DamProjectData != null && DamProjectData.DamProjectType == DamProjectType.DamLiveConfiguration && - DamProjectData.LocationJobs != null && DamProjectData.LocationJobs.Count > 0; case "CurrentProfileName": return false; case "CurrentScenarioName": return false; case "CurrentCalculation": return false; Index: DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs =================================================================== diff -u -r6763 -r6768 --- DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 6763) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 6768) @@ -76,7 +76,6 @@ private readonly Panel projectPanel = new Panel(); private readonly Panel materialPanel = new Panel(); private readonly Panel locationJobPanel = new Panel(); - private readonly Panel locationJobSymbolPanel = new Panel(); private readonly Panel calculationSpecificationPanel = new Panel(); private readonly Panel stabilityKernelTypeSpecificationPanel = new Panel(); private readonly Panel sensorPanel = new Panel(); @@ -145,7 +144,6 @@ private DAMNewProjectData damNewProjectData; private CsvExportData lastDesignResult; - private LocationResult lastLocationResult; private LocationJob currentLocationJob; public int MaxCalculationCores @@ -214,7 +212,6 @@ ConfigureMenu(); BindSupport.Assign(panel, this); - BindSupport.Assign(locationJobSymbolPanel, locationJobSymbol); DataEventPublisher.OnAfterChange += DataEventPublisher_OnAfterChange; DataEventPublisher.OnSelectionChanged += DataEventPublisher_OnSelectionChanged; @@ -261,7 +258,6 @@ // get data lastDesignResult = null; - lastLocationResult = null; currentLocationJob = null; DataSourceManager.DataSources = projectData.DataSources; @@ -294,11 +290,9 @@ RealTimeBackgroundValidator.Instance.Register(projectData); lastDesignResult = null; - lastLocationResult = null; // Read the Waterlevel Timeseries damProject.ImportWaterLevelTimeSeries(); - locationJobSymbol.Update(projectData.LocationJobs); if (projectData.DamProjectType == DamProjectType.DamLiveConfiguration) { @@ -538,32 +532,6 @@ Name = "ClearResultsMenuItem" }; - var trackBar = new RepositoryItemTrackBar - { - Maximum = 100, - TickFrequency = 10 - }; - - var sliderBarItem = new BarEditItem - { - Width = 300, - Edit = trackBar - }; - - var dateEdit = new RepositoryItemDateEdit(); - var dateBarItem = new BarEditItem - { - Edit = dateEdit, - Width = 80 - }; - - var timeEdit = new RepositoryItemTimeEdit(); - var timeBarItem = new BarEditItem - { - Edit = timeEdit, - Width = 100 - }; - var projectTypeComboBox = new RepositoryItemComboBox { TextEditStyle = TextEditStyles.DisableTextEditor @@ -591,9 +559,6 @@ mainForm.ToolBar.AddItems(new BarItem[] { projectTypeBarItem, - sliderBarItem, - dateBarItem, - timeBarItem, designAnalysisBarItem }); @@ -628,10 +593,6 @@ BindSupport.Bind(projectPanel, projectTypeBarItem, x => x.DamProjectType, BindingType.LabelAndValue); BindSupport.Bind(calculationSpecificationPanel, designAnalysisBarItem, x => DamProjectCalculationSpecification.SelectedAnalysisType, BindingType.LabelAndValue); - - BindSupport.Bind(locationJobSymbolPanel, sliderBarItem, x => x.CurrentView); - BindSupport.Bind(locationJobSymbolPanel, dateBarItem, x => x.CurrentDateTime); - BindSupport.Bind(locationJobSymbolPanel, timeBarItem, x => x.CurrentDateTime); } /// @@ -807,7 +768,6 @@ { damProject.DeleteResults(); lastDesignResult = null; - lastLocationResult = null; } catch (Exception exception) { @@ -872,14 +832,6 @@ { DataEventPublisher.AfterChange(this); } - - if (e.Property != null && e.Property.Equals("CurrentDateTime")) - { - if (lastLocationResult != null) - { - ShowLocationImage(lastLocationResult.StabilityTimeSerie, locationJobSymbol.CurrentDateTime); - } - } } else if (sender == damProject.DamProjectData) { @@ -897,7 +849,7 @@ try { damProject.ImportWaterLevelTimeSeries(); - locationJobSymbol.Update(damProject.DamProjectData.LocationJobs); + //locationJobSymbol.Update(damProject.DamProjectData.LocationJobs); } catch (TimeSerieSchemaValidationException exception) { @@ -957,10 +909,6 @@ { Location location = locationJob.Location; DataEventPublisher.SelectionChanged(location, PropertyEditorReactionType.Ignore); - if (damProject.DamProjectData.DamProjectType == DamProjectType.DamLiveConfiguration) - { - ShowLocationImage(null, locationJobSymbol.CurrentDateTime); - } if (damProject.DamProjectData.DamProjectType == DamProjectType.Design) { @@ -1066,21 +1014,6 @@ } } - private void ShowLocationImage(TimeSerie result, DateTime currentTime) - { - if (result != null) - { - string path = DamProject.ProjectWorkingPath + result.Entries.First().RelativeCalculationPathName; - string file = result.GetNearestBasisFileName(currentTime); - file = path + file + ".wmf"; - ShowImage(file); - } - else - { - mainForm.DynamicImageControl.ZoomablePictureBox.Image = null; - } - } - private void UpdateForDamApplicationType() { Assign(damProject.DamProjectData);