|
RomRaider
Documentation
Community
Developers
|
| Author |
Message |
|
SaltyRaider
|
Post subject: Scotthew's Dev Ramblings Posted: Thu Jul 11, 2013 11:45 am |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
|
I got the Fred Cook smack down for posting on GitHub so this will be the new location...
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Thu Jul 11, 2013 1:59 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
I think we were way off on our value bounds checking. This is now what i have. Can you please look over this and see if it makes sense? Potential issues with the old way: - Using Double.MIN_VALUE for the minimum. However Double.MIN_VALUE is not negative. - Using Double.MAX_VALUE ((2-2^-52)*2^1023). Should this be Float.MaxValue (2-2^-23)*2^127?
New Way: Code: if (getStorageType() != Settings.STORAGE_TYPE_FLOAT) { if (isSignedData()) { switch (getStorageType()) { case 1: minAllowedValue = Byte.MIN_VALUE; maxAllowedValue = Byte.MAX_VALUE; break; case 2: minAllowedValue = Short.MIN_VALUE; maxAllowedValue = Short.MAX_VALUE; break; case 4: minAllowedValue = Integer.MIN_VALUE; maxAllowedValue = Integer.MAX_VALUE; break; } } else { maxAllowedValue = (Math.pow(256, getStorageType()) - 1); minAllowedValue = 0.0; } } else { maxAllowedValue = Float.MAX_VALUE;
if(isSignedData()) { minAllowedValue = 0.0; } else { minAllowedValue = -Float.MAX_VALUE; } }
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Thu Jul 11, 2013 2:16 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
|
Dale,
also check out commit 2da92658542ba503f641cbec479479fd815ed9be. Let me know if this helps with performance issues.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Thu Jul 11, 2013 11:24 pm |
|
 |
| RomRaider Developer |
Joined: Wed May 20, 2009 9:49 pm Posts: 7314 Location: Canada eh!
|
|
I may not be able to get to this until the weekend.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 3:17 pm |
|
 |
| RomRaider Developer |
Joined: Wed May 20, 2009 9:49 pm Posts: 7314 Location: Canada eh!
|
|
I had a quick look at this and I think you are right. The MIN for a Double was actually set to the smallest magnitude that a Double can represent and not the most negative possible value (-Double.MAX_VALUE). And yes since we are dealing with Float dataType from the ROM we should be using the Float.MAX_VALUE and -FLOAT.MAX_VALUE as the extremes.
All of the Integer signed and unsigned min/max is defined correctly though, right?
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 4:25 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
Quote: All of the Integer signed and unsigned min/max is defined correctly though, right? Yes the others look correct just Float and Double have this issue. non negative min value issue.
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 4:43 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
|
You sent me down a rabbit hole.
The scale node can have min and max attributes. Are these min and max values expressed in terms of the scaled value or the raw values? Stepping through the code it appears to be the scaled value but I just wanted to double check.
And if it was the scaled values then this was not done correctly. This value needs to be converted to raw first and then applied to the raw value check.
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 5:05 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
Have you ever heard of the "Scale Selection Panel" This is supposed to be part of the toolbar but it is commented out? I think I may know why. 
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 5:35 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 6:06 pm |
|
 |
| RomRaider Developer |
Joined: Wed May 20, 2009 9:49 pm Posts: 7314 Location: Canada eh!
|
SaltyRaider wrote: You sent me down a rabbit hole.
The scale node can have min and max attributes. Are these min and max values expressed in terms of the scaled value or the raw values? Stepping through the code it appears to be the scaled value but I just wanted to double check.
And if it was the scaled values then this was not done correctly. This value needs to be converted to raw first and then applied to the raw value check. I guess there's two min/max. The min/max of the dataType, i.e.: integer And min/max of "acceptable" scaled values for a table. Let assume you have a table of RPM values. Does it make sense to allow -2500 RPM to be entered (after conversion from real to byte) because the underlying dataType allows it? Probably not.
|
|
| Top |
|
 |
|
SaltyRaider
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Fri Jul 12, 2013 6:10 pm |
|
 |
| Newbie |
Joined: Sun Apr 01, 2012 1:28 pm Posts: 59
|
Quote: I guess there's two min/max. The min/max of the dataType, i.e.: integer and min/max of "acceptable" scaled values for a table. Yep that is what I thought. I just wanted validation. This has now been fixed.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Sat Jul 13, 2013 10:16 am |
|
 |
| RomRaider Developer |
Joined: Wed May 20, 2009 9:49 pm Posts: 7314 Location: Canada eh!
|
|
One thing I noticed with EcuFlash defs is that <scaling /> have min/max values specified but I have never seen them enforced, unless it only checked in the ROM saving step. The min/max is missing from the RomRaider scaling so I expect this is calculated internally. But it really takes a human to dictate the true min/max values appropriate for any table.
|
|
| Top |
|
 |
|
Merp
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Sat Jul 13, 2013 1:14 pm |
|
 |
| Experienced |
 |
Joined: Thu Jul 23, 2009 1:46 pm Posts: 863
|
|
I haven't checked the saving process in ECUFlash, but to my understanding the min/max are primarily used to set the color mapping min/max.
_________________ Please do not send me support questions via PM, use the forum instead!
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Sun Jul 14, 2013 10:25 pm |
|
 |
| RomRaider Developer |
Joined: Wed May 20, 2009 9:49 pm Posts: 7314 Location: Canada eh!
|
|
I'm having a look at your commit d4350b2127ddbf881d784296ab8b9bcb56aee549 The change to manual colourizing allows for much faster table updates and no spike in CPU utilization like before. I think more responsive is better than a colour update for a subtle table change. Nice update.
I think there's a problem with the set cell value function for 2D tables. Set value works on some tables and not others. I cannot set a value in the injector latency table but I can on the timing table. The up/down buttons and multiple still works fine.
And there's still the problem that clicking Restore Defaults in the RomRaider Settings page removes all entries in the Def Manager list, resets User Level and changes the <image_dir /> item. I believe the Restore Defaults should only apply to the Settings page items as the Def Manager is a separate function with its own dialog, as is User Level and image_dir is just the dir of the last ROM loaded.
On the subject of User Level. Level 5 is defined as Debug. Do you see any code that is triggered by Debug mode in the Editor (there's that greyed out Debug Mode in settings too, what's that)?
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Scotthew's Dev Ramblings Posted: Sun Jul 14, 2013 10:35 pm |
|
 |
| RomRaider Developer |
Joined: Wed May 20, 2009 9:49 pm Posts: 7314 Location: Canada eh!
|
|
Oh and I found that colourization should be activated when doing a compare. Right now a compare shows no changes on the activate table until you press the re-colourize button or hide/redisplay the table with compare still on.
|
|
| Top |
|
 |
Who is online |
Users browsing this forum: No registered users and 6 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
|
|