Example #1
0
 // Запуск мониторинга
 private void c_RunMonitoringMenu_Click(object sender, EventArgs e)
 {
     if (!m_MainNeuralNet.GetTrainNet)
     {
         MessageBox.Show("Neural network not trained, train it in monitoring tools.");
         return;
     }
     if (!m_Monitoring.GetRun)
     {
         m_Monitoring.RunMonitoring();
         GraphicsForObjects.DrawingStatusMonitoring(p_MonitoringStatusPanel, m_Monitoring.GetRun);
     }
 }
Example #2
0
        // Остановка мониторинга
        public void StopMonitoring()
        {
            if (t_Monitoring != null)
            {
                c_TokenCancel.Cancel();
                t_Monitoring.Wait();
            }
            // Выключение индикаторов
            d_OutputData = new double[] { 0, 0, 0 };
            GraphicsForObjects.DrawingStatusNetwork(p_NetworkStatusPanel, d_OutputData,
                                                    new string[] { "Normal work", "Overload", "Failure" }, new Color[] { Color.LawnGreen, Color.Yellow, Color.Red });

            b_Run = false;
        }
Example #3
0
        // Вывод на индикаторы
        private string OutputInIndicators(double[] d_OutputValuesInKnowledgeNet)
        {
            if (l_LayersKnowledgeNet[l_LayersKnowledgeNet.Length - 1].GetSetOutputNodes[0].GetLabel == "Нормальная работа сети")
            {
                d_OutputData[0] = d_OutputValuesInKnowledgeNet[0];
            }
            else if (l_LayersKnowledgeNet[l_LayersKnowledgeNet.Length - 1].GetSetOutputNodes[0].GetLabel == "Перегрузка сети")
            {
                d_OutputData[1] = d_OutputValuesInKnowledgeNet[0];
            }
            else
            {
                d_OutputData[2] = d_OutputValuesInKnowledgeNet[0];
            }

            if (l_LayersKnowledgeNet[l_LayersKnowledgeNet.Length - 1].GetSetOutputNodes[1].GetLabel == "Нормальная работа сети")
            {
                d_OutputData[0] = d_OutputValuesInKnowledgeNet[1];
            }
            else if (l_LayersKnowledgeNet[l_LayersKnowledgeNet.Length - 1].GetSetOutputNodes[1].GetLabel == "Перегрузка сети")
            {
                d_OutputData[1] = d_OutputValuesInKnowledgeNet[1];
            }
            else
            {
                d_OutputData[2] = d_OutputValuesInKnowledgeNet[1];
            }

            if (l_LayersKnowledgeNet[l_LayersKnowledgeNet.Length - 1].GetSetOutputNodes[2].GetLabel == "Нормальная работа сети")
            {
                d_OutputData[0] = d_OutputValuesInKnowledgeNet[2];
            }
            else if (l_LayersKnowledgeNet[l_LayersKnowledgeNet.Length - 1].GetSetOutputNodes[2].GetLabel == "Перегрузка сети")
            {
                d_OutputData[1] = d_OutputValuesInKnowledgeNet[2];
            }
            else
            {
                d_OutputData[2] = d_OutputValuesInKnowledgeNet[2];
            }

            string s_StatusNetwork = "";

            if (d_OutputData[0] == 1)
            {
                s_StatusNetwork = "Normal work";
            }
            else if (d_OutputData[1] == 1)
            {
                s_StatusNetwork = "Overload";
            }
            else
            {
                s_StatusNetwork = "Failure";
            }

            p_NetworkStatusPanel.Invoke((Action) delegate
            {
                GraphicsForObjects.DrawingStatusNetwork(p_NetworkStatusPanel, d_OutputData,
                                                        new string[] { "Normal work", "Overload", "Failure" }, new Color[] { Color.LawnGreen, Color.Yellow, Color.Red });
            });

            return(s_StatusNetwork);
        }
Example #4
0
 private void l_NetworkStatus_Paint(object sender, PaintEventArgs e)
 {
     GraphicsForObjects.DrawingStatusMonitoring(p_MonitoringStatusPanel, m_Monitoring.GetRun);
 }
Example #5
0
 // При перерисовке панели перерисовка графики
 private void p_NetworkStatusPanel_Paint(object sender, PaintEventArgs e)
 {
     GraphicsForObjects.DrawingStatusNetwork(p_NetworkStatusPanel, m_Monitoring.GetOutputData,
                                             new string[] { "Normal work", "Overload", "Failure" }, new Color[] { Color.LawnGreen, Color.Yellow, Color.Red });
 }
Example #6
0
 // Остановка мониторинга
 private void c_StopMonitoringMenu_Click(object sender, EventArgs e)
 {
     m_Monitoring.StopMonitoring();
     GraphicsForObjects.DrawingStatusMonitoring(p_MonitoringStatusPanel, m_Monitoring.GetRun);
 }