Skip to content

Commit

Permalink
Merge pull request #14 from anes300/develop
Browse files Browse the repository at this point in the history
Merged develop into main v.1.0.0
  • Loading branch information
Chillhound authored Mar 25, 2022
2 parents 5a6b65f + 9ee8ec5 commit d8ddc5d
Show file tree
Hide file tree
Showing 49 changed files with 2,012 additions and 17 deletions.
35 changes: 35 additions & 0 deletions IOTManagment/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/API-Web/bin/Debug/net6.0/API-Web.dll",
"args": [],
"cwd": "${workspaceFolder}/API-Web",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
41 changes: 41 additions & 0 deletions IOTManagment/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/API-Web/API-Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/API-Web/API-Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/API-Web/API-Web.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
11 changes: 11 additions & 0 deletions IOTManagment/API-Web/API-Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NetMQ" Version="4.0.1.8" />
</ItemGroup>

<ItemGroup>
<None Remove="RabbitMQ.Client" />
<None Remove="Newtonsoft.Json" />
<None Remove="ZeroMQ" />
<None Remove="NetMQ" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Services\Services.csproj" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions IOTManagment/IOTManagment.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Services", "Services\Services.csproj", "{14640077-5376-4D81-92C0-5EC70D84E54E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{D92E85EE-E28A-4B66-8A88-83AE6EDDB1B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -33,6 +35,10 @@ Global
{14640077-5376-4D81-92C0-5EC70D84E54E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14640077-5376-4D81-92C0-5EC70D84E54E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14640077-5376-4D81-92C0-5EC70D84E54E}.Release|Any CPU.Build.0 = Release|Any CPU
{D92E85EE-E28A-4B66-8A88-83AE6EDDB1B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D92E85EE-E28A-4B66-8A88-83AE6EDDB1B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D92E85EE-E28A-4B66-8A88-83AE6EDDB1B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D92E85EE-E28A-4B66-8A88-83AE6EDDB1B4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 0 additions & 7 deletions IOTManagment/Model/Class1.cs

This file was deleted.

32 changes: 32 additions & 0 deletions IOTManagment/Model/Messages/Message.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Model.Nodes;
using System;
using System.Net;

namespace Model.Messages
{
public class Message
{
public Guid messageId { get; set; } = Guid.NewGuid();
public string messageBody { get; } // = PayloadBody
public MessageType messageType { get; }
public string senderIP { get; }
public int senderPort { get; }

public Message(string messageBody, MessageType messageType, string senderIP,int senderPort)
{
this.messageBody = messageBody;
this.messageType = messageType;
this.senderIP = senderIP;
this.senderPort = senderPort;
}
}

public enum MessageType
{
CONNECT=1,
FORWARD=2,
RESPONSEAPI=3,
QUERY = 4,
STOP = 5,
};
}
14 changes: 14 additions & 0 deletions IOTManagment/Model/Messages/SelectVariableResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Model.Queries.Variables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Messages
{
public class SelectVariableResult : SelectVariable
{
public double? Value { get; set; }
}
}
15 changes: 15 additions & 0 deletions IOTManagment/Model/Nodes/Enum/DataType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Nodes.Enum
{
public enum DataType
{
TEMPERATURE_CPU = 1,
TEMPERATURE_GPU = 2,
TEST_VAR = 3,
}
}
16 changes: 16 additions & 0 deletions IOTManagment/Model/Nodes/Enum/NodeType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Nodes.Enum
{
public enum NodeType
{
SENSOR = 1,
NODE = 2,
ROUTENODE = 3,
ROOT = 4
}
}
14 changes: 14 additions & 0 deletions IOTManagment/Model/Nodes/Enum/Status.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Nodes.Enum
{
public enum Status
{
INACTIVE = 0,
ACTIVE = 1
}
}
26 changes: 26 additions & 0 deletions IOTManagment/Model/Nodes/INode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Model.Nodes.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Model.Nodes
{
public interface INode
{

public string? Parent { get; set; }
public int? ParentPort { get; set; }

public string Address { get; set; }
public int AddressPort { get; set; }

public NodeType Type { get; set; }
public Status Status { get; set; }
public DataType DataType { get; set; }


}
}
26 changes: 26 additions & 0 deletions IOTManagment/Model/Nodes/Node.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Model.Nodes.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;


namespace Model.Nodes
{
public class Node : INode
{
public string? Parent { get; set; }
public int? ParentPort { get; set; }

public string Address { get; set; }
public int AddressPort { get; set; }

public NodeType Type { get; set; }
public Status Status { get; set; }
public DataType DataType { get; set; }


}
}
14 changes: 14 additions & 0 deletions IOTManagment/Model/Queries/Enums/SelectOperator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries.Enums
{
public enum SelectOperator
{
None,
Sum
}
}
20 changes: 20 additions & 0 deletions IOTManagment/Model/Queries/Enums/WhereExpOperator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries.Enums
{
public enum WhereExpOperator
{
GreaterThan,
LessThan,
LessThanOrEqual,
GreaterThenOrEqual,
NotEqual,
Equal
}
}
15 changes: 15 additions & 0 deletions IOTManagment/Model/Queries/Enums/WhereOperator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries.Enums
{
public enum WhereOperator
{
None,
And,
Or
}
}
16 changes: 16 additions & 0 deletions IOTManagment/Model/Queries/Expressions/WhereExpression.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Model.Queries.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries.Expressions
{
public class WhereExpression
{
public string exp1 { get; set; }
public string exp2 { get; set; }
public WhereExpOperator Operator { get; set; }
}
}
17 changes: 17 additions & 0 deletions IOTManagment/Model/Queries/Query.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Model.Queries.Statements;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries
{
public class Query
{
public Guid Id { get; set; } = Guid.NewGuid();
public SelectStatement SelectStatement { get; set; }
public IntervalStatement IntervalStatement { get; set; }
public WhereStatement? WhereStatement { get; set; }
}
}
13 changes: 13 additions & 0 deletions IOTManagment/Model/Queries/Statements/IntervalStatement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries.Statements
{
public class IntervalStatement
{
public int Interval { get; set; }
}
}
14 changes: 14 additions & 0 deletions IOTManagment/Model/Queries/Statements/SelectStatement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Model.Queries.Variables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Queries.Statements
{
public class SelectStatement
{
public List<SelectVariable> Variables { get; set; } = new List<SelectVariable>();
}
}
Loading

0 comments on commit d8ddc5d

Please sign in to comment.