Exemplo n.º 1
0
        public void ProcessSearchResult(LineValues lineValues)
        {
            foreach (var strategy in this.SearchStrategies)
            {
                switch (strategy)
                {
                case StrategyEnum.DistinctClientIP:
                {
                    this.CalculateDistinctClientIPStrategy(lineValues.ClientIp);
                    break;
                }

                case StrategyEnum.DistinctFqdnIP:
                {
                    this.CalculateDistinctFqdnIPStrategy(lineValues.ClientIp, lineValues.FqdnIp);
                    break;
                }

                case StrategyEnum.CountClientCalls:
                {
                    this.CalculateCountClientCallsStrategy(lineValues.ClientIp);
                    break;
                }

                default:
                    throw new Exception("Insupported search strategy");
                }
            }
        }
Exemplo n.º 2
0
        private void DisplayValue(string sVal)
        {
            try
            {
                ushort v  = ushort.Parse(sVal);
                double cv = double.Parse(sVal);
                if (v < 0 || v > maxPhotoVal)
                {
                    return;
                }

                SensorData data = new SensorData(DateTime.Now, v);
                photoDatas.Add(data);
                InsertDataToDB(data);

                TxtSensorCount.Text      = photoDatas.Count.ToString();
                PgbPhotoRegistor.Value   = v;
                LblPhotoRegistor.Content = v.ToString();

                string item = $"{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")}\t{v}";
                if (AxisX.MaxValue < 200)
                {
                    AxisX.MaxValue++;
                }
                RtbLog.AppendText($"{item}\n");
                RtbLog.ScrollToEnd();
                LineValues.Add(cv);
                DataContext = this;
            }
            catch (Exception ex)
            {
                RtbLog.AppendText($"Error : {ex.Message}\n");
                RtbLog.ScrollToEnd(); //RtbLog.ScrollToCaret();
            }
        }
Exemplo n.º 3
0
    public ConversationObject(string inputFilename)
    {
        string     line;
        LineValues lineValues;

        System.IO.StreamReader file = new System.IO.StreamReader(inputFilename);

        while ((line = file.ReadLine()) != null)
        {
            lineValues = new LineValues(line);
            allPhraseLines.Add(lineValues);
        }
    }