Sunday, February 25, 2018

Tracker - Printing is still hard!

But I've got a start. Using some UWP Community tools to help with the print. What really needs to happen is a more generic way (there is a pretty good MVVM version that almost works, and might if I was doing the whole MVVM thing. But I am not).

I do have it printing the list control (the list of cargos themselves), but what really needs to happen is I need to create a nice looking RTF (Rich Text Format) and go from there. I now know how to get the print to work using the OS native print control, so there is a preview and all that. Now I just need to make a good-looking document and print from there.

And this is slow going not because it is hard (well, that too), but because I have a severe lack of time due to classes. Who knew that getting a 2nd masters would take so much time? Rhetorical question - I figured I'd give up any personal life the next 2 years.  I am adapting (and so far have a 49.5 / 50 so must be doing something right!). Any free time though goes to family. They all happen to be away today and I've caught up on classes. So here we are!

Wish I had a picture or something. Heck - I'll put in the ugly print I've got now.  I do plan on making this into a better document, and I am really thinking adding graphics - i.e., allow the user to upload stamps and stuff.  Down the road assuming I keep going down the road...


Monday, February 12, 2018

Tracker - printing is hard

Sadly, printing in a UWP app is a lot more difficult than it should be.  I've tried a few things, but in the end, I may end creating an HTML doc internally, and then saving that to a PDF.  I've not really had enough time to go through all the options, and there is a printer helper that in theory allows you to print a UI component, such as a grid.  But the component can't be attached to anything, and there is no simple way to clone a UI element.  I've got some code from Code Project that in theory allows for a deep clone of an element, but it is having issues I need to work through.

I want to get a generic print thing going as more than just the cargo manifest will need to be printed.

And it was a leg day on Monday - never a great way to start off the week!

Monday, February 05, 2018

Tracker - world images, logs now pivot

Switched the world control around a bit, so now the world image (primary image), notes, log and general images are all in a pivot control.  Still need to set the 1st image when the images get loaded - there's always a blank image until you scroll, then that image goes away.

The idea for the world log is to have a date-based log for the worlds just as we do for the ships. I don't think I've actually implemented that though.


Friday, February 02, 2018

Adding images to the worlds

I've added the image carousel to the world control.  Found a few things:
  1. I need to either set the height in that control or do something - the image will come out at the size they are, and that means it rolls off the screen.  Maybe a pivot to have info & image?
  2. it seems to lave a blank spot to being with, but once you scroll it is no longer there.  I think I need to set the first image as selected.
  3. Drag & dropping images would be nice
  4. a way to delete images would be nice
  5. the world image can cover data - pivot to the rescue?
But it did work! And even more fun - it's a control using a control!


Sunday, January 28, 2018

Tracker - now with images!

I added a generic image table so that I could add images to worlds or ships.  The hard part was displaying them.  I finally, after way too much trouble, got the image carousel to work. While you can't see it on the image, this is a carousel you can slide through the images.  I've made it a user control so I can plop it anywhere. Currently it is on the ship page, but I'll get around to adding it to the world viewer so you can have more than one image attached to a world.


Saturday, January 20, 2018

Tracker - more cleanup, added notes to the world model

More under the hood updates with some UI updates: I've removed the edit buttons on the lists. Now you just click or press on the item and the editor loads up.  This saves a column to better fit smaller screens as well as cleaning up the UI a bit.

I've also added a notes field to the world, and I may do the same for the ship, so that you can have notes that are not ship date based.

I've added a generic image holder to the program but have yet to do anything with that.  If I have time this weekend I would like to get an image carousel working.  Get that done, and I can stick it on the ship tracking page and the world view control so you can add images to help invoke what things look like.

I've also added light slate blue as the background color for the user controls. If I don't like that I can always change the formatting dictionary.

Wednesday, January 17, 2018

Tracker - more cleanup and UI updates

Due to snow, I was unable to get to work today. So while I did spend half the day getting my computer ready to be able to work from home (Ubuntu on Windows without a VM! All the updates! Then Ruby! Then Rails! Literally almost half the day just downloading stuff) I also spent half the day working on this project (technically the office is closed due to the snow, but as some of us can work from home...)  I also spent some time shoveling snow, and getting my computer ready for the project management class that starts tomorrow.  So updates, due to an estimated 15 hours a week for class time, may be greatly reduced soon.

