Saturday, December 28, 2013

Pencil Project - Tips and Trix

Have been using Pencil project to GUI prototype a project I'm working on. There is a lot of features that might be hard to find info about. Thought I write down a few tips I've found out.

PNG-files can be dragged and dropped in pencil project. When you do this you get a relative path from the project file to the PNG-file. So to make your pencil projects portable or to check in
to a repository make sure that all files that are dragged and dropped are in a sub folder to the project. If you forgot to do this and have moved the project add a sub folder and move all the resource files there and open the project in a text editor for example Notepad++ and change all pathes on the images in the project file.

Ctrl and click on several objects makes it possible to group the objects, this makes you life easy when there starts to be many objects in the design.




Clicking twice on an object makes it possible to rotate the object, by dragging the vertex in the corner.


Thursday, September 26, 2013

Map Collaboration with XSockets and ArcGIS for JavaScript Revisited

Made a blog post approximately two years ago on using XSockets.net and ArcGIS for JavaScript, a lot has happened since my blog post, so I thought it could be interesting to revisit the subject.

Creating a XSockets.net solution is done the same way. What's new is the possibility to create a windows service running the XSockets server using Chocolatey. I will not do this in this post, but I like the idea.

Create New Project. Is done the same way as before:
In VS2012 choose New Project

Create a new ASP.Net MVC 4 Web application
Choose empty web project:
Choose Empty template and Razor view engine


We use Nuget as we did before to import the XSockets.net package:

Install-Package XSockets

Successful installation

The project now have resources added for XSockets.Net


What strikes me is that the need for several projects has disappeared. Everything is neatly in the same project.

For the client side I used the same boilerplate show extent example but with newer ArcGIS for Javascript and XSocket Javascript API to make it easier to follow what changes I needed to do.

Add a new html page in the root of the project:
Add New Item

MapClient.html


Now it's time add the sample code:


Don't forget to set the new page to be the start page of the web application, right click the page in the solution explorer and choose start page.

So with the client side done it's time to setup the server side. Create custom Controller (Controller was called handler before):

We do that by scaffolding a new controller:
Scaffold XSocketController DemoController
 The code that gets created should look like this:
DemoController.cs
Add the following code:

Start the web page by choosing Chrome and start in Visual Studio:

Use the drop down in VS2012 to choose the right browser


This should start the web browser showing a map, start an other chrome instance and copy the adress into that browser. If you did all the steps correct, you will be able to pan the extent in one map and the other browser will follow:
Opened the MapClient.html in two browser windows



Wednesday, September 25, 2013

Visual Studio 2013 Preview - What's new?

A few personal thoughts when testing the Visual Studio 2013 Preview.

The first thing that I noticed was the login. This helps Visual Studio syncing between machines. Is this a good feature?
Well if you are like me having several developer machines at work and home then it might be a good idea. You can change what will be synchronized by changing the settings in Tools | Options.



Second thing is the color schemes, I would argue that is a good feature making it easy to switch between an brighter theme on day time and a darker to use in the evenings. This can also be changed under Tools | Options later on.

The notification in the upper right is good, discrete but let you notice that there are updates to download etc.


Wednesday, April 24, 2013

Creating a Windows 8 Store App - Part 2


Before you can start building the application we need to design how the application will look like, and work. So lets create a GUI Prototype using the use cases in Part 1.

There are several tools for creating GUI prototypes, Microsoft SketchFlow are only available with Visual Studio Premium, because of that I will go with Pencil Project instead, it's a free open source project that works in a similar way.

Download and install Pencil Project.


Create a new Dokument.


Change page properties.


Change page size.

 OK, when to apply new size.

Use the Sketch Stencils, to get a sketchy look on the components.

We can now add a box, label and so on to create a layout of the application:

To add a New Page click on Add Page to handle New Routes click "New Page":


Add a descriptive name to the new Page:
 

 It's possible to add links between the pages by right clicking items and choose link to, so we add a link to the main page to return from the New Routes page:
  


When the prototype is completed it's possible to export the document into different formats, so the people that is going to review the prototype dosen't need Pencil project installed: 


I choose web page because everyone has a web browser:


Export all pages:


Choose the output directory, I created a MyRoutesHTMLExport directory:


The result is a html page and resources:


The page show our prototype, and is clickable to jump between pages:


I will try detail the pages more in the next blog post.


Sunday, April 14, 2013

Creating a Windows Store App - Part 1

I haven't done much blogging lately  but I will try to start again. I will make a few blog posts on how to create a Windows Store Application. The parts will be published when they are written so I can't promise how often it will be, because it depends on workload etc. But here we go:

Where do we begin? You need an application idea!

Let's say you are into riding bicycles, what kind of application do all cyclists need?
Well all cyclist needs to make sure that their friends and family knows where they going to ride their bike, so if the cyclist go missing because of an accident they know where to start looking. The application needs to help the bicyclist to do at least:
  • Add a route
  • Changing a route
  • Share a route
To outline the users needs, lets create a fictive user called John Bikealot. John 44 years old living with his wife and two kids. John is a everyday cyclist, commuting to work and does some extra cycling for exercise a few days a week.

How would Mr Bikealot want the "Add a route" feature to work?

He want to minimize the time spent adding routes, he like to ride his bike. So adding a route needs to be as simple as just naming the streets or clicking on a map. Because he will be riding his bike in the same area most of the time he doesn't what to add the same route more than once.

When and Why would Mr Bikealot want to change the route?

Having done training during the summer he starts feeling fresh in the legs late on the route, so extending the route with a detour on some new roads might be necessary to get the same time on the bike as he had early on the season. But he want to do this in a quick way not spending any unnecessary time in front of a computer.

How does Mr Bikealot want to share the routes with his family and friends?

The easiest way possible. Email or status by doing an update on Facebook perhaps.

Saturday, February 09, 2013

Solution when Windows 8 cannot shutdown

I got a problem on my laptop that I migrated to Windows 8. It could not shutdown. When choosing shutdown the computer ended up running the only way to shutdown was to press the hardware switch for a long time several timed forcing the computer to stop.

I've googled the problem and the solution is:

Right-click the lower left corner to get the power menu, click Power options:

Choose, "Choose what the power button do" in the left column:














Click "Change settings that are currently unavailable":



Uncheck "Turn on fast start-up":




And after this change the computer is possible to shutdown.