aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-02-10 02:13:37 +0200
committerRoy <roy.mail.net@gmail.com>2018-02-10 02:13:37 +0200
commit07e686eb253ffd29f36dbe530b3a17633e02b353 (patch)
treed9663f1c92a400349dffc743adb0114ee1a7f618 /Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
parentc8c9606e545f49aae3d9f0524775436adbdf27e9 (diff)
downloadTango-07e686eb253ffd29f36dbe530b3a17633e02b353.tar.gz
Tango-07e686eb253ffd29f36dbe530b3a17633e02b353.zip
Added support for motor controllers.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs42
1 files changed, 9 insertions, 33 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
index 0b1a10f13..99be80b29 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
@@ -145,18 +145,21 @@ namespace Tango.MachineEM.UI.ViewModels
/// </summary>
public MainViewVM()
{
- MainViewLogger logger = new MainViewLogger();
- //logger.NewLog += (output) =>
- //{
- // Log += output + Environment.NewLine;
- //};
+ SimpleStringLogger logger = new SimpleStringLogger(LogCategory.Critical, LogCategory.Error, LogCategory.General, LogCategory.Warning);
+ logger.LogReceived += (sedner, log) =>
+ {
+ Log += log.ToString() + Environment.NewLine;
+ };
LogManager.RegisterLogger(logger);
+ LogManager.Log("Embedded Emulator Started...");
+
+
Emulator = new MachineEmulator(new BasicTransporter());
StartCommand = new RelayCommand(Start, (x) => !Emulator.IsStarted);
- StopCommand = new RelayCommand(Stop,(x) => Emulator.IsStarted);
+ StopCommand = new RelayCommand(Stop, (x) => Emulator.IsStarted);
RunCommand = new RelayCommand(RunSelectedStub, (x) => !_running);
CancelCommand = new RelayCommand(Cancel, (x) => _running);
ClearCommand = new RelayCommand(() => Log = String.Empty);
@@ -257,32 +260,5 @@ namespace Tango.MachineEM.UI.ViewModels
}
#endregion
-
- #region Custom Logger
-
- public class MainViewLogger : ILogger
- {
- public bool Enabled { get; set; }
- public bool Immediate { get; set; }
- public event Action<String> NewLog;
-
- public MainViewLogger()
- {
- Enabled = true;
- Immediate = true;
- }
-
- public void OnError(LogItemBase output)
- {
- NewLog?.Invoke(output.ToString());
- }
-
- public void OnTrace(LogItemBase output)
- {
- NewLog?.Invoke(output.ToString());
- }
- }
-
- #endregion
}
}