private void RoboSep_UserProtocolList_Load(object sender, EventArgs e)
        {
            // set my protocolList to protocol list created by protocols window
            myProtocolList = RoboSep_ProtocolList.getInstance();

            // load user name from UserConsole window
            UserNameHeader.Text = strUserName;

            // set labels and button text based on language settings
            LanguageINI = RoboSep_UserConsole.getInstance().LanguageINI;
            //lblUsrProtocols.Text = LanguageINI.GetString("lblUserProtocols");
            TabLists.Tab1        = LanguageINI.GetString("lblEditList");
            TabLists.Tab2        = LanguageINI.GetString("lblMyList");
            button_Remove.Text   = LanguageINI.GetString("lblRemoveProtocol");
            button_SaveList.Text = LanguageINI.GetString("lblSaveList");

            // set up for drawing
            theFormat               = new StringFormat();
            theFormat.Alignment     = StringAlignment.Near;
            theFormat.LineAlignment = StringAlignment.Center;
            BG_ColorEven            = Color.FromArgb(216, 217, 218);
            BG_ColorOdd             = Color.FromArgb(243, 243, 243);
            BG_Selected             = Color.FromArgb(78, 38, 131);
            Txt_Color               = Color.FromArgb(95, 96, 98);
        }
예제 #2
0
        private void hex_help_Click(object sender, EventArgs e)
        {
            RoboSep_UserConsole.getInstance().SuspendLayout();
            RoboSep_About about = null;

            switch (RoboSep_UserConsole.CurrentHelpTab)
            {
            case RoboSep_UserConsole.HelpTab.About:
                about          = RoboSep_About.getInstance();
                about.Location = new Point(0, 0);
                RoboSep_UserConsole.getInstance().Controls.Add(about);
                RoboSep_UserConsole.ctrlCurrentUserControl = about;
                break;

            case RoboSep_UserConsole.HelpTab.HelpVid:
                break;
            }

            closeHomeWindow();

            if (about != null)
            {
                about.BringToFront();
                about.Focus();
            }

            // LOG
            string logMSG = "Help button clicked";

            //GUI_Controls.uiLog.LOG(this, "hex_help_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
예제 #3
0
        private List <string> AskUserToInsertUSBDrive()
        {
            List <string> lstUSBDrives = Utilities.GetUSBDrives();

            if (lstUSBDrives == null)
            {
                return(null);
            }

            if (lstUSBDrives.Count > 0)
            {
                return(lstUSBDrives);
            }

            // show dialog prompting user to insert USB key
            string msg = LanguageINI.GetString("SaveReport");

            GUI_Controls.RoboMessagePanel prompt = new GUI_Controls.RoboMessagePanel(
                RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_INFORMATION, msg, LanguageINI.GetString("headerSaveReport"),
                LanguageINI.GetString("Yes"), LanguageINI.GetString("Cancel"));
            RoboSep_UserConsole.showOverlay();
            prompt.ShowDialog();
            RoboSep_UserConsole.hideOverlay();

            if (prompt.DialogResult != DialogResult.OK)
            {
                prompt.Dispose();
                return(null);
            }
            prompt.Dispose();
            return(AskUserToInsertUSBDrive());
        }
예제 #4
0
        private void hex_UserPreferences_Click(object sender, EventArgs e)
        {
            RoboSep_UserConsole.getInstance().SuspendLayout();

            if (myUserPreferences != null)
            {
                myUserPreferences.Dispose();
                myUserPreferences = null;
            }

            myUserPreferences        = new RoboSep_UserPreferences(RoboSep_UserConsole.strCurrentUser, false, true);
            myUserPreferences.Parent = this.Parent;
            myUserPreferences.ClosingUserPreferencesApp += new EventHandler(HandleClosingUserPreferencesApp);

            //myUserPreferences.Location = new Point(0, 0);
            // RoboSep_UserConsole.getInstance().Controls.Add(myUserPreferences);
            //   RoboSep_UserConsole.ctrlCurrentUserControl = myUserPreferences;
            myUserPreferences.Show();
            myUserPreferences.BringToFront();
            myUserPreferences.Focus();
            // LOG
            string logMSG = "User Preferences button clicked";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
        private void button_SaveList_Click(object sender, EventArgs e)
        {
            // Check if User list contains atleast 1 protocol (otherwise don't exit screen)
            bool validUser = myUserProtocols.Count > 0;

            if (validUser)
            {
                // save list
                saveUserList();

                // close protocol list and user protocol list
                RoboSep_Protocols.getInstance().UserName = strUserName;
                RoboSep_UserConsole.getInstance().Controls.Add(RoboSep_Protocols.getInstance());
                RoboSep_UserConsole.getInstance().Controls.Remove(this);

                // Update user list
                RoboSep_Protocols.getInstance().LoadUsers();

                // LOG
                string logMSG = "Save List button clicked";
                //GUI_Controls.uiLog.LOG(this, "button_SaveList_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);
                //  (logMSG);
                LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            }
            else
            {
                GUI_Controls.RoboMessagePanel prompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING,
                                                                                         LanguageINI.GetString("msgValidUser"), LanguageINI.GetString("headerValidUser"), LanguageINI.GetString("Ok"));
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                prompt.Dispose();
                RoboSep_UserConsole.hideOverlay();
            }
        }
예제 #6
0
        private void hex_shutdown_Click(object sender, EventArgs e)
        {
            // LOG
            string logMSG = "SHUTDOWN button clicked";

            //GUI_Controls.uiLog.LOG(this, "hex_shutdown_Click", GUI_Controls.uiLog.LogLevel.GENERAL, logMSG);

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            // set up msg prompt
            string sMSG = LanguageINI.GetString("msgShutDown");

            GUI_Controls.RoboMessagePanel newPrompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, sMSG,
                                                                                        LanguageINI.GetString("UserShutdown"), LanguageINI.GetString("Ok"), LanguageINI.GetString("Cancel"));
            RoboSep_UserConsole.getInstance().addForm(newPrompt, newPrompt.Offset);

            // prompt user
            newPrompt.ShowDialog();
            if (newPrompt.DialogResult == DialogResult.OK)
            {
                this.Hide();
                RoboSep_UserConsole.getInstance().frmHomeOverlay.Hide();
                // shut down robosep system
                logMSG = "User Shutdown Confirmed";
                LogFile.AddMessage(TraceLevel.Info, logMSG);

                RoboSep_UserConsole.getInstance().InvokeShutdownAction();
            }
            newPrompt.Dispose();
        }
예제 #7
0
        private void ShowSystemWindowHelperInUiThread(bool bCheckBoxKeyboard, bool bCheckBoxLidSensor, bool bCheckBoxLiquidSensor)
        {
            if (this.InvokeRequired)
            {
                this.Invoke((MethodInvoker) delegate() { this.ShowSystemWindowHelperInUiThread(bCheckBoxKeyboard, bCheckBoxLidSensor, bCheckBoxLiquidSensor); });
            }
            else
            {
                RoboSep_UserConsole.getInstance().SuspendLayout();
                RoboSep_System SystemWindow = RoboSep_System.getInstance();
                SystemWindow.Visible  = false;
                SystemWindow.Location = new Point(0, 0);
                RoboSep_UserConsole.getInstance().Controls.Add(SystemWindow);
                RoboSep_UserConsole.ctrlCurrentUserControl = SystemWindow;
                SystemWindow.RefreshSettings(bCheckBoxKeyboard, bCheckBoxLidSensor, bCheckBoxLiquidSensor);
                SystemWindow.Visible = true;
                closeHomeWindow();
                SystemWindow.BringToFront();
                SystemWindow.Focus();

                // LOG
                string logMSG = "System button clicked";
                //GUI_Controls.uiLog.LOG(this, "hex_system_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);

                LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            }
        }
예제 #8
0
 private void Form_Home_Deactivate(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         RoboSep_UserConsole.getInstance().frmHomeOverlay.BringToFront();
     }
 }
예제 #9
0
        private void Form_UserSelect_Load(object sender, EventArgs e)
        {
            // add forms to form tracker
            Offset = new Point((RoboSep_UserConsole.getInstance().Size.Width - this.Size.Width) / 2,
                               (RoboSep_UserConsole.getInstance().Size.Height - this.Size.Height) / 2);

            this.Location = new Point(Offset.X + RoboSep_UserConsole.getInstance().Location.X,
                                      Offset.Y + RoboSep_UserConsole.getInstance().Location.Y);

            RoboSep_UserConsole.getInstance().addForm(this, Offset);

            // set up listview drag scroll properties
            listView_users.VERTICAL_PAGE_SIZE = listView_users.VisibleRow;

            if (listView_users.VERTICAL_PAGE_SIZE > (listView_users.VisibleRow - 1))
            {
                listView_users.VERTICAL_PAGE_SIZE = listView_users.VisibleRow - 1;
            }

            // Load users into listview items
            loadUserList();

            // set up for drawing
            theFormat               = new StringFormat();
            theFormat.Alignment     = StringAlignment.Near;
            theFormat.LineAlignment = StringAlignment.Center;
            BG_ColorEven            = Color.FromArgb(216, 217, 218);
            BG_ColorOdd             = Color.FromArgb(243, 243, 243);
            BG_Selected             = Color.FromArgb(78, 38, 131);
            Txt_Color               = Color.FromArgb(95, 96, 98);
        }
        public void LoadUserToServer(string ActiveUser)
        {
            // LOG
            string logMSG = "Loading user profile";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            // load user from ini
            List <RoboSep_Protocol> tempList = RoboSep_UserDB.getInstance().loadUserProtocols(ActiveUser);

            if (tempList == null)
            {
                // prompt user that no protocols to load
                string           sTitle  = LanguageINI.GetString("headerNoProtocols");
                string           sMsg    = LanguageINI.GetString("msgNoProtocols");
                string           sButton = LanguageINI.GetString("Ok");
                RoboMessagePanel prompt  = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, sMsg, sTitle, sButton);
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                prompt.Dispose();
                RoboSep_UserConsole.hideOverlay();
                return;
            }

            StartLoadingProtocolsToServer(ActiveUser, tempList);
        }
예제 #11
0
        private void button_OK_Click(object sender, EventArgs e)
        {
            if (listView_users.SelectedItems.Count == 0)
            {
                // prompt user
                string title     = LanguageINI.GetString("headerSelectUserFromList");
                string msg       = LanguageINI.GetString("lblSelectUserFromList");
                string buttonTxt = LanguageINI.GetString("Ok");
                GUI_Controls.RoboMessagePanel prompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), GUI_Controls.MessageIcon.MBICON_WARNING, msg, title, buttonTxt);
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                prompt.Dispose();
                RoboSep_UserConsole.hideOverlay();
                return;
            }
            SelectedUser = listView_users.SelectedItems[0].Tag as string;
            RoboSep_UserConsole.hideOverlay();
            this.DialogResult = DialogResult.OK;
            this.Close();

            // LOG
            string logMSG = "User " + listView_users.SelectedItems[0].Text + " Selected";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
예제 #12
0
        static void Main()
        {
            Form1 newForm1 = new Form1();

            Application.Run(newForm1);
            Application.Run(RoboSep_UserConsole.getInstance());
        }
        private void button_Cancel_Click(object sender, EventArgs e)
        {
            // Sunny to do
            // Remove temperory files
            if (tempUser.TempImageIconPath != null)
            {
                try
                {
                    // delete temp folder
                    Utilities.RemoveTempFileDirectory(tempUser.TempImageIconPath);
                }
                catch (Exception ex)
                {
                    // LOG
                    LogFile.LogException(System.Diagnostics.TraceLevel.Error, ex);
                }

                tempUser.Clear();
            }

            RoboSep_UserConsole.hideOverlay();

            this.DialogResult = DialogResult.Cancel;

            this.Close();
            //RoboSep_UserConsole.UserConsole.removeForm(overlay);

            RoboSep_UserConsole.getInstance().Activate();

            // LOG
            string logMSG = "User Login window closed without creating new user";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
        private void Form_UserLoginNew_Load(object sender, EventArgs e)
        {
            // add forms to form tracker
            Offset = new Point((RoboSep_UserConsole.getInstance().Size.Width - this.Size.Width) / 2,
                               (RoboSep_UserConsole.getInstance().Size.Height - this.Size.Height) / 2);

            this.Location = new Point(Offset.X + RoboSep_UserConsole.getInstance().Location.X,
                                      Offset.Y + RoboSep_UserConsole.getInstance().Location.Y);

            RoboSep_UserConsole.getInstance().addForm(this, Offset);

            bool bAddEvent = true;

            if (!bCreateNewUser && !string.IsNullOrEmpty(DefaultLoginID))
            {
                textBox_NewUserLoginID.Text = Utilities.GetUserName(DefaultLoginID, spaceChar, reservedChar);
                if (RoboSep_UserDB.getInstance().IsPresetUser(DefaultLoginID))
                {
                    textBox_NewUserLoginID.ReadOnly = true;
                    bAddEvent = false;
                }
            }

            if (bAddEvent)
            {
                evTextBoxClicked = new System.EventHandler(this.textBox_NewUserLoginID_Click);
                this.textBox_NewUserLoginID.Click += evTextBoxClicked;
            }
            label_User.Select();
        }
        protected virtual void btn_home_Click(object sender, EventArgs e)
        {
            // Open Home Window
            myHome = RoboSep_Home.getInstance();
            RoboSep_UserConsole.getInstance().SuspendLayout();
            myHome.Location = new Point(0, 0);
            RoboSep_UserConsole.getInstance().Controls.Add(myHome);
            RoboSep_UserConsole.getInstance().Controls.Remove(RoboSep_UserConsole.ctrlCurrentUserControl);
            myHome.Visible = true;
            myHome.Enabled = true;
            myHome.UpdateButtons();
            myHome.BringToFront();
            RoboSep_UserConsole.getInstance().SuspendLayout();
            //RoboSep_UserConsole.getInstance().frmHomeOverlay.Show();
            //RoboSep_UserConsole.getInstance().frmHomeOverlay.BringToFront();
            //myHome.Location = new Point(
            //RoboSep_UserConsole.getInstance().Location.X + RoboSep_UserConsole.getInstance().myHome.GetOffset().X,
            //RoboSep_UserConsole.getInstance().Location.Y + RoboSep_UserConsole.getInstance().myHome.GetOffset().Y);
            //myHome.Show();
            //myHome.BringToFront();

            // LOG
            string logMSG = "Home button clicked";

            //GUI_Controls.uiLog.LOG(this, "btn_home_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Verbose, logMSG);
        }
예제 #16
0
        private void hex_service_Click(object sender, EventArgs e)
        {
            // LOG
            string logMSG = "Service button clicked";

            //GUI_Controls.uiLog.LOG(this, "hex_service_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);

            RoboSep_UserConsole.getInstance().SuspendLayout();
            closeHomeWindow();

            // see if Service target directory exist
            string systemPath = RoboSep_UserDB.getInstance().sysPath;

            string[] directories = systemPath.Split('\\');

            //string servicePath = string.Empty;
            //for (int i = 0; i < directories.Length-2; i++)
            //    servicePath += directories[i] + "\\";
            //servicePath += "RoboSepService\\bin\\";

            StringBuilder sPath = new StringBuilder();

            for (int i = 0; i < directories.Length - 2; i++)
            {
                sPath.Append(directories[i]);
                sPath.Append("\\");
            }
            sPath.Append("RoboSepService\\bin\\");

            string servicePath = sPath.ToString();

            // check if service directory exists
            if (!System.IO.Directory.Exists(servicePath))
            {
                System.IO.Directory.CreateDirectory(servicePath);
            }

            // if Service.exe exists, run service.exe
            if (System.IO.File.Exists(servicePath + SERVICE_EXE_FILENAME))
            {
                // run Service
                ProcessStartInfo ServiceStartInfo = new ProcessStartInfo();
                ServiceStartInfo.WorkingDirectory = servicePath;
                ServiceStartInfo.FileName         = SERVICE_EXE_FILENAME;
                ServiceStartInfo.WindowStyle      = ProcessWindowStyle.Normal;

                Process ServiceProgram = new Process();
                ServiceProgram.StartInfo = ServiceStartInfo;
                ServiceProgram.Start();

                LogFile.AddMessage(TraceLevel.Warning, "Starting Service program");
            }
            else
            {
                logMSG = "Could not locate Service Program at '" + servicePath + SERVICE_EXE_FILENAME + "'";
                LogFile.AddMessage(TraceLevel.Warning, logMSG);
            }
        }
예제 #17
0
        private bool validateUser()
        {
            string username = textBox_UserName.Text.ToUpper();

            if (username.Length < 5)
            {
                string sTitle = GUI_Controls.UserDetails.getValue("GUI", "headerLoginError3");
                string sMSG   = GUI_Controls.UserDetails.getValue("GUI", "msgLoginError3");
                sMSG = sMSG == null ? "User Name entered is not long enough" : sMSG;
                GUI_Controls.RoboMessagePanel newPrompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), GUI_Controls.MessageIcon.MBICON_ERROR,
                                                                                            sMSG, sTitle);
                RoboSep_UserConsole.getInstance().addForm(newPrompt, newPrompt.Offset);
                RoboSep_UserConsole.showOverlay();
                newPrompt.ShowDialog();
                newPrompt.Dispose();
                RoboSep_UserConsole.hideOverlay();
                //MessageBox.Show("User name not long enough");
                return(false);
            }
            for (int i = 0; i < username.Length; i++)
            {
                if (!((int)username[i] >= 65 && (int)username[i] <= 90 || (int)username[i] == 32))
                {
                    string sTitle  = GUI_Controls.UserDetails.getValue("GUI", "headerLoginError");
                    string sMSG    = GUI_Controls.UserDetails.getValue("GUI", "msgLoginError1");
                    string sButton = GUI_Controls.UserDetails.getValue("GUI", "Ok");
                    sMSG = sMSG == null ? "User name should not include numbers, symbols, or punctuation" : sMSG;
                    GUI_Controls.RoboMessagePanel newPrompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), GUI_Controls.MessageIcon.MBICON_ERROR,
                                                                                                sMSG, sTitle, sButton);
                    RoboSep_UserConsole.getInstance().addForm(newPrompt, newPrompt.Offset);
                    RoboSep_UserConsole.showOverlay();
                    newPrompt.ShowDialog();
                    newPrompt.Dispose();
                    RoboSep_UserConsole.hideOverlay();
                    //MessageBox.Show("User name should not include symbols or punctuation");
                    return(false);
                }
                if (i < (username.Length - 2))
                {
                    if (username[i] == username[i + 1] && username[i] == username[i + 2])
                    {
                        string sTitle = GUI_Controls.UserDetails.getValue("GUI", "headerLoginError");
                        string sMSG   = GUI_Controls.UserDetails.getValue("GUI", "msgLoginError2");
                        sMSG = sMSG == null ? "Incorrenctly typed User Name" : sMSG;
                        string sButton = GUI_Controls.UserDetails.getValue("GUI", "Ok");
                        GUI_Controls.RoboMessagePanel newPrompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), GUI_Controls.MessageIcon.MBICON_ERROR,
                                                                                                    sMSG, sTitle, sButton);
                        RoboSep_UserConsole.getInstance().addForm(newPrompt, newPrompt.Offset);
                        RoboSep_UserConsole.showOverlay();
                        newPrompt.ShowDialog();
                        newPrompt.Dispose();
                        RoboSep_UserConsole.hideOverlay();
                        //MessageBox.Show("Incorrectly typed user name");
                        return(false);
                    }
                }
            }
            return(true);
        }
