After a lively discussion on the COTI forum, the conclusion is that the tonnage is:
(Flux + Pop) x (TCs + 1)
The trade codes (TCs) that are applicable are a limited sub-set of all the trade codes, so I've added that flag to the trade code table and it seemed to work. I'll probably update the seed to automatically set that as well when you load the software the first time.
I am also assuming we're using the absolute value of flux - no negative tonnage (I guess we really could do that and say that there is a demand for that particular cargo in the system). And it is possible for flux to be 0, meaning that no cargo was found. And unlike CT, it appears we roll once per day - good thing I set up the version table to have a slot for how many days per search!
And I still need to make that UI better: buying cargo should show the updated manifest. I do have the new ship process a bit better: it does go to the ship details layout. I may want to color-code the items you need to have entered to indicate that things are still needed. However, selecting the era did load the appropriate sectors and all that.
And playing with Campaign Cartographer more. I really need to go through a LOT more tutorials...but here is a test for the Cosmographer satellite view. I really need to figure out a bit more..