|
 |
|
06-10-2009, 10:37 AM
|
#1
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
Vehicle Maintenence Plugin
I've developed a standalone maintenance tracker application and im considering porting it over to an RR plugin (long overdue IMHO). The standalone works by calculating the distance between GPS coordinates which calculates the total distance traveled, then weighs that figure against his preset maintenance intervals. Im surprised to say the distance calculation works very well! I've tested it over the last few days side by side with iGuidance and the distances are spot on. Finishing the application should be a matter of using a timer to calculate the difference between the interval value and distance value.. but while i'm still tinkering with distance calculation i'm curious to see if anyone can think of any other potential uses for it.
Beta 2 Released 10/30/09
http://cid-742b075baeb78d0d.skydrive...ublic/RRVM.rar
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
Last edited by JohnWPB; 10-30-2009 at 04:40 PM..
Reason: Updated the date to match the new upload.
|
|
|
|
|
|
Advertisement
|
Sponsored links
|
06-10-2009, 01:50 PM
|
#2
|
|
Constant Bitrate
Join Date: Jun 2008
Location: Atlanta, GA
Posts: 132
|
Quote: Originally Posted by Sonicxtacy02 
I've developed a standalone maintenance tracker application and im considering porting it over to an RR plugin (long overdue IMHO). The standalone works by calculating the distance between GPS coordinates which calculates the total distance traveled, then weighs that figure against his preset maintenance intervals. Im surprised to say the distance calculation works very well! I've tested it over the last few days side by side with iGuidance and the distances are spot on. Finishing the application should be a matter of using a timer to calculate the difference between the interval value and distance value.. but while i'm still tinkering with distance calculation i'm curious to see if anyone can think of any other potential uses for it.
I've been thinking about a similar thing!
You could combine this with the notifications from (I think) RRExtended and pop up reminders when you need to get an oil change, etc.
Are you calculating the distance based on the GPS coordinates every minute or so?
Edit: just re-read your post and seems that's exactly what you had in mind...  In either case, this would be a welcome addition to RR, I think.
Last edited by spamminator; 06-10-2009 at 01:54 PM..
|
|
|
06-10-2009, 02:40 PM
|
#3
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
Quote: Originally Posted by spamminator 
I've been thinking about a similar thing!
You could combine this with the notifications from (I think) RRExtended and pop up reminders when you need to get an oil change, etc.
Are you calculating the distance based on the GPS coordinates every minute or so?
Edit: just re-read your post and seems that's exactly what you had in mind...  In either case, this would be a welcome addition to RR, I think.
i've been calculating once per second as thats the frequency the gps updates its position.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
|
|
|
06-10-2009, 04:53 PM
|
#4
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
Here's a screenshot of my maintenance plugin i threw some time into today. in this example i set my oil change interval to 5 miles. the content in the message box is pulled from an .ini file thats formatted like so.
Code:
/USER CONFIGURABLE SETTINGS
/<ITEM#>=<NAME>,<MILEAGE INTERVAL>,<TIME INTERVAL (DAYS)>,<COST(WITHOUT'$')>,<NOTES>
Maintenance1=Oil Change;5;180;17.50;Use 5W-30
Maintenance2=Air Filter;12000;360;12.00;Check cabin filter
You can see at the top of the shot the total distance is 5.97 miles traveling, thus i got a warning letting me know i was .9 over my oil change interval. Once complete, the plugin will allow you to add maintenance items at runtime and view each item in list form. Selecting an item in list will show you the details from the ini along with handy labels for distance to interval, last "change" date, and time remaining.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
Last edited by Sonicxtacy02; 06-10-2009 at 04:57 PM..
|
|
|
06-10-2009, 05:06 PM
|
#5
|
|
Newbie
Join Date: Mar 2009
Posts: 4
|
an other idea is to use the distance calculation for a tripmaster
i have a tripmaster in my car now which i use with 4x4 trips
it can measure 4 different distances
totall of the day
totall of the trip
totall between two waypoints
and one to spare
and they can be set zero with one touch on a button
i tried to use milage but somehow i cant get it running 
i like the idea that the tripmaster is integrated in the computer
it will clean up my dashboard 
and it is easyer to get external sigals trigger one of the meters
i tried with milage to let one counter automaticly count the kilometers driven in 4x4 by using the signal of the 4x4 light in the dashboard
|
|
|
06-10-2009, 05:09 PM
|
#6
|
|
Newbie
Join Date: Aug 2007
Posts: 8
|
This is great. Add a tire rotation reminder too! Ultimately, some nice little oil-can and tire icons in the skin that turn red or blink when it is time for service.
|
|
|
06-10-2009, 07:08 PM
|
#7
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
Quote: Originally Posted by ingtvis 
an other idea is to use the distance calculation for a tripmaster
i have a tripmaster in my car now which i use with 4x4 trips
it can measure 4 different distances
totall of the day
totall of the trip
totall between two waypoints
and one to spare
and they can be set zero with one touch on a button
i tried to use milage but somehow i cant get it running 
i like the idea that the tripmaster is integrated in the computer
it will clean up my dashboard 
and it is easyer to get external sigals trigger one of the meters
i tried with milage to let one counter automaticly count the kilometers driven in 4x4 by using the signal of the 4x4 light in the dashboard
already calculating trip distance... dont see why waypoint calculator cant be added with a command to set waypoint A and B
Quote: Originally Posted by BusterGroove 
This is great. Add a tire rotation reminder too! Ultimately, some nice little oil-can and tire icons in the skin that turn red or blink when it is time for service.
You set the reminders you wish to use as well as the intervals. At this point it accepts up to 50 maintence items and that is easily expandable. what i can do is have each maintenance item have an indicator with 3 user-definable images...good, warning, and exceeded that will be based on the intervals current status. Sorta the same way i did the traffic details plugin forever ago for you old bodies
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
|
|
|
06-12-2009, 03:24 PM
|
#8
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
went ahead and changed the thread title to where this is going. Here's a screenshot of the plugin in action with its full capability.
the icons next to the list items are a quick view status indicator for each maintenance item. The screen shot indicates its very close to time to change my oil. This is based on the fact that the time remaining label is 0 days and the oil change interval displayed is 1 day(if time interval is less than 80% of number of days counted the orange alert occurs). If it were tomorrow the icon next to Oil Change would change to a red one indicating it need be changed NOW! There will also be a popup skin that will show once daily if the status is orange or red. Popup will give you the option to snooze the warning for a day, or tell the plugin the oil change is done... thus resetting the time remaining and mileage remaining.
The way point feature is not shown in use but its working. Basically you hit the "Add Point" button then the waypoint mileage starts tracking. Hitting the add point button again stops the tracker and saves the resulting mileage to an .ini file for later retrieval. Hitting the button a third time starts the process all over
Last thing for me to do is add the ability to add items from within RR. This will require multiple OSK popups but in the end it'll be easier than opening the .ini everytime u want to change something.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
Last edited by Sonicxtacy02; 06-12-2009 at 03:27 PM..
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
06-12-2009, 03:55 PM
|
#9
|
|
Constant Bitrate
Join Date: Jun 2008
Location: Atlanta, GA
Posts: 132
|
Awesome!
I'm wondering if MPG calculations couldn't be rolled into this as well. Basically, hit a button to "add gas" then type in how many gallons and at what price. The plugin knows how far you've gone since the last fill-up, so it could tell you your average MPG (for those without an OBD2 connection to the PC). Heck, it could remember the last 100 fillups and give you a nice graph of your MPG over the last XXX miles or YYY months, if we wanted to get adventurous....
I think the other trip meter/milege calculator did something similar, but I could never got it to work right...
|
|
|
06-12-2009, 04:04 PM
|
#10
|
|
Low Bitrate
Join Date: Apr 2009
Posts: 71
|
Quote: Originally Posted by spamminator 
Awesome!
I'm wondering if MPG calculations couldn't be rolled into this as well. Basically, hit a button to "add gas" then type in how many gallons and at what price. The plugin knows how far you've gone since the last fill-up, so it could tell you your average MPG (for those without an OBD2 connection to the PC). Heck, it could remember the last 100 fillups and give you a nice graph of your MPG over the last XXX miles or YYY months, if we wanted to get adventurous....
I think the other trip meter/milege calculator did something similar, but I could never got it to work right...
I like graphs!
Personally I like a cost/mile ratio over time graph. With the fluctuation in gas price, it helps me keep track of what I'm actually spending for every mile I drive.
|
|
|
06-12-2009, 04:06 PM
|
#11
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
i was actually considering that last night. Should be easily done. I'd also like to come up with a cost per mile readout based on the cost label for each maintenance item but i'm not sure how to handle it. one thing i did have to do is scale the mile reading back to once ever 2 seconds because my timer that handles the calculation took more than a second the calculate and save to file. Gonna run this over the weekend and see if i come up with anymore bugs but for the last 2 days its been rock solid.
also forgot to mention the status indicators are user definable. They are based on 3 .jpg files in the skin file. green.jpg, yellow.jpg, and red.jpg.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
Last edited by Sonicxtacy02; 06-12-2009 at 04:09 PM..
|
|
|
06-12-2009, 04:10 PM
|
#12
|
|
Low Bitrate
Join Date: Apr 2009
Posts: 71
|
Quote: Originally Posted by Sonicxtacy02 
one thing i did have to do is scale the mile reading back to once ever 2 seconds because my timer that handles the calculation took more than a second the calculate and save to file.
What I like to do in this situation is queue the actual write to the file in a separate thread, so that the updates to the UI are pretty fast. Then on the background thread do bulk-writes to the file instead of one at a time. File access is much slower than in-memory access, but once you have a handle open for a file, you should be able to write lots of data to it quickly.
Not sure what you're programming this in though.
Great job, and good luck!
|
|
|
06-12-2009, 04:13 PM
|
#13
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
I'm writing in vb.net.. and i'm a noob (still) dont know much about multi-threading. Spose now's a good time to read up lol.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
|
|
|
06-12-2009, 04:30 PM
|
#14
|
|
Low Bitrate
Join Date: Apr 2009
Posts: 71
|
Quote: Originally Posted by Sonicxtacy02 
I'm writing in vb.net.. and i'm a noob (still) dont know much about multi-threading. Spose now's a good time to read up lol.
I'd help ya out, but I'm a C# developer, so the syntax issues will cause issues.
But basically I create a separate class to handle writes to the file. If you're using .NET 2.0 or higher, use a generic Queue to Enqueue the item you want to write to the file system. Have a private method in your class that does a loop over the queue, dequeing each item and write it to the file system.
Your class should have one System.Threading.Thread members in it, and have it point to the method with the write loop.
Then just call the Start Abort method on your thread to start your looping method.
Here's a really quick and dirty example written in C#, that has not been tested. But you should be able to get the idea.
But yes, do some reading.
Code:
public class QueuedWriter:IDisposable
{
StreamWriter writer; // writer use to actually write to the file
Thread workerThread; // background thread used to perform the writes to the file
Queue<string> itemsToWrite = new Queue<string>(); // queue of items that will be written to the file
public QueuedWriter(string fileName)
{
writer = new StreamWriter(fileName);
workerThread = new Thread(mainLoop); // notice, we're specifying the mainLoop method in the constructor of the Thread
workerThread.Priority = ThreadPriority.BelowNormal;
workerThread.Start();
}
public void WriteItem(string item)
{
itemsToWrite.Enqueue(item);
}
private void mainLoop()
{
bool abort = false;
while (!abort)
{
try
{
/// Write everything that has been queued
while (itemsToWrite.Count > 0)
{
writer.WriteLine(itemsToWrite.Dequeue());
}
//Nothing to write, sleep a while
Thread.Sleep(1000);
writer.Flush();
}
catch (ThreadAbortException)
{
abort = true;
}
}
}
#region IDisposable Members
public void Dispose()
{
if (workerThread != null)
{
workerThread.Abort();
}
workerThread = null;
if (writer != null)
{
writer.Flush();
writer.Close();
writer.Dispose();
}
}
#endregion
}
|
|
|
06-12-2009, 04:32 PM
|
#15
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,253
|
i've got a c# to vb.net converter.. so that will help. Thanks!
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:51 PM.
| |