Exemplo n.º 1
0
        public bool Initialize()
        {
            lioDataEmoSigFileName = Path.Combine(ApplicationDirectoryPath, "QA5SigData.lio");
            lioDataSEGMENTfile = Path.Combine(ApplicationDirectoryPath, "EmoData.lio");
            bordersFileName = Path.Combine(ApplicationDirectoryPath, "QAbrdrs.dat");

            if (!InitQA5Core())
                return false;

            ui.SetBGLevel(0x3e8);

            LoadUserDefinedEmoSegments();

            LoadLionetUserDefinedEmotions();

            if (!LoadLioNetKnowledgeAndEmotionalSignatures())
                return false;

            for (var i = 0; i < trenders.Length; i++)
                trenders[i] = new TrendAnalyzerClass();

            return true;
        }
Exemplo n.º 2
0
        public bool Initialize()
        {
            Console.ForegroundColor = ConsoleColor.Red;
            lioDataEmoSigFileName = Path.Combine(ApplicationDirectoryPath, "QA5SigData.lio");
            lioDataSEGMENTfile = Path.Combine(ApplicationDirectoryPath, "EmoData.lio");
            bordersFileName = Path.Combine(ApplicationDirectoryPath, "QAbrdrs.dat");

            if (!InitQA5Core())
                return false;

            if (!InitLicenseAndCallee())
                return false;

            if (!ConfigureCoreForItsDesignatedTasks())
                return false;

           // InitTrenders();

            InitLioNetResultsCache();

            //ui.SetBGLevel(0x3e8);

            LoadUserDefinedEmoSegments();

            LoadLionetUserDefinedEmotions();

            if (!LoadLioNetKnowledgeAndEmotionalSignatures())
                return false;

            for (var i = 0; i < trenders.Length; i++)
                trenders[i] = new TrendAnalyzerClass();

            return true;
        }
Exemplo n.º 3
0
        public void DrawData(double[] data, double min, double max, double avg, int scaleMin, int scaleMax, int column)
        {
            if (InvokeRequired)
            {
                Invoke(new DrawDataDelegate(DrawData),
                       new object[] {data, min, max, avg, scaleMin, scaleMax, column});
            }
            else
            {
                segmentStats.Text = string.Format("{3} (Min: {0}; Max: {1}; Avg: {2})", min, max, avg.ToString("F02"),
                                                  segmentsList.Columns[column].Text);

                var item = new ListViewItem(" ")
                               {
                                   BackColor = selectedColor.BackColor,
                                   ForeColor = Color.Black,
                                   UseItemStyleForSubItems = false
                               };
                item.SubItems.Add(new ListViewItem.ListViewSubItem(item, segmentStats.Text, Color.Black, Color.White,
                                                                   new Font("Times New Roman", 10f)));
                colorHistory.Items.Add(item);

                if (!useSameGraph.Checked)
                    graphView.Cls();

                double scaleHeight = max - min;
                graphView.ScaleHeight = scaleHeight + 1.0;
                graphView.ScaleWidth = data.Length - 1;

                graphView.MoveTo(0.0, ((float) ((scaleHeight + min) - data[0])));

                for (int i = 1; i < data.Length; i++)
                    graphView.LineTo(i, (float) ((scaleHeight + min) - data[i]),
                                     new object[] {selectedColor.BackColor});

                TrendAnalyzer analyzer = new TrendAnalyzerClass();
                int degree = 1;
                analyzer.set_Degree(ref degree);
                analyzer.Init();

                double newX = 0.0;
                double x = 0.0;
                foreach (double sample in data)
                {
                    analyzer.AddPoint(newX, sample);
                    analyzer.AddVal(ref x);
                    double trendValue = analyzer.AddVal(ref newX);
                    newX++;
                    graphView.Circle(newX, (graphView.ScaleHeight - trendValue) + min, 4.0, selectedColor.BackColor);
                }

                graphView.Refresh();
            }
        }