Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions NetSdrClientApp/NetSdrClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{
public class NetSdrClient
{
private ITcpClient _tcpClient;
private IUdpClient _udpClient;
private readonly ITcpClient _tcpClient;
private readonly IUdpClient _udpClient;

public bool IQStarted { get; set; }

public NetSdrClient(ITcpClient tcpClient, IUdpClient udpClient)

Check warning on line 22 in NetSdrClientApp/NetSdrClient.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Non-nullable field 'responseTaskSource' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 22 in NetSdrClientApp/NetSdrClient.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field 'responseTaskSource' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=friezze_ReengineeringCourse&issues=AZ6E-yGekASlgEhJnxX7&open=AZ6E-yGekASlgEhJnxX7&pullRequest=2
{
_tcpClient = tcpClient;
_udpClient = udpClient;
Expand Down Expand Up @@ -66,7 +66,7 @@
return;
}

; var iqDataMode = (byte)0x80;
var iqDataMode = (byte)0x80;
var start = (byte)0x02;
var fifo16bitCaptureMode = (byte)0x01;
var n = (byte)1;
Expand Down Expand Up @@ -114,9 +114,9 @@
await SendTcpRequest(msg);
}

private void _udpClient_MessageReceived(object? sender, byte[] e)
private static void _udpClient_MessageReceived(object? sender, byte[] e)
{
NetSdrMessageHelper.TranslateMessage(e, out MsgTypes type, out ControlItemCodes code, out ushort sequenceNum, out byte[] body);
NetSdrMessageHelper.TranslateMessage(e, out _, out _, out _, out byte[] body);
var samples = NetSdrMessageHelper.GetSamples(16, body);

Console.WriteLine($"Samples recieved: " + body.Select(b => Convert.ToString(b, toBase: 16)).Aggregate((l, r) => $"{l} {r}"));
Expand All @@ -138,7 +138,7 @@
if (!_tcpClient.Connected)
{
Console.WriteLine("No active connection.");
return null;

Check warning on line 141 in NetSdrClientApp/NetSdrClient.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Possible null reference return.

Check warning on line 141 in NetSdrClientApp/NetSdrClient.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Possible null reference return.

See more on https://sonarcloud.io/project/issues?id=friezze_ReengineeringCourse&issues=AZ6E-yGekASlgEhJnxX8&open=AZ6E-yGekASlgEhJnxX8&pullRequest=2
}

responseTaskSource = new TaskCompletionSource<byte[]>(TaskCreationOptions.RunContinuationsAsynchronously);
Expand All @@ -153,11 +153,11 @@

private void _tcpClient_MessageReceived(object? sender, byte[] e)
{
//TODO: add Unsolicited messages handling here
//NOTE: add Unsolicited messages handling here
if (responseTaskSource != null)
{
responseTaskSource.SetResult(e);
responseTaskSource = null;

Check warning on line 160 in NetSdrClientApp/NetSdrClient.cs

View workflow job for this annotation

GitHub Actions / Sonar Check

Cannot convert null literal to non-nullable reference type.

Check warning on line 160 in NetSdrClientApp/NetSdrClient.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Cannot convert null literal to non-nullable reference type.

See more on https://sonarcloud.io/project/issues?id=friezze_ReengineeringCourse&issues=AZ6E-yGekASlgEhJnxX9&open=AZ6E-yGekASlgEhJnxX9&pullRequest=2
}
Console.WriteLine("Response recieved: " + e.Select(b => Convert.ToString(b, toBase: 16)).Aggregate((l, r) => $"{l} {r}"));
}
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ppanchen_NetSdrClient&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=ppanchen_NetSdrClient)



## Тут все пов'язане з виконанням самих лаб
# 1
![Чек сонарклауда з форка репозиторія](image.png)
![Бейджі](image-1.png)
Лінк на коміт
'''
https://github.com/friezze/ReengineeringCourse/commit/2534516c319a38d4aecd5d70a4e93c086961300
'''

# 2

До змін
![alt text](image-2.png)
Після


Цей репозиторій використовується для курсу **реінжиніринг ПЗ**.
Мета — провести комплексний реінжиніринг спадкового коду NetSdrClient, включаючи рефакторинг архітектури, покращення якості коду, впровадження сучасних практик розробки та автоматизацію процесів контролю якості через CI/CD пайплайни.

Expand Down
Binary file added image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading