Ejemplo n.º 1
0
        public void AddData2Table2M(Point pt, double Imageheight, double xPos)
        {
            ObjectData od;
            int        chcnt = TableStrinsCollection.Count;
            double     yPos;

            try
            {
                od = TableStrinsCollection[chcnt - 1];
                double theta2 = Conversion.ConvertY2Theta(pt.Y, Imageheight);
                yPos = Conversion.ConvertDegreesToRadians(theta2);
                Point XYPoint = Conversion.XYcalculation(new Point(xPos, yPos));
                od.Theta2Data = Math.Round(theta2, 2).ToString();
                od.XData      = Math.Round(XYPoint.X, 2).ToString();
                od.YData      = Math.Round(XYPoint.Y, 2).ToString();
                od.Z1Data     = Math.Round(pt.X * Conversion.SamplingSpace, 2).ToString();

                TableStrinsCollection.RemoveAt(chcnt - 1);

                TableStrinsCollection.Add(od);

                if (DataTable.Items.Count > 0)
                {
                    DataTable.SelectedIndex = DataTable.Items.Count - 1;
                }
            }
            catch (Exception ex)
            { string s = ex.Message; }
        }
Ejemplo n.º 2
0
        public double AddData2Table1M(Point pt, double Imageheight)
        {
            try
            {
                ObjectData od;
                double     xPos;
                double     theta1 = Conversion.ConvertY2Theta(pt.Y, Imageheight);
                xPos = Conversion.ConvertDegreesToRadians(theta1);
                int tcount = TableStrinsCollection.Count + 1;
                od = new ObjectData
                {
                    FragData   = tcount.ToString(),
                    ShapeData  = "Not Specified",
                    SizeData   = "Not Specified",
                    TypeData   = "Not Specified",
                    Theta1Data = Math.Round(theta1, 2).ToString(),
                    Theta2Data = "",
                    ZData      = Math.Round(pt.X * Conversion.SamplingSpace, 0).ToString(),
                    XData      = "",
                    YData      = "",
                    Z1Data     = ""
                };

                TableStrinsCollection.Add(od);

                DataTable.SelectedIndex = DataTable.Items.Count - 1;
                DataTable.ScrollIntoView(DataTable.SelectedItem);

                return(xPos);
            }
            catch { }

            return(0);
        }