Inheritance: MonoBehaviour
示例#1
0
文件: CSTest.cs 项目: srfoster/Euclid
 void AskEclipse()
 {
     while (true)
     {
         Eclipse eclipse = new Eclipse();
         messages = eclipse.ProjectListString();
         Thread.Sleep(200);
     }
 }
示例#2
0
文件: CSTest.cs 项目: srfoster/Euclid
 void AskEclipse()
 {
     while(true)
     {
         Eclipse eclipse = new Eclipse();
         messages = eclipse.ProjectListString();
         Thread.Sleep(200);
     }
 }
示例#3
0
    //String last_error = "";

    public EclipseInput(string project_name, string file_name) : base(file_name)
    {
        this.project_name = project_name;
        eclipse           = new Eclipse();

        //This should definitely be moved into Euclid's API.  Clients of an API should not have to do this much work!

        /*
         * string project_list_string = eclipse.ProjectListString();
         * string project_string = "";
         * foreach(string s in project_list_string.Split('\n'))
         * {
         *      Debug.Log("Project : " + s);
         *      if(!s.Equals(""))
         *      {
         *              string[] project_string_split = s.Split(',');
         *              string name = project_string_split[1].Split(':')[1].Replace("\"","");
         *
         *              if(name.Equals(project_name))
         *              {
         *                      project_path = project_string_split[2].Split(':')[1].Replace("\"","");
         *              }
         *      }
         * }
         *
         *
         * //If no Eclipse project was found, we create a new one.
         * if(project_string.Equals(""))
         * {
         *      string[] file_name_split = file_name.Split('/');
         *      string[] file_name_split_path = new string[file_name_split.Length-1];
         *
         *      for(int i = 0; i < file_name_split.Length - 1; i++)
         *      {
         *              file_name_split_path[i] = file_name_split[i];
         *      }
         *
         *      project_path = String.Join("/",file_name_split_path);
         *
         *      eclipse.CreateNewProject(project_path);
         * }
         *
         *
         *
         * short_file_name = GetFileName().Replace(project_path,"");
         */

        /*
         * Thread java_thread = (new Thread(javaCompile));
         * java_thread.Start();
         */
    }
示例#4
0
    //String last_error = "";
    public EclipseInput(string project_name, string file_name)
        : base(file_name)
    {
        this.project_name = project_name;
        eclipse = new Eclipse();

        //This should definitely be moved into Euclid's API.  Clients of an API should not have to do this much work!
        /*
        string project_list_string = eclipse.ProjectListString();
        string project_string = "";
        foreach(string s in project_list_string.Split('\n'))
        {
            Debug.Log("Project : " + s);
            if(!s.Equals(""))
            {
                string[] project_string_split = s.Split(',');
                string name = project_string_split[1].Split(':')[1].Replace("\"","");

                if(name.Equals(project_name))
                {
                    project_path = project_string_split[2].Split(':')[1].Replace("\"","");
                }
            }
        }

        //If no Eclipse project was found, we create a new one.
        if(project_string.Equals(""))
        {
            string[] file_name_split = file_name.Split('/');
            string[] file_name_split_path = new string[file_name_split.Length-1];

            for(int i = 0; i < file_name_split.Length - 1; i++)
            {
                file_name_split_path[i] = file_name_split[i];
            }

            project_path = String.Join("/",file_name_split_path);

            eclipse.CreateNewProject(project_path);
        }

        short_file_name = GetFileName().Replace(project_path,"");
        */

        /*
        Thread java_thread = (new Thread(javaCompile));
        java_thread.Start();
        */
    }
