Example #1
0
 public LogItem(string message, LogTypes type, LogDataFormat format)
 {
     date = DateTime.Now;
     SortMessage = message;
     LongMessage = date + " : " + message;
     MessageType = type;
     MessageColor = SetColorByType(type);
 }
Example #2
0
    public static void addLogDataOnce(LogDataFormat logFormat)
    {
        float currProgressTime = Time.time;

        if (!recordedLoggingData.ContainsKey(currProgressTime))
        {
            recordedLoggingData.Add(currProgressTime, new List <LogTimeData>());
        }
        recordedLoggingData[currProgressTime].Add(new LogTimeData(currProgressTime, logFormat));
    }
Example #3
0
    //add log data, it will be called when necessary to log
    public static void addLogData(LogDataFormat logFormat)
    {
        string key = logFormat.name;

        if (!loggingData.ContainsKey(key))
        {
            loggingData.Add(key, logFormat);
        }
        else
        {
            loggingData[key] = logFormat;
        }
    }
Example #4
0
 public LogItem(DetectorMessage message, string text, LogTypes type, LogDataFormat Format)
 {
     date = DateTime.Now;
     Message = message;
     SortMessage = text;
     MessageType = type;
     MessageColor = SetColorByType(type);
     LongMessage = date + " : " + text + " ";
     switch(Format)
     {
         case LogDataFormat.ASCII:
             LongMessage += message.DataASCII;
             break;
         case LogDataFormat.HEX:
             LongMessage += message.DataHEX;
             break;
         case LogDataFormat.Decimal:
             LongMessage += message.DataInt;
             break;
     }
 }
Example #5
0
    //LogDataFormat to string
    public static string returnByType(LogDataFormat logDataFormat)
    {
        DataType dt       = logDataFormat.type;
        string   contents = "";

        switch (dt)
        {
        case DataType.POSITION:
            Vector3 t = (Vector3)logDataFormat.obj;
            contents = string.Format("({0:F3}, {1:F3}, {2:F3})", t.x, t.y, t.z);
            break;

        case DataType.VEC2:
            Vector2 v = (Vector2)logDataFormat.obj;
            contents = string.Format("({0:F3}, {1:F3})", v.x, v.y);
            break;

        case DataType.INT:
            contents = ((int)logDataFormat.obj).ToString();
            break;

        case DataType.STRING:
            contents = (string)logDataFormat.obj;
            break;

        case DataType.BOOL:
            contents = ((bool)logDataFormat.obj).ToString();
            break;

        case DataType.FLOAT:
            contents = ((float)logDataFormat.obj).ToString();
            break;
        }

        return(contents);
    }
Example #6
0
 public static void ChangeDataFormat(LogDataFormat format)
 {
     Format = format;
 }
Example #7
0
 public LogTimeData(float _time, LogDataFormat _logFormat)
 {
     time      = _time;
     logFormat = _logFormat;
 }