RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Wed Dec 24, 2025 1:35 pm

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Tue Mar 06, 2007 5:02 pm 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
kascade wrote:
ok, i've implemented this in the logger with some slight modifications.

You'll need to finish the implementation of the class RomRaider.logger.utec.plugin.UtecDataSource to hook into the UTEC data. UtecDataSource is an implementation of the interface ExternalDataSource:

Code:
public interface ExternalDataSource {

    String getName();
   
    String getVersion();

    List<ExternalDataItem> getDataItems();
}


which needs to return a list of ExternalDataItem's. These are defined as:

Code:
public interface ExternalDataItem {

    String getName();

    String getDescription();

    String getUnits();

    double getData();
}


As an example I have provided a very basic TestExternalDataSource class which just returns random values from its ExternalDataItem implementation.

It is all integrated into the gui, file logger and profile management by default. Additional external sources can be added at will either directly into the codebase or via external jar files. This is possible because the logger dynamically adds additional external datasources based on the presence of *.plugin files in the plugin directory. There is one file per data source which specifies the data source class name. note that a data source may support multiple data items by just returning each of them in the list via the getDataItems() method.

I have only tested it quickly for the moment but it seems to work fine so far. i had to use a couple of small hacks to get it in but they are pretty well restricted to a single class in the bowels of the logger.

hopefully this should open up the way to integrating the LC-1, etc too - whatever happened to the code for that anyway? i'm still waiting...

anyway, let me know how you go.



Thanks for your work.

My only other thought is the coordination of COM access. The UTEC, LM/C-1 and other wideband sensors connect via a COM port like the OBD2 access. It would be nice if in your logger gui it would somehow allow the users to assign a COM port to the UTEC (one not used by your logger)

As in a user would select say com7 for UTEC access, and you could call methods like below on the ExternalDataSource instance.


Code:
setCommPort(String port);
connect();
disconnect();
startLogging();
stopLogging();

*We could then create a ExternalDataSourceError to be thrown if connection and or logging fail*

I'll implement what you have now, and if you agree to the above methods, I'll add them afterwards for you to use.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 11:04 pm 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
I changed your ExternalDataSource interface to include my suggestions. Easy to remove if need be :), no offense taken.

I've checked in the relevant code and am headed to my car to test now.

Code:
package RomRaider.logger.utec.plugin;

import RomRaider.logger.ecu.external.ExternalDataItem;
import RomRaider.logger.ecu.external.ExternalDataSource;
import RomRaider.logger.utec.commInterface.UtecInterface;

import java.util.ArrayList;
import java.util.List;

//NOTE: This class is instantiated via a no-args constructor.
public final class UtecDataSource implements ExternalDataSource {
   private ArrayList<ExternalDataItem> externalDataItems = new ArrayList<ExternalDataItem>();
   
   public UtecDataSource(){
      externalDataItems.add(new AfrExternalDataItem());
      externalDataItems.add(new PsiExternalDataItem());
      externalDataItems.add(new KnockExternalDataItem());
   }
   
    public String getName() {
        return "UTEC Datasource";
    }

    public String getVersion() {
        return "0.01";
    }

    public List<ExternalDataItem> getDataItems() {
        System.out.println("External TXS data items requested.");
       
        return externalDataItems;
    }
   
    // *****************************
    // Suggested Methods of interest
    // *****************************
   
    public void setCommPortChoice(String commPort){
       UtecInterface.setPortChoice(commPort);
    }
   
    public void connect(){
       UtecInterface.openConnection();
    }
   
    public void disconnect(){
       UtecInterface.closeConnection();
    }
   
    public void startLogging(){
       UtecInterface.startLoggerDataFlow();
    }
   
    public void stopLogging(){
       UtecInterface.resetUtec();
    }
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 11:59 pm 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
I could not test as there is an issue with the logger.

Kascade, your ConnectionPropertiesImpl class request information on baud rate etc. The logger.xml is being used to get this connection information but the logger.xml does not have baud information etc, and thus the following code fails when you try to parse an Integer from an empty string:

I just wanted to point this out. :)

