private void ShowRecordOneExampleButton() { // Only draw this in single example collection mode if (m_TrainingExamplesNode.ModeOfCollection == TrainingExamplesNode.CollectionMode.SingleExample) { // Only run button logic when there are features to extract from if (!Lists.IsNullOrEmpty(ref m_TrainingExamplesNode.InputFeatures)) { string nameButton = ""; if (m_TrainingExamplesNode.CollectingData) { nameButton = "STOP Recording Example"; } else { nameButton = "Record ONE Example"; } bool disableButton = false; // If there are any models connected we check some conditions if (!Lists.IsNullOrEmpty(ref m_TrainingExamplesNode.IMLConfigurationNodesConnected)) { for (int i = 0; i < m_TrainingExamplesNode.IMLConfigurationNodesConnected.Count; i++) { var IMLConfigNodeConnected = m_TrainingExamplesNode.IMLConfigurationNodesConnected[i]; // Disable button if model(s) connected are runnning or training if (IMLConfigNodeConnected.Running || IMLConfigNodeConnected.Training) { disableButton = true; break; } } } // Draw button if (disableButton) { GUI.enabled = false; } if (GUILayout.Button(nameButton)) { m_TrainingExamplesNode.AddSingleTrainingExample(); } // Always enable it back at the end GUI.enabled = true; } // If there are no features to extract from we draw a disabled button else { GUI.enabled = false; if (GUILayout.Button("Record ONE Example")) { m_TrainingExamplesNode.ToggleCollectExamples(); } GUI.enabled = true; } } }
private string ShowRecordExamplesButton() { string nameButton = ""; //// Only run button logic when there are features to extract from //if (!Lists.IsNullOrEmpty(ref m_SeriesTrainingExamplesNode.InputFeatures)) //{ if (m_TrainingExamplesNode.CollectingData) { nameButton = " STOP "; } else { nameButton = "Record Series "; } bool disableButton = false; // If there are any models connected we check some conditions /*if (!Lists.IsNullOrEmpty(ref m_SeriesTrainingExamplesNode.IMLConfigurationNodesConnected)) * { * for (int i = 0; i < m_SeriesTrainingExamplesNode.IMLConfigurationNodesConnected.Count; i++) * { * var IMLConfigNodeConnected = m_SeriesTrainingExamplesNode.IMLConfigurationNodesConnected[i]; * // Disable button if model(s) connected are runnning or training * if (IMLConfigNodeConnected.Running || IMLConfigNodeConnected.Training) * { * disableButton = true; * break; * } * * } * }*/ // Draw button if (disableButton) { GUI.enabled = false; } if (GUILayout.Button("Record Data", Resources.Load <GUISkin>("GUIStyles/InteractMLGUISkin").GetStyle("Record Button"))) { m_TrainingExamplesNode.ToggleCollectExamples(); } // Always enable it back at the end GUI.enabled = true; return(nameButton); //} }