Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vinniko/sauep

🏭 Energy analysis and metering system for heavy industry
https://github.com/vinniko/sauep

asp-net-core csharp http net-core rest-api sql tcp tcp-server tcp-server-client tcp-socket wpf

Last synced: about 2 months ago
JSON representation

🏭 Energy analysis and metering system for heavy industry

Awesome Lists containing this project

README

        

# Electricity analysis and metering system
---------------------------------------------------------------------------------------------
1. Установка
---------------------------------------------------------------------------------------------
Π‘ΠΊΠ»ΠΎΠ½ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Ρ€Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΡ€ΠΈΠΉ:
>git clone https://github.com/Vinniko/SAUEP.git

На сСрвСрС ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ Π±Π°Π·Ρƒ Π΄Π°Π½Π½Ρ‹Ρ… PostgreSQL, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€:
>sudo -i -u postgres
>psql
>CREATE DATABASE MyDatabase

Π’Π΅ΠΏΠ΅Ρ€ΡŒ Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΏΠΎΠ΄Π½ΡΡ‚ΡŒ схСму Π΄Π°Π½Π½Ρ‹Ρ…:
>pgrestore -U postgres -d MyDatabase -1 ../SAUEPDump.sql

НСобходимо Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΊ Π±Π°Π·Π΅ Π΄Π°Π½Π½Ρ‹Ρ… Π² ΠΌΠΎΠ΄eΠ»Π΅ ApiServer.
Для этого Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΏΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ Π² ./SAUEP.ApiServer/Connections
И Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:
>cp Connection.json.example Connection.json

ΠŸΡ€ΠΈΠΌΠ΅Ρ€ заполнСния:
>{
> "Host": "localhost",
> "Username": "postgres",
> "Password": "root",
> "Database": "MyDatabase"
>}

Для измСнСния хоста ΠΈ ΠΏΠΎΡ€Ρ‚Π° ΠΏΠΎΠ΄ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΌ запускаСтся ApiServer, ΠΏΠ΅Ρ€Π΅ΠΉΠ΄Π΅ΠΌ Π² ΠΏΠ°ΠΏΠΊΡƒ ./SAUEP.ApiServer/Properties/launchSettings.json
и измСним поля: applicationUrl и sslPort.

Запуск ApiServer.
ΠŸΠ΅Ρ€Π΅ΠΉΠ΄Π΅ΠΌ Π² ΠΏΠ°ΠΏΠΊΡƒ ./SAUEP.ApiServer/ ΠΈ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠΌ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ
>dotnet publish --configuration Release

ПослС выполнСния ΠΏΠ΅Ρ€Π΅ΠΉΠ΄Π΅ΠΌ Π² ΠΏΠ°ΠΏΠΊΡƒ ./bin/Release/netcoreapp3.1 ΠΈ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠΌ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:
>dotnet SAUEP.ApiServer.dll &

Π”Π°Π»Π΅Π΅ настроим TcpServer.
Настроим ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΊ Π±Π°Π·Π΅ ΠΏΠΎ Π°Π½Π°Π»ΠΎΠ³ΠΈΠΈ с ApiServer.
ΠŸΠ΅Ρ€Π΅ΠΉΠ΄Π΅ΠΌ Π² ./SAUEP.TCPServer/Connections/Connection.json
ΠŸΡ€ΠΈΠΌΠ΅Ρ€ заполнСния:
>{
> "Host": "localhost",
> "Username": "postgres",
> "Password": "root",
> "Database": "MyDatabase"
>}

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠΌΠ΅Π½ΡΡ‚ΡŒ ΠΏΠΎΡ€Ρ‚Ρ‹ ΠΈ хост ΠΏΠΎΠ΄ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΌΠΈ запускаСтся TcpServer, Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ Ρ„Π°ΠΉΠ»./SAUEP.TCPServer/Models/SocketModel.cs
ΠŸΡ€ΠΈΠΌΠ΅Ρ€ настройки:
>private const int _listenPort = 8005;
>private const int _sayPort = 8003;
>private string _ipAddress = "127.0.0.1";

Π‘ΠΎΠ·Π΄Π°Π΄ΠΈΠΌ Ρ€Π΅Π»ΠΈΠ· Π²Π΅Ρ€ΡΠΈΡŽ Π² ΠΏΠ°ΠΏΠΊΠ΅ ./SAUEP.TCPServer:
>dotnet publish --configuration Release

И запустим сСрвСр ΠΈΠ· ΠΏΠ°ΠΏΠΊΠΈ ./SAUEP.TCPServer/bin/Release/ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ:
>dotnet SAUEP.TCPServer.dll &

Настроим Ρ‚Π΅ΡΡ‚ΠΎΠ²ΡƒΡŽ Π²Π΅Ρ€ΡΠΈΡŽ DeviceClient:
Настроим ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΊ Π±Π°Π·Π΅.
ΠŸΠ΅Ρ€Π΅ΠΉΠ΄Π΅ΠΌ Π² ./SAUEP.DeviceClient/Connections
И Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΠΌ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:
>cp Connection.json.example Connection.json

ΠŸΡ€ΠΈΠΌΠ΅Ρ€ заполнСния:
>{
> "Host": "localhost",
> "Username": "postgres",
> "Password": "root",
> "Database": "MyDatabase"
>}

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠΌΠ΅Π½ΡΡ‚ΡŒ ΠΏΠΎΡ€Ρ‚ ΠΈ хост ΠΏΠΎΠ΄ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΌΠΈ запускаСтся DeviceServer, Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ ./SAUEP.DeviceClient/Configs
И Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:
>cp Config.json.example Config.json

ПослС Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ ΠΊΠΎΠ½Ρ„ΠΈΠ³. НапримСр:
>{
> "Ip": "127.0.0.1",
> "Port": 8005
>}

Π‘ΠΎΠ·Π΄Π°Π΄ΠΈΠΌ Ρ€Π΅Π»ΠΈΠ· Π²Π΅Ρ€ΡΠΈΡŽ Π² ΠΏΠ°ΠΏΠΊΠ΅ ./SAUEP.DeviceClient:
>dotnet publish --configuration Release

И запустим ΠΊΠ»ΠΈΠ΅Π½Ρ‚ устройств ΠΈΠ· ΠΏΠ°ΠΏΠΊΠΈ ./SAUEP.DeviceClient/bin/Release/ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ:
>dotnet SAUEP.DeviceClient.dll &

Π—Π°ΠΏΡƒΡΡ‚ΠΈΡ‚ΡŒ Desktop-ΠΊΠ»ΠΈΠ΅Π½Ρ‚ ΠΌΠΎΠΆΠ½ΠΎ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ ΠΏΠΎΠ΄ Windows.
Настроим ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΊ ApiServer.
ΠžΡ‚ΠΊΡ€ΠΎΠ΅ΠΌ Ρ„Π°ΠΉΠ» ./Core/Connections/Connection.json ΠΈ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠΌ ConnectionUrl Π½Π° хост ΠΏΠΎΠ΄ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΌ Π·Π°ΠΏΡƒΡ‰Π΅Π½ ApiServer.
НапримСр:
>{
> "ConnectionUrl": "http://localhost:53773/"
>}

Π’ Ρ„Π°ΠΉΠ»Π΅ ./Core/Models/SocketModel.cs
Настроим _listenPort ΠΈ _ipAddress сСрвСра:
>private const int _listenPort = 8003;
>private string _ipAddress = "127.0.0.1";

МоТно Π·Π°ΠΏΡƒΡΠΊΠ°Ρ‚ΡŒ SAUEP.exe

---------------------------------------------------------------------------------------------
2. Бвязь
---------------------------------------------------------------------------------------------


Email: [email protected] / [email protected]

Telegram: https://t.me/vinnik0

LinkedIn: https://www.linkedin.com/in/алСксСй-винник-7450a5208/

HeadHunter: https://spb.hh.ru/resume/f658e91bff090474030039ed1f5a4141446844