Need some Advice on Status Indicator

Discussion in 'Mac Programming' started by pilotError, Jun 4, 2012.

  1. macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #1
    I'm working on an Open Source project to interface to a battery charger.

    This particular charger only comes with Windows Software, and that's just not right...

    Either way, I've reverse engineered a large part of the communications protocol and have a basic front end up and running.

    I wanted to get fancy with it, but I have two issues. I'm not a front end developer by any means. I don't have a lot of coding time on Mac / Xcode and the various libraries.

    Given that, I have two things I would like to accomplish.

    I want to create a Battery Charge Indicator, similar to what the iPhone has when it's plugged in. That giant green battery, not the one on the status bar. I don't even know how to begin / what API's to use; create a set of jpg's and display them?, core graphics? Any good tutorials for this type of thing? It's asking a lot, I know...


    The second issue is I want to create real time graphs of various variables. Anyone recommend a good open source charting library?
     
  2. macrumors 68000

    Sydde

    Joined:
    Aug 17, 2009
    #2
    For the charge display, you want NSLevelIndicator, which produces a green image just like Apple's battery display (which you would have to embed in a battery graphic).

    Seems to me that NSBezierPath would handle most of the grunt work you would need for graphing. You might define a class that contains a path object and a color that updates and draws itself in its view. Bear in mind, though, that the view for paths should be flipped so that its Y value increases visibly upward instead of downward.
     

Share This Page