static void Main(string[] args) { Network.init(); Console.WriteLine("----------------------------------"); Console.WriteLine("Convergence Divergence Zone Module"); Console.WriteLine("----------------------------------"); ResourceFinder rf = new ResourceFinder(); rf.setDefaultContext("MMCM/conf"); //Workaround the "--from" issue bool loadingFromWeights = false; string configFile = "defaultMap.ini"; for (int i = 0; i < args.Count(); i++) { if (args[i] == "--from") { configFile = args[i + 1]; } if (args[i] == "--load") { loadingFromWeights = true; configFile = args[i + 1]; } } if (!loadingFromWeights) { rf.setDefaultConfigFile(configFile); } SVector argsVect = new SVector(args); rf.configure("MMCM_ROOT", argsVect); IConvergenceZone cvz = null; if (loadingFromWeights) { Console.Write("Loading MMCM from weights file..."); string path = rf.findFile(configFile).c_str(); Console.WriteLine(path); cvz = CVZFactory.Create(path); } else { cvz = CVZFactory.Create(rf); } Application.EnableVisualStyles(); MMCM_ControlPanel form = new MMCM_ControlPanel(cvz as CVZ_MMCM); Application.Run(form); }
static void Main(string[] args) { Network.init(); ResourceFinder rf = new ResourceFinder(); bool loadingFromWeights = false; string configFile = "defaultMap.ini"; for (int i = 0; i < args.Count(); i++) { if (args[i] == "--from") { configFile = args[i + 1]; } if (args[i] == "--load") { loadingFromWeights = true; configFile = args[i + 1]; } } if (!loadingFromWeights) { rf.setDefaultConfigFile(configFile); } rf.setDefaultContext("MMCM/conf"); SVector argsVect = new SVector(args); rf.configure("MMCM_ROOT", argsVect); string mapType = CVZFactory.GetCvzType(rf); switch (mapType) { case "MMCM": { RFModuleMMCM module = new RFModuleMMCM(); module.configure(rf); module.runModule(); break; } case "CTPC": { RFModuleCTPC module = new RFModuleCTPC(); module.configure(rf); module.runModule(); break; } default: throw new Exception("Unknown CVZ type"); } }