Beispiel #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();
    }
Beispiel #2
0
 public void TestCycle()
 {
     Assert.IsFalse(Cycle().IsTree());
     Assert.IsFalse(NonTree().IsTree());
     Assert.IsTrue(Tree().IsTree());
     Assert.IsFalse(ExampleMachine.Plant().IsTree());
 }
Beispiel #3
0
 /// <summary>
 /// Test na wykrycie, ¿e cykl nie jest drzewem.
 /// </summary>
 public void TestCycle()
 {
     Assertion.Assert(!Cycle().IsTree());
     Assertion.Assert(!NonTree().IsTree());
     Assertion.Assert(Tree().IsTree());
     Assertion.Assert(!ExampleMachine.Plant().IsTree());
 }
Beispiel #4
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();
    }
Beispiel #5
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();
    }
Beispiel #6
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();
    }
Beispiel #7
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";
    }
Beispiel #8
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 krakow = ExampleMachine.Krakow();
            ShellAssembler   sa     = (ShellAssembler)krakow.Find("Maszyna montażowa:3302");
            StarPress        sp     = (StarPress)krakow.Find("Prasa:3404");
            UnloadBuffer     ub     = (UnloadBuffer)krakow.Find("Taśmociąg: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 CarryCommandSequence();

            seq.AddCommand(c1);
            seq.AddCommand(c2);
            seq.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();
    }
Beispiel #11
0
    public static void Main()
    {
        MachineComponent c = ExampleMachine.Plant();

        Console.WriteLine(c.GetMachineCount());
    }