Code:
  public void startElement(String uri, String localName, String qName, Attributes attributes) {
        if (TAG_PROTOCOL.equals(qName)) {
            parseProtocol = protocol.equalsIgnoreCase(attributes.getValue(ATTR_ID));
            if (parseProtocol) {
               System.out.println("Attr: "+attributes.getValue(ATTR_BAUD));
                connectionProperties = new ConnectionPropertiesImpl(Integer.parseInt(attributes.getValue(ATTR_BAUD)),
                        Integer.parseInt(attributes.getValue(ATTR_DATABITS)), Integer.parseInt(attributes.getValue(ATTR_STOPBITS)),
                        Integer.parseInt(attributes.getValue(ATTR_PARITY)), Integer.parseInt(attributes.getValue(ATTR_CONNECT_TIMEOUT)),
                        Integer.parseInt(attributes.getValue(ATTR_SEND_TIMEOUT)));
            }


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 3:18 am 
Offline
RomRaider Developer
User avatar

Joined: Sun Jul 16, 2006 12:09 am
Posts: 644
Location: Brisbane, Australia
Tgui wrote:
I could not test as there is an issue with the logger.

Kascade, your ConnectionPropertiesImpl class request information on baud rate etc. The logger.xml is being used to get this connection information but the logger.xml does not have baud information etc, and thus the following code fails when you try to parse an Integer from an empty string:

I just wanted to point this out. :)


The connection properties are definitely in there and it's all checked in. Here's what it should look like:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE logger SYSTEM "logger.dtd">

<logger>
    <protocols>
        <protocol id="SSM" baud="4800" databits="8" stopbits="1" parity="0" connect_timeout="2000" send_timeout="55">

            <parameters>
                 ...

_________________
Paul.
------------------------------------
MY04 Forester XT (Aus. spec)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 11:21 am 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
kascade wrote:
Tgui wrote:
I could not test as there is an issue with the logger.

Kascade, your ConnectionPropertiesImpl class request information on baud rate etc. The logger.xml is being used to get this connection information but the logger.xml does not have baud information etc, and thus the following code fails when you try to parse an Integer from an empty string:

I just wanted to point this out. :)


The connection properties are definitely in there and it's all checked in. Here's what it should look like:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE logger SYSTEM "logger.dtd">

<logger>
    <protocols>
        <protocol id="SSM" baud="4800" databits="8" stopbits="1" parity="0" connect_timeout="2000" send_timeout="55">

            <parameters>
                 ...


Strange, I did a doc search for "baud' and your code was definitely taking a crap. I'll try to pull the latest code again.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 2:20 am 
Offline
RomRaider Developer
User avatar

Joined: Sun Jul 16, 2006 12:09 am
Posts: 644
Location: Brisbane, Australia
any luck getting it going? all the code is there, so make sure you are using the latest logger.xml.

_________________
Paul.
------------------------------------
MY04 Forester XT (Aus. spec)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 2:42 am 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
kascade wrote:
any luck getting it going? all the code is there, so make sure you are using the latest logger.xml.


I've fixed my dev environment and have just found I broke my code somehow. Suppose if I were a proper developer I'd have plenty of unit tests to prevent such things from happening. :P


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 8:40 am 
Offline
Administrator
User avatar

Joined: Fri Jan 13, 2006 12:33 pm
Posts: 2079
Location: Palo, IA
Tgui wrote:
Suppose if I were a proper developer I'd have plenty of unit tests to prevent such things from happening. :P

I've never known anyone like that.. ;)

_________________
- Jared


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 4:50 pm 
Offline
Newbie

Joined: Fri Apr 07, 2006 9:23 am
Posts: 19
was thinking on this, and think a utec plugin will be really useful. Also, a gps plugin could be very nice and probably not too bad?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 10, 2007 3:28 pm 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
Utec integration works :) See attached log.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 10, 2007 5:17 pm 
Offline
RomRaider Developer
User avatar

Joined: Sun Jul 16, 2006 12:09 am
Posts: 644
Location: Brisbane, Australia
nice! now we know it more or less works, i'll have a look at cleaning the code up a little bit and have a look at the connection properties, etc per plugin. Eventually we'll also need support for multiple unit selection too.

_________________
Paul.
------------------------------------
MY04 Forester XT (Aus. spec)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 10:40 am 
Offline
Senior Member

Joined: Thu Aug 03, 2006 10:40 am
Posts: 1934
anything new on this? it looks great!

could it be possible to log additional utec fields, like mod ign1?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 11:47 am 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
ride5000 wrote:
anything new on this? it looks great!

could it be possible to log additional utec fields, like mod ign1?


Right now the utec code supports logger #1, so if mod ign1 is in that, then yes. If not, which logger is it in?

Otherwise, not much new on this. I'm working 3 jobs now, so I'm a tad tied up. Let me know what logger # youre using and I can add support. Worst case is I write up a howto and supply my alpha code so that Utec users have something to play with.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 1:09 pm 
Offline
Senior Member

Joined: Thu Aug 03, 2006 10:40 am
Posts: 1934
no, mod ign #1 is the utec specified ignition value when it is "in control" and is certainly one of the fields of logger #1, so if that's covered then everything is cool.

i guess my question is: what do i need to do to enable utec serial com port 1 log 1 logging?

even now i'm just getting used to the idea of logging with RomRaider. ;)

tia
ken


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 1:31 pm 
Offline
RomRaider Developer

Joined: Tue Jul 11, 2006 9:25 pm
Posts: 1025
ride5000 wrote:
no, mod ign #1 is the utec specified ignition value when it is "in control" and is certainly one of the fields of logger #1, so if that's covered then everything is cool.

i guess my question is: what do i need to do to enable utec serial com port 1 log 1 logging?

even now i'm just getting used to the idea of logging with RomRaider. ;)

tia
ken


I'll post more later, but the basic steps now are

1) Launch RomRaider
2) Launch UTEC logging application, select com port, start flow of data
3) Launch Eninguity logger and select supported utec logging attributes (Afr mod ign etc)
4) Do your driving thing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl