-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from zivillian/tgb2
retrieve parameters from setup instead of smartset.db
- Loading branch information
Showing
28 changed files
with
224,426 additions
and
27,821 deletions.
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Concurrent; | ||
using System.Reflection; | ||
using LuCon.Common.ConfigService; | ||
using LuCon.SocketServer.SocketServerBase; | ||
using Microsoft.Extensions.Logging; | ||
using Wolf.DRIVR.Model; | ||
using Wolf.SocketServer.ISMInterface; | ||
|
||
namespace ism7config; | ||
|
||
public class BetterParameterStore : ParameterStore | ||
{ | ||
private readonly FieldInfo _parametersByIdInfo; | ||
|
||
public BetterParameterStore(IDatalogCacheWriter datalogCacheWriter, ISystemMaintenanceStateCacheWriter systemMaintenanceStateCacheWriter, IConverterTemplateService converterTemplateService, IParameterTemplateService parameterTemplateService, IFaultMessageResponseBatchHandler faultMessageResponseBatchHandler, IDeviceTemplateService deviceTemplateService, ILoggerFactory loggerFactory, IDRIVR eventPublisher) : base(datalogCacheWriter, systemMaintenanceStateCacheWriter, converterTemplateService, parameterTemplateService, faultMessageResponseBatchHandler, deviceTemplateService, loggerFactory, eventPublisher) | ||
{ | ||
_parametersByIdInfo = typeof(ParameterStore).GetField("_parametersById", BindingFlags.Instance | BindingFlags.NonPublic); | ||
} | ||
|
||
public ConcurrentDictionary<long, LuCon.SocketServer.SocketServerBase.Parameter> Parameters => (ConcurrentDictionary<long, LuCon.SocketServer.SocketServerBase.Parameter>)_parametersByIdInfo.GetValue(this); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ism7config; | ||
|
||
class Config | ||
{ | ||
public List<Device> Devices { get; set; } | ||
} | ||
|
||
class Device | ||
{ | ||
[JsonIgnore] | ||
public long Id { get; set; } | ||
|
||
public string ReadBusAddress { get; set; } | ||
|
||
public int DeviceTemplateId { get; set; } | ||
|
||
[JsonIgnore] | ||
public List<Parameter> Parameters { get; set; } | ||
|
||
[JsonPropertyName("Parameter")] | ||
public IEnumerable<long> Ids | ||
{ | ||
get { return Parameters.Select(x => x.ParameterId); } | ||
} | ||
} | ||
|
||
class Parameter | ||
{ | ||
public long ParameterId { get; set; } | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Wolf.SocketServer.ISMInterface; | ||
|
||
namespace ism7config; | ||
|
||
public class FaultMessageHandler : IFaultMessageResponseBatchHandler | ||
{ | ||
public void Start() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Stop() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void AddResponse(TelegrBundleResponse resp) | ||
{ | ||
} | ||
|
||
public void ScheduleRuntimeAlertDataUpdate(long gatewayId, long deviceId, TimeSpan timespan, | ||
ModbusDeviceRuntimeAlertData modbusDeviceRuntimeAlertData) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
Oops, something went wrong.