예제 #18
0
        private void ShowSystemWindowHelper(object stateinfo)
        {
            bool bCheckBoxKeyboard     = RoboSep_UserConsole.KeyboardEnabled;
            bool bCheckBoxLidSensor    = !RoboSep_UserConsole.getInstance().GetIgnoreLidSensor();
            bool bCheckBoxLiquidSensor = !RoboSep_UserConsole.getInstance().GetIgnoreHydraulicSensor();

            ShowSystemWindowHelperInUiThread(bCheckBoxKeyboard, bCheckBoxLidSensor, bCheckBoxLiquidSensor);
        }
예제 #19
0
        private void button_Cancel_Click(object sender, EventArgs e)
        {
            RoboSep_UserConsole.hideOverlay();
            this.Close();

            RoboSep_UserConsole.getInstance().Activate();
            this.DialogResult = DialogResult.Cancel;
        }
예제 #20
0
 private void CloseWaitMessage()
 {
     // clean up
     if (WaitingMSG != null)
     {
         WaitingMSG.Close();
         WaitingMSG = null;
         RoboSep_UserConsole.hideOverlay();
     }
 }
예제 #21
0
        private void showGeneralErrorMessage(string errMsg)
        {
            RoboMessagePanel dlg = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_ERROR,
                                                        errMsg, "Error", LanguageINI.GetString("Ok"));

            RoboSep_UserConsole.showOverlay();
            dlg.ShowDialog();
            dlg.Dispose();
            RoboSep_UserConsole.hideOverlay();
        }
        /*
         * protected override void btn_home_Click(object sender, EventArgs e)
         * {
         *  if (LoadUserRequired && !RoboSep_UserConsole.bIsRunning)
         *  {
         *      // changing profile to a pre-defined protocol list will not
         *      // require loading protocols to server
         *      if (textBox_UserName.Text != "All Human" && textBox_UserName.Text != "All Mouse" && textBox_UserName.Text != "Whole Blood"
         *          && textBox_UserName.Text != "Full List" && textBox_UserName.Text != "USER NAME")
         *      {
         *          LoadUserRequired = false;
         *          LoadUserToServer(textBox_UserName.Text);
         *      }
         *      elseYou go
         *      {
         *          //
         *          //
         *          // Set up for No- All Protocols
         *          // !! REMOVE ALL PROTOCOLS LIST
         *          //
         #if true            // get list for preset
         *          string[] PresetList = RoboSep_ProtocolList.getInstance().LoadPresetList(this.textBox_UserName.Text);
         *          protocolsToLoad = PresetList.Length;
         *
         *          // save list to User1.udb
         *          RoboSep_UserDB.getInstance().XML_SaveUserProfile(this.textBox_UserName.Text, PresetList);
         *
         *          // load user1.udb to server.
         *          myReloadProtocolsThread = new Thread(new ThreadStart(this.ReloadProtocolsThread));
         *          myReloadProtocolsThread.IsBackground = true;
         *          myReloadProtocolsThread.Start();
         *
         *          // set sep-gateway to updating Separator Protocols
         *          // so that we can watch for when it is updated
         *          // (in timer_tick)
         *          SeparatorGateway.GetInstance().separatorUpdating = true;
         *
         *          //Thread.Sleep(SERVER_WAIT_TIME);
         *          // add loop to that polls loading status
         *          LoadUserTimer.Start();
         #else
         *          base.btn_home_Click(sender, e);
         #endif
         *      }
         *  }
         *  else
         *  {
         *      base.btn_home_Click(sender, e);
         *  }
         *
         * }
         */

        private void Prompt_RunInProgress()
        {
            string           sMSG   = LanguageINI.GetString("msgIsRunning");
            RoboMessagePanel prompt = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, sMSG,
                                                           LanguageINI.GetString("headerIsRunning"), LanguageINI.GetString("Ok"));

            RoboSep_UserConsole.showOverlay();
            prompt.ShowDialog();
            prompt.Dispose();
            RoboSep_UserConsole.hideOverlay();
        }
        private void createKeybaord()
        {
            // Create keybaord control
            GUI_Controls.Keyboard newKeyboard =
                GUI_Controls.Keyboard.getInstance(RoboSep_UserConsole.getInstance(),
                                                  textBox_NewUserLoginID, null, RoboSep_UserConsole.getInstance().frmOverlay, false);
            newKeyboard.ShowDialog();
            newKeyboard.Dispose();


            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, "Generating touch keybaord");
        }
        public void StartLoadingProtocolsToServer(string ActiveUser, List <RoboSep_Protocol> tempList)
        {
            if (tempList == null)
            {
                return;
            }

            // LOG
            string logMSG = "Start thread for loading profile";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            try
            {
                RoboSep_UserConsole.strCurrentUser = ActiveUser;// textBox_UserName.Text;
                UserNameHeader.Text = ActiveUser;

                string[] sProtocols = new string[tempList.Count];
                for (int i = 0; i < tempList.Count; i++)
                {
                    sProtocols[i] = tempList[i].Protocol_FileName;
                }

                // save over user1.udb
                RoboSep_UserDB.getInstance().XML_SaveUserProfile(ActiveUser, sProtocols);
                protocolsToLoad = sProtocols.Length;

                // Reload protocols with SeparatorGateway using a thread
                myReloadProtocolsThread = new Thread(new ThreadStart(this.ReloadProtocolsThread));
                myReloadProtocolsThread.IsBackground = true;
                myReloadProtocolsThread.Start();

                // set sep-gateway to updating Separator Protocols
                // so that we can watch for when it is updated
                // (in timer_tick)
                SeparatorGateway.GetInstance().separatorUpdating = true;

                string sMSG   = LanguageINI.GetString("msgLoadingProtocols");
                string sTitle = LanguageINI.GetString("headerLoadingUserProtocols");
                loading = new RoboMessagePanel5(RoboSep_UserConsole.getInstance(), sTitle, sMSG, GUI_Controls.GifAnimationMode.eUploadingMultipleFiles);
                RoboSep_UserConsole.showOverlay();
                loading.Show();
                //Thread.Sleep(SERVER_WAIT_TIME);
                // add loop to that polls loading status
                LoadUserTimer.Start();
            }
            catch (Exception ex)
            {
                // LOG
                logMSG = "Failed to save user to server";

                LogFile.AddMessage(System.Diagnostics.TraceLevel.Error, logMSG);
            }
        }
        private void button_AllProtocols_Click(object sender, EventArgs e)
        {
            // switch to all protocols control
            RoboSep_UserConsole.getInstance().Controls.Remove(this);
            RoboSep_UserConsole.getInstance().Controls.Add(RoboSep_ProtocolList.getInstance());

            // LOG
            string logMSG = "All Protocols button clicked";

            //GUI_Controls.uiLog.LOG(this, "button_AllProtocols_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);
            //  (logMSG);
            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
예제 #26
0
        private void button_Cancel_Click(object sender, EventArgs e)
        {
            RoboSep_UserConsole.hideOverlay();
            this.Close();

            RoboSep_UserConsole.getInstance().Activate();
            this.DialogResult = DialogResult.Cancel;

            // LOG
            string logMSG = "User Select window closed without selection";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
예제 #27
0
        private DialogResult confirmSpecificProtocol(SharingProtocol sharingProtocol)
        {
            string logMSG;

            if (sharingProtocol == null)
            {
                logMSG = "confirmSpecificProtocol called. Invalid input parameter 'sharingProtocol' is null.";

                LogFile.AddMessage(System.Diagnostics.TraceLevel.Verbose, logMSG);
                return(DialogResult.Cancel);
            }

            ArrayList sharingWith = sharingProtocol.SharingWith;

            if (sharingWith == null)
            {
                logMSG = "confirmSpecificProtocol called. Invalid input parameter 'sharingProtocol.SharingWith' is null.";
                LogFile.AddMessage(System.Diagnostics.TraceLevel.Verbose, logMSG);
                return(DialogResult.Cancel);
            }

            int initQuadrantIndex = sharingProtocol.InitQuadrant;

            //build message
            string quadrantsLabel = "Q" + (initQuadrantIndex + 1);

            for (int i = 0; i < sharingWith.Count; i++)
            {
                if (i >= sharingWith.Count - 1)
                {
                    quadrantsLabel += " and Q" + sharingWith[i];
                }
                else
                {
                    quadrantsLabel += ", Q" + sharingWith[i];
                }
            }

            //ask the user
            string sMSG = LanguageINI.GetString("QS1") + " " + quadrantsLabel + " " + LanguageINI.GetString("QS2") + " "
                          + sharingProtocol.Name + " " + LanguageINI.GetString("QS3");
            RoboMessagePanel messageDialog = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_QUESTION, sMSG,
                                                                  LanguageINI.GetString("headerQS"), LanguageINI.GetString("Yes"), LanguageINI.GetString("No"));

            RoboSep_UserConsole.showOverlay();
            DialogResult result = messageDialog.ShowDialog();

            RoboSep_UserConsole.hideOverlay();
            messageDialog.Dispose();
            return(result);//messageDialog.DialogResult;
        }
        private void generateKeyboard()
        {
            // Show form overlay
            //RoboSep_UserConsole.showOverlay();
            //RoboSep_UserConsole.getInstance().frmOverlay.BringToFront();

            // Create new Keyboard control form
            GUI_Controls.Keyboard newKeyboard =
                GUI_Controls.Keyboard.getInstance(RoboSep_UserConsole.getInstance(),
                                                  textBox_UserName, textBox_UserName.AutoCompleteCustomSource, RoboSep_UserConsole.getInstance().frmOverlay, false);
            newKeyboard.ShowDialog();
            newKeyboard.Dispose();
            RoboSep_UserConsole.hideOverlay();
        }
예제 #29
0
 private void closeHomeWindow()
 {
     for (int i = 0; i < Application.OpenForms.Count; i++)
     {
         if (RoboSep_UserConsole.getInstance().frmHomeOverlay == Application.OpenForms[i])
         {
             Application.OpenForms[i].Hide();
         }
     }
     GC.Collect();
     RoboSep_UserConsole.getInstance().Controls.Remove(this);
     RoboSep_UserConsole.getInstance().ResumeLayout();
     LogFile.AddMessage(TraceLevel.Verbose, "Hiding Home window");
 }
예제 #30
0
        private void hex_sampling_Click(object sender, EventArgs e)
        {
            // LOG
            string logMSG = "Run Sample button clicked";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            RoboSep_UserConsole.getInstance().SuspendLayout();

            closeHomeWindow();

            // open sampling window unless in "run mode"
            if (!RoboSep_UserConsole.bIsRunning)
            {
                RoboSep_RunSamples.getInstance().Visible  = false;
                RoboSep_RunSamples.getInstance().Location = new Point(0, 0);
                RoboSep_UserConsole.getInstance().Controls.Add(RoboSep_RunSamples.getInstance());
                RoboSep_UserConsole.ctrlCurrentUserControl = RoboSep_RunSamples.getInstance();
                RoboSep_RunSamples.getInstance().Visible = true;
                string UserName = RoboSep_RunSamples.getInstance().UserName;
                RoboSep_RunSamples.getInstance().UserName = RoboSep_UserConsole.strCurrentUser;
                bool bRefreshDisplayName = true;
                if (UserName != RoboSep_UserConsole.strCurrentUser)
                {
                    RoboSep_RunSamples.getInstance().LoadProtocolsMRU();
                    bRefreshDisplayName = false;
                }

                if (bRefreshDisplayName && RoboSep_RunSamples.getInstance().IsInitialized)
                {
                    RoboSep_RunSamples.getInstance().refreshSelectedProtocolsDisplayName();
                }

                RoboSep_RunSamples.getInstance().BringToFront();

                logMSG = "System running, opening RunProgress";
                LogFile.AddMessage(TraceLevel.Verbose, logMSG);
            }
            else
            {
                RoboSep_RunProgress.getInstance().Visible  = false;
                RoboSep_RunProgress.getInstance().Location = new Point(0, 0);
                RoboSep_UserConsole.getInstance().Controls.Add(RoboSep_RunProgress.getInstance());
                RoboSep_UserConsole.ctrlCurrentUserControl = RoboSep_RunProgress.getInstance();
                RoboSep_RunProgress.getInstance().Visible = true;

                RoboSep_RunProgress.getInstance().BringToFront();
                logMSG = "Opening RunSamples page";
                LogFile.AddMessage(TraceLevel.Verbose, logMSG);
            }
        }