示例#5
0
    public EclipseInput(string project_name, string file_name) : base(file_name)
    {
        this.project_name = project_name;
        eclipse           = new Eclipse();

        //This should definitely be moved into Euclid's API.  Clients of an API should not have to do this much work!
        string project_list_string = eclipse.ProjectListString();
        string project_string      = "";

        foreach (string s in project_list_string.Split('\n'))
        {
            Debug.Log("Project : " + s);
            if (!s.Equals(""))
            {
                string[] project_string_split = s.Split(',');
                string   name = project_string_split[1].Split(':')[1].Replace("\"", "");

                if (name.Equals(project_name))
                {
                    project_path = project_string_split[2].Split(':')[1].Replace("\"", "");
                }
            }
        }


        //If no Eclipse project was found, we create a new one.
        if (project_string.Equals(""))
        {
            string[] file_name_split      = file_name.Split('/');
            string[] file_name_split_path = new string[file_name_split.Length - 1];

            for (int i = 0; i < file_name_split.Length - 1; i++)
            {
                file_name_split_path[i] = file_name_split[i];
            }

            project_path = String.Join("/", file_name_split_path);

            eclipse.CreateNewProject(project_path);
        }



        short_file_name = GetFileName().Replace(project_path, "");
    }
        private void draw_Click(object sender, EventArgs e)
        {
            if (circle.Checked || line.Checked || ellipse.Checked)
            {
                switch (operation)
                {
                case "line":
                {
                    var    coordinates = coordinate = Line.BresLineOrig(new Point(int.Parse(textBox1.Text), int.Parse(textBox2.Text)), new Point(int.Parse(textBox3.Text), int.Parse(textBox4.Text)));
                    Bitmap bmp         = new Bitmap(pictureBox1.Image);
                    foreach (var item in coordinates)
                    {
                        bmp.SetPixel((bmp.Size.Width - item.X) / 2, (bmp.Size.Height - item.Y) / 2, Color.Red);
                    }
                    pictureBox1.Image = bmp;
                }
                break;

                case "circle":
                {
                    var    coordinates = coordinate = Circle.DrawCircle(int.Parse(textBox1.Text), int.Parse(textBox2.Text), int.Parse(R.Text));
                    Bitmap bmp         = new Bitmap(pictureBox1.Image);
                    foreach (var item in coordinates)
                    {
                        bmp.SetPixel((bmp.Size.Width - item.X) / 2, (bmp.Size.Height - item.Y) / 2, Color.Red);
                    }
                    pictureBox1.Image = bmp;
                }
                break;

                case "ellipse":
                {
                    var    coordinates = coordinate = Eclipse.DrawEclipse(double.Parse(textBox1.Text), double.Parse(textBox2.Text), double.Parse(textBox3.Text), double.Parse(textBox4.Text));
                    Bitmap bmp         = new Bitmap(pictureBox1.Image);
                    foreach (var item in coordinates)
                    {
                        bmp.SetPixel((bmp.Size.Width - item.X) / 2, (bmp.Size.Height - item.Y) / 2, Color.Red);
                    }
                    pictureBox1.Image = bmp;
                }
                break;
                }
            }
        }
示例#7
0
    void startStuff()
    {
        Eclipse eclipse = new Eclipse();
        string eclim_running = eclipse.ProjectListString();

        if(eclim_running.Contains("Connection refused"))
        {
            (new Thread(startEclimd)).Start();

            while(eclim_running.Contains("Connection refused"))
            {
                eclim_running = eclipse.ProjectListString();

                Thread.Sleep(10);
            }
        }

        unloader.Loaded();
    }
示例#8
0
    void startStuff()
    {
        Eclipse eclipse       = new Eclipse();
        string  eclim_running = eclipse.ProjectListString();

        if (eclim_running.Contains("Connection refused"))
        {
            (new Thread(startEclimd)).Start();

            while (eclim_running.Contains("Connection refused"))
            {
                eclim_running = eclipse.ProjectListString();

                Thread.Sleep(10);
            }
        }

        unloader.Loaded();
    }
    // Use this for initialization
    void Start()
    {
        splittextdata = new string[100];
        separate      = new char[2];
        touch_count   = 0;
        amperage      = new float[10];
        voltage       = new float[10];
        kairo         = new Texture2D[3];
        num           = Eclipse.CallFuncB();
        //num = 221;

        if (num == 0)
        {
            txtxt    = Resources.Load("kadai_text/tutorial") as TextAsset;
            kairo[0] = Resources.Load("gazou/tutorial") as Texture2D;
            ReadTextData();
            separate      = aaa.ToCharArray();
            splittextdata = textdata.Split(separate, 100);
        }
        else if (num > 0)
        {
            kadai_dai  = num / 100;                                            //章番号
            kadai_syou = (num - kadai_dai * 100) / 10;                         //節番号
            file_path  = "kadai_text/kadai_0" + kadai_dai + "_0" + kadai_syou; //ファイルパス指定
            print(file_path);
            txtxt     = Resources.Load(file_path) as TextAsset;
            file_path = "gazou/kadai_0" + kadai_dai + "_0" + kadai_syou;//ファイルパス指定
            for (i = 0; i < 3; i++)
            {
                kairo[i] = Resources.Load(file_path + "_" + i) as Texture2D;
            }
            ReadTextData();                                //テキストデータ読み込み(textdataにテキストデータを代入)
            separate      = aaa.ToCharArray();             //区切り文字の設定
            splittextdata = textdata.Split(separate, 100); //区切り文字ごとに区切る
        }

        for (i = 0; i < 10; i++)
        {
            amperage[i] = 0;
            voltage[i]  = 0;
        }
    }
示例#10
0
        public void IsValueTypeTest()
        {
            Eclipse?it = new Eclipse();

            Assert.IsTrue(TypeInterrogator.IsValueType(it.GetType()));

            SoundLevle sl = SoundLevle.Deaf;

            Assert.IsTrue(TypeInterrogator.IsValueType(sl.GetType()));

            double x = 6.0;

            Assert.IsTrue(TypeInterrogator.IsNumericType(x.GetType()));

            Assert.IsTrue(TypeInterrogator.IsStrcutType(typeof(Eclipse)));
            Assert.IsFalse(TypeInterrogator.IsStrcutType(typeof(EmployeeBase <int>)));
            Assert.IsFalse(TypeInterrogator.IsStrcutType(typeof(EmployeeBase <>)));

            Assert.IsTrue(TypeInterrogator.IsReferenceType(typeof(EmployeeBase <>)));
            Assert.IsTrue(TypeInterrogator.IsReferenceType(typeof(Employee.HasNetWork)));
            Assert.IsTrue(TypeInterrogator.IsDelegateType(typeof(Employee.HasNetWork)));
        }
示例#11
0
        //[TestMethod()]
        public void SubTypeTest()
        {
            Assert.IsTrue(TypeInterrogator.IsSubclass(typeof(EmployeeBase <>), typeof(Manager)));
            Assert.IsTrue(TypeInterrogator.IsSubclass(typeof(EmployeeBase <>), typeof(TemplatedInspector <int>)));

            Employee inspector = new TemplatedInspector <Insight>();

            Assert.IsTrue(TypeInterrogator.IsSubclass(typeof(EmployeeBase <>), inspector.GetType()));

            Employee emp = new Employee();

            Assert.IsFalse(emp.GetType().IsGenericType);
            Assert.IsTrue(TypeInterrogator.IsSubclass(emp.GetType(), inspector.GetType()));
            Assert.IsTrue(TypeInterrogator.IsSubclass(typeof(EmployeeBase <>), emp.GetType()));

            Eclipse?it = new Eclipse();

            Assert.IsFalse(TypeInterrogator.IsSubclass(typeof(EmployeeBase <>), it.GetType()));

            List <EmployeeBase <int> > xlist = new List <EmployeeBase <int> >();

            Assert.IsTrue(xlist.GetType().IsGenericType);
        }
示例#12
0
 private void ApplyEclipse()
 {
     Eclipse.ApplyElipse(pnRoot, 30);
 }
示例#13
0
        public static Shape TimHinhVe(OpenGLControl openGLControl, int chooseImg, Point start, Point end, Color userChoose, float thickness)
        {
            Shape imgToDraw = null;

            //Xem lựa chọn của user và chọn hinh vẽ
            if (start.X != -1000)
            {
                if (start == end)
                {
                    chooseImg = -1;
                }
                switch (chooseImg)
                {
                case 0:
                    imgToDraw = new Line(start, end, thickness, userChoose);
                    break;

                case 1:
                    imgToDraw = new Circle(start, end, thickness, userChoose);
                    break;

                case 2:
                    imgToDraw = new Eclipse(start, end, thickness, userChoose);
                    break;

                case 3:
                    imgToDraw = new Rectangel(start, end, thickness, userChoose);
                    break;

                case 4:
                    imgToDraw = new EqualTriangle(start, end, thickness, userChoose);
                    break;

                case 5:
                    imgToDraw = new EqualPentagon(start, end, thickness, userChoose);
                    break;

                case 6:
                    imgToDraw = new EqualHexagon(start, end, thickness, userChoose);
                    break;

                default:
                    imgToDraw = null;
                    break;
                }
            }
            if (imgToDraw != null)
            {
                if (listDraw.Count > 0)
                {
                    var tmpPop = listDraw.Pop();
                    if (tmpPop.upLeft == imgToDraw.upLeft && tmpPop.GetType() == imgToDraw.GetType())
                    {
                        imgToDraw.thoiGianVe = tmpPop.thoiGianVe;
                    }
                    else
                    {
                        listDraw.Push(tmpPop);
                    }
                }
                listDraw.Push(imgToDraw);
            }
            return(imgToDraw);
        }