public void setSensor(OceanLoadingProperties.GreenFunctionEntry GreensFunction, OceanLoadingProperties.OceanModelEntry[] OceanModel, OceanLoadingProperties.LocalOceanModelEntry[] LocalOceanModel, string pathProperties) { this.GreensFunction = GreensFunction; if (OceanModel != null) { this._OceanModel = new List <OceanLoadingProperties.OceanModelEntry>(OceanModel); } else { this._OceanModel = null; } if (LocalOceanModel != null) { this._LocalOceanModel = new List <OceanLoadingProperties.LocalOceanModelEntry>(LocalOceanModel); } else { this._LocalOceanModel = null; } oclp = OceanLoadingProperties.deserialisieren(pathProperties); setFormsEarthModel(); setFormsOceanModel(); setFormsLocalOceanModel(); readyForContinue(); }
public UserControl_OceanLoadingProperties(OceanLoadingProperties.GreenFunctionEntry GreensFunction, OceanLoadingProperties.OceanModelEntry[] OceanModel, OceanLoadingProperties.LocalOceanModelEntry[] LocalOceanModel, string pathProperties) { this.pathProperties = pathProperties; InitializeComponent(); setSensor(GreensFunction, OceanModel, LocalOceanModel, pathProperties); }
// public string pathProperties { get; private set; } public SelectOceanLoadingProperties(OceanLoadingProperties.GreenFunctionEntry GreensFunction, OceanLoadingProperties.OceanModelEntry[] OceanModel, OceanLoadingProperties.LocalOceanModelEntry[] LocalOceanModel, string pathProperties) { this.GreensFunction = GreensFunction; this.OceanModel = OceanModel; this.LocalOceanModel = LocalOceanModel; InitializeComponent(); userControl_OceanLoadingProperties.setSensor(GreensFunction, OceanModel, LocalOceanModel, pathProperties); userControl_OceanLoadingProperties.OnUpdateStatus += new SPOTL.UserControl_OceanLoadingProperties.StatusUpdateHandler(uControl_OceanLoadingProperties1_OnUpdateStatus); }
private void updateSensorEntry() { if (suppress) { return; } GreensFunction = null; _OceanModel = null; _LocalOceanModel = null; // Earth Model string selectedModel = null; if (comboBoxEarthModel.SelectedItem != null) { selectedModel = comboBoxEarthModel.SelectedItem.ToString(); for (int i = 0; i < oclp.GreenFunctionItems.Length; i++) { if (selectedModel == System.IO.Path.GetFileNameWithoutExtension(oclp.GreenFunctionItems[i].FileName)) { GreensFunction = new OceanLoadingProperties.GreenFunctionEntry( oclp.GreenFunctionItems[i].Description, oclp.GreenFunctionItems[i].FileName, oclp.GreenFunctionItems[i].EarthModel, oclp.GreenFunctionItems[i].Source, oclp.GreenFunctionItems[i].Pattern, oclp.GreenFunctionItems[i].Frame); break; } } } // Ocean Model _OceanModel = new List <OceanLoadingProperties.OceanModelEntry>(); for (int i = 0; i < cbWaves.Length; i++) { if (cbWaves[i].Checked) { string[] parts = cbWaves[i].Name.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries); string model = parts[0]; string wave = parts[1]; bool existent = false; for (int j = 0; j < _OceanModel.Count; j++) { if (OceanModel[j].ModelName == model) { existent = true; } } if (!existent) { for (int k = 0; k < oclp.OceanModelItems.Length; k++) { if (oclp.OceanModelItems[k].ModelName == model) { _OceanModel.Add(new OceanLoadingProperties.OceanModelEntry() { ModelName = oclp.OceanModelItems[k].ModelName, Description = oclp.OceanModelItems[k].Description, FilePath = oclp.OceanModelItems[k].FilePath, Year = oclp.OceanModelItems[k].Year, DarwinSymbol = new string[] { wave }, }); break; } } } else { for (int k = 0; k < OceanModel.Length; k++) { if (_OceanModel[k].ModelName == model) { List <string> ds = new List <string>(); if (_OceanModel[k].DarwinSymbol != null) { ds = new List <string>(_OceanModel[k].DarwinSymbol); } ds.Add(wave); _OceanModel[k].DarwinSymbol = ds.ToArray(); break; } } } } } // Local Model _LocalOceanModel = new List <OceanLoadingProperties.LocalOceanModelEntry>(); for (int i = 0; i < cbLocalWaves.Length; i++) { if (cbLocalWaves[i].Checked) { string[] parts = cbLocalWaves[i].Name.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries); string model = parts[0]; string wave = parts[1]; bool existent = false; for (int j = 0; j < _LocalOceanModel.Count; j++) { if (_LocalOceanModel[j].ModelName == model) { existent = true; } } if (!existent) { for (int k = 0; k < oclp.LocalOceanModelItem.Length; k++) { if (oclp.LocalOceanModelItem[k].ModelName == model) { _LocalOceanModel.Add(new OceanLoadingProperties.LocalOceanModelEntry() { ModelName = oclp.LocalOceanModelItem[k].ModelName, Description = oclp.LocalOceanModelItem[k].Description, Location = oclp.LocalOceanModelItem[k].Location, FilePath = oclp.LocalOceanModelItem[k].FilePath, Year = oclp.LocalOceanModelItem[k].Year, DarwinSymbol = new string[] { wave }, }); break; } } } else { for (int k = 0; k < _LocalOceanModel.Count; k++) { if (_LocalOceanModel[k].ModelName == model) { List <string> ds = new List <string>(); if (_LocalOceanModel[k].DarwinSymbol != null) { ds = new List <string>(_LocalOceanModel[k].DarwinSymbol); } ds.Add(wave); _LocalOceanModel[k].DarwinSymbol = ds.ToArray(); break; } } } } } if (_LocalOceanModel.Count == 0) { _LocalOceanModel = null; } readyForContinue(); }