Skip to content

Commit f1432df

Browse files
Code Review fixes and nuget usage Skyline.DataMiner.Utils.Protocol.Extension
1 parent 08b4f3d commit f1432df

12 files changed

+19
-309
lines changed

QAction_1/ProtocolExtensions.cs

-287
This file was deleted.

QAction_1/SnmpAgentState.cs

-8
This file was deleted.

QAction_1000/IfTable.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
using Skyline.DataMiner.Scripting;
88
using Skyline.DataMiner.Utils.Interfaces;
9+
using Skyline.DataMiner.Utils.Protocol.Extension;
910
using Skyline.DataMiner.Utils.Rates.Protocol;
1011
using Skyline.DataMiner.Utils.SafeConverters;
1112
using Skyline.DataMiner.Utils.SNMP;
12-
using Skyline.Protocol.Extension;
1313
using Skyline.Protocol.Interface;
1414

1515
public class IfTableTimeoutProcessor
@@ -150,7 +150,7 @@ public void ProcessData()
150150
ProcessUtilization(duplexStatuses, i, key, bitrateIn, bitrateOut);
151151
}
152152

153-
if (iftableGetter.IsSnmpAgentRestarted == SnmpAgentStates.Restarted)
153+
if (iftableGetter.IsSnmpAgentRestarted)
154154
{
155155
iftableSetter.SetParamsData[Parameter.iftablesnmpagentrestartflag] = 0;
156156
}
@@ -180,7 +180,7 @@ private void ProcessBitRates(SnmpDeltaHelper snmpDeltaHelper, int getPosition, o
180180
string discontinuityTime = Convert.ToString(iftableGetter.Discontinuity[getPosition]);
181181
bool discontinuity = Interface.HasDiscontinuity(discontinuityTime, rateData.DiscontinuityTime);
182182

183-
if (iftableGetter.IsSnmpAgentRestarted == SnmpAgentStates.Restarted || discontinuity)
183+
if (iftableGetter.IsSnmpAgentRestarted || discontinuity)
184184
{
185185
rateData.BitrateIn = SnmpRate32.FromJsonString(String.Empty, MinDelta, MaxDelta);
186186
rateData.BitrateOut = SnmpRate32.FromJsonString(String.Empty, MinDelta, MaxDelta);
@@ -281,12 +281,11 @@ public IfTableGetter(SLProtocol protocol)
281281

282282
public object[] RateData { get; private set; }
283283

284-
public SnmpAgentStates IsSnmpAgentRestarted { get; private set; }
284+
public bool IsSnmpAgentRestarted { get; private set; }
285285

286286
public void Load()
287287
{
288-
Enum.TryParse<SnmpAgentStates>(Convert.ToString(protocol.GetParameter(Parameter.iftablesnmpagentrestartflag)), out var snmpAgentState);
289-
IsSnmpAgentRestarted = snmpAgentState;
288+
IsSnmpAgentRestarted = Convert.ToBoolean(protocol.GetParameter(Parameter.iftablesnmpagentrestartflag));
290289
LoadIfTable();
291290
LoadIfXTable();
292291
}

QAction_1000/QAction_1000.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<ItemGroup>
1414
<PackageReference Include="Skyline.DataMiner.Dev.Protocol" Version="10.2.0.25" />
1515
<PackageReference Include="Skyline.DataMiner.Utils.Interfaces" Version="1.0.0.3" />
16+
<PackageReference Include="Skyline.DataMiner.Utils.Protocol.Extension" Version="1.0.0.3" />
1617
<PackageReference Include="Skyline.DataMiner.Utils.Rates.Protocol" Version="1.0.0.4" />
1718
<PackageReference Include="Skyline.DataMiner.Utils.SafeConverters" Version="1.0.0.1" />
1819
</ItemGroup>

0 commit comments

Comments
 (0)