refactor: Replace DataPacket w/ IDataPacket in many places
This commit is contained in:
1 parent
49a952fb32
commit
03a8f4e9c0
64 files changed
+191
-200
No files matched your search
@@ -38,7 +38,7 @@ namespace BCG {
|
||||
protected override void myOnLastSubscriber() { myStream.onChange -= new ChangeDelegate(myHandleChanges); }
|
||||
|
||||
private void myHandleChanges(object newValue) {
|
||||
IBlueRowCollection totalState = (newValue as DataPacket).newRows;
|
||||
var totalState = ((IDataPacket)newValue).newRows;
|
||||
if (totalState.Count > 0 && myNWrites < myNMaxWrites) {
|
||||
myNWrites++;
|
||||
int i = 0;
|
||||
@@ -60,7 +60,10 @@ namespace BCG {
|
||||
IBlueRow nr = new BlueRow(myResultSchema, 0, myFullyQualifiedFileName, myNWrites, totalState.Count);
|
||||
BlueTable nRows = new BlueTable(myResultSchema);
|
||||
nRows.addRow(nr);
|
||||
myFireEvent(new DataPacket(nRows, nRows, new BlueTable(myLastValue == null ? new BlueTable(myResultSchema) : (myLastValue as DataPacket).newRows)));
|
||||
IBlueRowCollection deletedRows = myLastValue is null
|
||||
? new BlueTable(myResultSchema)
|
||||
: new BlueTable(((IDataPacket)myLastValue).newRows);
|
||||
myFireEvent(new DataPacket(nRows, nRows, deletedRows));
|
||||
} else
|
||||
myFireEvent(newValue);
|
||||
}
|
||||
@@ -126,7 +129,7 @@ namespace BCG {
|
||||
//_stopwatch.Stop();
|
||||
//bts.Log.Gen.info($"CSVReaderStream.myOnFirstSubscriber stream csv load col_count: {df.Columns.Count} rows, time: {_stopwatch.ElapsedMilliseconds} msecs");
|
||||
var rows = LoadFile(_file_address);
|
||||
DataPacket dp_out = BlueDataUtility.build_dp_inc(rows, myLastValue as DataPacket);
|
||||
var dp_out = BlueDataUtility.build_dp_inc(rows, myLastValue as IDataPacket);
|
||||
myFireEvent(dp_out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ namespace bts {
|
||||
}
|
||||
|
||||
private void _on_data(object obj) {
|
||||
DataPacket dp = obj as DataPacket;
|
||||
var dp = (IDataPacket)obj;
|
||||
if (_rows == null) {
|
||||
_rows = BlueDataUtility.get_typed_table(dp.newRows);
|
||||
}
|
||||
var dp_out = BlueDataUtility.build_dp_inc(_rows, myLastValue as DataPacket);
|
||||
var dp_out = BlueDataUtility.build_dp_inc(_rows, myLastValue as IDataPacket);
|
||||
myFireEvent(dp_out);
|
||||
|
||||
}
|
||||
@@ -30,4 +30,4 @@ namespace bts {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user