Some Fix
This commit is contained in:
@@ -13,8 +13,7 @@ namespace Modbus.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="receiveMessage">收到的报文信息</param>
|
/// <param name="receiveMessage">收到的报文信息</param>
|
||||||
/// <param name="packageCountPositions">收到的断包长度查询位置</param>
|
/// <param name="packageCountPositions">收到的断包长度查询位置</param>
|
||||||
/// <param name="otherCount">除掉长度查询信息外其它报文的长度
|
/// <param name="otherCount">除掉长度查询信息外其它报文的长度</param>
|
||||||
/// 注意:该长度不包含CRC校验</param>
|
|
||||||
/// <returns>切分后的报文信息</returns>
|
/// <returns>切分后的报文信息</returns>
|
||||||
private static ICollection<byte[]> DuplicateMessages(byte[] receiveMessage, ICollection<int> packageCountPositions, int otherCount)
|
private static ICollection<byte[]> DuplicateMessages(byte[] receiveMessage, ICollection<int> packageCountPositions, int otherCount)
|
||||||
{
|
{
|
||||||
@@ -51,8 +50,7 @@ namespace Modbus.Net
|
|||||||
/// 获取按照长度断包的函数
|
/// 获取按照长度断包的函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="packageCountPositions">断包长度的位置信息</param>
|
/// <param name="packageCountPositions">断包长度的位置信息</param>
|
||||||
/// <param name="otherCount">除掉长度查询信息外其它报文的长度
|
/// <param name="otherCount">除掉长度查询信息外其它报文的长度</param>
|
||||||
/// 注意:该长度不包含CRC校验</param>
|
|
||||||
/// <returns>断包函数</returns>
|
/// <returns>断包函数</returns>
|
||||||
public static Func<byte[], ICollection<byte[]>> GetDuplcateFunc(ICollection<int> packageCountPositions, int otherCount)
|
public static Func<byte[], ICollection<byte[]>> GetDuplcateFunc(ICollection<int> packageCountPositions, int otherCount)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,8 +94,12 @@ namespace Modbus.Net
|
|||||||
|
|
||||||
public async Task<MachineSetJobScheduler> Query(string queryId = null, Func<Dictionary<string, ReturnUnit>, Dictionary<string, ReturnUnit>> QueryDataFunc = null)
|
public async Task<MachineSetJobScheduler> Query(string queryId = null, Func<Dictionary<string, ReturnUnit>, Dictionary<string, ReturnUnit>> QueryDataFunc = null)
|
||||||
{
|
{
|
||||||
JobChainingJobListenerWithDataMap listener = _scheduler.ListenerManager.GetJobListener("Modbus.Net.DataQuery.Chain") as JobChainingJobListenerWithDataMap;
|
JobChainingJobListenerWithDataMap listener;
|
||||||
if (listener == null)
|
try
|
||||||
|
{
|
||||||
|
listener = _scheduler.ListenerManager.GetJobListener("Modbus.Net.DataQuery.Chain") as JobChainingJobListenerWithDataMap;
|
||||||
|
}
|
||||||
|
catch
|
||||||
{
|
{
|
||||||
listener = new JobChainingJobListenerWithDataMap("Modbus.Net.DataQuery.Chain", false);
|
listener = new JobChainingJobListenerWithDataMap("Modbus.Net.DataQuery.Chain", false);
|
||||||
_scheduler.ListenerManager.AddJobListener(listener, GroupMatcher<JobKey>.GroupEquals("Modbus.Net.DataQuery.Group"));
|
_scheduler.ListenerManager.AddJobListener(listener, GroupMatcher<JobKey>.GroupEquals("Modbus.Net.DataQuery.Group"));
|
||||||
|
|||||||
Reference in New Issue
Block a user