Skip to content

Commit

Permalink
Preparing Backgroundog
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 18, 2023
1 parent a90f687 commit 4b14a5b
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/Project/Sucrose.Backgroundog/Helper/Initialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void Start()
{
SBMI.Computer.Open();
TimerCallback Callback = InitializeTimer_Callback;
SBMI.InitializeTimer = new(Callback, null, 0, 1000);
SBMI.InitializeTimer = new(Callback, null, 0, 250);
}

public static void Stop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void WebEngineInitializationCompleted(object sender, CoreWebView2I

SSEWVMI.WebEngine.CoreWebView2.DOMContentLoaded += WebEngineDOMContentLoaded;

SSEWVMI.WebEngine.CoreWebView2.OpenDevToolsWindow();
//SSEWVMI.WebEngine.CoreWebView2.OpenDevToolsWindow();
}
}
}
149 changes: 109 additions & 40 deletions src/Shared/Engine/Sucrose.Shared.Engine/Helper/System.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using SSEMM = Sucrose.Shared.Engine.Manage.Manager;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
using SGSGSS = Sucrose.Grpc.Services.GeneralServerService;
using Sucrose.Grpc.Common;
using SGCSBCS = Sucrose.Grpc.Client.Services.BackgroundogClientService;
using SGSGSS = Sucrose.Grpc.Services.GeneralServerService;
using SMMM = Sucrose.Manager.Manage.Manager;
using SMR = Sucrose.Memory.Readonly;
using SSDECT = Sucrose.Shared.Dependency.Enum.CommandsType;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
using SSEMM = Sucrose.Shared.Engine.Manage.Manager;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;
using Sucrose.Grpc.Common;
using SSSMI = Sucrose.Shared.Space.Manage.Internal;

namespace Sucrose.Shared.Engine.Helper
{
Expand All @@ -14,12 +17,23 @@ public static string GetSystemCpu()
{
if (SSSHP.Work(SMR.Backgroundog))
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogCpuResponse Response = SGCSBCS.GetCpu(SSEMI.Client);

return Response.Info;
try
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogCpuResponse Response = SGCSBCS.GetCpu(SSEMI.Client);

return Response.Info;
}
catch
{
//
}
}
else if (SMMM.PerformanceCounter)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}");
}

return string.Empty;
Expand All @@ -29,12 +43,23 @@ public static string GetSystemDate()
{
if (SSSHP.Work(SMR.Backgroundog))
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogDateResponse Response = SGCSBCS.GetDate(SSEMI.Client);

return Response.Info;
try
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogDateResponse Response = SGCSBCS.GetDate(SSEMI.Client);

return Response.Info;
}
catch
{
//
}
}
else if (SMMM.PerformanceCounter)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}");
}

return string.Empty;
Expand All @@ -44,12 +69,23 @@ public static string GetSystemMemory()
{
if (SSSHP.Work(SMR.Backgroundog))
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogMemoryResponse Response = SGCSBCS.GetMemory(SSEMI.Client);

return Response.Info;
try
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogMemoryResponse Response = SGCSBCS.GetMemory(SSEMI.Client);

return Response.Info;
}
catch
{
//
}
}
else if (SMMM.PerformanceCounter)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}");
}

return string.Empty;
Expand All @@ -59,12 +95,23 @@ public static string GetSystemBattery()
{
if (SSSHP.Work(SMR.Backgroundog))
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogBatteryResponse Response = SGCSBCS.GetBattery(SSEMI.Client);

return Response.Info;
try
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogBatteryResponse Response = SGCSBCS.GetBattery(SSEMI.Client);

return Response.Info;
}
catch
{
//
}
}
else if (SMMM.PerformanceCounter)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}");
}

return string.Empty;
Expand All @@ -74,12 +121,23 @@ public static string GetSystemNetwork()
{
if (SSSHP.Work(SMR.Backgroundog))
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogNetworkResponse Response = SGCSBCS.GetNetwork(SSEMI.Client);

return Response.Info;
try
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogNetworkResponse Response = SGCSBCS.GetNetwork(SSEMI.Client);

return Response.Info;
}
catch
{
//
}
}
else if (SMMM.PerformanceCounter)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}");
}

return string.Empty;
Expand All @@ -89,12 +147,23 @@ public static string GetSystemMotherboard()
{
if (SSSHP.Work(SMR.Backgroundog))
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogMotherboardResponse Response = SGCSBCS.GetMotherboard(SSEMI.Client);

return Response.Info;
try
{
SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port);
SSEMI.Client = new(SGSGSS.ChannelInstance);

BackgroundogMotherboardResponse Response = SGCSBCS.GetMotherboard(SSEMI.Client);

return Response.Info;
}
catch
{
//
}
}
else if (SMMM.PerformanceCounter)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}");
}

return string.Empty;
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Windows.Threading;
using SGCBBC = Sucrose.Grpc.Common.Backgroundog.BackgroundogClient;
using SSESB = Sucrose.Shared.Engine.Setting.Browser;
using SSTHC = Sucrose.Shared.Theme.Helper.Compatible;
using SSTHP = Sucrose.Shared.Theme.Helper.Properties;
using SGCBBC = Sucrose.Grpc.Common.Backgroundog.BackgroundogClient;

namespace Sucrose.Shared.Engine.Manage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using Newtonsoft.Json;
using Sucrose.Grpc.Common;
using static Sucrose.Grpc.Common.Backgroundog;
using SBED = Sucrose.Backgroundog.Extension.Data;
using Newtonsoft.Json;

namespace Sucrose.Shared.Server.Services
{
Expand Down

0 comments on commit 4b14a5b

Please sign in to comment.