Ejemplo n.º 1
0
 public static void write__(IceInternal.BasicStream os__, MidaxIcePrx v__)
 {
     os__.writeProxy(v__);
 }
Ejemplo n.º 2
0
            public override int run(string[] args)
            {
                if (args.Length > 0)
                {
                    Console.Error.WriteLine(appName() + ": too many arguments");
                    return(1);
                }

                try
                {
                    serverController = MidaxIcePrxHelper.checkedCast(communicator().stringToProxy("serverController"));
                }
                catch (Ice.NotRegisteredException)
                {
                    IceGrid.QueryPrx query =
                        IceGrid.QueryPrxHelper.checkedCast(communicator().stringToProxy("MidaxIceGrid/Query"));
                    serverController = MidaxIcePrxHelper.checkedCast(query.findObjectByType("::Midax::MidaxIce"));
                }
                if (serverController == null)
                {
                    Console.WriteLine("couldn't find a `::Midax::MidaxIce' object");
                    return(1);
                }

                menu();

                string line = null;

                do
                {
                    try
                    {
                        Console.Write("==> ");
                        Console.Out.Flush();
                        line = Console.In.ReadLine();
                        if (line == null)
                        {
                            break;
                        }
                        if (line.Equals("p"))
                        {
                            Console.WriteLine(string.Format("{0} Ping", DateTime.Now.TimeOfDay));
                            Console.WriteLine(string.Format("{0} Answer: {1}", DateTime.Now.TimeOfDay, serverController.ping()));
                        }
                        else if (line.Equals("s"))
                        {
                            Console.WriteLine(string.Format("{0} Status:\n{1}", DateTime.Now.TimeOfDay, serverController.getStatus()));
                        }
                        else if (line.Equals("shut"))
                        {
                            serverController.shutdown();
                        }
                        else if (line.Equals("x"))
                        {
                            // Nothing to do
                        }
                        else if (line.Equals("?"))
                        {
                            menu();
                        }
                        else if (line.Equals("start"))
                        {
                            serverController.startsignals();
                        }
                        else if (line.Equals("stop"))
                        {
                            serverController.stopsignals();
                        }
                        else
                        {
                            Console.WriteLine("unknown command `" + line + "'");
                            menu();
                        }
                    }
                    catch (Ice.LocalException ex)
                    {
                        Console.WriteLine(ex);
                    }
                }while (!line.Equals("x"));

                return(0);
            }
Ejemplo n.º 3
0
            public override int run(string[] args)
            {
                if (args.Length > 0)
                 {
                     Console.Error.WriteLine(appName() + ": too many arguments");
                     return 1;
                 }

                 try
                 {
                     serverController = MidaxIcePrxHelper.checkedCast(communicator().stringToProxy("serverController"));
                 }
                 catch (Ice.NotRegisteredException)
                 {
                     IceGrid.QueryPrx query =
                         IceGrid.QueryPrxHelper.checkedCast(communicator().stringToProxy("MidaxIceGrid/Query"));
                     serverController = MidaxIcePrxHelper.checkedCast(query.findObjectByType("::Midax::MidaxIce"));
                 }
                 if (serverController == null)
                 {
                     Console.WriteLine("couldn't find a `::Midax::MidaxIce' object");
                     return 1;
                 }

                 menu();

                 string line = null;
                 do
                 {
                     try
                     {
                         Console.Write("==> ");
                         Console.Out.Flush();
                         line = Console.In.ReadLine();
                         if (line == null)
                         {
                             break;
                         }
                         if (line.Equals("p"))
                         {
                             Console.WriteLine(string.Format("{0} Ping", DateTime.Now.TimeOfDay));
                             Console.WriteLine(string.Format("{0} Answer: {1}", DateTime.Now.TimeOfDay, serverController.ping()));
                         }
                         else if (line.Equals("s"))
                         {
                             Console.WriteLine(string.Format("{0} Status:\n{1}", DateTime.Now.TimeOfDay, serverController.getStatus()));
                         }
                         else if (line.Equals("shut"))
                         {
                             serverController.shutdown();
                         }
                         else if (line.Equals("x"))
                         {
                             // Nothing to do
                         }
                         else if (line.Equals("?"))
                         {
                             menu();
                         }
                         else if (line.Equals("start"))
                         {
                             serverController.startsignals();
                         }
                         else if (line.Equals("stop"))
                         {
                             serverController.stopsignals();
                         }
                         else
                         {
                             Console.WriteLine("unknown command `" + line + "'");
                             menu();
                         }
                     }
                     catch (Ice.LocalException ex)
                     {
                         Console.WriteLine(ex);
                     }
                 }
                 while (!line.Equals("x"));

                 return 0;
            }