Archive for MHS Project

Howto get started with this code

This is a quickstart note about getting up and running with MHS. This is a spot for me to keep notes about a developer readme. 

  1. Software
    • Windows 2000 SP4 or greater (not sure about vista)
    • Visual Studio 2005
    • .Net 2.0
    • DirectX 9 SDK
    • Tablet PC SDK
    • Visual Studio Extensions for Windows Workflow foundations
    • Polhemus Driver & SDK
    • [optional] Blender for working with meshes
    • [optional] PhotoShop for working with images and icons
    • [optional] MS Office for viewing developer documents
    • [optional] TortoiseSVN (or equivalent) subversion client for checking out code
  2. Read the design document. It has changed a little bit since the last writing. It still gets tthe gist across.
  3. Look at the visio .vsd and the visual studio .cd digrams. They really help explain things quickly.
  4. Review the code in Model.cs to see the core data types you have to work with. Explore it with the test program.
  5. Review the code in ModelController.cs. It extends the model classes to add types necessary for workflow management.
  6. Review the code Controller.cs, the FieldTripControllerService. This is the controller that application programmers will use.
  7. Finally, spend a long time looking at the supporting classes and complicated logic.
  8. Code!

Comments off

Next: Wizard Forms Need ties to underlying model objects

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MhsController.Forms
{
    public partial class wpAnotherRandomPointWizardPage : YesNoWizardPage
    {
        public WaypointController Waypoint
        {
            get { return wp; }
            set { wp = value; }
        }
        private WaypointController wp = null;

[...snip...]
        // when this form is brought to the fore front it should recalculate its value based on the stored object
        private void wpAnotherRandomPointWizardPage_VisibleChanged(object sender, EventArgs e)
        {
            if (wp != null)
            {
                this.textBox1.Text = String.Format("You have sampled " +
                "{0} random reference spots, " +
                "{1} plant patches, " +
                "{2} species, and " +
                "{3} twigs at this " +
                "waypoint. Would you like to sample patches at another random spot?",

                Stats.ReferencePointCount(wp),
                Stats.PatchCount(wp),
                "##speciesCount##",
                Stats.CygCount(wp));
            }
        }

    }
}

Comments off

Next: UTM GPS Coords as 4 variables; zone, hemisphere, easting, northing

http://www.maptools.com/UsingUTM/quickUTM.html
http://rockyweb.cr.usgs.gov/outreach/gps/UTM_Zones_AK.pdf

    /// <summary></summary>
    /// http://www.maptools.com/UsingUTM/quickUTM.html
    /// http://rockyweb.cr.usgs.gov/outreach/gps/UTM_Zones_AK.pdf
    ///
    public class UtmCoordinate
    {
        /// <summary></summary>
        ///
        ///
        public double Northing
        {
            get { return northing; }
            set { northing = value; }
        }
        private double northing = 0; 

        /// <summary></summary>
        ///
        ///
        public double Easting
        {
            get { return easting; }
            set { easting = value; }
        }
        private double easting = 0; 

        /// <summary></summary>
        ///
        ///
        public int Zone
        {
            get { return zone; }
            set { zone = value; }
        }
        private int zone = 6; 

        /// <summary></summary>
        ///
        ///
        public Hemisphere Hemisphere
        {
            get { return hemisphere; }
            set { hemisphere = value; }
        }
        private Hemisphere hemisphere = Hemisphere.North; 

    }

Comments off

« Previous entries