Exemplo n.º 1
0
        public SocketWindow(out bool to_close)
        {
            to_close = false;
            InitializeComponent();
            while (Config == null)
            {
                while (Config == null)
                {
                    SocketConfig socketConfig = new SocketConfig(this);
                    bool? userClickedOK = socketConfig.ShowDialog();
                    if (userClickedOK == false)
                    {
                        to_close = true;
                        return;
                    }
                    else

                    if (Config == null)
                    {
                        System.Windows.MessageBox.Show("Invalid configuration. Please, change it.");
                    }

                }
            }
            if (!to_close)
            {
               // RunCommunication();
                Connect("localhost", 5100, out outputAdmin, out inputAdmin);

                // CfgSettings.WritePathToFile("path_to_config.txt", rawpath);
                //if (!_readCfg) System.Windows.MessageBox.Show("Invalid configuration file");
                //else
                {
                    ConfigList.DataContext = Config;
                    _agentDataDictionary = new AgentDataDictionary(Config);
                    _statePeriod = SpeedSlider.Value;
                }
                AuctionsLabel.Header = "{Special items}";
                LoadAndSetup(Config);
                SetBindings();
                SetUI();

                //RunRegistration();
                //RunSimulation();

                //AgentDataDictionary = new AgentDataDictionary(@"D:\#Recent_desktop\UNI\PES602\DMG\dammage 1.0\domains\english.pl");
                this.Title = "MultiAgentz Visualization - " + Config.HistPath;
            }
        }