Пример #1
0
        static void Main(string[] args)
        {
            // Test(); return;

            try
            {
                var tc = new TreatConstructConsole();

                var mp = new MyPoints();
                mp.GenDistances2();
                Console.WriteLine(mp);
                mp.CheckPointMatch(tc);


                mp.GenPoints();
                mp.GenDistances2();
                Console.WriteLine(mp);
                mp.CheckPointMatch(tc);

                mp.GenPoints();
                mp.GenDistances2();
                Console.WriteLine(mp);
                mp.CheckPointMatch(tc);

                mp.GenPoints();
                mp.CheckPointMatch(tc);

                //mp.GenDistances2();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #2
0
            public static List <MyPoints> make_data()
            {
                double   dx = Math.PI / 180.0;
                MyPoints tmp;
                var      result = new List <MyPoints>();

                for (int i = 0; i < 360; i++)
                {
                    tmp = new MyPoints(i * dx, Math.Sin(i * dx));
                    result.Add(tmp);
                }
                return(result);
            }
Пример #3
0
        public override int GetHashCode()
        {
            var hashCode = -1827612781;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(nick);

            hashCode = hashCode * -1521134295 + points.GetHashCode();
            hashCode = hashCode * -1521134295 + time.GetHashCode();
            hashCode = hashCode * -1521134295 + clicks.GetHashCode();
            hashCode = hashCode * -1521134295 + hints.GetHashCode();
            hashCode = hashCode * -1521134295 + matches.GetHashCode();
            hashCode = hashCode * -1521134295 + MyPoints.GetHashCode();
            return(hashCode);
        }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     MyPoints.Clear();
     for (int i = 0; i < SpawnedPoints; i++)
     {
         Vector3 NewPosition = new Vector3(Random.Range(-Range, Range), Random.Range(-Range, Range), Random.Range(-Range, Range));
         //NewPosition.x = Mathf.Clamp(NewPosition.x, -Range, Range);
         MyPoints.Add(NewPosition);
         MyColors.Add(new Color32((byte)Random.Range(0.0f, 1.0f),
                                  (byte)Random.Range(0.0f, 1.0f),
                                  (byte)Random.Range(0.0f, 1.0f),
                                  (byte)1.0f));
     }
     CreateMesh();
 }
Пример #5
0
        private void Write_csv_and_graph(string pressure, DateTime nowtime, MyGraph myg, int intervaltime)   //my_all_dataに代入とグラフを描く関数
        //graph code
        {
            int      passed_time = this.time_to_int(this.class_my_starttime, nowtime);
            MyPoints tmp_point   = new MyPoints(passed_time, double.Parse(pressure));

            if (!this.my_all_data.ContainsKey(passed_time.ToString()))
            {
                this.my_all_data[passed_time.ToString()] = pressure;
                myg.slowly_plot(tmp_point, this);
            }
            //write_csv
            //MessageBox.Show(passed_time.ToString());

            //using (StreamWriter sw = new StreamWriter(save_name, true, Encoding.GetEncoding("shift_jis"))) {    //例外とらえていない
            //    sw.WriteLine(nowtime.ToString() + "," + pressure);
            //}
        }
Пример #6
0
            public void slowly_plot(MyPoints point, object ob)
            {
                Form1 tmp = (Form1)ob;

                string[] tmpstr = { };
                foreach (var value in this.chartcontrol.ChartAreas)
                {
                    tmpstr = value.ToString().Split('-');
                    //this.chartcontrol.ChartAreas[tmpstr[1]].AxisX.Maximum += 1;   //グラフエリアのx軸の拡張
                }


                if (tmp.InvokeRequired)
                {
                    tmp.Invoke((MethodInvoker) delegate() { this.slowly_plot(point, ob); });
                    return;
                }
                else
                {
                    this.graphdata.Points.AddXY(point.X, point.Y);
                    //if (this.chartcontrol.ChartAreas[tmpstr[1]].AxisX.Maximum <= point.X)
                    //{
                    //  this.chartcontrol.ChartAreas[tmpstr[1]].AxisX.Maximum += 10;
                    //}
                    if (tmp.class_plot_xmax != null && tmp.class_plot_xmin != null)
                    {   //エラーハンドリング必要
                        this.chartcontrol.ChartAreas[tmpstr[1]].AxisX.Maximum = (double)tmp.class_plot_xmax;
                        this.chartcontrol.ChartAreas[tmpstr[1]].AxisX.Minimum = (double)tmp.class_plot_xmin;
                    }
                    if (tmp.class_plot_ymax != null && tmp.class_plot_ymin != null)
                    {
                        this.chartcontrol.ChartAreas[tmpstr[1]].AxisY.Maximum = (double)tmp.class_plot_ymax;
                        this.chartcontrol.ChartAreas[tmpstr[1]].AxisY.Minimum = (double)tmp.class_plot_ymin;
                    }
                }
            }
Пример #7
0
        public void StartAlgo()
        {
            firstPoint = true;

            var mp = new MyPoints();

            mp.GenDistances2();
            Console.WriteLine(mp);
            mp.CheckPointMatch(this);


            mp.GenPoints();
            mp.GenDistances2();
            Console.WriteLine(mp);
            mp.CheckPointMatch(this);

            mp.GenPoints();
            mp.GenDistances2();
            Console.WriteLine(mp);
            mp.CheckPointMatch(this);

            mp.GenPoints();
            mp.CheckPointMatch(this);
        }