diff --git a/App/.editorconfig b/App/.editorconfig new file mode 100644 index 0000000..4aaad81 --- /dev/null +++ b/App/.editorconfig @@ -0,0 +1,280 @@ +# editorconfig.org + +# top-most EditorConfig file +root = true + +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +[*] +insert_final_newline = true +indent_style = space +indent_size = 4 +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +end_of_line = crlf +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion +dotnet_style_namespace_match_folder = true:suggestion + +# C# files +[*.cs] +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# trim_trailing_whitespace = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# prefer var +csharp_style_var_for_built_in_types = true +csharp_style_var_when_type_is_apparent = true +csharp_style_var_elsewhere = true:suggestion + +# use language keywords instead of BCL types +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# name all constant fields using PascalCase +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_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# private static fields should have s_ prefix +dotnet_naming_rule.private_static_fields_should_have_prefix.severity = suggestion +dotnet_naming_rule.private_static_fields_should_have_prefix.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_should_have_prefix.style = private_static_prefix_style + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.required_modifiers = static +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private + +dotnet_naming_style.private_static_prefix_style.required_prefix = s_ +dotnet_naming_style.private_static_prefix_style.capitalization = camel_case + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# use accessibility modifiers +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion + +# Code style defaults +dotnet_sort_system_directives_first = true +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false +space_within_single_line_array_initializer_braces = true + +#Net Analyzer +dotnet_analyzer_diagnostic.category-Performance.severity = none #error - Uncomment when all violations are fixed. + +# CS0649: Field 'field' is never assigned to, and will always have its default value 'value' +dotnet_diagnostic.CS0649.severity = error + +# CS1591: Missing XML comment for publicly visible type or member +dotnet_diagnostic.CS1591.severity = suggestion + +# CS0162: Remove unreachable code +dotnet_diagnostic.CS0162.severity = error +# CA1018: Mark attributes with AttributeUsageAttribute +dotnet_diagnostic.CA1018.severity = error +# CA1304: Specify CultureInfo +dotnet_diagnostic.CA1304.severity = warning +# CA1802: Use literals where appropriate +dotnet_diagnostic.CA1802.severity = warning +# CA1813: Avoid unsealed attributes +dotnet_diagnostic.CA1813.severity = error +# CA1815: Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = warning +# CA1820: Test for empty strings using string length +dotnet_diagnostic.CA1820.severity = warning +# CA1821: Remove empty finalizers +dotnet_diagnostic.CA1821.severity = error +# CA1822: Mark members as static +dotnet_diagnostic.CA1822.severity = suggestion +dotnet_code_quality.CA1822.api_surface = private, internal +# CA1823: Avoid unused private fields +dotnet_diagnostic.CA1823.severity = error +# CA1825: Avoid zero-length array allocations +dotnet_diagnostic.CA1825.severity = warning +# CA1826: Use property instead of Linq Enumerable method +dotnet_diagnostic.CA1826.severity = suggestion +# CA1827: Do not use Count/LongCount when Any can be used +dotnet_diagnostic.CA1827.severity = warning +# CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used +dotnet_diagnostic.CA1828.severity = warning +# CA1829: Use Length/Count property instead of Enumerable.Count method +dotnet_diagnostic.CA1829.severity = warning +#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters +dotnet_diagnostic.CA1847.severity = warning +# CA1851: Possible multiple enumerations of IEnumerable collection +dotnet_diagnostic.CA1851.severity = warning +#CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method +dotnet_diagnostic.CA1854.severity = warning +#CA2211:Non-constant fields should not be visible +dotnet_diagnostic.CA2211.severity = error + +# Wrapping preferences +csharp_wrap_before_ternary_opsigns = false + +# Avalonia DevAnalyzer preferences +dotnet_diagnostic.AVADEV2001.severity = error + +# Avalonia PublicAnalyzer preferences +dotnet_diagnostic.AVP1000.severity = error +dotnet_diagnostic.AVP1001.severity = error +dotnet_diagnostic.AVP1002.severity = error +dotnet_diagnostic.AVP1010.severity = error +dotnet_diagnostic.AVP1011.severity = error +dotnet_diagnostic.AVP1012.severity = warning +dotnet_diagnostic.AVP1013.severity = error +dotnet_diagnostic.AVP1020.severity = error +dotnet_diagnostic.AVP1021.severity = error +dotnet_diagnostic.AVP1022.severity = error +dotnet_diagnostic.AVP1030.severity = error +dotnet_diagnostic.AVP1031.severity = error +dotnet_diagnostic.AVP1032.severity = error +dotnet_diagnostic.AVP1040.severity = error +dotnet_diagnostic.AVA2001.severity = error +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +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_prefer_system_threading_lock = true:suggestion +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent + +# Xaml files +[*.{xaml,axaml}] +indent_size = 2 +# DuplicateSetterError +avalonia_xaml_diagnostic.AVLN2203.severity = error +# StyleInMergedDictionaries +avalonia_xaml_diagnostic.AVLN2204.severity = error +# RequiredTemplatePartMissing +avalonia_xaml_diagnostic.AVLN2205.severity = error +# OptionalTemplatePartMissing +avalonia_xaml_diagnostic.AVLN2206.severity = info +# TemplatePartWrongType +avalonia_xaml_diagnostic.AVLN2207.severity = error +# ItemContainerInsideTemplate +avalonia_xaml_diagnostic.AVLN2208.severity = error +# Obsolete +avalonia_xaml_diagnostic.AVLN5001.severity = error + +# Xml project files +[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{xml,stylecop,resx,ruleset}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +[*.json] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd,bat}] +end_of_line = crlf diff --git a/App/.gitignore b/App/.gitignore new file mode 100644 index 0000000..4dd3751 --- /dev/null +++ b/App/.gitignore @@ -0,0 +1,453 @@ +## 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 + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# JetBrains Rider +.idea/ +*.sln.iml + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/App/Directory.Build.props b/App/Directory.Build.props new file mode 100644 index 0000000..4d9a552 --- /dev/null +++ b/App/Directory.Build.props @@ -0,0 +1,7 @@ + + + enable + 11.2.6 + 1.0.0 + + diff --git a/App/Harp.LoadCells.App.sln b/App/Harp.LoadCells.App.sln new file mode 100644 index 0000000..411e5e0 --- /dev/null +++ b/App/Harp.LoadCells.App.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{EB0D5F63-BC4F-49DC-B7B3-02E48F1B0C64}") = "Harp.LoadCells.App", "Harp.LoadCells.App\Harp.LoadCells.App.csproj", "{0E27295C-F856-47ED-B978-D4C4202A0F22}" +EndProject +Project("{EB0D5F63-BC4F-49DC-B7B3-02E48F1B0C64}") = "Harp.LoadCells.Design", "Harp.LoadCells.Design\Harp.LoadCells.Design.csproj", "{744754F8-E47C-44F9-A451-2DD93C0AF6E7}" +EndProject +Project("{EB0D5F63-BC4F-49DC-B7B3-02E48F1B0C64}") = "Harp.LoadCells", "..\Interface\Harp.LoadCells\Harp.LoadCells.csproj", "{DB9716D6-0BD7-41A1-BA65-51D820BBB89B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A4CB54F2-2C25-437E-B829-23DC9B47619A}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + Harp.LoadCells.nsi = Harp.LoadCells.nsi + README.md = README.md + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0E27295C-F856-47ED-B978-D4C4202A0F22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E27295C-F856-47ED-B978-D4C4202A0F22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E27295C-F856-47ED-B978-D4C4202A0F22}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E27295C-F856-47ED-B978-D4C4202A0F22}.Release|Any CPU.Build.0 = Release|Any CPU + {744754F8-E47C-44F9-A451-2DD93C0AF6E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {744754F8-E47C-44F9-A451-2DD93C0AF6E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {744754F8-E47C-44F9-A451-2DD93C0AF6E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {744754F8-E47C-44F9-A451-2DD93C0AF6E7}.Release|Any CPU.Build.0 = Release|Any CPU + {DB9716D6-0BD7-41A1-BA65-51D820BBB89B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB9716D6-0BD7-41A1-BA65-51D820BBB89B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB9716D6-0BD7-41A1-BA65-51D820BBB89B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB9716D6-0BD7-41A1-BA65-51D820BBB89B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/App/Harp.LoadCells.App/Harp.LoadCells.App.csproj b/App/Harp.LoadCells.App/Harp.LoadCells.App.csproj new file mode 100644 index 0000000..47614a4 --- /dev/null +++ b/App/Harp.LoadCells.App/Harp.LoadCells.App.csproj @@ -0,0 +1,52 @@ + + + WinExe + + net8.0 + enable + true + app.manifest + ..\bin\$(Configuration) + $(AppVersion) + ..\Harp.LoadCells.Design\Assets\cf-logo.ico + Harp.LoadCells.App + + + + Harp.LoadCells.App + Harp.LoadCells.App + org.fchampalimaud + $(Version) + $(Version) + AAPL + . + Harp.LoadCells.App + cf-logo.icns + NSApplication + true + Champalimaud Foundation + ..\Harp.LoadCells.Design\Assets\cf-logo.ico + ..\README.md + git + ..\bin\$(Configuration) + + + + + + + + + + + + + + + + + + + + diff --git a/App/Harp.LoadCells.App/Program.cs b/App/Harp.LoadCells.App/Program.cs new file mode 100644 index 0000000..8066c14 --- /dev/null +++ b/App/Harp.LoadCells.App/Program.cs @@ -0,0 +1,24 @@ +using System; + +using Avalonia; +using Avalonia.ReactiveUI; + +namespace Harp.LoadCells.App; + +class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace() + .UseReactiveUI(); +} diff --git a/App/Harp.LoadCells.App/Properties/launchSettings.json b/App/Harp.LoadCells.App/Properties/launchSettings.json new file mode 100644 index 0000000..33f0dab --- /dev/null +++ b/App/Harp.LoadCells.App/Properties/launchSettings.json @@ -0,0 +1,11 @@ +{ + "profiles": { + "Harp.LoadCells.App": { + "commandName": "Project" + }, + "WSL": { + "commandName": "WSL", + "distributionName": "" + } + } +} \ No newline at end of file diff --git a/App/Harp.LoadCells.App/app.manifest b/App/Harp.LoadCells.App/app.manifest new file mode 100644 index 0000000..e0ce8d0 --- /dev/null +++ b/App/Harp.LoadCells.App/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/App/Harp.LoadCells.Design/App.axaml b/App/Harp.LoadCells.Design/App.axaml new file mode 100644 index 0000000..d143415 --- /dev/null +++ b/App/Harp.LoadCells.Design/App.axaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/App/Harp.LoadCells.Design/App.axaml.cs b/App/Harp.LoadCells.Design/App.axaml.cs new file mode 100644 index 0000000..b3a391e --- /dev/null +++ b/App/Harp.LoadCells.Design/App.axaml.cs @@ -0,0 +1,44 @@ +using System; +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +using Harp.LoadCells.Design.ViewModels; +using Harp.LoadCells.Design.Views; + +namespace Harp.LoadCells.Design; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow + { + DataContext = new LoadCellsViewModel() + }; + } + else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) + { + singleViewPlatform.MainView = new LoadCellsView + { + DataContext = new LoadCellsViewModel() + }; + } + + base.OnFrameworkInitializationCompleted(); + } + + private void NativeMenuItem_OnClick(object sender, EventArgs e) + { + var about = new About() { DataContext = new AboutViewModel() }; + about.ShowDialog((Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime) + .MainWindow); + } +} diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo-small.bmp b/App/Harp.LoadCells.Design/Assets/cf-logo-small.bmp new file mode 100644 index 0000000..3d70185 Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf-logo-small.bmp differ diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo-white-lettering.png b/App/Harp.LoadCells.Design/Assets/cf-logo-white-lettering.png new file mode 100644 index 0000000..ca64284 Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf-logo-white-lettering.png differ diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo-white-lettering.svg b/App/Harp.LoadCells.Design/Assets/cf-logo-white-lettering.svg new file mode 100644 index 0000000..dc288cd --- /dev/null +++ b/App/Harp.LoadCells.Design/Assets/cf-logo-white-lettering.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo.icns b/App/Harp.LoadCells.Design/Assets/cf-logo.icns new file mode 100644 index 0000000..d50056d Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf-logo.icns differ diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo.ico b/App/Harp.LoadCells.Design/Assets/cf-logo.ico new file mode 100644 index 0000000..7f15636 Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf-logo.ico differ diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo.png b/App/Harp.LoadCells.Design/Assets/cf-logo.png new file mode 100644 index 0000000..007e30e Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf-logo.png differ diff --git a/App/Harp.LoadCells.Design/Assets/cf-logo.svg b/App/Harp.LoadCells.Design/Assets/cf-logo.svg new file mode 100644 index 0000000..08e8841 --- /dev/null +++ b/App/Harp.LoadCells.Design/Assets/cf-logo.svg @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo.png b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo.png new file mode 100644 index 0000000..f8afc50 Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo.png differ diff --git a/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo.svg b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo.svg new file mode 100644 index 0000000..1896536 --- /dev/null +++ b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo.svg @@ -0,0 +1,94 @@ + + + + + + + CF_hardware_sofware_logo + + + + + CF_hardware_sofware_logo + + + + + + + + + Hardware and + + + Software + + Platform + + + + diff --git a/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo_white_lettering.png b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo_white_lettering.png new file mode 100644 index 0000000..e201b4b Binary files /dev/null and b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo_white_lettering.png differ diff --git a/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo_white_lettering.svg b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo_white_lettering.svg new file mode 100644 index 0000000..c11b09a --- /dev/null +++ b/App/Harp.LoadCells.Design/Assets/cf_hardware_software_logo_white_lettering.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + Hardware and + Software + Platform + diff --git a/App/Harp.LoadCells.Design/Controls/ExtendedColorPicker.cs b/App/Harp.LoadCells.Design/Controls/ExtendedColorPicker.cs new file mode 100644 index 0000000..2f02938 --- /dev/null +++ b/App/Harp.LoadCells.Design/Controls/ExtendedColorPicker.cs @@ -0,0 +1,33 @@ +using System; +using System.Reflection; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; +using Avalonia.Interactivity; + +namespace Harp.LoadCells.Design.Controls; + +// NOTE: This is currently needed because there's an issue in the ColorPicker control where +// the SelectedIndex is not respected on load. +public class ExtendedColorPicker : ColorPicker +{ + protected override Type StyleKeyOverride => typeof(ColorPicker); + + private int _selectedTabIndex; + + protected override void OnApplyTemplate(TemplateAppliedEventArgs e) + { + // There might be a property set in xaml that get's overridden here + _selectedTabIndex = SelectedIndex; + base.OnApplyTemplate(e); + } + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + var type = typeof(ColorView); + if (type.GetField("_tabControl", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(this) is not TabControl tabControl) + return; + tabControl.SelectedIndex = _selectedTabIndex; + } +} diff --git a/App/Harp.LoadCells.Design/Controls/VisualStatus.axaml b/App/Harp.LoadCells.Design/Controls/VisualStatus.axaml new file mode 100644 index 0000000..a737035 --- /dev/null +++ b/App/Harp.LoadCells.Design/Controls/VisualStatus.axaml @@ -0,0 +1,11 @@ + + + + + + diff --git a/App/Harp.LoadCells.Design/Controls/VisualStatus.axaml.cs b/App/Harp.LoadCells.Design/Controls/VisualStatus.axaml.cs new file mode 100644 index 0000000..1035b49 --- /dev/null +++ b/App/Harp.LoadCells.Design/Controls/VisualStatus.axaml.cs @@ -0,0 +1,21 @@ +using Avalonia; +using Avalonia.Controls; + +namespace Harp.LoadCells.Design.Controls; + +public partial class VisualStatus : ContentControl +{ + public static readonly StyledProperty StatusProperty = + AvaloniaProperty.Register(nameof(Status), null); + + public bool? Status + { + get => GetValue(StatusProperty); + set => SetValue(StatusProperty, value); + } + + public VisualStatus() + { + InitializeComponent(); + } +} diff --git a/App/Harp.LoadCells.Design/Controls/WriteMessagesControl.axaml b/App/Harp.LoadCells.Design/Controls/WriteMessagesControl.axaml new file mode 100644 index 0000000..fd34d73 --- /dev/null +++ b/App/Harp.LoadCells.Design/Controls/WriteMessagesControl.axaml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +