Well today is a new day. The days of coding are getting longer and the amount of daylight is getting shorter with each passing day as the day with the least amount of daylight is coming soon. It is so cold out to me that it is not very appealing to be outside anyway!
Today I have a new mapping engine that I need to add to my project and then see how many things have been fixed. We were having issues with touch events working but today that has been fixed. That is a great start to a new day. I also added a debug statement handler for the mapping engine so when running in debug I could tell if I caused any errors by incorrect setup on my part. The mapping engine team of two needed that functionality anyway to help debug crashes I was seeing so hopefully it will help us both.
I had yet another victory using LINQ and the more I use it the more I like it. This time I needed an "orderby" and "group" to find unique values. Oh my gosh that was so simple and makes sense at the same time. Now if I just had that in other languages that I use. This list of LINQ grouping examples definitely helped me a lot. Then I wanted to pass the group to a method to do more calculations and I found that I can create a List instead of having to deal with IGrouping by using ToList(). Wow that is so nice.
Next up is a little bit of math and thanks to the iPad app code I learned about this great site that explains in exact details how to determine a bearing. That certainly was easy, except for one thing I need to get the floating point modulus, which does not exist in the Windows Store Math library. Wait, it turns out that the "%" operator already handles that and so there is no need for a special Math library function like in Objective-C - that is the way it should work. I think I am finally getting the hang of this C# stuff. Of course it matters who you hang out with. Spending many hours yesterday with ex-Microsofties helps me know which language is better!
Pretty happy day so far as I finished the last layer on the map so now just need to look into a couple of small bugs and move onto the next tasks of filtering the data being displayed on the map. That is after I get the app working on another Windows 8.1 machine to make sure all of the mapping engine bugs have been fixed that preventing me from getting that far yesterday.
Today I am trying new music by following related to links in Spotify and found Doyle Bramhall again and I am enjoying like while struggling with builds. And then something magical happens as I have the app running on the other tablet. Maybe I should just quit while I am way ahead and it is not even noon yet.
I took a short break to celebrate but helping my daughter with my old Mac laptop as it was acting strangely. It is a 2009 model and still works pretty well for homework and cruising on the internet so it has done a great deal of work over the years. I originally bought it to work on writing my book as I wanted to use Pages and carry it around with me at work and when I went to the library. Overall is looks pretty good and recently my daughter decorated it with a turquoise outer shell and has a thin rubber key cover as well. All it took was a reboot and then holding down Command+S and I checked the hard drive to make sure there were no problems. All was well in the old Mac land.
Now I am back to work as I need to get filtering working. Wait, I cannot start yet as my Windows laptop has a bunch of updates that require a restart. I might as well do that before I get back into the depths of filtering. Just when I thought the work would begin on filtering I re-ran the app and noticed a point off the west coast of Africa, which can only mean one thing. There was a slight problem in that I always need to check to make sure every GPS point I receive is valid. Not that a point off the west Africa is not valid, it just is not valid in my case. I had to do some searching to see if there was anything special I had to do in C# to test a float is close to zero. Turns out the solution would work in pretty much any language.
Had to take a break and do a show-n-tell at work so others could see all of the amazing stuff that is working in the 18+ days so far.
Now I get to learn about notifications, bindings and the event model used in Windows Store apps. There is a couple of articles I need to read to become familiar with it.
At the moment I have to figure out how to take a screenshot on a Windows tablet without a keyboard. This is special hardware I am on so hopefully a generic solution will work. I searched Ms. Google for "windows 8 tablet screenshot" and found an article that described exactly what I need. Thankfully clicking on the Windows button on the front of the tablet and the Volume down button did the trick. It is kind of like the Home button and the Power button on my iPad. The only problem is I have to look to find which button is the Volume down button as the up and down buttons feel just the same. The Power button is right above the Volume up so that is probably not a good button to click on randomly. There is another button below the Power button that I don't even know what it is. I click it and behold it is the Autorotate button, which feels different from the others as it is smaller. The small unreadable label did not help me figure out that one.
I think it is time to call it a day and think about the notifications tomorrow morning when I am fresh from a good night's sleep. I am a morning person and need such tasks that require concentration for the wee morning hours.
Does good design really make a difference? Implementing software often has no relation to life outside work, where chaos seems to be the rule rather than the exception. You may not be able to control life, but let's not practice chaos when developing software.
Thursday, December 12, 2013
From concept to reality in 6 weeks - part 18
In two more days it will be one more week gone and that will leave me with only 3 weeks to go. No pressure! After a very long day yesterday, I definitely needed a night to rest and just not think about the Windows Store app. I woke up this morning ready for a new day. It was super frosty outside and I was just glad I did not have to go outside. Definitely zero interesting in running when it is this cold out.
The first thing is to solve the problems I had with one of the layers not displaying the correct colors. I had to go into the code that was defining the values and put in a "System.Diagnostics.Debug.WriteLine" to see what the values were. After seeing the output it was obvious what happened as I had two problems. The first was I saw a bunch of "-Infinity" values. I handled the case with missing values in my data loader but forgot I need to ignore those values when displaying data. The second problem was that all of the values were fractional and yet I stored color values in the range from 1-10. A quick scale factor solved that problem.
Then a couple more fixes and one last test proved that something had gone seriously wrong. I am now getting a run-time exception as the mapping engine does not like something I am passing to it. I try to use the Git client to see what I changed that was not good. I did not find it so it is time to debug until I find the problem.
I had a GoToMeeting with the customer, who was a no show, but I needed to document some of the potential UI needed for the next piece, so I added screenshots of the iPad app into Kanbanery along with some text explaining what I need to do. One of my favorite characters is the checkmark which is needed for the text description of the next few tasks, where I needed to show checkboxes [✓].
Now I have to hurry up and find this run-time error somewhere in my code. First I need to check on updating the UI from a background thread since I want to make sure that is not my problem. Microsoft has some nice documentation on asynchronous programming that explained many useful things. I don't see anything I am doing wrong so time to dig in a debug until I find and fix the problem. Some times you just have to relax, take a deep breath and then dive in.
I have to say that finding run time exceptions is just nasty in any language. I finally found and fixed the problem as I was calling an asynchronous method and when it returned I had assumed it fully completed - what a terribly bad idea that was. I looked back at the Git source history to see all of the changes I made this morning and then noticed the "async" change. I got into the debugger and checked the values after the method returned and found nothing was setup correctly. Bingo, found that nasty bug and now I get to move onto the making another build to test on another machine that mine.
Since I have only create one successful release build, I had to go remind myself how to do that by reading the documentation. The big secret is to select Store > Create App Packages... and then select "No" that I don't want to put the app in the store. My executable is now 10MB in size and that is after I removed BingMaps which made no difference at all in the size of the executable. Hopefully someone other than me will be able to get that to work correctly in Windows 8.
Turns out that it worked sort of. I was able to load the executable on a USB thumb drive and install it on another Windows 8.1 tablet but the way VSE creates a package installer is a bit odd. You have to be the administrator of the computer in order to use PowerShell. I found a Microsoft article that described the ticket to PowerShell working as you have to set the execution policy as in a PowerShell window:
Most of the remaining part of the day is trying to get work done in a very crowded Starbucks. I was meeting the mapping engine developers there. Typically they told me it was empty, but when I arrived there was not a single seat available at 2pm. I was constantly getting a dropped WiFi connection, which I assume was due to so many people trying to get WiFi and since I did not use it constantly I was being dropped. I finally gave up and just used the WiFi from my iPhone as it was the only reliable WiFi. Then it started having issues.
It was time to figure out how to get the app working by reading the files I downloaded from the server as that was my intent all along but did not take the time to get that working. For some reason the super crowds in the Starbucks must have caused my brain to stop working as I had to read about File IO again. The quick start guide to reading and writing files in a Windows Store app to the rescue. Everything hinges on a StorageFolder and a StorageFile. Finally after an hour I had the JSON being read from the last files I downloaded that worked. Not bad but it should have been a couple of minutes since I had already dealt with it, but so much time and code had passed thru my mind since then I guess.
The rest of my day was learning all of the new mapping engine APIs that I needed to call and making notes in Kanbanery so I did not forget how to do them when tomorrow morning arrives early. I also had to deploy many times and try to get the app running on a couple of other Windows 8.1 machines to verify the whole deployment would work easily.
Since I have only create one successful release build, I had to go remind myself how to do that by reading the documentation. The big secret is to select Store > Create App Packages... and then select "No" that I don't want to put the app in the store. My executable is now 10MB in size and that is after I removed BingMaps which made no difference at all in the size of the executable. Hopefully someone other than me will be able to get that to work correctly in Windows 8.
Turns out that it worked sort of. I was able to load the executable on a USB thumb drive and install it on another Windows 8.1 tablet but the way VSE creates a package installer is a bit odd. You have to be the administrator of the computer in order to use PowerShell. I found a Microsoft article that described the ticket to PowerShell working as you have to set the execution policy as in a PowerShell window:
This allows the command to be run to install the executable in the Metro desktop by running:Set-ExecutionPolicy RemoteSigned
./Add-AppDevPackage.ps1Of course most fonts make it very hard to know whether that is a numeric one or lowercase "L" as the last character in the file extension, but that is another usability problem for another day.
Most of the remaining part of the day is trying to get work done in a very crowded Starbucks. I was meeting the mapping engine developers there. Typically they told me it was empty, but when I arrived there was not a single seat available at 2pm. I was constantly getting a dropped WiFi connection, which I assume was due to so many people trying to get WiFi and since I did not use it constantly I was being dropped. I finally gave up and just used the WiFi from my iPhone as it was the only reliable WiFi. Then it started having issues.
It was time to figure out how to get the app working by reading the files I downloaded from the server as that was my intent all along but did not take the time to get that working. For some reason the super crowds in the Starbucks must have caused my brain to stop working as I had to read about File IO again. The quick start guide to reading and writing files in a Windows Store app to the rescue. Everything hinges on a StorageFolder and a StorageFile. Finally after an hour I had the JSON being read from the last files I downloaded that worked. Not bad but it should have been a couple of minutes since I had already dealt with it, but so much time and code had passed thru my mind since then I guess.
The rest of my day was learning all of the new mapping engine APIs that I needed to call and making notes in Kanbanery so I did not forget how to do them when tomorrow morning arrives early. I also had to deploy many times and try to get the app running on a couple of other Windows 8.1 machines to verify the whole deployment would work easily.
Tuesday, December 10, 2013
From concept to reality in 6 weeks - part 17
Today we start yet another day but for me it is all down hill from here on out. Today's big challenge is to make another build and see if my customer can install it without it prompting for my developer account. I also need to explorer ways of installing a Windows Store app outside the store to make sure the Microsoft documented way is the only way to get it to work. I also need to get layer filtering to work with the latest mapping engine build. On this very raining cold day I am expected to get a lot done. In general I need to hurry up as I have a week until the next full moon day and we all know what happens on those days. Before jumping into it, I have been re-listening to the music of Roy Buchanan while working this week. Yet another unknown talented guitar player who met his early demise. It just seems like the most creating people always have the biggest problems and Roy Buchanan killed himself in jail many years ago after yet another drunken state. So sad for me to read this again.
I started the morning by double checking all of the anchor points for the images I created yesterday to make sure it was exactly the same for each one. That was a bit time consuming. I then had to create white versions of each icon as that is what the mapping engine requires to color the values by height. It was time again to learn a bit about ImageMagick and how to do this in an automated fashion. This required using a trick where you pass an opaque color and the fill color. I preferred to ignore all pixels except the transparent color to do the fill that way:
I wish there was more to write about today but it was just a tons of coding and debugging. Nothing new or exciting to write about. All in all a good day as I got most of what I wanted done. I did not get time to look into how to deploy the app outside the Windows Store as that will have to wait until tomorrow.
I started the morning by double checking all of the anchor points for the images I created yesterday to make sure it was exactly the same for each one. That was a bit time consuming. I then had to create white versions of each icon as that is what the mapping engine requires to color the values by height. It was time again to learn a bit about ImageMagick and how to do this in an automated fashion. This required using a trick where you pass an opaque color and the fill color. I preferred to ignore all pixels except the transparent color to do the fill that way:
I learned this trick by going to one of the great tutorials that explains how to use ImageMagick for this purpose called Color Basics.convert +opaque transparent -fill 'rgba(255,255,255,255)' A.png A_white.png
I wish there was more to write about today but it was just a tons of coding and debugging. Nothing new or exciting to write about. All in all a good day as I got most of what I wanted done. I did not get time to look into how to deploy the app outside the Windows Store as that will have to wait until tomorrow.
Monday, December 9, 2013
From concept to reality in 6 weeks - part 16
Today is thankfully a new day as I just want to completely forget everything that happened this weekend as it was all just a bad dream, or at least that is what I want to tell myself. It was all personal problems with my family that is just getting worse with every passing day. That is the challenge of balancing family and work life. No client of mine pays me to moan and groan about my personal and family issues. They are paying me for super first class high quality results. Part of experience of getting old is to be able to separate family and work and put 100% effort into work every when things are going terribly at home. I really learned this two jobs ago when my best friend was dying of cancer in front of me daily at work. He definitely rose above his circumstances and did his absolute best even when feeling horrible from chemotherapy or radiation. He was a trooper until the end and I have to remember those 3 years for the rest of my life.
Now it is time to refocus on the task at hand as I am half way thru the project. Elapsed time wise I have 4 calendar weeks left to go. I realize that does not mean I have 20 days as I want to spend time with my family during Christmas and New Year's Day. Today my task is to finish off the final layer and resolve the layer icon issues so they all look correct by color and size. Before I start on that I need to check the label changes I made and learn about latitude for the millionth time it seems. I quickly go to Wikipedia so I can see a visual picture in my head so maybe just maybe I will remember this time that longitudes or meridians go thru the poles and latitudes are parallel to the equator. I change my debug statements to show the extend of the markers for N/S latitudes and E/W longitudes. I then need to fix my labels to show altitudes as whole numbers as I see decimal points being displayed, so I switch back over to the C# number formatting documentation asI have been there before. The secret was to use "N0" to show a number with no values after the decimal point. Two problems resolved just like that.
Now to solve the markers. I have decided to automate this whole process by using ImageMagick convert program since I don't want to edit the SVG files and generate PNGs each manually as that is too time consuming. I had to regenerate the triangle in Inkscape so I had to look that up as it is not obvious how to do that. The first thing is how to set the transparent pixel which is done with -transparent option. The second thing is how to account for the case when the background color is not an exact single color and that is fixed by using the -fuzz option. Then I need a way to change the default foreground pixel color as it needs to change for each marker depending on elevation and that is done with the -fill option. Now I just need to figure out the colors that match each of the icons and I am done. ImageMagick definitely helps me here as it supports many color syntax values. I have RGBA values stored in C# so I am going to use those values in my Bash script that will auto-image-magickally do every thing for me. As an aside, this has to be one of the worst names in all of UNIX, the shebang marker at the top of the UNIX shell script which I add to my script. I always run it with the time command so I know how long it takes to run:
The whole rest of the day was fixing, changing, editing and resizing icons to make sure they look really good as they are essential to the app. Gimp and Inkscape were my constant companions all day long. It took way too long to fix all of the images it had to be done either programatically or manually. I am just glad that it all looks good and I can call it a day.
Now it is time to refocus on the task at hand as I am half way thru the project. Elapsed time wise I have 4 calendar weeks left to go. I realize that does not mean I have 20 days as I want to spend time with my family during Christmas and New Year's Day. Today my task is to finish off the final layer and resolve the layer icon issues so they all look correct by color and size. Before I start on that I need to check the label changes I made and learn about latitude for the millionth time it seems. I quickly go to Wikipedia so I can see a visual picture in my head so maybe just maybe I will remember this time that longitudes or meridians go thru the poles and latitudes are parallel to the equator. I change my debug statements to show the extend of the markers for N/S latitudes and E/W longitudes. I then need to fix my labels to show altitudes as whole numbers as I see decimal points being displayed, so I switch back over to the C# number formatting documentation asI have been there before. The secret was to use "N0" to show a number with no values after the decimal point. Two problems resolved just like that.
Now to solve the markers. I have decided to automate this whole process by using ImageMagick convert program since I don't want to edit the SVG files and generate PNGs each manually as that is too time consuming. I had to regenerate the triangle in Inkscape so I had to look that up as it is not obvious how to do that. The first thing is how to set the transparent pixel which is done with -transparent option. The second thing is how to account for the case when the background color is not an exact single color and that is fixed by using the -fuzz option. Then I need a way to change the default foreground pixel color as it needs to change for each marker depending on elevation and that is done with the -fill option. Now I just need to figure out the colors that match each of the icons and I am done. ImageMagick definitely helps me here as it supports many color syntax values. I have RGBA values stored in C# so I am going to use those values in my Bash script that will auto-image-magickally do every thing for me. As an aside, this has to be one of the worst names in all of UNIX, the shebang marker at the top of the UNIX shell script which I add to my script. I always run it with the time command so I know how long it takes to run:
This is what my script looks like in general:$ time ./convert.shreal 0m1.388suser 0m0.443ssys 0m0.278s
The last thing I had to do in my script was copy each output PNG file into the Windows Store project Assets folder so I can easily add them into the VSE project on my Windows laptop. I am still not happy with the icons as I need to find a way to use vector icons as generating the PNG files just don't look good at all. The functionality is working, but it looks bad, so I need to address that somehow.convert -fill 'rgba(181,13,33,235)' -fuzz 20% -transparent white A.svg A.png
The whole rest of the day was fixing, changing, editing and resizing icons to make sure they look really good as they are essential to the app. Gimp and Inkscape were my constant companions all day long. It took way too long to fix all of the images it had to be done either programatically or manually. I am just glad that it all looks good and I can call it a day.
Saturday, December 7, 2013
From concept to reality in 6 weeks - part 15+
With my customer visit yesterday I did not have time to record my thoughts all day long. This means I get to try to remember every thing that happened yesterday and this morning. I woke up early this morning so that should be pretty easy to recall.
The first task I completely failed on yesterday was switching from Kanbanery to Trello for the Kanban project management board. It is just so hard to switch tools like that in the middle of a project. I would need to export all of the tasks from Kanbanery and import then into Trello. That is just not going to happen easily as I have almost 50 tasks in 4 different columns. Something is going to get lost and I don't have time to fix stuff like that.
Part of this story is going to be easy as I can look at the Git log and see what I did yesterday! The big news for yesterday is that I got a new build for the mapping engine and was able to get it all working and showing 3 out of the 4 layers. I definitely like it when things just work. I tried a couple of times to get the images working and then just gave up and colorized the ones I needed to a fixed color. I looked at the iPad app Objective-C code to find the colors and the layer settings since we are using the same mapping engine. That exercise just reminded me how verbose and challenging Objective-C is to write an enterprise application. The code just hurts my head and is painful to read and to follow the flow of what is going on. On the other hand C# is very much like Java or ActionScript where you need to understand the framework, threads and events and you are done.
A couple of new challenges occurred yesterday. The first one was I had to learn how to split strings but that was very easy by reading the documentation. Then I needed to figure out how to create a new LINQ query with multiple where clauses. Back to the documentation and within minutes I yet again fell in love with LINQ. As I was adding this new LINQ statement, I was chatting with the mapping engine developer and he told me he worked on LINQ while at Microsoft. I quickly told him, he was now in the circle of trust as my favorite Microsoft developer. I have only met a handful of Microsofties but I have never lived in that part of the country either. Doesn't matter as still anyone involved with LINQ is near the top of useful people.
Another lesson while changing to use the new mapping engine API, was to learn how to read a file from the file system using Windows.ApplicationModel.Package.Current.InstalledLocation. That is interesting since working on web sites for so long you just forget that you can actually read and write files!
Everything considered, yesterday was a huge success so it was a very happy day. I was able to take a break and play tennis also since it was a nice spring day in the middle of December.
The hardest thing all day this morning was fixing images. I still do not have them working as I would like but I quickly made PNG files so I could verify my layers were displaying properly for the data values. I find that the easiest thing to do is use Gimp or Inkscape on my Mac, check the files in and then go to Windows and use Git to retrieve the files and then add them to my project. So much easier than waiting for SkyDrive which is not the speediest tool in the shed.
The first task I completely failed on yesterday was switching from Kanbanery to Trello for the Kanban project management board. It is just so hard to switch tools like that in the middle of a project. I would need to export all of the tasks from Kanbanery and import then into Trello. That is just not going to happen easily as I have almost 50 tasks in 4 different columns. Something is going to get lost and I don't have time to fix stuff like that.
Part of this story is going to be easy as I can look at the Git log and see what I did yesterday! The big news for yesterday is that I got a new build for the mapping engine and was able to get it all working and showing 3 out of the 4 layers. I definitely like it when things just work. I tried a couple of times to get the images working and then just gave up and colorized the ones I needed to a fixed color. I looked at the iPad app Objective-C code to find the colors and the layer settings since we are using the same mapping engine. That exercise just reminded me how verbose and challenging Objective-C is to write an enterprise application. The code just hurts my head and is painful to read and to follow the flow of what is going on. On the other hand C# is very much like Java or ActionScript where you need to understand the framework, threads and events and you are done.
A couple of new challenges occurred yesterday. The first one was I had to learn how to split strings but that was very easy by reading the documentation. Then I needed to figure out how to create a new LINQ query with multiple where clauses. Back to the documentation and within minutes I yet again fell in love with LINQ. As I was adding this new LINQ statement, I was chatting with the mapping engine developer and he told me he worked on LINQ while at Microsoft. I quickly told him, he was now in the circle of trust as my favorite Microsoft developer. I have only met a handful of Microsofties but I have never lived in that part of the country either. Doesn't matter as still anyone involved with LINQ is near the top of useful people.
Another lesson while changing to use the new mapping engine API, was to learn how to read a file from the file system using Windows.ApplicationModel.Package.Current.InstalledLocation. That is interesting since working on web sites for so long you just forget that you can actually read and write files!
Everything considered, yesterday was a huge success so it was a very happy day. I was able to take a break and play tennis also since it was a nice spring day in the middle of December.
The hardest thing all day this morning was fixing images. I still do not have them working as I would like but I quickly made PNG files so I could verify my layers were displaying properly for the data values. I find that the easiest thing to do is use Gimp or Inkscape on my Mac, check the files in and then go to Windows and use Git to retrieve the files and then add them to my project. So much easier than waiting for SkyDrive which is not the speediest tool in the shed.
Thursday, December 5, 2013
From concept to reality in 6 weeks - part 14
Whoever came up with the idea that 13 is an unlucky number? What does luck have to do with anything? I just don't believe in luck has to do with anything. I used to avoid even saying the word. All I know is that yesterday was the 13th day on this Windows 8 app and it was my most productive day so far!
Today is the big day when I switch from using Bing Maps to a different 3rd party mapping engine. I received new DLLs yesterday for the mapping engine but ran out of time to try it out in my app. I did try it out late last night to make sure the sample project I was given definitely works. This morning when I woke up early I found a newer version waiting for me, including a new vector map that is much better than the one we used in the iPad app. There is a lot more working today than yesterday and I was told that I would receive new builds each morning. The lead developer basically works all night long and I work all day long, so we have 24 hour coverage on this app.
I looked at the mapping engine example code and know exactly what I need to do. The one big exception is I must figure out how to add dynamic images which I create from a my icomoon custom font that contains the map marker symbols. I ran out of time yesterday to get that working on Bing Maps. The code I wrote will work in both cases, so that is where I will begin this morning.
But first now that I have two different maps, it is time to learn how to use C# interfaces. I want a single interface implemented in two different ways. I would also like to store some static properties in the interface that are constants I need in all implementations. To the documentation I go and I find a good explanation of how interfaces work in C#. I also find that C# supports properties in interfaces so that is all I need to begin. Turns out that you cannot have properties in an interface after all. Not exactly what I meant by static properties across all implementations so that is not going to work for me.
Now I am back on the task of figuring out how to create a dynamic image bitmap. The problem is that this is very easy in Windows desktop apps as I have done this before many years ago and I find articles explaining how to do create dynamic images but it does not work in Windows Store apps. I also cannot use the Bitmap class directly as it is not supported either. Bummer. Basically I cannot use anything in System.Windows.Media.Imaging as Windows Store app can only use Windows.UI.Xaml.Media.Imaging. The good news is that I learned that lesson already, so now all I need to do it figure out how to do what I want. In the correct package I see something promising called WriteableBitmap class. It appears that this is a very common question and the only solution I have found so far is to use DirectX, which just seems so wrong. I am giving up and creating images that I can then transform to whatever color I want as I just have not found any solution to my problem.
The big decision today was to go ahead and purchase the Hobbyist license of Telerik XAML Windows 8 controls since I can use that for the range slider without writing one from scratch.
I was able to get some of the data displaying on the mapping engine. I have been struggling all day trying to get images to display correctly on the map and now I am getting a very odd runtime exception that I do not know where it is coming from. That all will have to wait until tomorrow as it is time to go running for the 4th day in a row as I seriously need a break right now.
Today is the big day when I switch from using Bing Maps to a different 3rd party mapping engine. I received new DLLs yesterday for the mapping engine but ran out of time to try it out in my app. I did try it out late last night to make sure the sample project I was given definitely works. This morning when I woke up early I found a newer version waiting for me, including a new vector map that is much better than the one we used in the iPad app. There is a lot more working today than yesterday and I was told that I would receive new builds each morning. The lead developer basically works all night long and I work all day long, so we have 24 hour coverage on this app.
I looked at the mapping engine example code and know exactly what I need to do. The one big exception is I must figure out how to add dynamic images which I create from a my icomoon custom font that contains the map marker symbols. I ran out of time yesterday to get that working on Bing Maps. The code I wrote will work in both cases, so that is where I will begin this morning.
But first now that I have two different maps, it is time to learn how to use C# interfaces. I want a single interface implemented in two different ways. I would also like to store some static properties in the interface that are constants I need in all implementations. To the documentation I go and I find a good explanation of how interfaces work in C#. I also find that C# supports properties in interfaces so that is all I need to begin. Turns out that you cannot have properties in an interface after all. Not exactly what I meant by static properties across all implementations so that is not going to work for me.
Now I am back on the task of figuring out how to create a dynamic image bitmap. The problem is that this is very easy in Windows desktop apps as I have done this before many years ago and I find articles explaining how to do create dynamic images but it does not work in Windows Store apps. I also cannot use the Bitmap class directly as it is not supported either. Bummer. Basically I cannot use anything in System.Windows.Media.Imaging as Windows Store app can only use Windows.UI.Xaml.Media.Imaging. The good news is that I learned that lesson already, so now all I need to do it figure out how to do what I want. In the correct package I see something promising called WriteableBitmap class. It appears that this is a very common question and the only solution I have found so far is to use DirectX, which just seems so wrong. I am giving up and creating images that I can then transform to whatever color I want as I just have not found any solution to my problem.
The big decision today was to go ahead and purchase the Hobbyist license of Telerik XAML Windows 8 controls since I can use that for the range slider without writing one from scratch.
I was able to get some of the data displaying on the mapping engine. I have been struggling all day trying to get images to display correctly on the map and now I am getting a very odd runtime exception that I do not know where it is coming from. That all will have to wait until tomorrow as it is time to go running for the 4th day in a row as I seriously need a break right now.
Wednesday, December 4, 2013
From concept to reality in 6 weeks - part 13
Today is a brand new day and several things are planned for the day. I need to create some new SVG symbols for my map markers and then added them to my custom font. I then need to get the rest of the data to display on the map with dynamic colors per each marker. I then need to load the latest build for the mapping engine and see if I can get the markers to display on it. I then need to look into buying a 3rd party set of controls from Telerik since they have a dual range slider that may just work out of the box. I downloaded the RadControls demo trial on my Windows laptop and it looks like it will work. I also like their date picker as it looks good and is very similar to the Apple iOS7 date selector.
First thing up is to get the rest of the map markers displaying in different colors. It was easy to put the markers on another layer on the Bing Map. It was a bit of work to get the push pins to be different colors depending on the elevation. I have not gotten custom images on the map yet as that will be my first chore for tomorrow morning. I have my font ready to go but ran out of time to use it. I really want to use the FontIcon class but really wonder if the Bing Map will allow it as a child of a map layer. I may have to use one of the Windows.Graphics.Imaging classes instead and learn how to draw into a bitmap from a font symbol, now that does not really sound like fun.
I also had to learn about formatting doubles since I needed to show some details when a map marker was tapped, but I wanted to show numbers in a reasonable format like "12,345" with the thousands separator. I had to look in two places as the Double.ToString method was a great start and then I found this beauty that lists all of the Standard Numeric Format options. That gave me everything I ever wanted to know about formatting in Windows apps.
Next up is learning how to use LINQ to build dynamic queries in-line as I wanted to show some statistics on the data that was loaded. Before I could use them I had to convert my old school Array code to use a List Generic. Then I directed by a co-worker to the LINQ cheat sheet that just made my day. I was then able to find the count of a couple of properties and the date range of the data that was loaded very easily in just a couple of simple and readable statements.
I did not write down much today but I was so excited when I had all of the data showing up on a Bing Map that I forgot to record what I was doing. The above links definitely describe all of the fun I had today.
Subscribe to:
Posts (Atom)