/// <summary> /// Load plane parameters from input textboxes and verify they are correct /// </summary> /// <returns>pipe parameters</returns> public PlanarParameters GetPlaneParametres() { double depth = Convert.ToDouble(textBoxLength.Text); double width = Convert.ToDouble(textBoxInnerDiameter.Text, CultureInfo.InvariantCulture); double height = Convert.ToDouble(textBoxOuterDiameter.Text, CultureInfo.InvariantCulture); PlanarParameters pp = new PlanarParameters(width, height, depth); if (!Validator.ValidPlane(pp)) { return(null); } return(pp); }
/// <summary> /// create plane /// </summary> /// <param name="crystParams">parameters of the crystal</param> /// <param name="inputFile">name of file with input crystal</param> /// <param name="axis">axis and direction of rotation</param> public void CreatePlane(CrystalParameters crystParams, string inputFile, string axis) { PlanarParameters plane = GetPlaneParametres(); if (Equals(plane, null)) { ShowError("Invalid values of plane parametres."); return; } try { Program.CreatePlane(crystParams, plane, inputFile, axis); ActionWasSuccessfull("Plane was created."); } catch { ShowError("Invalid input file with crystal atom's coordinates."); } }