Giter Club home page Giter Club logo

Comments (4)

Bokonon79 avatar Bokonon79 commented on June 28, 2024

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.

amund7 avatar amund7 commented on June 28, 2024

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.

Bokonon79 avatar Bokonon79 commented on June 28, 2024

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.

amund7 avatar amund7 commented on June 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.