private void PortOpen(object sender, RoutedEventArgs e) { string portType = (string)pmHt[sender]; DataProvider dp = PluginLoader.Instance().NewPluginInstance(portType); if (dp.Open() >= 0) { PortPannel pp = new PortPannel(); DataPump dataPump = new DataPump(); CurveWindow cw = new CurveWindow(); CodeEditor ce = new CodeEditor(); Session session = new Session(); session.dataProvider = dp; session.portPannel = pp; session.dataPump = dataPump; session.curveWindow = cw; session.codeEditor = ce; this.pannelList.Items.Add(pp); /* * double[] data = new double[2] { 23, 45 }; * for(int i = 0; i < 1600; i++) * { * cw.DeliverData(data); * } */ } }
public void Spalten_Header_werden_geliefert() { var sut = new DataPump(); var headers = sut.GenerateHeader(new[] { new ColumnDefinition("a", new IncrementingIntGenerator()), new ColumnDefinition("b", new IncrementingIntGenerator()) }); Assert.That(headers.Select(x => x.Header), Is.EqualTo(new[]{"a", "b"})); }
static void PrepareTables() { const int NDX_LABEL = 0; const int NDX_SPOT_VALUE = 1; IDatumProvider dp = AppContext.AccessPath.GetDataProvider(InternalTablesID.TRANSACTION); List <RowAction>[] actions = { new List <RowAction>(), new List <RowAction>() }; using (var pump = new DataPump(dp)) { pump.Connect(); DataPump.Item item = pump.NextItem; while (item != null) { var trans = item.Row as Transaction; int ndx = trans.TableID == InternalTablesID.TR_LABEL ? NDX_LABEL : trans.TableID == InternalTablesID.TR_SPOT_VALUE ? NDX_SPOT_VALUE : -1; if (ndx != -1) { RowAction ra = actions[ndx].Find(a => a.RowID == trans.RowID); if (ra == null) { actions[ndx].Add(new RowAction(trans.RowID, trans.Action)); } else if (ra.ActionCode == ActionCode_t.AddRow && trans.Action == ActionCode_t.DeleteRow) { actions[ndx].Remove(ra); } else { ra.ActionCode = SelectAction(ra.ActionCode, trans.Action); } dp.Delete(item.Index); } item = pump.NextItem; } } foreach (RowAction ra in actions[NDX_LABEL]) { UpdateTextTable(ra.RowID, ra.ActionCode); } foreach (RowAction ra in actions[NDX_SPOT_VALUE]) { UpdateSpotTable(ra.RowID, ra.ActionCode); } }
public void Extract(SourceFileItem item, IAsyncProgress asyn) { if (Context == null) { return; } Context.UnsafeSource = item; DataPumpControllableExecutionContext contextEx = Context as DataPumpControllableExecutionContext; if (contextEx != null) { contextEx.Reporter = asyn; } DataPump.Execute(Context); }
private void DoDataPump(ExtractItem extractItem, IEnumerable <DataParsePluginInfo> plugins) { //执行数据泵服务 foreach (var plugin in plugins) { foreach (var s in plugin.SourcePath) { if (_cancelToken.IsCancellationRequested) { return; } DataPump.Execute(s, null, extractItem); } } Reporter?.ChangeProgress(extractItem.GUID, 0.33); }
/// <summary> /// Called to perform the main body of work for the application after command line arguments have been parsed. /// </summary> /// <param name="commandLine">Command line arguments.</param> protected override void Run(Arguments commandLine) { Log.WriteInfo("Starting up.\nUTC time: {0}\nLocal time: {1}\nVersion: {2}", DateTime.UtcNow, DateTime.Now, Assembly.GetExecutingAssembly().GetName().Version); Log.WriteInfo("Input directory: {0}", commandLine.InputPath); Log.WriteInfo("Output directory: {0}", commandLine.OutputPath); Log.WriteInfo("TShark path: {0}", commandLine.TShark); Log.WriteInfo("TShark parameters: {0}", commandLine.TSharkParams); DataWriterType dataWriterType; string connectionString; if (commandLine.DBSqlServer) { SqlConnectionStringBuilder sqlStringBuilder = new SqlConnectionStringBuilder(); sqlStringBuilder.DataSource = commandLine.DBHostname; sqlStringBuilder.IntegratedSecurity = commandLine.DBIntegrated; if (!commandLine.DBIntegrated) { sqlStringBuilder.UserID = commandLine.DBUsername; sqlStringBuilder.Password = "******"; } sqlStringBuilder.InitialCatalog = commandLine.DBCatalog; Log.WriteInfo("Using SQL Server database: {0}", sqlStringBuilder.ToString()); if (!commandLine.DBIntegrated) { sqlStringBuilder.Password = commandLine.DBPassword; } connectionString = sqlStringBuilder.ToString(); dataWriterType = DataWriterType.SqlServer; } else { MySqlConnectionStringBuilder sqlStringBuilder = new MySqlConnectionStringBuilder(); sqlStringBuilder.Server = commandLine.DBHostname; sqlStringBuilder.IntegratedSecurity = commandLine.DBIntegrated; if (!commandLine.DBIntegrated) { sqlStringBuilder.UserID = commandLine.DBUsername; sqlStringBuilder.Password = "******"; } sqlStringBuilder.Database = commandLine.DBCatalog; Log.WriteInfo("Using MySQL database: {0}", sqlStringBuilder.ToString()); if (!commandLine.DBIntegrated) { sqlStringBuilder.Password = commandLine.DBPassword; } connectionString = sqlStringBuilder.ToString(); dataWriterType = DataWriterType.MySql; } DataPump dataPump = new DataPump(); dataPump.TSharkPath = Path.GetFullPath(commandLine.TShark); dataPump.TSharkParams = commandLine.TSharkParams; dataPump.InputPath = Path.GetFullPath(commandLine.InputPath); dataPump.OutputPath = Path.GetFullPath(commandLine.OutputPath); dataPump.ConnectionString = connectionString; dataPump.DataWriterType = dataWriterType; dataPump.DisableForeignKeys = commandLine.DBForeignKeys; if (!string.IsNullOrEmpty(commandLine.FixupsPath)) { dataPump.FixupsPath = Path.GetFullPath(commandLine.FixupsPath); } if (!string.IsNullOrEmpty(commandLine.DataFilterPath)) { dataPump.DataFilterPath = Path.GetFullPath(commandLine.DataFilterPath); } dataPump.DataFilterPreset = commandLine.DataFilterPreset; dataPump.Run(); }
public void Init(Pump pump, IEnumerable <ExtractItem> extractItems, String rootSavePath, IAsyncProgress asyn) { DataPump = pump.GetDataPump(); Context = DataPump.CreateContext(pump, rootSavePath, null, null, asyn); }
public void Setup() { sut = new DataPump(); }
public void Init(Pump pump, IEnumerable <ExtractItem> extractItems, String rootSavePath, DefaultMultiTaskReporter asyn) { DataPump = pump.GetDataPump(); Context = DataPump.CreateContext(pump, rootSavePath, null, null, asyn); }