Beispiel #1
0
        private void ClearRunSamples()
        {
            RoboSep_RunSamples RS = RoboSep_RunSamples.getInstance();

            for (int i = 0; i < 4; i++)
            {
                if (RS.RunInfo[i].QuadrantLabel != string.Empty)
                {
                    RS.CancelQuadrant(i);
                }
            }
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        private void hex_protocols_Click(object sender, EventArgs e)
        {
            // check if any protocols are selected
            int[] CurrentQuadrants = RoboSep_RunSamples.getInstance().iSelectedProtocols;
            if (CurrentQuadrants.Length > 0)
            {
                // prompt if user is sure they want to manage protocols if all protocol selections are removed
                string           msg    = LanguageINI.GetString("msgManageProtocols");
                RoboMessagePanel prompt = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, msg,
                                                               LanguageINI.GetString("headerManageProtocols"), LanguageINI.GetString("Ok"), LanguageINI.GetString("Cancel"));
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                RoboSep_UserConsole.hideOverlay();

                if (prompt.DialogResult != DialogResult.OK)
                {
                    prompt.Dispose();
                    return;
                }
                prompt.Dispose();
            }

            // remove all currently selected protocols
            for (int i = 0; i < CurrentQuadrants.Length; i++)
            {
                RoboSep_RunSamples.getInstance().CancelQuadrant(CurrentQuadrants[i]);
            }

            RoboSep_UserConsole.getInstance().SuspendLayout();
            RoboSep_ProtocolList myProtocolsListPage = RoboSep_ProtocolList.getInstance();

            if (myProtocolsListPage.IsInitialized)
            {
                myProtocolsListPage.ReInitialized();
            }

            myProtocolsListPage.Location    = new Point(0, 0);
            myProtocolsListPage.strUserName = RoboSep_UserConsole.strCurrentUser;
            RoboSep_UserConsole.getInstance().Controls.Add(myProtocolsListPage);
            RoboSep_UserConsole.ctrlCurrentUserControl = myProtocolsListPage;

            closeHomeWindow();

            myProtocolsListPage.BringToFront();
            // LOG
            string logMSG = "Protocols button clicked";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
        private bool checkForSelectedProtocols( )
        {
            // check if Protocols have been selected on Run Samples page
            // can not load protocols from multiple users
            if (RoboSep_RunSamples.getInstance().iSelectedProtocols.Length > 0)
            {
                // set up message prompt
                string sMSG = LanguageINI.GetString("msgChangeUser");

                RoboMessagePanel prompt = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, sMSG,
                                                               LanguageINI.GetString("headerChangeUsr"), LanguageINI.GetString("Ok"), LanguageINI.GetString("Cancel"));
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                RoboSep_UserConsole.hideOverlay();

                if (prompt.DialogResult == DialogResult.OK)
                {
                    int[] CurrentlySelectedProtocols = RoboSep_RunSamples.getInstance().iSelectedProtocols;
                    // remove protocols from sample list
                    for (int i = 0; i < CurrentlySelectedProtocols.Length; i++)
                    {
                        int Q = CurrentlySelectedProtocols[i];
                        RoboSep_RunSamples.getInstance().CancelQuadrant(Q);

                        // LOG
                        string LOGmsg = "Changing User and removing all selected protocols from current run";
                        //GUI_Controls.uiLog.LOG(this, "textBox_UserName_Enter", GUI_Controls.uiLog.LogLevel.EVENTS, LOGmsg);
                        //  (LOGmsg);
                        LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, LOGmsg);
                    }
                    prompt.Dispose();
                    return(false);
                }
                prompt.Dispose();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #5
0
        private void hex_Users_Click(object sender, EventArgs e)
        {
            // check if any protocols are selected
            int[] CurrentQuadrants = RoboSep_RunSamples.getInstance().iSelectedProtocols;
            if (CurrentQuadrants.Length > 0)
            {
                // prompt if user is sure they want to switch users if
                // all protocol selections are removed
                string           msg    = LanguageINI.GetString("msgChangeUser");
                RoboMessagePanel prompt = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, msg,
                                                               LanguageINI.GetString("headerChangeUsr"), LanguageINI.GetString("Ok"), LanguageINI.GetString("Cancel"));
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                RoboSep_UserConsole.hideOverlay();

                if (prompt.DialogResult != DialogResult.OK)
                {
                    prompt.Dispose();
                    return;
                }
                prompt.Dispose();
            }

            // remove all currently selected protocols
            for (int i = 0; i < CurrentQuadrants.Length; i++)
            {
                RoboSep_RunSamples.getInstance().CancelQuadrant(CurrentQuadrants[i]);
            }

            // change to robosep user select window
            RoboSep_UserConsole.getInstance().SuspendLayout();
            RoboSep_UserSelect usrSelect = new RoboSep_UserSelect();

            RoboSep_UserConsole.getInstance().Controls.Add(usrSelect);
            RoboSep_UserConsole.ctrlCurrentUserControl = usrSelect;

            usrSelect.BringToFront();
            usrSelect.Focus();
        }
        private void HandleUserProtocolsReloadedBeforeExiting(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("--------- RoboSep_UserSelect: HandleUserProtocolsReloadedBeforeExiting is called. ThreadID = {0}, ----------", Thread.CurrentThread.ManagedThreadId));

            RoboSep_UserConsole.getInstance().NotifyUserSeparationProtocolsUpdated -= evhHandleUserProtocolsReloaded;

            RoboSep_Protocols.getInstance().setProtocolLoading(false);

            // open run samples window
            RoboSep_UserConsole myUC = RoboSep_UserConsole.getInstance();

            RoboSep_UserConsole.ctrlCurrentUserControl = RoboSep_RunSamples.getInstance();
            RoboSep_RunSamples.getInstance().UserName = SelectedUser;
            RoboSep_RunSamples.getInstance().Enabled  = false;
            myUC.SuspendLayout();
            myUC.Controls.Remove(this);
            myUC.Controls.Add(RoboSep_RunSamples.getInstance());
            myUC.ResumeLayout();
            if (RoboSep_RunSamples.getInstance().IsInitialized)
            {
                RoboSep_RunSamples.getInstance().ReInitialize();
            }
            RoboSep_RunSamples.getInstance().Enabled = true;
        }
        private void SelectUser(string UserLogin)
        {
            if (string.IsNullOrEmpty(UserLogin))
            {
                return;
            }

            string usrName = UserLogin;

            RoboSep_UserConsole.strCurrentUser = usrName;

#if false
            // load user preferences
            RoboSep_UserDB.getInstance().loadCurrentUserPreferences(usrName);

            // load user protocols
            List <RoboSep_Protocol> tempList = RoboSep_UserDB.getInstance().loadUserProtocols(usrName);

            // it could be new user with no protocols
            if (tempList != null && tempList.Count > 0)
            {
                // load user protocols
                RoboSep_Protocols.getInstance().LoadUserToServer(usrName);
                RoboSep_Protocols.getInstance().setProtocolLoading(true);
                SeparatorGateway.GetInstance().separatorUpdating = true;

                if (evhHandleUserProtocolsReloaded == null)
                {
                    evhHandleUserProtocolsReloaded = new EventHandler(HandleUserProtocolsReloadedBeforeExiting);
                }

                RoboSep_UserConsole.getInstance().NotifyUserSeparationProtocolsUpdated += evhHandleUserProtocolsReloaded;
                return;
            }
#else
            // load user protocols
            List <RoboSep_Protocol> tempList = RoboSep_UserDB.getInstance().loadUserProtocols(usrName);

            // it could be new user with no protocols
            if (tempList != null && tempList.Count > 0)
            {
                // load user protocols
                RoboSep_Protocols.getInstance().LoadUserToServer(usrName);
                RoboSep_Protocols.getInstance().setProtocolLoading(true);
                SeparatorGateway.GetInstance().separatorUpdating = true;

                // load user preferences
                RoboSep_UserDB.getInstance().loadCurrentUserPreferences(usrName);

                if (evhHandleUserProtocolsReloaded == null)
                {
                    evhHandleUserProtocolsReloaded = new EventHandler(HandleUserProtocolsReloadedBeforeExiting);
                }

                RoboSep_UserConsole.getInstance().NotifyUserSeparationProtocolsUpdated += evhHandleUserProtocolsReloaded;
                return;
            }
            else
            {
                // load user preferences
                RoboSep_UserDB.getInstance().loadCurrentUserPreferences(usrName);
            }
#endif
            // open run samples window
            RoboSep_UserConsole myUC = RoboSep_UserConsole.getInstance();
            RoboSep_UserConsole.ctrlCurrentUserControl = RoboSep_RunSamples.getInstance();
            RoboSep_RunSamples.getInstance().UserName = usrName;
            RoboSep_RunSamples.getInstance().Enabled  = false;
            myUC.SuspendLayout();
            myUC.Controls.Remove(this);
            myUC.Controls.Add(RoboSep_RunSamples.getInstance());
            myUC.ResumeLayout();
            if (RoboSep_RunSamples.getInstance().IsInitialized)
            {
                RoboSep_RunSamples.getInstance().ReInitialize();
            }
            RoboSep_RunSamples.getInstance().Enabled = true;
        }
        private void button_EditList_Click(object sender, EventArgs e)
        {
            if (!RoboSep_UserConsole.bIsRunning)
            {
                // check if protocols loaded for run will be lost if list is re-loaded
                // caused by adding from the "All list" section of the selct protocol window
                if (RoboSep_RunSamples.getInstance().iSelectedProtocols.Length > 0)
                {
                    List <RoboSep_Protocol> usrLst  = RoboSep_UserDB.getInstance().loadUserProtocols(textBox_UserName.Text);
                    QuadrantInfo[]          RunInfo = RoboSep_RunSamples.getInstance().RunInfo;

                    List <int> removeQuadrants = new List <int>();

                    for (int Quadrant = 0; Quadrant < 4; Quadrant++)
                    {
                        if (RunInfo[Quadrant].bQuadrantInUse)
                        {
                            bool ProtocolInList = false;
                            for (int i = 0; i < usrLst.Count; i++)
                            {
                                if (RunInfo[Quadrant].QuadrantLabel == usrLst[i].Protocol_Name)
                                {
                                    ProtocolInList = true;
                                    break;
                                }
                            }
                            if (!ProtocolInList)
                            {
                                for (int i = 0; i < RunInfo[Quadrant].QuadrantsRequired; i++)
                                {
                                    removeQuadrants.Add(Quadrant + i);
                                }
                            }
                        }
                    }

                    // check if any protocols have been selected
                    // for the current run and will be lost
                    // when reloading profile
                    if (removeQuadrants.Count > 0)
                    {
                        string           sMSG   = LanguageINI.GetString("msgRefreshList") + "\r\n\r\n" + LanguageINI.GetString("msgRefreshList2");
                        RoboMessagePanel prompt = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING,
                                                                       sMSG, LanguageINI.GetString("Warning"), LanguageINI.GetString("Yes"), LanguageINI.GetString("Cancel"));
                        RoboSep_UserConsole.showOverlay();
                        prompt.ShowDialog();

                        // wait for response

                        if (prompt.DialogResult == DialogResult.OK)
                        {
                            for (int i = 0; i < removeQuadrants.Count; i++)
                            {
                                RoboSep_RunSamples.getInstance().CancelQuadrant(removeQuadrants[i]);
                            }
                        }

                        prompt.Dispose();
                    }
                    else
                    {
                        return;
                    }
                }


                LoadRequired = true;

                //RoboSep_UserConsole.strCurrentUser = textBox_UserName.Text;
                openProtocolList();

                // LOG
                string LOGmsg = "Edit list button clicked";
                //GUI_Controls.uiLog.LOG(this, "button_EditList_Click", GUI_Controls.uiLog.LogLevel.EVENTS, LOGmsg);
                //  (LOGmsg);
                LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, LOGmsg);
            }
            else
            {
                Prompt_RunInProgress();
            }
        }