Conversion from metric to imperial and vice versa

Hi, 

How do I make the program to display all input and output values either in metric or imperial?

ie., All inputs in Metric and all output in imperial  or vice versa

Right now all my inputs and outputs all metric units 

Parents
  • Some log forms allow you to specify input units and logs are set up to change labels based on the units.  There may be some that that are set up to allow specifying both input and output units but that gets pretty complicated.  My approach has been as follows.

    The following example is set up to convert data entered in US units to a log in metric units.  However, this was a special case in that the location data and elevation data was provided by surveyors in metric units. My general approach is to copy the log form I want to use into a new page and then edit the log form to convert on the fly as follows:

    1. Edit all header text entities to reflect the desired output units.  This includes editing the label if units are included in the label and editing the text expression to convert and format the associated number. There are many more of these than you would expect.  They included:

    Location Coordinates

    Elevation

    Station and offset (converting metric and us stationing is a bit tricky)

    Water levels

    Drill hole/ bit diameter

    Sampler sizes

    Drive hammer weight

    Drive hammer fall

    And many more

    An example of a simple text entity conversion text expression is shown for a water level reading in the picture below

    Note that the waterlevel reading is multiplied by the conversion factor (0.3048) and then formatted to 2 decimal places in this expression.

    2. Change all body column headings to reflect desired units

    3. Edit all body entities to display the desired depth/ elevation values. The approach I take for this is to leave all the depth expressions alone so that the log plots using the original units.  The only thing I change is text expressions that output depth or elevation text to the log.  This way it LOOKS like a metric log but the underlying plotting is done in feet and inches of paper.  the user does not know this until it comes to output time if you allow them to select the feet per page or scale.  This approach just keeps the process simpler.  an example of a simple depth column conversion  is shown in the picture below

    Note the depth expression is set to the original sample depth (in this case feet) but the text expression that is printed to the log is converted and formatted to 2 decimal places. Also note the column heading was changed to reflect meters as described in 2 above.

    A more complicated conversion is shown in the picture below which is the depth and elevation label for my strata description lines contained in the second text spec tab.  Again the depth expression for this entity is left as is for the native units so I am not changing where it plots, just changing the labels.

    In this case the depth label is converted to meters and formatted and the "m" designation is added and the elevation is computed using a depth that is converted to meters.  In this case this works because the ground elevation is entered in metric but if the ground elevation was entered in feet you would have to convert to elevation using depth in feet first then convert the end result to meters and format to 2 decimals and add appropriate Unit labels.

    4 Trick any depth scale entities to plot in the correct units.  This is easy and the depth scale entity has a special field to do this.  See the picture below:

    The property Scale factor expression allows you to plot the scale numbers at a different location than they would normally appear based on the underlying depth units.  In this case I want to expand the scale by a factor of 3.28084 so that the 1 mark actually plots at 3.2 feet depth which is 1 meter. Again, the log thinks it is plotting in feet but the labels are moved to correspond to meters.

    5. Modify any depth vs text expressions that output lab or field test results to convert to the appropriate units, for example convert psi to MPa.

    6. This is the hardest part. If any of your descriptions contain any depths embedded in the text... for example a description that reads "GRANITE, hard, grey. Broken from 25.6 ft to 26.3 ft."  the embedded numbers in the text need to be converted to metric.  If there are only a few of these, you can simply do the conversions manually and edit the description appropriately.  However, if there is a large number of these it may be worth it to write a text expression to extract the numbers, convert and format them, and then reassemble the description with the new converted numbers.  gINT has the functions to do this but there has to be a consistent format or unique key word to look for in the description.  I can develop an example that shows how this can be done if you want but will not put the effort in right now.

    There are probably many other ways to do this, this is the way I decided to do it for the 1 project that required conversion. If you were doing this for a fence template, the strategy of keeping the underlying base units the same may not be appropriate.

  • Can you please help me converting the scale numbers and scale ticks of depth scale column  from SI to imperial or vice versa ? 

  • This is covered in item 2 and item 4 above.  Item 2 changes the scale column heading label to be consistent with what the modified column will represent.  In item 4, I set the scale factor of the depth scale to either stretch the scale ticks and numbers out or compress them closer together.  A scale factor of 3.28084 converts from base units of feet to a scale that measures in meters. A scale factor of 0.3048 converts a scale from base units of meters to a display that represents feet.  A scale factor of 6 would convert from base units of feet to a display of fathoms.

    You may want to adjust the number of divisions for minor and labeled ticks in the revised entity Scale numbers and scale ticks tabs to better show the desired scale.

    If this is not what you are looking for, please better describe what you are trying to do and include a marked-up picture of the desired output.

  • This a sample conversion metric to imperial. Even though I define scale factor of 3.28084 for my vertical scale, scale does not plot till the hole depth. 

    Is there a way to give bottom depth expression for the scale column ?

  • There is a mandatory field in the point table called HoleDeph.  This field controls the depths of column displays.  All entities have an option in them to plot to hole depth or bottom of page.  It is located in various places in the entity and some entities have it in 2 places.  For example, The scale entity in the example in 4 above has one in the main tab which is set to bottom of page (see picture above). I could be set to hole depth.  This entity also has a control on the column lines tab which controls the lines on the side of the column.  A text entity will only have a control on the column lines tab.  A graph entity might have more than one control, I forget. It appears as if the HoleDepth field for the boring in your example is set to 1m even though the hole goes much deeper than 1 meter.  It also appears that your log form is set to terminate column lines, scales, etc. at the hole depth for the fields shown.  You can fix this by allowing the entities to go to the bottom of the page or by correcting the HoleDepth Field in the data. To get the ticks to scale correctly if you are going from meters to feet the scale factor should be 0.3048. You will have to adjust the tick and number spacing on the tick and number tabs so that it is not all crammed together.

Reply
  • There is a mandatory field in the point table called HoleDeph.  This field controls the depths of column displays.  All entities have an option in them to plot to hole depth or bottom of page.  It is located in various places in the entity and some entities have it in 2 places.  For example, The scale entity in the example in 4 above has one in the main tab which is set to bottom of page (see picture above). I could be set to hole depth.  This entity also has a control on the column lines tab which controls the lines on the side of the column.  A text entity will only have a control on the column lines tab.  A graph entity might have more than one control, I forget. It appears as if the HoleDepth field for the boring in your example is set to 1m even though the hole goes much deeper than 1 meter.  It also appears that your log form is set to terminate column lines, scales, etc. at the hole depth for the fields shown.  You can fix this by allowing the entities to go to the bottom of the page or by correcting the HoleDepth Field in the data. To get the ticks to scale correctly if you are going from meters to feet the scale factor should be 0.3048. You will have to adjust the tick and number spacing on the tick and number tabs so that it is not all crammed together.

Children
No Data