Comments (8)
Why is this needed? Why not just load all at once and then iterate through the Data enumerable (see DataWithColumns) at whatever rate you want?
I'm not saying "no" to the per-line capability (callback or whatever) but it doesn't seem to be required, right?
from canbus-analyzer.
@Bokonon79
Let me know if this (DataColumns.Read) covers what you need:
https://brianman.visualstudio.com/_git/CANTools/commit/2a1bba820dbf207b5594ea92d3e712fe96c120e7?refName=refs%2Fheads%2Fu%2Fbrianman%2FLoadIncremental
I'll push to master but I figured it would be good to have you test it first.
from canbus-analyzer.
Why is this needed? Why not just load all at once and then iterate through the Data enumerable (see DataWithColumns) at whatever rate you want?
I could be prematurely optimizing, but my reasoning was this: longer captures are going to be several hundred MBs or a few GBs in size. If we were to read the entire file into memory all at once, only to pass it to the timerCallback() loop one line at a time, we'd end up consuming ~twice the memory by the end of the load, which could become a problem on a multi-GB file. Since both DataWithColumns and CANBUS-Analyzer's timerCallback() loop are already built around line-by-line iteration, it seemed like a natural solution to connect the two with minimal effort.
Let me know if this (DataColumns.Read) covers what you need:
I could be missing something, but just from looking at the commit, I didn't see where the callback was actually invoked.... Does something like this need to be added to Read() at line 199?
if (callback != null)
{
callback(row);
}
I'll push to master but I figured it would be good to have you test it first.
Sounds good. I've added CANTools/u/brianman/LoadIncremental as a submodule on my development branch and will try it out later today (adding the code above if needed).
from canbus-analyzer.
Good catch on the missing callback(row). That pointed out a bug in my unit test. The unit test bug is now fixed in master and u/brianman/LoadIncremental has been rebased onto the new master and had the fix applied. Sorry for the inconvenience.
from canbus-analyzer.
No apologies necessary, thanks for making those changes! I've updated the submodule in my main dev branch and will try wiring it up this weekend.
from canbus-analyzer.
Sorry for the absence... I've got the CANTools log readers integrated in my CANToolsReaders branch, along with a bug fix for #26.
To get the log readers to work, I ended up making three small changes to DataWithColumns in a cloned copy of CANTools/LoadIncremental
-
Extract ReadHeaders() and ReadNext() methods from Read():
Bokonon79/CANTools@ae7a4fd -
Add support for multi-space delimited files:
Bokonon79/CANTools@f32163b
@brian-man, I didn't see a way to submit a pull request to your CANTools repo on Azure DevOps, but if I could, it would contain the above two commits. Could you please have a look at them when you get a chance, and consider merging them into the LoadIncremental branch? Thanks.
from canbus-analyzer.
Initial feedback:
- ReadHeaders doesn't need to be public.
- What's the benefit of adding ReadNext, and why is it public?
Perhaps I'm missing something. Can you point me to your branch's commit in CANBUS-Analyzer the uses CANLib?
from canbus-analyzer.
Also, I don't like multi-space because it's lossy -- which means it breaks, for example, round-trip serialization. What benefit is it giving you?
from canbus-analyzer.
Related Issues (15)
- a screenshot wanted HOT 5
- CanOPEN import filter broken by known packets definitions HOT 3
- Add support for importing Vector ASCII format
- NotifyPropertyChanged in ListItem throws NullPointerException a lot HOT 4
- Choose which packet definitions to use (Model S, Model 3, Model S DBC, etc.) HOT 3
- Reset packet counts, graphs, etc. when a new file is loaded HOT 1
- Stable Release/experimental builds HOT 6
- Clickonce installer auto-update
- Better playback controls HOT 1
- Improve or rethink "Interpret as", "copy ID" functionality
- Vector ASCII Format: message IDs < 0x100 should be zero-padded
- Multiplexed DBC message implementation has some (poor) assumptions
- Time axis on X axis of graph
- Crash when loading a dbc file HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canbus-analyzer.