123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- namespace MinicsUI.Helper;
- public class HistoryViewer(MonitorHelper monitorHelper)
- {
- public bool StartChannelHistory(byte mini8Index, byte channelIndex)
- {
- if (!monitorHelper.Monitors.TryGetValue(monitorHelper.SelectedDisplay, out MonitorInfo? monitorInfo) || monitorInfo is null)
- return false;
- ProcessStartInfo startInfo = new()
- {
- FileName = FilePaths.HistoryExe,
- UseShellExecute = false,
- RedirectStandardOutput = true,
- };
- startInfo.ArgumentList.Add(monitorInfo.StartPixVertical.ToString());
- startInfo.ArgumentList.Add(monitorInfo.StartPixHorizontal.ToString());
- startInfo.ArgumentList.Add(monitorInfo.ResolutionVertical.ToString());
- startInfo.ArgumentList.Add(monitorInfo.ResolutionHorizontal.ToString());
- startInfo.ArgumentList.Add("1");
- startInfo.ArgumentList.Add(mini8Index.ToString());
- startInfo.ArgumentList.Add(channelIndex.ToString());
- try
- {
- Process.Start(startInfo);
- return true;
- }
- catch
- {
- return false;
- }
- }
- public bool StartMultiChannelHistory(byte mini8Index)
- {
- if (!monitorHelper.Monitors.TryGetValue(monitorHelper.SelectedDisplay, out MonitorInfo? monitorInfo) || monitorInfo is null)
- return false;
- ProcessStartInfo startInfo = new()
- {
- FileName = FilePaths.HistoryExe,
- UseShellExecute = false,
- RedirectStandardOutput = true,
- };
- startInfo.ArgumentList.Add(monitorInfo.StartPixVertical.ToString());
- startInfo.ArgumentList.Add(monitorInfo.StartPixHorizontal.ToString());
- startInfo.ArgumentList.Add(monitorInfo.ResolutionVertical.ToString());
- startInfo.ArgumentList.Add(monitorInfo.ResolutionHorizontal.ToString());
- startInfo.ArgumentList.Add("3");
- startInfo.ArgumentList.Add(mini8Index.ToString());
- startInfo.ArgumentList.Add("1");
- try
- {
- Process.Start(startInfo);
- return true;
- }
- catch
- {
- return false;
- }
- }
- public bool StartAlarmHistroy()
- {
- if (!monitorHelper.Monitors.TryGetValue(monitorHelper.SelectedDisplay, out MonitorInfo? monitorInfo) || monitorInfo is null)
- return false;
- ProcessStartInfo startInfo = new()
- {
- FileName = FilePaths.HistoryExe,
- UseShellExecute = false,
- RedirectStandardOutput = true,
- };
- startInfo.ArgumentList.Add(monitorInfo.StartPixVertical.ToString());
- startInfo.ArgumentList.Add(monitorInfo.StartPixHorizontal.ToString());
- startInfo.ArgumentList.Add(monitorInfo.ResolutionVertical.ToString());
- startInfo.ArgumentList.Add(monitorInfo.ResolutionHorizontal.ToString());
- startInfo.ArgumentList.Add("2");
- try
- {
- Process.Start(startInfo);
- return true;
- }
- catch
- {
- return false;
- }
- }
- }
|