mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-11 10:41:33 +00:00
Adding TextScreenHelpers.
This commit is contained in:
parent
21c464d946
commit
5ec6d38ad4
1 changed files with 65 additions and 0 deletions
65
source/Cosmos.HAL/TextScreenHelpers.cs
Normal file
65
source/Cosmos.HAL/TextScreenHelpers.cs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Debugger = Cosmos.Debug.Kernel.Debugger;
|
||||
using Cosmos.Common.Extensions;
|
||||
|
||||
namespace Cosmos.HAL
|
||||
{
|
||||
public static class TextScreenHelpers
|
||||
{
|
||||
private static Debugger mDebugger = new Debugger("TextScreen", "Debug");
|
||||
|
||||
[Conditional("COSMOSDEBUG")]
|
||||
public static void Debug(string aMessage, params object[] aParams)
|
||||
{
|
||||
string xMessage = aMessage;
|
||||
|
||||
if (aParams != null)
|
||||
{
|
||||
aMessage = aMessage + " : ";
|
||||
for (int i = 0; i < aParams.Length; i++)
|
||||
{
|
||||
if (aParams[i] != null)
|
||||
{
|
||||
string xParam = aParams[i].ToString();
|
||||
if (!string.IsNullOrWhiteSpace(xParam))
|
||||
{
|
||||
xMessage = xMessage + " " + xParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mDebugger.Send("TextScreen Debug: " + xMessage);
|
||||
}
|
||||
|
||||
[Conditional("COSMOSDEBUG")]
|
||||
public static void Debug(string aMessage)
|
||||
{
|
||||
mDebugger.Send("TextScreen Debug: " + aMessage);
|
||||
}
|
||||
|
||||
[Conditional("COSMOSDEBUG")]
|
||||
public static void DebugNumber(uint aValue)
|
||||
{
|
||||
mDebugger.SendNumber(aValue);
|
||||
}
|
||||
|
||||
[Conditional("COSMOSDEBUG")]
|
||||
public static void DebugNumber(ulong aValue)
|
||||
{
|
||||
mDebugger.Send(((uint)aValue).ToString() + ((uint)aValue >> 32).ToString());
|
||||
}
|
||||
|
||||
[Conditional("COSMOSDEBUG")]
|
||||
public static void DevDebug(string message)
|
||||
{
|
||||
mDebugger.Send("TextScreen DevDebug: " + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue