Example #1
0
        private String header()
        {
            String hdr = "";

            DrawAcceleration da = new DrawAcceleration();
            da.compute();					// Lifter diameter

            hdr += headLine("Built by G-CAM " + DateTime.UtcNow + "  UTC");
            hdr += headLine("Name: ", Data.sName);
            hdr += headLine("Base radius: ", Data.dBaseRadius);
            hdr += headLine("Lift: ", Data.dLift);
            hdr += headLine("Flank radius: ", Data.dFlankRadius);
            hdr += headLine("CAM Duration angle: ", Change.toDegrees(Data.dAction));
            hdr += headLine("Nose radius: ", Data.dNoseRadius);
            hdr += headLine("Flat lifter min diameter: ", Data.dLifterDiameter);
            hdr += headLine("Blank diameter: ", Data.dBlankDiameter);
            hdr += headLine("Tracking leeway: ", Data.dPrecision);
            hdr += headLine( Data.sRotaryAxis + " values referenced from top of nose - TDC");
            hdr += headLine( Data.sOffsetAxis + " values referenced from edge of blank");

            if (!Data.sCrossAxis.Equals(""))
            {
                hdr += headLine("Cross axis: " + Data.sCrossAxis + " from 0 to " + Data.sCrossAxisEnd + " step " + Data.sCrossAxisStep);
            }

            return hdr;
        }
Example #2
0
        private bool buildGraphics(String guid)
        {
            lblErrHead.Visible = false;

            try
            {
                // Cleanup all the old graphics files
                try
                {
                    DirectoryInfo downloadedMessageInfo = new DirectoryInfo(Server.MapPath("~") + "/Temporary/");
                    foreach (FileInfo file in downloadedMessageInfo.GetFiles())
                    {
                        file.Delete();
                    }
                }
                catch (Exception ee)
                {
                }

                DrawCam dc = new DrawCam();
                dc.drawCam();
                System.Drawing.Image image = dc.getImage();

                String name = "/Temporary/A" + guid + ".png";
                image.Save(Server.MapPath("~") + name, ImageFormat.Png);

                DrawAcceleration da = new DrawAcceleration();
                System.Drawing.Image image1 = null;

                if (radioType.SelectedValue.Equals("L")) { image1 = da.drawLift(); }
                if (radioType.SelectedValue.Equals("V")) { image1 = da.drawVelocity(); }
                if (radioType.SelectedValue.Equals("A")) { image1 = da.drawAcceleration(); }
                if (radioType.SelectedValue.Equals("G")) { image1 = da.drawGrinder(); }

                name = "/Temporary/B" + radioType.SelectedValue + guid + ".png";
                image1.Save(Server.MapPath("~") + name, ImageFormat.Png);

                HttpContext.Current.Session["da"] = da;

                return true;
            }
            catch (Exception ee)
            {
                lblError.Text = "Impossible geometry, cannot be modelled!";
                lblErrHead.Visible = true;
                return false;
            }
        }