Anyway, after playing around some more I realized that several of my layouts won't play nice with smaller screens. So I've been doing a bit of revising, and some more cleanup under the hood as I've found minor errors when using the tracker.  The only major UI update you'll see from today's work is the available cargo tab.  I've set the major/minor/incidental cargos to just be text inside the button, and that reduced the width enough to fit on most tablets I am pretty sure. I also added the jump distance next to the world name, and if you click on the world name, the world info box comes up just as it does on the jump listing.

I've also had 2 people clone the repository, so that does mean at least two other people are looking at the code. Woot?  I also finished up the community stuff in GitHub (basically be nice) just because.







Sunday, January 14, 2018

Tracker - and more cleanup

A lot more under the hood updates, mostly correcting the removal of an application-wide list of sectors I did not need. I also added the 1st option: reset the sectors. This actually removes all the sectors and worlds from the local DB, resets all the ship sectors and worlds (now I realize I don't need a ship sector if I have a world - the world contains the sector. Maybe another correction in a bit).  It then reloads ALL the sectors for the 4 eras. Doing so of course broke the ship view - it was assuming we have valid values for the things I just cleared!  On the bright side, this should also correct the same issue when adding a new ship - something I had not thought of.

I also added a list of eras to the main app, so it is now centralized versus being in various places. The eras (M0, M1105, M1248 & M1900) are part of the API calls to the TravellerMap, so that you can get the UWP for the specific era. 1105 is of course the largest set of sectors; I think M0 only had about a dozen or so versus all of them for 1105.  I may have the options page show the count of sectors for each era, and maybe the list as well or something.

I've added a generic dialog class so that I can abstract user-enter dialogs a bit.  I've added that as I also added the image list table, and will allow you to load images for ships or worlds. I want to figure out the image carousel thing as I think that would be really cool, but realized I also wanted the user to be able to enter text for the images.

Throwing in one of the hex maps from my game - no images for the tracker since the UI has not changed much yet, and I like pictures.


Saturday, January 13, 2018

Tracker - moved jump map to same tab (aka pivot) as the jump list

Well, that was simple, and I think simplifies the UI a bit more...so now we've the visual with the text for the jump distance as well.



Tracker - more cleanup, added the jump distance to the jump button

Bit more cleanup under the hood. There are parts that are a bit more complicated than I like - sometimes I apparently develop in a stream of conscious sort of way.  But I am at least unifying the UI a bit.

I've also added the jump distance to the jump button on the list of systems in range.  Just so you know at a glance how far away they are.  And now I am thinking I could add the jump map there...

What I really need is someone to side load this & give me feed back. Sort of going in circles.  If anyone is interested, I'll create the new installers for Windows 10 and post them.


Tracker - still in clean up mode

Mostly under the hood updates. I've moved all the ship edit stuff to the ship tracking view, and removed the edit option from the main ship listing. So now there is just tracking, and to edit the ship use the info tab.

A few other minor cleanups - apparently I was calling the TravellerMap API more than necessary (not that they are charging or anything but someone is paying for the web!)  So there is a bit more checking to see if I've already loaded what is needed into the local DB before loading again.  So that should also improve off-line capabilities a bit more (and I've not really tested that, but I am going with there will be problems).

Mostly refactoring.  Hopefully I'll finish that today.

I also updated the tiles to be better. The splash screen as a tile does not work well. Not happy with the small or wide tile so those will also need a bit more work. But they are better than before.  GIMP is under my Traveller selection as I pretty much only use it for Traveller stuff.



Sunday, January 07, 2018

Tracker - a bit more consistency

I've started attempting to make the various layouts more consistent. I've removed the New Ship button from the main menu and it is now on the ship listing content page. That's where the new whatever button will be on the various layouts, such as cargo and starports (yes, you can now add your own starport class).  The ship listing page no longer has the delete option - it is on the ship edit page instead. But I have added the ship class so that may make the listing more useful.

I've also made the database save all changes when the program is closing or getting suspended.  I still have issues with data not always getting persisted to the DB, and this should help.

I've also reset the migrations, so anyone who is running this from the source code will have to reset their database if they use the last version or two of the software (App.xaml.cs file, uncomment the db.Database.EnsureDeleted line, run the program, then re-comment out that line unless you want a fresh DB every time).

Interestingly I have received no comments about installing this locally on user machines. Either no one wants to, the directions were more complicated than I thought, or people are being more cautious about installing software from the internet.  While I do have 7 watchers on that repository, no one has cloned it either.  But the code is out there for anyone to see.


Saturday, January 06, 2018

Tracker - Traveller version update

After realizing there were also...questions...about the cost per jump for passengers, and not just bulk cargo, and also finding that the layout did not work on my tablet, I've made some additional updates to the version.  I've added the cost per passage by jump, and updated the math involved so that adding passengers as well as cargo should use the cost that is assigned to the ship's version.

Just trying to avoid the whole can of worms that has been open for, say, 40 years or so now...

Not entirely liking my approach: I almost went the way of adding yet another table that would have the cost, the jump distance, and what it was (high, mid, low, bulk cargo), as well as the version ID.  It would have allowed for jumps more than 6 if you allow that as well as streamlining the tables. But it also makes the UI more complicated in some ways. So each version would have, out of the box, 6 (jump ranges) x 4 (cargo, high, mid, low pax) associated records. I went this route for the actual value table - there are 14 actual value records per version (they get created at 100% when you load a version the 1st time).  So it could have been done to make it more flexible (I would then add another field to the version to indicate max jump range, rather than the default 6 with the hardcoded fields).

I really hate hard-coded fields - they box you in. I may still go that route, but as this is not enterprise level software, I probably won't.


Monday, January 01, 2018

Tracker - sideload the alpha release

I'm going with this is an alpha release.  If you want to trust me and have Windows 10 and install what I've got so far, here is how you do that:

1. Go to Windows settings & set your machine to developer mode to allow side-loading

2. download the installer package here (this has the installers for x86, x64 and ARM processers - I loaded it on my ARM Win10 machine this way to test):  https://1drv.ms/u/s!AgjJYJOsJH7WgYtQgV1IYp11qM_lwg

3. right click the appx package and follow the directions here to allow my not-a-real security certificate to allow you to install software from me: https://stackoverflow.com/questions/23812471/installing-appx-without-trusted-certificate

4. Install

Now this is an early, beta release, so it WILL have issues (I just found that the version editor on my tablet does not scroll so you can't get past the J4 settings).  But I will appreciate any feedback.

Now note that this does mean you are trusting me, a faceless person on the internet.  While this application does access the internet (to use the TravellerMap API) and I've given it access to your pictures folder which may not be necessary to load images but I've not tested that yet), that is all it accesses.  You will get that info when installing.

Also note that if I do make radical database updates, your Traveller Tracker data will go away.  I cannot stress enough that this is an alpha release!

And finally, as to not clog up the Traveller G+ site, probably any questions/requests should go on this blog.  I fear most of them will be of a technical nature if you are not a developer.

Saturday, December 30, 2017

Tracker - some general cleanup

Mostly under the hood updates. I've added the ability to remove the cargos and logs for a ship, as well as deleting a ship itself.  As I've updated the way the ship cargo works so that it is never actually deleted, even when unloaded, you may want to clean up things after a while.  I am setting an active flag for the cargo so we can have a cargo manifest based on what is currently loaded, or on some historical dates (i.e., what you were carrying 3 months ago. Pesky bureaucracies!)

Minor UI update to the ship list to make it a bit easier to read, and I've added the version and current planet as well as the delete button.  The number in [ ] is the ID of the ship.  I'll probably remove it but I thought it could be interesting to see how many ships you have added.


Tuesday, December 26, 2017

Tracker - buying and selling spec trade

Both the purchase and selling go through the same control now - the difference is which DMs are you using (purchase or resale) and whether you are adding it or removing it from your cargo.

Basic part is there (and spent way too much time rotating that text - as it is in a grid that caused the text to get truncated until I figured that out). You can add your DMs, click the roll, and it will calculate the price based on tonnage and the actual value table.

