Пример #1
0
        private void startInteractions()
        {
            List <int> moleculeIDs = molecules.GetIDs();

            if (moleculeIDs.Count != 2)
            {
                if (moleculeIDs.Count > 2)
                {
                    console.ShowError("Can't monitor molecule interactions. Only two molecules can to be loaded");
                }
                else
                {
                    console.ShowError("Can't monitor molecule interactions. At least two molecules need to be loaded");
                }

                return;
            }

            MoleculeRenderSettings molecule1Settings = molecules.Get(moleculeIDs[0]).RenderSettings;
            MoleculeRenderSettings molecule2Settings = molecules.Get(moleculeIDs[1]).RenderSettings;

            if (molecules.Get(moleculeIDs[0]).HasTrajectory || molecules.Get(moleculeIDs[1]).HasTrajectory)
            {
                MoleculeEvents.RaiseInteractionsMessage("Can't monitor interactions. Monitored molecules cannot have trajectories loaded.", true);
                return;
            }

            MonitoringEnabled        = true;
            StartStopButtonText.text = "Stop Monitoring Interactions";
            UserInterfaceEvents.RaiseStartMonitoringMoleculeInteractions(moleculeIDs[0], moleculeIDs[1], interactionSettings, molecule1Settings, molecule2Settings);

            ResetPositionsButton.interactable = true;
        }