Example #1
0
        public override bool configure(ResourceFinder rf)
        {
            Time.turboBoost();
            Console.WriteLine("----------------------------------");
            Console.WriteLine("Convergence Divergence Zone Module");
            Console.WriteLine("----------------------------------");

            bool loadingFromWeights = rf.check("load");

            period           = rf.check("period", new Value(100)).asInt();
            broadcastDisplay = !rf.check("noDisplay");
            Console.Write("Running every " + period + " ms");

            if (loadingFromWeights)
            {
                Console.Write("Loading MMCM from weights file...");
                string weightFile = rf.find("load").asString().c_str();
                string path       = rf.findFile(weightFile).c_str();
                Console.WriteLine(path);
                cvz = CVZFactory.Create(path);
            }
            else
            {
                cvz = CVZFactory.Create(rf);
            }

            //Open the RPC communication
            rpc.open("/" + cvz.name + "/rpc");
            attach(rpc);

            return(true);
        }