private void WaveDataBaseSelection_Loaded(object sender, RoutedEventArgs e) { if ((sender as OpenFileButton).SelectedFileName != null) { m_WavesDataBase = new WaveLengthLoader((sender as OpenFileButton).SelectedFileName); m_WavesDataBase.Search(" ", WavesDatabaseList); } }
private void WaveDataBaseSelection_FileSelect(object sender, OpenFileButton.FileSelectionArgs e) { if (e.isSelected) { m_WavesDataBase = new WaveLengthLoader(e.FileName); m_WavesDataBase.Search(" ", WavesDatabaseList); } }
private void LoadConfig_Click(object sender, RoutedEventArgs e) { var debugPath = "../../json.json"; string configFilePath = debugPath; var openDialog = new OpenFileDialog(); openDialog.Filter = "Config files (*.xconf)|*.xconf|All file (*.*)|*.*"; if (openDialog.ShowDialog() == false) { return; } configFilePath = openDialog.FileName; System.IO.StreamReader sw = new System.IO.StreamReader(configFilePath); var jsonConf = sw.ReadLine(); m_SysConf = JsonConvert.DeserializeObject <SystemConfig>(jsonConf); jsonConf = sw.ReadLine(); var waveBase = JsonConvert.DeserializeObject <WaveLengthLoader>(jsonConf); m_WavesDataBase = new WaveLengthLoader(waveBase); jsonConf = sw.ReadLine(); m_SelectedWaves = JsonConvert.DeserializeObject <WaveLenghts>(jsonConf); m_SelectedWaves.onWaveAdd += SelectedWaves_onWaveAdd; m_SelectedWaves.onWaveChange += SelectedWaves_onWaveChange; m_SysConf.onChange += SysConf_onChange; m_SysConf.onWaveLimitChange += SysConf_onWaveLimitChange; SysConf_onChange(this, null); m_SelectedWaves.UpdateUI(m_UIS); m_WavePlot.SetWaveLimits(m_SysConf.waveLimits); }
public WaveLengthLoader(WaveLengthLoader loader) { m_DBName = loader.m_DBName; ReadDatabase(); }
public static void Search(this WaveLengthLoader loader, string pattern, DataGrid WavesDatabaseList) { WavesDatabaseList.ItemsSource = loader.Search(pattern); WavesDatabaseList.Items.Refresh(); }