Ejemplo n.º 1
0
 private void LoadLkpType()
 {
     // TODO: This line of code loads data into the 'travdataDataSet.lkpType' table. You can move, or remove it, as needed.
     this.lkpTypeTableAdapter.Fill(this.travdataDataSet.lkpType);
     //= lkpTypeDataGridView1.Rows[0];
     LoadLkp(CommonStr.s2i(travdataDataSet.lkpType.Rows[0]["lkpTypeID"].ToString()));
 }
Ejemplo n.º 2
0
        private void Add_CC_lkpType(int ATag)
        {
            if (cboLkpType.SelectedIndex < 0)
            {
                MessageBox.Show("No Lookup Selected", "Select Lookup", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //need current CCID
            DataGridViewRow r = ccDataGridView.CurrentRow;

            if (r != null)
            {
                int ccid      = CommonStr.s2i(r.Cells[0].Value.ToString());
                int lkpTypeID = lsLkpID[cboLkpType.SelectedIndex];
                dmMain.Add_cc_lkpType(ccid, lkpTypeID, ATag);
                //need current lkpTypeID
                //add ccid + lkpType combo to ccLkpType (ATag=0)
            }
            else
            {
                MessageBox.Show("No Calcuation Method Selected", "Select a Calculation Method", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //refresh
            LoadCalcLookup();
        }
Ejemplo n.º 3
0
        private void txtPeg3_TextChanged(object sender, EventArgs e)
        {
            Clear_Peg3(p3);
            Clear_Base_SF(sf);

            p3.Peg    = txtPeg3.Text.Trim();
            p3.Mine   = lsMineVal[cboMine.SelectedIndex];
            p3.Trav   = lsTravVal[cboTrav.SelectedIndex];
            p3.MineID = lsMineID[cboMine.SelectedIndex];
            p3.TravID = lsTravID[cboTrav.SelectedIndex];
            p3.MTID   = dmMain.Get_MTID(p3.MineID, p3.TravID);

            if ((p3.Peg != ""))
            {
                if (dmMain.Get_PegCoords(p3))
                {
                    lblPeg3.ForeColor  = Color.Red;
                    lblPeg3F.ForeColor = Color.Red;
                    lblPeg3F.Text      = "New Peg Exists";
                    lblMine3.Text      = p3.Mine;
                    lblTrav3.Text      = p3.Trav;
                    lblPeg3X.Text      = CommonStr.d2s(p3.coord.X);
                    lblPeg3Y.Text      = CommonStr.d2s(p3.coord.Y);
                    lblPeg3Z.Text      = CommonStr.d2s(p3.coord.Z);
                    lblLP3.Text        = CommonStr.LP_Text(p3.LP);
                    lblPeg3G.Text      = CommonStr.d2s(p3.coord.G);
                    lblPeg3E.Text      = p3.E;
                    lblPeg3C.Text      = p3.C;


                    Check_IfBaseExists_SF();
                }
            }
        }
Ejemplo n.º 4
0
        private void txtPeg2_TextChanged(object sender, EventArgs e)
        {
            ClearPeg2(fs);
            ClearBase(bf);

            fs.Peg = txtPeg2.Text.Trim();

            if (fs.Peg != "")
            {
                if (dmMain.Get_PegCoords(fs))
                {
                    lblPeg2.ForeColor = Color.Green;

                    lblMine2.Text = fs.Mine;
                    lblTrav2.Text = fs.Trav;
                    lblPeg2X.Text = CommonStr.d2s(fs.coord.X);
                    lblPeg2Y.Text = CommonStr.d2s(fs.coord.Y);
                    lblPeg2Z.Text = CommonStr.d2s(fs.coord.Z);
                    lblLP2.Text   = CommonStr.LP_Text(fs.LP);

                    lblMineB.Text = fs.Mine;
                    lblTravB.Text = fs.Trav;

                    CalcJoin();
                }
            }
        }
Ejemplo n.º 5
0
        private void txtPeg2_TextChanged(object sender, EventArgs e)
        {
            Clear_Peg2(p2);
            Clear_Base_BS(bs);
            Clear_Base_SF(sf);

            p2.Peg = txtPeg2.Text.Trim();

            if (p2.Peg != "")
            {
                if (dmMain.Get_PegCoords(p2))
                {
                    lblPeg2.ForeColor = Color.Green;

                    lblMine2.Text = p2.Mine;
                    lblTrav2.Text = p2.Trav;
                    lblPeg2X.Text = CommonStr.d2s(p2.coord.X);
                    lblPeg2Y.Text = CommonStr.d2s(p2.coord.Y);
                    lblPeg2Z.Text = CommonStr.d2s(p2.coord.Z);
                    lblLP2.Text   = CommonStr.LP_Text(p2.LP);
                    lblPeg2G.Text = CommonStr.d2s(p2.coord.G);
                    lblPeg2E.Text = p2.E;
                    lblPeg2C.Text = p2.C;

                    lblMineSF.Text = p2.Mine;
                    lblTravSF.Text = p2.Trav;

                    cboMine.Text = p2.Mine;
                    cboTrav.Text = p2.Trav;

                    Check_IfBaseExists_BS();
                    Check_IfBaseExists_SF();
                }
            }
        }
Ejemplo n.º 6
0
        private void txtPeg1_TextChanged(object sender, EventArgs e)
        {
            Clear_Peg1(p1);
            Clear_Base_BS(bs);

            p1.Peg = txtPeg1.Text.Trim();

            if ((p1.Peg != ""))
            {
                if (dmMain.Get_PegCoords(p1))
                {
                    lblPeg1.ForeColor = Color.Green;
                    lblMine1.Text     = p1.Mine;
                    lblTrav1.Text     = p1.Trav;
                    lblPeg1X.Text     = CommonStr.d2s(p1.coord.X);
                    lblPeg1Y.Text     = CommonStr.d2s(p1.coord.Y);
                    lblPeg1Z.Text     = CommonStr.d2s(p1.coord.Z);
                    lblLP1.Text       = CommonStr.LP_Text(p1.LP);
                    lblPeg3G.Text     = CommonStr.d2s(p1.coord.G);
                    lblPeg3E.Text     = p1.E;
                    lblPeg3C.Text     = p1.C;

                    Check_IfBaseExists_BS();
                }
            }
        }
Ejemplo n.º 7
0
        private void CalcJoin()
        {
            if (CheckInput())
            {
                Read_Val_GUI(-1);
                lblBase.ForeColor = Color.Green;
                lblLPB.Text       = CommonStr.LP_Text(bf.LP);
                lblBear.Text      = CommonStr.ConvertDecToDMS(bf.sfs.Bear);
                lblBear180.Text   = CommonStr.ConvertDecToDMS(bf.sfs.Bear180());
                lblHD.Text        = CommonStr.d2s(bf.sfs.HD);
                lblED.Text        = CommonStr.d2s(bf.sfs.ED);

                CheckIfBaseExists();
            }
        }
Ejemplo n.º 8
0
        private void btnlkpTypeUpdate_Click(object sender, EventArgs e)
        {
            int             ID   = -1;
            int             ATag = 0;
            DataGridViewRow r    = lkpTypeDataGridView1.CurrentRow;

            if (r != null)
            {
                ID = CommonStr.s2i(r.Cells[0].Value.ToString());
            }
            if (chkLkpType.Checked == true)
            {
                ATag = 1;
            }
            dmMain.AddLkpType(ID, txtlkpType.Text, ATag);
        }
Ejemplo n.º 9
0
        private void lkpTypeDataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            DataGridViewRow r = lkpTypeDataGridView1.CurrentRow;

            if (r != null)
            {
                string id = r.Cells[0].Value.ToString();
                LoadLkp(CommonStr.s2i(id));
                txtlkpType.Text    = r.Cells[1].Value.ToString();
                chkLkpType.Checked = false;
                if (r.Cells[2].Value.ToString()[0] == '1')
                {
                    chkLkpType.Checked = true;
                }
            }
        }
Ejemplo n.º 10
0
        private void LoadCalcLookup()
        {
            DataGridViewRow r = ccDataGridView.CurrentRow;

            if (r != null)
            {
                int ccid = CommonStr.s2i(r.Cells[0].Value.ToString());
                try
                {
                    this.v_cc_lkp_TypeTableAdapter.FillBy_CCID(this.travdataDataSet.v_cc_lkp_Type, ccid);
                }
                finally
                {
                }
            }
        }
Ejemplo n.º 11
0
 private void txtBear_TextChanged(object sender, EventArgs e)
 {
     if (txtBear.Text.Trim() == "")
     {
         bf.sfs.BearManual = -1;
         bf.sfs.BearErr    = 0;
         bf.HAFLErr        = bf.sfs.BearErr;
         lblBearErr.Text   = "0";
     }
     else
     {
         bf.sfs.BearManual = CommonStr.ConvertDMSToDec(txtBear.Text);
         bf.sfs.BearErr    = CalcClass.CalcAngErr(bf.sfs.Bear, bf.sfs.BearManual);
         bf.HAFLErr        = bf.sfs.BearErr;
         lblBearErr.Text   = CommonStr.ConvertDecToDMS(bf.sfs.BearErr);
     }
 }
Ejemplo n.º 12
0
        private void CheckIfBaseExists()
        {
            pnlBaseExist.Visible = false;
            ExistingBase.clear();
            if (dmMain.Get_bc3_ByNames(st.Peg, fs.Peg, ExistingBase) > -1)
            {
                pnlBaseExist.Visible = true;

                lblMineEB.Text    = ExistingBase.Mine;
                lblTravEB.Text    = ExistingBase.Trav;
                lblBearEB.Text    = CommonStr.ConvertDecToDMS(ExistingBase.sfs.Bear);
                lblBear180EB.Text = CommonStr.ConvertDecToDMS(ExistingBase.sfs.Bear180());
                lblBearErrEB.Text = CommonStr.ConvertDecToDMS(ExistingBase.HAFLErr);
                lblHDEB.Text      = CommonStr.d2s(ExistingBase.sfs.HD);
                lblEDEB.Text      = CommonStr.d2s(ExistingBase.sfs.ED);
                lblLPEB.Text      = CommonStr.LP_Text(ExistingBase.LP);
            }
        }
Ejemplo n.º 13
0
 private void Check_IfBaseExists_SF() // STN FS
 {
     sf.clear();
     if (dmMain.Get_bc2_ByNames(p2.Peg, p3.Peg, sf) > -1)
     {
         lblBaseSF.Text      = "STN to FS Base Exists";
         lblBaseSF.ForeColor = Color.Red;
         lblMineSF.Text      = sf.Mine;
         lblTravSF.Text      = sf.Trav;
         lblBearSF.Text      = CommonStr.ConvertDecToDMS(sf.polar.Bear);
         lblBear180SF.Text   = CommonStr.ConvertDecToDMS(sf.polar.Bear180());
         lblBearErrSF.Text   = CommonStr.ConvertDecToDMS(sf.polar.BearErr);
         lblHDSF.Text        = CommonStr.d2s(sf.polar.HD);
         lblEDSF.Text        = CommonStr.d2s(sf.polar.ED);
         lblLPSF.Text        = CommonStr.LP_Text(sf.LP);
         lblESF.Text         = sf.E;
         lblCSF.Text         = sf.C;
     }
 }
Ejemplo n.º 14
0
        private void Check_IfBaseExists_BS() // BS ST - Remember to reverse - STN to BS
        {
            bs.clear();
            if (dmMain.Get_bc2_ByNames(p2.Peg, p1.Peg, bs) > -1)  // Reverse base???
            {
                lblBaseBS.Text      = "STN to BS Base Exists";
                lblBaseBS.ForeColor = Color.Green;

                lblMineBS.Text    = bs.Mine;
                lblTravBS.Text    = bs.Trav;
                lblBearBS.Text    = CommonStr.ConvertDecToDMS(bs.polar.Bear);
                lblBear180BS.Text = CommonStr.ConvertDecToDMS(bs.polar.Bear180());
                lblBearErrBS.Text = CommonStr.ConvertDecToDMS(bs.polar.BearErr);
                lblHDBS.Text      = CommonStr.d2s(bs.polar.HD);
                lblEDBS.Text      = CommonStr.d2s(bs.polar.ED);
                lblLPBS.Text      = CommonStr.LP_Text(bs.LP);
                lblEBS.Text       = bs.E;
                lblCBS.Text       = bs.C;
            }
        }
Ejemplo n.º 15
0
        private void v_BaseDataGridView_SelectionChanged(object sender, EventArgs e)
        {
            if (v_BaseDataGridView.CurrentRow != null)
            {
                String JobInfoID = v_BaseDataGridView.CurrentRow.Cells["JobInfoID"].Value.ToString();
                String CalcID    = v_BaseDataGridView.CurrentRow.Cells["bcid"].Value.ToString();
                String JobDescr  = v_BaseDataGridView.CurrentRow.Cells["BS"].Value.ToString()
                                   + " - " + v_BaseDataGridView.CurrentRow.Cells["ST"].Value.ToString()
                                   + " - " + v_BaseDataGridView.CurrentRow.Cells["FS"].Value.ToString();

                lblJobInfoID.Text = JobDescr;

                if (JobInfoID == "")
                {
                    JobInfoID = "-1";
                }


                tLkp = frmM.LoadDataLookup(ccid, CommonStr.s2i(JobInfoID), CommonStr.s2i(CalcID), JobDescr);
            }
        }
Ejemplo n.º 16
0
        private void txtPeg1_TextChanged(object sender, EventArgs e)
        {
            ClearPeg1(st);
            ClearBase(bf);

            st.Peg = txtPeg1.Text.Trim();

            if ((st.Peg != ""))
            {
                if (dmMain.Get_PegCoords(st))
                {
                    lblPeg1.ForeColor = Color.Green;
                    lblMine1.Text     = st.Mine;
                    lblTrav1.Text     = st.Trav;
                    lblPeg1X.Text     = CommonStr.d2s(st.coord.X);
                    lblPeg1Y.Text     = CommonStr.d2s(st.coord.Y);
                    lblPeg1Z.Text     = CommonStr.d2s(st.coord.Z);
                    lblLP2.Text       = CommonStr.LP_Text(st.LP);

                    CalcJoin();
                }
            }
        }
Ejemplo n.º 17
0
            public int Read_Val_GUI(frmAddNewPeg f, int ipcid)
            {
                pcid   = ipcid;
                PegID  = dmMain.Get_PegNameID(f.txtPegName.Text);
                X      = CommonStr.s2d(f.txtX.Text);
                Y      = CommonStr.s2d(f.txtY.Text);
                Z      = CommonStr.s2d(f.txtZ.Text);
                G      = CommonStr.s2d(f.txtG.Text);
                CCID   = 0;
                CID    = 0;
                EID    = 0;
                AUID   = GlobalLogon.AUID;
                PLogID = 0;
                HDErr  = 0;
                EDErr  = 0;
                HAErr  = 0;
                LP     = 0;
                CCnt   = 0;
                MineID = f.lsMineID[f.cboMine.SelectedIndex];
                TravID = f.lsTravID[f.cboTrav.SelectedIndex];
                MTID   = dmMain.Get_MTID(MineID, TravID);

                return(PegID);
            }