Unnessesery projects deleted
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
</site>
|
||||
<site name="MeterProcessState" id="2">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\drabesch_ro\Repo\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\SZLATEV\source\repos\laa_production\Common\Service\MeterProcessState" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
||||
|
||||
@@ -100,5 +100,8 @@
|
||||
<Name>Common.Utils.Extensions</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="configuration.json" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,10 +1,162 @@
|
||||
namespace CommonConsole
|
||||
{
|
||||
using Common.Logic.Extensions.SQL;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
SQLConnection
|
||||
.CreateSQLConnection("Server=SLASQL01.emea.sensus.net; Database=Auftrag; User ID=sa; Password=sqlserver;")
|
||||
.CreateCommand(@"
|
||||
SELECT CONVERT(VARBINARY(8), '0x' + REPLACE(x.Address, '-', ''), 1)
|
||||
, CONVERT(VARBINARY(256), '0x' + REPLACE(x.Value, '-', ''), 1)
|
||||
FROM (SELECT rh.Address
|
||||
, rh.Value
|
||||
, ROW_NUMBER() OVER (PARTITION BY rh.Address ORDER BY rh.date DESC) AS Row
|
||||
FROM GenesisMeterRegisterHistory AS rh
|
||||
WHERE rh.PcbId = @pcbId) AS x
|
||||
WHERE x.Row = 1
|
||||
ORDER BY x.Address")
|
||||
.SetParameter("pcbId", "241330796")
|
||||
.ExecuteReader(reader =>
|
||||
{
|
||||
var address = reader.GetValue<Byte[]>(0);
|
||||
|
||||
if (address.Length == 2)
|
||||
{
|
||||
var value = reader.GetValue<Byte[]>(1);
|
||||
|
||||
Console.WriteLine($"App: {address[0], 5:X2} Register: {address[1], 5:X2} Data: {BitConverter.ToString(value)}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public class Cordonel : Dictionary<String, App>
|
||||
{
|
||||
[OnDeserialized]
|
||||
internal void OnDeserialized(StreamingContext _)
|
||||
{
|
||||
foreach (var x in this)
|
||||
{
|
||||
x.Value.Name = x.Key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class App
|
||||
{
|
||||
public Byte Id { get; set; }
|
||||
|
||||
public String Name { get; set; }
|
||||
|
||||
public V Version { get; set; }
|
||||
|
||||
public Registers Registers { get; set; }
|
||||
|
||||
public Statuses Status { get; set; }
|
||||
}
|
||||
|
||||
public class V
|
||||
{
|
||||
public UInt16? First { get; set; }
|
||||
|
||||
public UInt16? Last { get; set; }
|
||||
}
|
||||
|
||||
public class Registers : Dictionary<String, Register>
|
||||
{
|
||||
[OnDeserialized]
|
||||
internal void OnDeserialized(StreamingContext _)
|
||||
{
|
||||
foreach (var x in this)
|
||||
{
|
||||
x.Value.Name = x.Key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Register
|
||||
{
|
||||
public Byte Id { get; set; }
|
||||
|
||||
public String Name { get; set; }
|
||||
|
||||
public Detail[] Details { get; set; }
|
||||
}
|
||||
|
||||
public class Detail
|
||||
{
|
||||
public V Version { get; set; }
|
||||
|
||||
public String Type { get; set; }
|
||||
|
||||
public String StaticType { get; set; }
|
||||
|
||||
public String Description { get; set; }
|
||||
|
||||
public Privilege Privilege { get; set; }
|
||||
|
||||
public Values Values { get; set; }
|
||||
}
|
||||
|
||||
public class Values
|
||||
{
|
||||
public Object Minimum { get; set; }
|
||||
|
||||
public Object Maximum { get; set; }
|
||||
|
||||
public Object Default { get; set; }
|
||||
}
|
||||
|
||||
public class Privilege
|
||||
{
|
||||
public Privileges Lvl1 { get; set; }
|
||||
|
||||
public Privileges Lvl2 { get; set; }
|
||||
|
||||
public Privileges Lvl3 { get; set; }
|
||||
|
||||
public Privileges Lvl4 { get; set; }
|
||||
|
||||
public Privileges Lvl5 { get; set; }
|
||||
|
||||
public Privileges Lvl6 { get; set; }
|
||||
|
||||
public Privileges Lvl7 { get; set; }
|
||||
|
||||
public Privileges Lvl8 { get; set; }
|
||||
}
|
||||
|
||||
public enum Privileges
|
||||
{
|
||||
NA,
|
||||
RO,
|
||||
WO,
|
||||
RW,
|
||||
}
|
||||
|
||||
public class Statuses : Dictionary<String, Status>
|
||||
{
|
||||
[OnDeserialized]
|
||||
internal void OnDeserialized(StreamingContext _)
|
||||
{
|
||||
foreach (var x in this)
|
||||
{
|
||||
x.Value.Name = x.Key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Status
|
||||
{
|
||||
public Byte Id { get; set; }
|
||||
|
||||
public String Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
c43c40a030005a8f189e6179faf40a6d42bfef5c
|
||||
89102b0142e574de38a9f47d370f3334e5e6c268
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
{
|
||||
[RoutePrefix("api/ConfigurationJson")]
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
[RoutePrefix("api/configurationjson")]
|
||||
public class ConfigurationJsonController : ApiController
|
||||
{
|
||||
[HttpGet]
|
||||
[Route]
|
||||
public IHttpActionResult Get()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user