Exemple #1
0
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main()
    {
        Variable v = new Variable("machine");
        Command  c = new ForCommand(ExampleMachine.Dublin(), v, new PrintCommand(v));

        c.Execute();
    }
Exemple #2
0
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main()
    {
        MachineComposite dublin = ExampleMachine.Dublin();
        Variable         v      = new Variable("machine");
        Command          c      = new ForCommand(dublin, v, new ShutDownCommand(v));

        c.Execute();
    }
Exemple #3
0
    public static void Main()
    {
        MachineComposite dublin = ExampleMachine.Dublin();
        Term             sp     = new Constant((Machine)dublin.Find("StarPress:1401"));
        Term             ub     = new Constant((Machine)dublin.Find("UnloadBuffer:1501"));
        WhileCommand     wc     = new WhileCommand(
            new HasMaterial(sp),
            new CarryCommand(sp, ub));

        wc.Execute();
    }
Exemple #4
0
    public static void Main()
    {
        MachineComponent dublin = ExampleMachine.Dublin();
        OozinozFilter    w      = new CommaListFilter(new WrapFilter(new ConsoleWriter(), 60));
        Set leaves = new RakeVisitor().GetLeaves(dublin);

        foreach (MachineComponent mc in leaves)
        {
            w.Write(mc.ID.ToString());
        }
        w.Close();
    }
Exemple #5
0
    public ShowTreeNodeVisitor()
    {
        TreeView view = new TreeView();

        view.Dock = DockStyle.Fill;
        view.Font = UI.NORMAL.Font;
        TreeNodeVisitor v = new TreeNodeVisitor();

        v.Visit(ExampleMachine.Dublin());
        view.Nodes.Add(v.TreeNode);
        Controls.Add(view);
        Text = "Show Tree Node View";
    }
Exemple #6
0
    public static void Main()
    {
        MachineComposite dublin = ExampleMachine.Dublin();
        //Machine starPress = (Machine) dublin.Find("StarPress:1401"); // uncomment to add bins
        //starPress.Load(new Bin(42));// and see it work
        //starPress.Load(new Bin(84));//
        Term         sp = new Constant((Machine)dublin.Find("StarPress:1401"));
        Term         ub = new Constant((Machine)dublin.Find("UnloadBuffer:1501"));
        WhileCommand wc = new WhileCommand(
            new HasMaterial(sp),
            new CarryCommand(sp, ub));

        wc.Execute();
    }
    public static void Main()
    {
        MachineComposite dublin = ExampleMachine.Dublin();
        ShellAssembler   sa     = (ShellAssembler)dublin.Find("ShellAssembler:3302");
        StarPress        sp     = (StarPress)dublin.Find("StarPress:3404");
        UnloadBuffer     ub     = (UnloadBuffer)dublin.Find("UnloadBuffer:3501");

        sa.Load(new Bin(11011));
        sp.Load(new Bin(11015));

        CarryCommand c1 = new CarryCommand(sa, ub);
        CarryCommand c2 = new CarryCommand(sp, ub);

        CommandSequence seq = new CommandSequence();

        seq.AddCommand(c1);
        seq.AddCommand(c2);

        seq.Execute();
    }