Last active
June 21, 2023 14:03
-
-
Save ShilGen/db6f5b253ae24bf4a3745cb84ad10936 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ObjStudioClasses; | |
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Xml; | |
using System.Threading.Tasks; | |
using GemBox.Spreadsheet; | |
public class Script | |
{ | |
public static object Execute() | |
{ | |
var shid=WebApplication.OnlyInstance.GetCollectorServiceShardsInfo(); | |
//return shid; | |
var css=CollectorScenario.GetInstances().ToArray(); | |
var els=ElectricityMeter.GetInstances().ToHashSet(); | |
var dic=new Dictionary<CollectorScenario,HashSet<ElectricityMeter>>(); | |
foreach(var cs in css) | |
{ | |
var enels=new HashSet<ElectricityMeter>(); | |
var eqs = CollectorService.OnlyInstance. | |
GetEquipmentWithSupportedParametersForScenario(shid.FirstOrDefault().Id,cs). | |
Select(x => x.Equipment as ElectricityMeter). | |
AsEnumerable(); | |
foreach(var eq in eqs) | |
{ | |
enels.Add(eq); | |
} | |
dic.Add(cs,enels); | |
} | |
return dic; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment