Exemple #1
0
        private void OpenRoutingTool(IBlock start, RoutingMode requestMode)
        {
            _routingToolOpen = true;
            _routeToolMode   = requestMode;

            var popup = new Form();

            popup.Text        = "Routing Tool";
            popup.AutoSize    = true;
            popup.FormClosed += Popup_RoutingTool_FormClosed;
            var rt = new RoutingTool(this, _ctcOffice, _environment, start, false);

            //create special for dispatch
            if (requestMode == RoutingMode.Dispatch)
            {
                rt = new RoutingTool(this, _ctcOffice, _environment, start, true);
            }

            //set ctc gui ref
            _routeTool = rt;
            _routeTool.EnablePointSelection += Rt_EnablePointSelection;
            _routeTool.SubmitRoute          += Rt_SubmitRoute;

            popup.Controls.Add(_routeTool);
            popup.Show();
        }
        public CTCOfficeGUI(ISimulationEnvironment env, CTCOffice ctc)
        {
            InitializeComponent();
            //set refs to ctc office and environment
            _ctcOffice = ctc;
            _environment = env;
            _speedState = 0;

            _res = _ctcOffice.Resource;

            _ctcOffice.LoadData += new EventHandler<EventArgs>(_ctcOffice_LoadData);
            _ctcOffice.UnlockLogin += new EventHandler<EventArgs>(_ctcOffice_UnlockLogin);
            _ctcOffice.MessagesReady += new EventHandler<EventArgs>(_ctcOffice_MessagesReady);
            _ctcOffice.UpdatedData += new EventHandler<EventArgs>(_ctcOffice_UpdatedData);
            _loginState = false;

            _btnLoginLogout.Enabled = _loginState;
            _txtPassword.Enabled = _loginState;
            _txtUsername.Enabled = _loginState;

            _rate = 100;
            _tickCount = 0;

            //init routing vars
            _routeTool = null;
            _inRoutingPoint = false;
            _routingToolOpen = false;
            _routeToolMode = RoutingMode.Dispatch;

            _lastRightClickContainer = null;

            _keyForm = null;
            _keyOpen = false;

            //subscribe to Environment Tick
            _environment.Tick += _environment_Tick;

            //ensure the user is logged out
            _ctcOffice.Logout();
            //change button text
            _btnLoginLogout.Text = "Login";

            //show team logo (block out user)
            MainDisplayLogo();
            DisableUserControls();
            _loginStatusImage.Image = _res.RedLight;
            _imageTeamLogo.Image = Properties.Resources.TerminalVelocity;

            UpdateMetrics();
            RefreshStatus();

            //populate red line and green line panel
            //parseLineData();

            //enables double buffering for control drawings
            //this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);

            //post to log that the gui has loaded
            _environment.SendLogEntry("CTCOffice: GUI Loaded");

            _tt = null;
        }
 private void Popup_RoutingTool_FormClosed(object sender, FormClosedEventArgs e)
 {
     _routeTool = null;
     _routingToolOpen = false;
     _popupIndicatorCTC.Image = null;
 }
        private void OpenRoutingTool(IBlock start, RoutingMode requestMode)
        {
            _routingToolOpen = true;
            _routeToolMode = requestMode;

            var popup = new Form();
            popup.Text = "Routing Tool";
            popup.AutoSize = true;
            popup.FormClosed += Popup_RoutingTool_FormClosed;
            var rt = new RoutingTool(this, _ctcOffice, _environment, start, false);

            //create special for dispatch
            if (requestMode == RoutingMode.Dispatch)
            {
                rt = new RoutingTool(this, _ctcOffice, _environment, start, true);
            }

            //set ctc gui ref
            _routeTool = rt;
            _routeTool.EnablePointSelection += Rt_EnablePointSelection;
            _routeTool.SubmitRoute += Rt_SubmitRoute;

            popup.Controls.Add(_routeTool);
            popup.Show();
        }
Exemple #5
0
        public CTCOfficeGUI(ISimulationEnvironment env, CTCOffice ctc)
        {
            InitializeComponent();
            //set refs to ctc office and environment
            _ctcOffice   = ctc;
            _environment = env;
            _speedState  = 0;

            _res = _ctcOffice.Resource;

            _ctcOffice.LoadData      += new EventHandler <EventArgs>(_ctcOffice_LoadData);
            _ctcOffice.UnlockLogin   += new EventHandler <EventArgs>(_ctcOffice_UnlockLogin);
            _ctcOffice.MessagesReady += new EventHandler <EventArgs>(_ctcOffice_MessagesReady);
            _ctcOffice.UpdatedData   += new EventHandler <EventArgs>(_ctcOffice_UpdatedData);
            _loginState = false;

            _btnLoginLogout.Enabled = _loginState;
            _txtPassword.Enabled    = _loginState;
            _txtUsername.Enabled    = _loginState;

            _rate      = 100;
            _tickCount = 0;

            //init routing vars
            _routeTool       = null;
            _inRoutingPoint  = false;
            _routingToolOpen = false;
            _routeToolMode   = RoutingMode.Dispatch;

            _lastRightClickContainer = null;

            _keyForm = null;
            _keyOpen = false;

            //subscribe to Environment Tick
            _environment.Tick += _environment_Tick;

            //ensure the user is logged out
            _ctcOffice.Logout();
            //change button text
            _btnLoginLogout.Text = "Login";


            //show team logo (block out user)
            MainDisplayLogo();
            DisableUserControls();
            _loginStatusImage.Image = _res.RedLight;
            _imageTeamLogo.Image    = Properties.Resources.TerminalVelocity;

            UpdateMetrics();
            RefreshStatus();

            //populate red line and green line panel
            //parseLineData();

            //enables double buffering for control drawings
            //this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);

            //post to log that the gui has loaded
            _environment.SendLogEntry("CTCOffice: GUI Loaded");

            _tt = null;
        }
Exemple #6
0
 private void Popup_RoutingTool_FormClosed(object sender, FormClosedEventArgs e)
 {
     _routeTool               = null;
     _routingToolOpen         = false;
     _popupIndicatorCTC.Image = null;
 }