public ConnectionInterface(PrinterModel printer,TerminalWindow window)
     : base(window,printer)
 {
     Name = "Connection";
     Interfaces.Add(new ActionInterface("Connect",Connect));
     Interfaces.Add(new ActionInterface("Disconnect",(s) => Disconnect()));
 }
 public DirectModeInterface(PrinterModel printer,TerminalWindow window)
     : base(window,printer)
 {
     Name = "DirectMode";
     Interfaces.Add(new ActionInterface("SetTemperature",SetTemperature));
     Interfaces.Add(new ActionInterface("G-Code",ExecuteGCODE));
 }
        public FileModeInterface(PrinterModel printer,TerminalWindow window)
            : base(window,printer)
        {
            Name = "FileMode";

            Interfaces.Add(new ActionInterface("Execute File",OpenFile));
        }
示例#4
0
        public static void Main(string[] args)
        {
            TerminalWindow window = new TerminalWindow();

            PrinterModel model = new PrinterModel(window);

            window.Interfaces.Add(new ConnectionInterface(model, window));
            window.Interfaces.Add(new DirectModeInterface(model, window));
            window.Interfaces.Add(new FileModeInterface(model, window));

            window.Run();

            /*
             *          Console.WriteLine ("Modis");
             *          Console.WriteLine ("0)Beenden");
             *          Console.WriteLine ("1)GCode-Datei");
             * Console.WriteLine ("2)Kompillierte GCode-Datei");
             *          Console.WriteLine ("3)Hand");
             *
             *          int input = 0;
             *          do
             *          {
             *                  Console.Write ("Eingabe:");
             *                  input = int.Parse(Console.ReadLine());
             *
             *                  if (input == 1)
             *  {
             *      ModGCode();
             *  }
             *  if (input == 2)
             *  {
             *      ModGCode(true);
             *  }
             *                  if (input == 3)
             *  {
             *      try
             *      {
             *          var context = OpenContext();
             *          ModHand(context);
             *          context.Close ();
             *      }
             *      catch (Exception ex)
             *      {
             *          Console.WriteLine (ex.Message);
             *      }
             *  }
             *
             *
             *          } while (input != 0);
             *
             */
        }
示例#5
0
        public static void Main(string[] args)
        {
            TerminalWindow window = new TerminalWindow ();

            PrinterModel model = new PrinterModel(window);

            window.Interfaces.Add(new ConnectionInterface(model,window));
            window.Interfaces.Add(new DirectModeInterface(model, window));
            window.Interfaces.Add(new FileModeInterface(model, window));

            window.Run();

            /*
            Console.WriteLine ("Modis");
            Console.WriteLine ("0)Beenden");
            Console.WriteLine ("1)GCode-Datei");
            Console.WriteLine ("2)Kompillierte GCode-Datei");
            Console.WriteLine ("3)Hand");

            int input = 0;
            do
            {
                Console.Write ("Eingabe:");
                input = int.Parse(Console.ReadLine());

                if (input == 1)
                {
                    ModGCode();
                }
                if (input == 2)
                {
                    ModGCode(true);
                }
                if (input == 3)
                {
                    try
                    {
                        var context = OpenContext();
                        ModHand(context);
                        context.Close ();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine (ex.Message);
                    }
                }

            } while (input != 0);

            */
        }
示例#6
0
 public DirectModeInterface(PrinterModel printer, TerminalWindow window)  : base(window, printer)
 {
     Name = "DirectMode";
     Interfaces.Add(new ActionInterface("SetTemperature", SetTemperature));
     Interfaces.Add(new ActionInterface("G-Code", ExecuteGCODE));
 }
 public ConnectionInterface(PrinterModel printer, TerminalWindow window) : base(window, printer)
 {
     Name = "Connection";
     Interfaces.Add(new ActionInterface("Connect", Connect));
     Interfaces.Add(new ActionInterface("Disconnect", (s) => Disconnect()));
 }
 public BasePrinterInterface(TerminalWindow window, PrinterModel printer)
 {
     Window  = window;
     Printer = printer;
 }
        public FileModeInterface(PrinterModel printer, TerminalWindow window) : base(window, printer)
        {
            Name = "FileMode";

            Interfaces.Add(new ActionInterface("Execute File", OpenFile));
        }
 public BasePrinterInterface(TerminalWindow window,PrinterModel printer)
 {
     Window = window;
     Printer = printer;
 }