MarkAusten / TDHelper

GUI for Trade Dangerous and EDDBlink
MIT License
7 stars 4 forks source link

Clean install capacity import from edce throws ArgumentOutOfRangeException #38

Closed poisonbl closed 6 years ago

poisonbl commented 6 years ago

After starting up clean, or deleting tdh.ini, with the current ship is set to "Sidewinder", if I hit Cmdr Profile to load from EDCE, it throws that exception. I believe it's trying to validate against the currently selected ship's capacity range before switching the ship to match the ship it's importing (in this case, for my Type-7). Running v2.0.8.1.

************** Exception Text **************
System.ArgumentOutOfRangeException: Value of '288' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
Parameter name: Value
   at System.Windows.Forms.NumericUpDown.set_Value(Decimal value)
   at TDHelper.MainForm.UpdateCommanderAndShipDetails()
   at TDHelper.MainForm.BackgroundWorker7_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)

tdhelper-v2 0 8 1-capacity-edce-import-issue

poisonbl commented 6 years ago

As a side note on this, I tend to run numbers for other people now and then, and having it restrict my cargo size to only what I can carry in a ship I have registered with it seems unnecessary. If I happen to have my viper selected, being unable to run numbers for the T6 I don't have in my list of ships is somewhat limiting. Aside from ease of use of the 'up' button topping off, is there really a reason to limit that value?

MarkAusten commented 6 years ago

Thanks for the report, I spotted this one myself over the weekend. It is fixed for the next version.

As for the cargo limit, the next version has both the commander's owned ships and the complete list of ships with their just bought values, owned ships at the top of the list. The idea is that the owned ships are a "shortcut" to save you having to set and reset the values for your own ships. If you want to experiment then you can use the other list of ships for that purpose.

Unless there is a very good argument for it, I'll be leaving in the cargo limit being set to the max value of the ship to avoid the situation where you inadvertently set the cargo to a higher value that is possible for the selected ship.

Perhaps I should also include a "what-if" entry that has no cap just for the situation that you describe.

poisonbl commented 6 years ago

Awesome, and thank you. Having the set of stock craft list available after the import works just as well for all my use-cases at least. And also, thank you for this awesome tool. I started building a front end two or three times and never did get to as good a state as you have this one.

MarkAusten commented 6 years ago

Strangely enough I did the something myself. I started a GUI in Lazarus Pascal but abandoned it when I found TD Helper about 3 years ago. It was originally written by Jon Wrights so most of the thanks should go to him. It was only after he effectively abandoned it that I took it on and updated it.

The next version should be deployed in a couple of days. For now I'll close this issue.