-
-
Save ShilGen/ca9e6692f0e1639090f19e0467147a5c 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
var worksheet = WorkbookNonExcel.Worksheets.FirstOrDefault(); | |
var mps=new HashSet<MeterPoint>(); | |
mps=MeterPoint.GetInstances().ToHashSet(); | |
int i=0; | |
int mpN =0; | |
foreach(var mp in mps) | |
{ | |
var el=mp.AttributeElectricityMeter; | |
if(el!=null) | |
{ | |
var gts=el.GetTimeStatus(); | |
if(gts!=null) | |
{ | |
var lsr=gts.LastSucceedReadInfo; | |
if(lsr!=null) | |
{ | |
worksheet.Cells[i,0].Value=mp.Caption; | |
worksheet.Cells[i,1].Value=el.AttributeSerialNumber; | |
worksheet.Cells[i,2].SetValue(lsr.ServerDt.AddSeconds(lsr.DeltaValueSec)); | |
worksheet.Cells[i,2].Style.NumberFormat="dd.mm.yyyy hh:mm:ss"; | |
worksheet.Cells[i,3].SetValue(lsr.ServerDt); | |
worksheet.Cells[i,3].Style.NumberFormat="dd.mm.yyyy hh:mm:ss"; | |
worksheet.Cells[i,4].SetValue(lsr.DeltaValueSec); | |
i++; | |
} | |
} | |
} | |
mpN++; | |
} | |
worksheet.Cells.GetSubrangeAbsolute(0,0, mpN, 4).Sort(false).By(4, true).Apply(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment