Skip to content

Commit

Permalink
Merge branch 'dev-2.3' into 18-gauge_scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
gbakeman committed May 6, 2024
2 parents 15cde37 + a93c6f5 commit 09b1186
Show file tree
Hide file tree
Showing 83 changed files with 21,386 additions and 307,135 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/2-bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report [advanced]
about: Please consider using the Discussions if you're experiencing a problem.
title: ''
labels: bug
assignees: gbakeman

---

**Please make sure to fill out this form completely, and attach your program logs (set to Debug setting). You can delete this line.**

- [ ] Searched to see if this issue exists
- [ ] Completed below form
- [ ] Attached debug log file
- [ ] Copy output in File -> UPS Variable

**WinNUT Version: **
**Windows OS Version: **

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Experiencing an issue?
url: https://github.com/nutdotnet/WinNUT-Client/discussions/categories/q-a
about: Go here to see and create Discussions.
2 changes: 1 addition & 1 deletion .github/workflows/build-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defaults:
on:
workflow_dispatch:
pull_request:
branches: [ main, Dev-2.2 ] # Build for dev primarily, probably don't need main...?
branches: [ main, dev-* ] # Build for dev primarily, probably don't need main...?
paths:
- '**.vb'
- '**.vbproj'
Expand Down
41 changes: 37 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
.suo
*.suo
*.user
*.userosscache
Expand All @@ -22,6 +21,7 @@ mono_crash.*
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
PreRelease/
x64/
x86/
[Ww][Ii][Nn]32/
Expand Down Expand Up @@ -91,6 +91,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -294,6 +295,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -350,6 +362,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -361,6 +376,24 @@ MigrationBackup/

# Fody - auto-generated XML schema
FodyWeavers.xsd
*.pdb

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
WinNUT_V2/.vs
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml
96 changes: 35 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,65 @@
# WinNUT-Client
WinNUT is a WinForms client for connecting to a Network UPS Tools monitoring server.

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate?hosted_button_id=FAFJ3ZKMENGCU)
- 📈 Monitor important values of your UPS like voltage and power consumption
- 🌩️ Receive notifications for abnormal power conditions (power outage)
- ❤️ Keep your hardware and data safe with configurable suspend and shutdown triggers

