Ejemplo n.º 1
0
 /// <summary>
 /// Open GUI for editting selected crack
 /// </summary>
 private void btnEditSequence_Click(object sender, EventArgs e)
 {
     if (this.crackIndexValid())
     {
         MeasurementSequence crack = this.cracks[this.ActiveIndex];
         Console.WriteLine(crack.Mode);
         NewMeasurementForm form   = new NewMeasurementForm(crack);
         DialogResult       result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             MeasurementSequence crack2 = findCrackName(form.GetName());
             // Check if name is unique
             if (crack2 == null || crack2 == crack)
             {
                 crack.Name        = form.GetName();
                 crack.Color       = Color.FromArgb(128, form.GetColor());
                 crack.LineSize    = form.GetLineSize();
                 crack.Orientation = form.GetOrientation();
                 crack.Mode        = form.GetMode();
                 this.updateMeasurementControls();
             }
             else
             {
                 MessageBox.Show("Please use a unique name");
             }
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create new measurement
        /// </summary>
        private void btnNewSequence_Click(object sender, EventArgs e)
        {
            string             cameraName = this.stage == RCCMStage.RCCM1 ? "wfov 1" : "wfov 2";
            NewMeasurementForm dlg        = new NewMeasurementForm("Crack " + MeasurementSequence.CrackCount, cameraName);
            DialogResult       result     = dlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                MeasurementSequence newCrack = new MeasurementSequence(dlg);
                // Check that name is unique
                MeasurementSequence crack2 = findCrackName(newCrack.Name);
                if (crack2 == null)
                {
                    this.cracks.Add(newCrack);
                    this.listMeasurements.SelectedIndex = this.cracks.Count - 1;
                }
                else
                {
                    MessageBox.Show("Please use a unique name");
                }
            }
            dlg.Dispose();
        }