예제 #1
0
 public void addLog(LogRecord log)
 {
     logWindow.Enqueue(log);
     if (logWindow.Count > Config.logAnalyzeWindowSize)
     {
         logWindow.Dequeue();
     }
     this.analyze();
 }
예제 #2
0
파일: Log.cs 프로젝트: swnhieian/Keyboard
 /* public void addLog(LogType logType, Point pos, int id)
  {
      LogRecord record = new LogRecord(logType, pos);
      record.setId(id);
      record.setInclinometerReading(this.inclinometer.GetCurrentReading());
      record.setAccelerometerReading(this.accelerometer.GetCurrentReading());
      record.setGyrometerReading(this.gyrometer.GetCurrentReading());
      record.setLightSensorReading(this.lightsensor.GetCurrentReading());
      this.logList.Add(record);
      
  }*/
  public void addLog(LogType logType, Point pos, int id, int handId, Key rawKey = Key.None)
  {
      if (Config.collectDataStatus == CollectDataStatus.Started)
      {
          LogRecord record = new LogRecord(logType, pos, handId);
          record.setId(id);
          if (isBehavior)
          {
              record.setDest(this.tasks.getCurrentDest());
              record.setInclinometerReading(this.inclinometer.GetCurrentReading());
              record.setAccelerometerReading(this.accelerometer.GetCurrentReading());
              record.setGyrometerReading(this.gyrometer.GetCurrentReading());
          }
          else
          {
              record.setDest(this.tasks.getCurrentDest());
              record.setKey(rawKey);
              record.setPredictHints(this.wordPredictor.getPredictHints());
          }
          this.logList.Add(record);
          //this.statusAnalyzer.addLog(record);
          if (logType == LogType.TouchDown)
          {
              this.statusAnalyzer.addLog(record);
          }
      }
  }