## Installation
To use it, please follow the following steps:
1. Get the [last available Releases](https://github.com/nutdotnet/WinNUT-Client/releases)
2. Install WinNUT-Client using the "WinNUT-Setup.msi" file obtained previously
3. If you were using an older version of WinNUT (v1.x), copy your "ups.ini" configuration file to the WinNUT-Client installation directory (by default "C:\Program Files(x86)\WinNUT-Client ") for an automatic import of your parameters during the first launch
4. Start WinNUT V2 and modify the parameters according to your needs

## Specific Configuration
<br />
<br />

### For Synology NAS
If your NUT server is hosted on a Synology NAS, be sure to provide the following connection information (default):
Login: upsmon
Password: secret
# Future development
WinNUT has gone through a long evolution with several different programming languages and maintainers. The time has come to retire this iteration of WinNUT and begin planning for the next version. See [issue #40](https://github.com/nutdotnet/WinNUT-Client/issues/40) for more information. Join in the discussions at [Coco.Nut](https://github.com/nutdotnet/Coco.Nut), and shape the future of the next iteration of WinNUT.

It will probably be necessary to allow the WinNUT-Client IP to communicate with the NUT server.
*See issue 47 for more information, specifically [this commentary](https://github.com/gawindx/WinNUT-Client/issues/47#issuecomment-759180793).*

###
## Contributing
### Translation
WinNUT-Client V2 is natively multilingual, so it is no longer necessary to select your language from the software interface.
Currently, WinNUT-Client supports:
- English
- German
- French
- Simplified Chinese
- Russian
# Installation
1. Get the [latest Release](https://github.com/nutdotnet/WinNUT-Client/releases)
2. Install WinNUT using the downloaded executable
3. If you were using an older version of WinNUT (v1.x), copy your "ups.ini" configuration file to the WinNUT-Client installation directory (by default "C:\Program Files(x86)\WinNUT-Client ") for an automatic import of your parameters during the first launch
4. Start WinNUT and modify the settings according to your needs

#### To add / correct a language
## Synology NAS
If you are connecting to a Synology NAS with a UPS attached, there is some additional configuration that needs to be done.

##### Method 1 (preferred)
1. [Fork](https://github.com/nutdotnet/WinNUT-Client/fork) this repository
2. In the translation directory:
Referring to the [Synology documentation](https://kb.synology.com/en-us/DSM/help/DSM/AdminCenter/system_hardware_ups?version=7), note that you must add your client computer's IP address to the *Permitted DiskStation Devices* window. In addition, WinNUT requires the following settings:

For a new translation:
1. Use the new_translation.csv file to translate the texts
2. Save this file in xx-XX corresponding to the language code
- **Login**: upsmon
- **Password**: secret
- **UPS Name**: ups

For a correction:
1. Edit the wrong language file
2. Make the necessary corrections

3. Save it instead
4. Create a pull request on this repository to take into account the translation.
*See [issue 47](https://github.com/gawindx/WinNUT-Client/issues/47#issuecomment-759180793) for more information.*

##### Method 2
1. Get the file [new_translation.csv](./Translation/new_translation.csv)
2. Perform the necessary translations
3. Save this file in csv format (IMPORTANT)
4. Create a gist via [gist github](https://gist.github.com) and paste the contents of the previously created csv file
5. Open a new issue and tell me:
- the link of the gist
- the language to create / correct
## QNAP NAS
If your NUT server is hosted on a QNAP NAS, be sure to provide the following connection information (default):

Your translation / correction will be added on a new version and will thus be available to the entire community.
- **UPS Name**: qnapups
- (Login and Password can be empty)

## Update WinNUT-Client
Also check the "Enable network UPS master" box on the Control Panel -> External device page on the QNAP webinterface and add the IP address of the WinNUT-Client to allow the client to connect to the QNAP for UPS information.

Since version 1.8.0.0, WinNUT-Client includes a process for checking for updates.
This process can be started automatically on startup or manually on demand (and you can choose whether you want to update from the stable or development version)
# Contributing
- [Translations](https://github.com/nutdotnet/WinNUT-Client/wiki/Translations)
- [Code/Bug fixes](https://github.com/nutdotnet/WinNUT-Client/wiki/Development)

During this update, the new installation file will be automatically downloaded and you can easily update your version of WinNUT-Client.
# Updates

This process is fully integrated and no longer requires a second executable.
WinNUT has built-in update functionality. This process can be started automatically on startup or manually on demand, and you can choose whether you want to update to the stable or development version. During this process, the new files will be automatically downloaded and installed.

## Third Party Components / Acknowledgments

WinNUT-Client uses:
WinNUT uses:
- a modified version of AGauge initially developed by [Code-Artist](https://github.com/Code-Artist/AGauge) and under [MIT license](https://opensource.org/licenses/MIT)
- Class IniReader developed by [Ludvik Jerabek](https://www.codeproject.com/Articles/21896/INI-Reader-Writer-Class-for-C-VB-NET-and-VBScript) and under [The Code Project Open License](http://www.codeproject.com/info/cpol10.aspx)
- Newtonsoft.Json Library is used in this Project [Newtonsoft.json Website](https://www.newtonsoft.com/json) and under [MIT license](https://opensource.org/licenses/MIT)

## License

WinNUT-Client is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
Copyright (C) 2019-2021 Gawindx (Decaux Nicolas)

- Copyright (C) 2019-2021 Gawindx (Decaux Nicolas)
- Copyright (C) 2022+ NUT Dot Net project

This program is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3 of the
License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY

## Donation
If you want to support this project or reward the work done, you can do so here:

[![paypal](https://www.paypalobjects.com/en_US/FR/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate?hosted_button_id=FAFJ3ZKMENGCU)
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
51 changes: 45 additions & 6 deletions WinNUT_V2/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ root = true
# All files
[*]
indent_style = space
file_header_template = WinNUT-Client is a NUT windows client for monitoring your ups hooked up to your favorite linux server.\nCopyright (C) 2019-2021 Gawindx (Decaux Nicolas)\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the\nGNU General Public License as published by the Free Software Foundation, either version 3 of the\nLicense, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\neven the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program.\nIf not, see https://www.gnu.org/licenses/.\n
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
Expand Down Expand Up @@ -54,18 +53,29 @@ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_code_quality_unused_parameters = all:suggestion
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
csharp_style_var_elsewhere = false:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
Expand Down Expand Up @@ -101,7 +111,7 @@ csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
csharp_indent_labels = one_less_than_current
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
Expand All @@ -117,6 +127,35 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_prefer_static_local_function = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
###############################
# VB Coding Conventions #
###############################
Expand Down
5 changes: 3 additions & 2 deletions WinNUT_V2/AGauge_mod/AGauge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
Expand Down
2 changes: 1 addition & 1 deletion WinNUT_V2/AGauge_mod/AGauge.csproj.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
Loading

0 comments on commit 09b1186

Please sign in to comment.