Now, I need to make it actually buy or sell when you click the button, but that part is already written. What I need to do is now abstract that out from the ship tracking view so that I can buy or sell cargo from a ship in other places.

It was interesting getting the actual value tables in place as well. They will default to 100% when loading the first time, but then you can set than as you wish.

Still need to let the user add new versions and a bunch of things like that. And I need to get the basic how to document done. But that will be mostly an iteration of:

  1. create a ship class. This is where the tonnage, jump, maneuver, power, cargo and passenger information is stored. If you want to modify a ship in terms of any of these things you will need to create a new ship class.
  2. create your ship: select the version, the milieu, the date, the ship class. Set your location and initialize ship funds
  3. create any cargo you want. currently I am sticking in the original d66 table from book 2 but it does not include the trade code DMs.  
  4. go to the ship tracking (ship list, then select track for the ship) where you can edit your ship logs, see what worlds are in jump range, load cargo and passengers, jump to any world within reach.
I've got a few things there I'm not actually using. I've set up the trade codes as a table you can edit so yo can set the trade codes based on the world stats, but at the moment I am using the remarks field from the TravellerMap API so I am not sure I'll keep that.  I've an options button that does nothing.


Tracker - selling spec trade - just about there!

I had to make a few more changes to the database: we need to track the price we purchased it at and sell it at. This way you can tell if you are making a profit or not. I plan on logging all this to the ship log, but also I may not actually delete cargos from the ship cargo manifest, but set them to a sold/not there anymore status.  This would allow us to generate the cargo manifest from any point to any point in time.  In case the custom's inspector wants to see what you were carrying the last time you came through this system 6 months ago.  So eventually the print cargo manifest will allow you to print what is currently on board, or what was on board for a specified date range. I do stress the eventually...

A few other changes, and I've (finally) got the trade code stuff working, and allowing the players' to have a DM on the actual value table. The roll button should add the number of days to your ship calendar as per the searching for cargo I think, and I've got to wire up the actual sell part (which is coded but not called).  But the resulting price is the base price * the tons * the percent value (which I now realize I need to divide by 100 - there is some major price gouging in that image!)

And I also have to revisit purchasing the spec cargo - it will end up being the same user control but in buy mode vs sell mode.This way we can keep the price you paid for it as well.

I've also added a UserBackground brush to my resource dictionary so that all the user controls can have the same color - change it one place & they all get the same color. Just need to update the other controls to use that.  The light blue is not a great choice...


Monday, December 25, 2017

Tracker - selling your spec trade

Getting closer.  I've added the actual value tables to be version specific, I've added trade code modifications to the Classic Traveller cargo, and I've got the basic sell your spec trade layout in place.  Now I have to figure out which DMs are available, so I will also be adding the current world's trade codes in a display at least, then cross-reference the two so we know which apply.

I'd almost rather have the DM based on cargo ID and trade code ID, but the data maintenance side of that would really bring back to mind the accountants in space trope for Traveller.  So I took the expedient way and will let the user just enter text.

And in re-reading the rules, the purchase price is also affected by trade codes...so I need to revisit that.



Sunday, December 24, 2017

Tracker - more version stuff

Adding the resale value table to the version.  Having some issues with this one, but making some progress.  But it does allow you to set the cargo code type as well as the actual value table.

However, for some reason this popover does not go away when you click outside of it.  Most strange!


Tracker - selling speculative trade

I've got the framework now in place - clicking on the remove button, if it is a speculative trade, will show the following pop up. The actual value table will show on the right, and I've yet to fill in some of the data. And this is another user control. And the UI needs work but it is the first draft.

However, I've decided to add the actual value table as a user-editable table to be attached to the version in play. Which means the simple version editor will get a bit more complicated, but it also solves, or rather bypasses, the issue I wasted way too much time on yesterday: getting an enumeration (the cargo codes) to be a combobox (list of choices) to display and work in a list of the versions.  So now there will be an 'other options' at the end of the version editor to allow you to enter the cargo code type and enter the true value lists.

I also need to work on the trade code part. I've got most of it in place, but the DMs are also version dependent or should be, so I may have to extend the trade codes table to also be linked to the version.
Doing this version-dependent thing, and not actually supplying the data, may allow this to get published without issue, but I will still be checking.