Comments (4)
Maybe I'm missing something, but I don't see anywhere in the code where the ListElement.PropertyChanged event handler is assigned to. I looked in the history for ListElement.cs and couldn't find a version where PropertyChanged was assigned a callback.
Do we know what the intended callback method(s) are supposed to be? Something in MainWindow.xaml.cs?
from canbus-analyzer.
This is the WPF data bindings subscribing to these events.
public class ListElement : INotifyPropertyChanged
and that these are 'subscribed' by the wpf system. So that when
` foreach (var i in items)
Graph.Series.Add(
new LineSeries() { StrokeThickness = 1, LineStyle = LineStyle.Solid, Title = i.Value.name, ItemsSource = i.Value.Points });
Graph.InvalidatePlot(true);
`
(from MainWindow.cs)
key here is the ItemsSource = i.Value.Points
That causes the "Points" property of MainWindow to be subscribed by the OxyPlot window.
However, Oxyplot says it does NOT support NotifyPropertyChanged properly, which is why I still need to call Graph.InvalidatePlot(true) to refresh the graph window.
I just tried an old checkin of mine from July 2018, that does not throw ANY null pointer exceptions in this PropertyChanged handler, and the whole screen updates seem a lot smoother.
Probably this is something simple and stupid, I noticed Brian-Man has broken the ListItem class into a separate file, maybe that file is not public, or some other access or namespace problems so the MainWindow WPF can not reach it properly ?
from canbus-analyzer.
Got it, I see the connection now.
It looks like the PropertyChanged event handler isn't wired up by OxyPlot until you actually select the graph tab, or select a different ID to graph, so perhaps the exception was being thrown prior to either of those happening.
Interesting that the graph seemed to work more smoothly in an older commit... I wonder what changed? ListItem class is public, and the graph seems to be able to add/remove the PropertyChanged event-handler without issue.
from canbus-analyzer.
No, in the earlier builds nothing happens with these until you select the graphs tab, and actually select some items to graph. If you turn on all exception and run it in debug, you will see that the older builds does not throw any nulls in that area.
Newer builds seem to throw null every time, and not working at all. The Pull Request I merged from Scott recently didn't really help, it just checks for null, and does not throw any exceptions, but the result is this handler does nothing.
Before that, Brian-Man added a lot of code to fix his issue that the graphs didn't auto-scale. I tried telling him that this was never an issue, but obviously it had happened when he started working on it.
The end result is not really that dramatic, but it seems the graphs will auto-scale when you start it, but not as it continues rendering. Meaning, if you switch packets while the log is running, the graph is correctly scaled, but if your signal goes higher or lower while watching it, it goes outside the window. On older build they would always scale correctly.
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
- Integrate CANTools Log File Readers HOT 8
- 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.