コード例 #1
0
        static void Main(string[] args)
        {
            double lowerLimit, upperLimit;

            do
            {
                Console.Write("Bitte das untere Intervalllimit (z.B. 0,0) eingeben: ");
                lowerLimit = Util.ReadDouble();

                Console.Write("Bitte das obere Intervalllimit (z.B. 1,0) eingeben: ");
                upperLimit = Util.ReadDouble();
            } while (lowerLimit >= upperLimit);

            IServer server = (IServer)Util.Connect("localhost", "TServer", 1234, 4711);

            Console.WriteLine("Der Server sagt:");
            Console.WriteLine(server.MessageOfTheDay);

            ICalculateNulls nulls = server.CreateCalculateNulls();

            Point[] results = nulls.Calculate(new DemoEquation(), lowerLimit, upperLimit);

            for (int i = 0; i < results.Length; i++)
            {
                Console.WriteLine(results[i].x + " => " + results[i].y);
            }

            Console.WriteLine("\nEingabetaste zum beenden.");
            Console.ReadLine();
        }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            #region input

            double lowerLimit, upperLimit;

            do
            {
                lowerLimit = IOHelper.AskForDouble(false);
                upperLimit = IOHelper.AskForDouble(true);
            } while (lowerLimit >= upperLimit);

            #endregion

            #region processing

            IServer server = (IServer)Util.Connect("localhost", "TServer", 1234, 4711);
            Console.WriteLine("Der Server sagt:");
            Console.WriteLine(server.MessageOfTheDay);

            ICalculateNulls nulls = server.CreateCalculateNulls();

            DemoEquation demo = new DemoEquation();

            Point[] results = nulls.Calculate(demo, lowerLimit, upperLimit);

            CalculateValues cv = new CalculateValues(demo);
            cv.FindValuesInRange(lowerLimit, upperLimit);

            #endregion

            #region output

            ClientGUI plot = new ClientGUI();
            plot.CreateSeries(true, results);
            plot.CreateSeries(false, cv.Values);
            Application.Run(plot);

            #endregion
        }