Beispiel #1
0
 private void cmdCalcVert_Click(object eventSender, EventArgs eventArgs)
 {
     H1 = (float)(0.5d * Conversion.Val(txtMTR.Text) + Conversion.Val(txtMTL.Text)); // H1 is height of MHW above MLLW
     H1 = (float)(Convert.ToInt32(H1 * 10f + 0.5d) / 10d);
     VC = (float)(Conversion.Val(txtCH.Text) + H1 - Conversion.Val(txtHeight.Text));
     AC = (float)(VC - Conversion.Val(txtBH.Text));
     AC = (float)(Convert.ToInt32(AC * 10f + 0.5d) / 10d);
     DC = (float)(Conversion.Val(txtCD.Text) + Conversion.Val(txtHeight.Text) - Conversion.Val(txtDraft.Text));
     VerticalTxtBx.SelectionAlignment = HorizontalAlignment.Center;
     VerticalTxtBx.AppendText("Height of MHW above MLLW = 1/2 Mean Range + Mean Tide");
     VerticalTxtBx.AppendText(" = 1/2 (" + Conversion.Val(txtMTR.Text) + ") + " + Conversion.Val(txtMTL.Text).ToString() + " = " + H1.ToString() + Environment.NewLine);
     VerticalTxtBx.AppendText("Vertical Clearance = Charted Height + Height of MHW above MLLW - Height of Tide above MLLW");
     VerticalTxtBx.AppendText(" = " + Conversion.Val(txtCH.Text) + " + " + H1.ToString() + " - " + Conversion.Val(txtHeight.Text).ToString() + " = " + VC.ToString() + Environment.NewLine);
     VerticalTxtBx.AppendText("Actual Clearance = Vertical Clearance - Boat Height");
     VerticalTxtBx.AppendText(" = " + VC + " - " + Conversion.Val(txtBH.Text).ToString() + " = " + AC.ToString() + Environment.NewLine);
     DepthTxtBx.SelectionAlignment = HorizontalAlignment.Center;
     DepthTxtBx.AppendText("Depth Clearance (under keel) = Charted Depth + Height of Tide above MLLW - Boat's Draft");
     DepthTxtBx.AppendText(" = " + Conversion.Val(txtCD.Text) + " + " + Conversion.Val(txtHeight.Text).ToString() + " - " + Conversion.Val(txtDraft.Text).ToString() + " = " + DC.ToString());
 }
Beispiel #2
0
 public override string ToString()
 {
     return(string.Format("{{{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}}}", H1.ToString("f" + 0), H2.ToString("f" + 9), H3.ToString("f" + 9), H4.ToString("f" + 9), H5.ToString("f" + 9), H6.ToString("f" + 9), H7.ToString("f" + 9), H8.ToString("f" + 9), H9.ToString("f" + 9), H10.ToString("f" + 9)));
 }
Beispiel #3
0
        public void Read_From_File()
        {
            #region USER DATA

            List <string> lst_content = new List <string>(File.ReadAllLines(user_input_file));
            string        kStr        = "";
            MyList        mList       = null;
            string        VarName     = "";

            #endregion
            int indx = -1;
            try
            {
                for (int i = 0; i < lst_content.Count; i++)
                {
                    kStr    = MyList.RemoveAllSpaces(lst_content[i]);
                    mList   = new MyList(kStr, '=');
                    VarName = MyList.RemoveAllSpaces(mList.StringList[0]);

                    //sw.WriteLine("={0}", Q);
                    //sw.WriteLine("={0}", V);
                    //sw.WriteLine("={0}", B);
                    //sw.WriteLine("={0}", H1);
                    //sw.WriteLine("={0}", H2);
                    //sw.WriteLine("W={0}", W);
                    //sw.WriteLine("I={0}", I);
                    #region SWITCH
                    switch (VarName)
                    {
                    case "Q":
                        Q          = mList.GetDouble(1);
                        txt_Q.Text = Q.ToString();
                        break;

                    case "V":
                        V          = mList.GetDouble(1);
                        txt_V.Text = V.ToString();
                        break;

                    case "B":
                        B          = mList.GetDouble(1);
                        txt_B.Text = B.ToString();
                        break;

                    case "H1":
                        H1          = mList.GetDouble(1);
                        txt_H1.Text = H1.ToString();
                        break;

                    case "H2":
                        H2          = mList.GetDouble(1);
                        txt_H2.Text = H2.ToString();
                        break;

                    case "W":
                        W          = mList.GetDouble(1);
                        txt_W.Text = W.ToString();
                        break;

                    case "I":
                        I          = mList.GetDouble(1);
                        txt_I.Text = I.ToString();
                        break;
                    }
                    #endregion
                }
            }
            catch (Exception ex)
            {
            }
            lst_content.Clear();
        }
Beispiel #4
0
        public void H1_Quando_Crio_Com_Filho_Span()
        {
            XControl h1 = new H1(new Span("titulo"));

            Assert.AreEqual("<h1><span>titulo</span></h1>", h1.ToString());
        }
Beispiel #5
0
        public void H1_Quando_Crio()
        {
            XControl h1 = new H1("Titulo");

            Assert.AreEqual("<h1>Titulo</h1>", h1.ToString());
        }