Skip to content

Commit 40bed83

Browse files
committed
Add MIT License and update AVnet Core Framework documentation
1 parent 1866b4f commit 40bed83

File tree

3 files changed

+180
-4
lines changed

3 files changed

+180
-4
lines changed

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Mike Jobson
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+151-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,152 @@
1-
# AVnetCore
1+
# AVnet Core Framework
22

3-
Documentation coming soon!
4-
:)
3+
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/uxav/AVnetCore/test.yml?branch=main&style=flat&logo=github&label=status)](https://github.com/uxav/AVnetCore/actions)
4+
[![GitHub Issues](https://img.shields.io/github/issues/uxav/AVnetCore?style=flat&logo=github)](https://github.com/uxav/AVnetCore/issues)
5+
[![Pull Requests](https://img.shields.io/github/issues-pr/uxav/AVnetCore?style=flat&logo=github)](https://github.com/uxav/AVnetCore/pulls)
6+
[![NuGet Version](https://img.shields.io/nuget/v/UXAV.AVnet.Core?style=flat&logo=nuget)](https://www.nuget.org/packages/UXAV.AVnet.Core)
7+
[![NuGet Downloads](https://img.shields.io/nuget/dt/UXAV.AVnet.Core?style=flat&logo=nuget)](https://www.nuget.org/packages/UXAV.AVnet.Core)
8+
[![GitHub License](https://img.shields.io/github/license/uxav/AVnetCore?style=flat)](LICENSE)
9+
10+
11+
12+
A Crestron SimplSharp Pro framework for Crestron control system programs
13+
14+
## Links
15+
16+
GitHub Repository: [AVnetCore](https://github.com/uxav/AVnetCore)
17+
18+
NuGet Package: [UXAV.AVnet.Core](https://www.nuget.org/packages/UXAV.AVnet.Core/)
19+
20+
## Usage
21+
22+
To use this test library in your project, follow these steps:
23+
24+
1. Install the package via NuGet. You can use the following command in the Package Manager Console:
25+
26+
```
27+
dotnet add [<PROJECT>] package UXAV.AVnet.Core
28+
```
29+
30+
2. Import the library classes in your code file(s):
31+
32+
```csharp
33+
using UXAV.AVnet.Core.Models;
34+
using UXAV.AVnet.Core.Models.Diagnostics;
35+
using UXAV.Logging;
36+
```
37+
38+
3. Create a class of SystemBase:
39+
```csharp
40+
public class MySystem : SystemBase
41+
{
42+
public MySystem(CrestronControlSystem controlSystem) : base(controlSystem)
43+
{
44+
// create all your instance logic here and any instances of rooms, devices or
45+
}
46+
47+
protected override void AppShouldRunUpgradeScripts()
48+
{
49+
// called when the program starts with a new version number
50+
}
51+
52+
protected override void OnProgramStatusEventHandler(eProgramStatusEventType eventType)
53+
{
54+
if (eventType == eProgramStatusEventType.Stopping)
55+
{
56+
// anything you need to save, disconnect or stop... the program is stopping
57+
}
58+
}
59+
60+
protected override IEnumerable<DiagnosticMessage> GenerateDiagnosticMessages()
61+
{
62+
return new DiagnosticMessage[]
63+
{
64+
// add any diagnostic messages here,
65+
// this is called for when the system needs to update the
66+
// status of stuff or the dashboard app requests it
67+
};
68+
}
69+
70+
protected override void SystemShouldAddItemsToInitialize(Action<IInitializable> addItem)
71+
{
72+
addItem(myDeviceWithInitialization);
73+
addItem(myOtherDeviceWithInitialization);
74+
}
75+
76+
protected override void WebScriptingHandlersShouldRegister()
77+
{
78+
// any web scripting handlers for API's can and should register here (see docs)
79+
}
80+
}
81+
```
82+
83+
4. Load and Initialize your main instance of system
84+
```csharp
85+
public class ControlSystem : CrestronControlSystem
86+
{
87+
private readonly SystemBase _mySystem;
88+
89+
public ControlSystem()
90+
{
91+
try
92+
{
93+
// create your instance of MySystem
94+
_mySystem = new MySystem(this);
95+
}
96+
catch (Exception e)
97+
{
98+
Logger.Error(e);
99+
}
100+
}
101+
102+
public override void InitializeSystem()
103+
{
104+
try
105+
{
106+
// start the initializing of MySystem
107+
_mySystem?.Initialize();
108+
}
109+
catch (Exception e)
110+
{
111+
Logger.Error(e);
112+
}
113+
}
114+
}
115+
```
116+
117+
## Dependencies
118+
119+
120+
121+
## Release Notes
122+
123+
### v2.0.0
124+
125+
- Reconfigured workspace to new style SDK format and added support for .NET 6.0
126+
- MidnightNotifier removed completely, use a [CronJob](UXAV.AVnet.Core/CronJobs.cs)
127+
-
128+
129+
## Documentation
130+
131+
TBC
132+
133+
## Contributing
134+
135+
Contributions are welcome! If you would like to contribute to this project, please follow these guidelines:
136+
137+
1. Fork the repository.
138+
2. Create a new branch for your feature or bug fix.
139+
3. Make your changes and commit them.
140+
4. Push your changes to your forked repository.
141+
5. Submit a pull request to the main repository.
142+
143+
Please ensure that your code follows the project's coding conventions and includes appropriate tests.
144+
145+
- For feature branches use the name `feature/feature-name`
146+
- Version numbers are checked against existing tags and fail CI on match
147+
148+
Thank you for your interest in contributing to this project!
149+
150+
## License
151+
152+
This project is licensed under the [MIT License](LICENSE).

UXAV.AVnet.Core/UXAV.AVnet.Core.csproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<AssemblyDescription>A Crestron Simpl# Pro Framework</AssemblyDescription>
1313
<RepositoryUrl>https://github.com/uxav/AVnetCore</RepositoryUrl>
1414
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
15-
<Version>2.0.0-beta-3</Version>
15+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
16+
<PackageReadmeFile>README.md</PackageReadmeFile>
17+
<Version>2.0.0-beta</Version>
1618
</PropertyGroup>
1719

1820
<ItemGroup>
@@ -32,4 +34,9 @@
3234
<PackageReference Include="UXAV.Logging" Version="2.0.0-rc-2"/>
3335
<PackageReference Include="WebSocketSharp-netstandard" Version="1.0.1"/>
3436
</ItemGroup>
37+
38+
<ItemGroup>
39+
<None Include="..\README.md" Pack="true" PackagePath="README.md"/>
40+
<None Include="..\LICENSE.md" Pack="true" PackagePath="LICENSE.md"/>
41+
</ItemGroup>
3542
</Project>

0 commit comments

Comments
 (0)