Skip to content
This repository was archived by the owner on Jan 11, 2021. It is now read-only.

Commit 19220c7

Browse files
committed
Version 1.0
Added icons. Updated DmxDevice classes. Adjusted Tab's. Moved files. Added JSON file to define devices outside of the program. Finished the "Add Device" window. And more...
1 parent d515425 commit 19220c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+11698
-332
lines changed

DMX/ClassDiagram1.cd

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<ClassDiagram MajorVersion="1" MinorVersion="1">
33
<Class Name="DMX.Entities.LedMovinghead">
4-
<Position X="0.5" Y="4" Width="2" />
4+
<Position X="0.5" Y="5" Width="2" />
55
<TypeIdentifier>
6-
<HashCode>AAAAAAAAAAAIgoABIAOAACCAgAAIAAABABwQgQAgEAA=</HashCode>
6+
<HashCode>AACAAAAAAAAIgoABIgOAACCAgAAIAAABABQggQAgAAA=</HashCode>
77
<FileName>Entities\LedMovinghead.cs</FileName>
88
</TypeIdentifier>
99
<Lollipop Position="0.2" />
1010
</Class>
1111
<Class Name="DMX.Entities.LedSpot">
12-
<Position X="10.5" Y="4" Width="2" />
12+
<Position X="10.5" Y="5" Width="2" />
1313
<TypeIdentifier>
14-
<HashCode>AAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAABgQAAAAEAA=</HashCode>
14+
<HashCode>AAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAABAAAAAAAAA=</HashCode>
1515
<FileName>Entities\LedSpot.cs</FileName>
1616
</TypeIdentifier>
1717
</Class>
1818
<Class Name="DMX.Entities.LedPanel">
19-
<Position X="8" Y="4" Width="2" />
19+
<Position X="8" Y="5" Width="2" />
2020
<TypeIdentifier>
21-
<HashCode>AAAAAAAAAABAAAAAAAAIAAAAAAAAAAAAABgQAAAAEAA=</HashCode>
21+
<HashCode>AAAAAAAAAABAAAAAAAAIAAAAAAAAAAAAABAAAAAAAAA=</HashCode>
2222
<FileName>Entities\LedPanel.cs</FileName>
2323
</TypeIdentifier>
2424
</Class>
2525
<Class Name="DMX.Entities.LaserMovinghead">
26-
<Position X="3" Y="4" Width="2" />
26+
<Position X="3" Y="5" Width="2" />
2727
<TypeIdentifier>
28-
<HashCode>AAAAAAAAAAAAgoABIAOAAACAgAAAAAABABgQAQAgEAA=</HashCode>
28+
<HashCode>AAAAAAAAAAAAgoABIAOAAACAgAAAAAABABAAAQAgAAA=</HashCode>
2929
<FileName>Entities\LaserMovinghead.cs</FileName>
3030
</TypeIdentifier>
3131
<Lollipop Position="0.2" />
3232
</Class>
3333
<Class Name="DMX.Entities.LedScanner">
34-
<Position X="5.5" Y="4" Width="2" />
34+
<Position X="5.5" Y="5" Width="2" />
3535
<TypeIdentifier>
36-
<HashCode>IAAgAAAEAACAIAAAAAMIAAAAAAAAAAAAABgQAAAgEAA=</HashCode>
36+
<HashCode>IAAgAAAEAACAIAAAAAMIAAAAAAAAAAAAABAAAAAgAAA=</HashCode>
3737
<FileName>Entities\LedScanner.cs</FileName>
3838
</TypeIdentifier>
3939
</Class>
4040
<Class Name="DMX.DmxDevice">
41-
<Position X="0.5" Y="12" Width="2" />
41+
<Position X="13" Y="5" Width="2" />
4242
<TypeIdentifier>
43-
<HashCode>IAAAAAAAAAAAAAAAAAAAAAYAAAAmAAAAAAAAAAAAAAA=</HashCode>
44-
<FileName>DmxDevice.cs</FileName>
43+
<HashCode>IAAAAAAAAAAAAAAAAAAAAAYAAAAmAAAAAAAQAAAAEAA=</HashCode>
44+
<FileName>Entities\DmxDevice.cs</FileName>
4545
</TypeIdentifier>
4646
</Class>
4747
<Class Name="DMX.Tabs.TabLedMovinghead">
4848
<Position X="3" Y="0.5" Width="2.25" />
4949
<TypeIdentifier>
50-
<HashCode>ABAAAgAAAAAAAEAAAAAAAAAIAAACAAAAACAIAAAAAAA=</HashCode>
50+
<HashCode>ABAEBBAAAAAAAEQAAAAAIAAIAAACACQAAAAIAAAAAAA=</HashCode>
5151
<FileName>Tabs\TabLedMovinghead.xaml.cs</FileName>
5252
</TypeIdentifier>
5353
<Lollipop Position="0.2" />
5454
</Class>
5555
<Class Name="DMX.Tabs.TabLaserMovinghead">
5656
<Position X="0.5" Y="0.5" Width="2.25" />
5757
<TypeIdentifier>
58-
<HashCode>ABAAAAAAAAAAAAAAAAAAAAAKAAACAAAAAAAIAAAAAAA=</HashCode>
58+
<HashCode>ABAAAAAAAAAAAAQEAAAAAAAIAAACAAQAAAAIAAAAAAA=</HashCode>
5959
<FileName>Tabs\TabLaserMovinghead.xaml.cs</FileName>
6060
</TypeIdentifier>
6161
<Lollipop Position="0.2" />
@@ -71,7 +71,7 @@
7171
<Class Name="DMX.Tabs.TabLedScanner" BaseTypeListCollapsed="true">
7272
<Position X="5.5" Y="0.5" Width="2.25" />
7373
<TypeIdentifier>
74-
<HashCode>AAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAA=</HashCode>
74+
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAI=</HashCode>
7575
<FileName>Tabs\TabLedScanner.xaml.cs</FileName>
7676
</TypeIdentifier>
7777
<Lollipop Position="0.2" Collapsed="true" />
@@ -84,8 +84,15 @@
8484
</TypeIdentifier>
8585
<Lollipop Position="0.2" Collapsed="true" />
8686
</Class>
87+
<Interface Name="DMX.Tabs.IDmxDeviceTabItem">
88+
<Position X="13" Y="0.5" Width="2.25" />
89+
<TypeIdentifier>
90+
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
91+
<FileName>Tabs\IDmxDeviceTabItem.cs</FileName>
92+
</TypeIdentifier>
93+
</Interface>
8794
<Enum Name="DMX.Entities.Enumerations.DmxDeviceTypes">
88-
<Position X="3" Y="12" Width="1.75" />
95+
<Position X="15.75" Y="5" Width="1.75" />
8996
<TypeIdentifier>
9097
<HashCode>AAAAAAAAAgAAAAAAAAAAAAABAAAAAIAAEAAAAAEQABA=</HashCode>
9198
<FileName>Entities\Enumerations\DmxDeviceTypes.cs</FileName>

DMX/DMX.csproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
</ItemGroup>
5151
<ItemGroup>
5252
<Compile Include="DmxDevice.cs" />
53+
<Compile Include="JsonDmxDeviceObject.cs" />
5354
<Compile Include="Entities\LaserMovinghead.cs" />
5455
<Compile Include="Entities\LedScanner.cs" />
5556
<Compile Include="Entities\Enumerations\DmxDeviceTypes.cs" />
@@ -156,19 +157,19 @@
156157
<Resource Include="Resources\Images\Gobo Open.PNG">
157158
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
158159
</Resource>
159-
<Resource Include="Resources\Images\LedLaser.png">
160+
<Resource Include="Resources\Images\Ayra_LedLaserMovinghead.png">
160161
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
161162
</Resource>
162-
<Resource Include="Resources\Images\LedMovinghead.png">
163+
<Resource Include="Resources\Images\Skytec_LedMovinghead.png">
163164
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
164165
</Resource>
165-
<Resource Include="Resources\Images\LedPanel.png">
166+
<Resource Include="Resources\Images\EuroLite_LedPanel.png">
166167
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
167168
</Resource>
168-
<Resource Include="Resources\Images\LedPar56.png">
169+
<Resource Include="Resources\Images\Showtec_LedSpot.png">
169170
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
170171
</Resource>
171-
<Resource Include="Resources\Images\LedScanner.png">
172+
<Resource Include="Resources\Images\Ayra_LedScanner.png">
172173
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
173174
</Resource>
174175
</ItemGroup>

DMX/DmxDevice.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
using DMX.Entities.Enumerations;
22
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
73

84
namespace DMX
95
{
10-
public abstract class DmxDevice
6+
public class DmxDevice
117
{
12-
public DmxDevice(string name, int startAddress, DmxDeviceTypes deviceType, byte[] channels)
8+
public DmxDevice(string name, int startAddress, DmxDeviceTypes deviceType, int numberOfChannels)
139
{
1410
Name = name;
1511
StartAddress = startAddress;
1612
DeviceType = deviceType;
17-
Channels = channels;
13+
Channels = new byte[numberOfChannels];
14+
}
15+
16+
public DmxDevice(JsonDmxDeviceObject jsonDmxDeviceObject)
17+
{
18+
Name = jsonDmxDeviceObject.Name;
19+
StartAddress = jsonDmxDeviceObject.StartAddress;
20+
DeviceType = Enum.IsDefined(typeof(DmxDeviceTypes), jsonDmxDeviceObject.DeviceType) ? (DmxDeviceTypes)jsonDmxDeviceObject.DeviceType : DmxDeviceTypes.Unknown;
21+
Channels = new byte[jsonDmxDeviceObject.NumberOfChannels];
1822
}
1923

2024
private readonly string name;
21-
public string Name { get; }
25+
public virtual string Name { get; }
2226

2327
private readonly int startAddress;
24-
public int StartAddress { get; }
28+
public virtual int StartAddress { get; }
2529

2630
private readonly DmxDeviceTypes deviceType;
27-
public DmxDeviceTypes DeviceType { get; }
31+
public virtual DmxDeviceTypes DeviceType { get; }
2832

29-
private byte[] channels;
30-
public byte[] Channels { get; private set; }
33+
private readonly byte[] channels;
34+
public virtual byte[] Channels { get; private set; }
3135
}
3236
}

DMX/Entities/Enumerations/DmxDeviceTypes.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace DMX.Entities.Enumerations
1+
namespace DMX.Entities.Enumerations
82
{
93
/// <summary>
104
/// Skytec_Mini_Spot_Led_Movinghead,

DMX/Entities/LaserMovinghead.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class LaserMovinghead : DmxDevice, INotifyPropertyChanged
1111
const double DEGREES_PER_BYTE = 1 / 65535.0;
1212

1313
public LaserMovinghead(string name, int startAddress, DmxDeviceTypes deviceType)
14-
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
14+
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
1515
{ }
1616

1717
// CH1 + CH2
@@ -65,8 +65,7 @@ public string ShutterStatus
6565
public event PropertyChangedEventHandler PropertyChanged;
6666
protected void OnPropertyChanged(string name)
6767
{
68-
if (PropertyChanged != null)
69-
PropertyChanged(this, new PropertyChangedEventArgs(name));
68+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
7069
}
7170

7271
// CH1 + CH2

DMX/Entities/LedMovinghead.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class LedMovinghead : DmxDevice, INotifyPropertyChanged
1111
const double DEGREES_PER_BYTE = 1 / 65535.0;
1212

1313
public LedMovinghead(string name, int startAddress, DmxDeviceTypes deviceType)
14-
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
14+
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
1515
{ }
1616

1717
// CH1 + CH2
@@ -89,8 +89,7 @@ private set
8989
public event PropertyChangedEventHandler PropertyChanged;
9090
protected void OnPropertyChanged(string name)
9191
{
92-
if (PropertyChanged != null)
93-
PropertyChanged(this, new PropertyChangedEventArgs(name));
92+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
9493
}
9594

9695
// CH1 + CH2

DMX/Entities/LedPanel.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ public class LedPanel : DmxDevice
1212
const int NUMBER_OF_CHANNELS = 48;
1313

1414
public LedPanel(string name, int startAddress, DmxDeviceTypes deviceType)
15-
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
15+
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
1616
{ }
1717

18-
public void UpdateChannel(int channelNumber, byte value)
19-
{
20-
if (channelNumber >= 0 && channelNumber < Channels.Count())
21-
Channels[channelNumber] = value;
22-
}
23-
2418
public byte[] GetLedRGB(int ledNumber)
2519
{
2620
return new byte[3] { Channels[3 * ledNumber], Channels[(3 * ledNumber) + 1], Channels[(3 * ledNumber) + 2] };

DMX/Entities/LedScanner.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,23 @@ public class LedScanner : DmxDevice
1515
const double DEGREES_PER_BYTE = 1 / 65535.0;
1616

1717
public LedScanner(string name, int startAddress, DmxDeviceTypes deviceType)
18-
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
18+
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
1919
{ }
2020

21-
public void UpdateChannel(int channelNumber, byte value)
22-
{
23-
if (channelNumber >= 0 && channelNumber < Channels.Count())
24-
Channels[channelNumber] = value;
25-
}
26-
2721
// CH1 + CH2
2822
public string GetRotationX()
2923
{
30-
return string.Format("X: {0:F2}°", MAX_X_ROTATION * ((Channels[0] << 8) + Channels[1]) * (double)DEGREES_PER_BYTE);
24+
return string.Format("{0:F2}°", MAX_X_ROTATION * (((int)Channels[0] << 8) + (int)Channels[1]) * (double)DEGREES_PER_BYTE);
3125
}
3226
// CH3 + CH4
3327
public string GetRotationY()
3428
{
35-
return string.Format("Y: {0:F2}°", MAX_Y_ROTATION * ((Channels[2] << 8) + Channels[3]) * (double)DEGREES_PER_BYTE);
29+
return string.Format("{0:F2}°", MAX_Y_ROTATION * (((int)Channels[2] << 8) + (int)Channels[3]) * (double)DEGREES_PER_BYTE);
3630
}
3731
// CH5
3832
public string GetAxisSpeed()
3933
{
40-
return string.Format("Speed: {0:F2}%", 100 * (1 - (Channels[4] / (double)255))); // 100->0%
34+
return string.Format("{0:F2}%", 100 * (1 - (Channels[4] / (double)255))); // 100->0%
4135
}
4236
// CH6
4337
public string GetDimmerStatus()

DMX/Entities/LedSpot.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ public class LedSpot : DmxDevice
1212
const int NUMBER_OF_CHANNELS = 6;
1313

1414
public LedSpot(string name, int startAddress, DmxDeviceTypes deviceType)
15-
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
15+
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
1616
{ }
1717

18-
public void UpdateChannel(int channelNumber, byte value)
19-
{
20-
if (channelNumber >= 0 && channelNumber < Channels.Count())
21-
Channels[channelNumber] = value;
22-
}
23-
2418
//// CH1 + CH2 + CH3
2519
//public byte[] GetRGB()
2620
//{

DMX/JsonDmxDeviceObject.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace DMX
2+
{
3+
public class JsonDmxDeviceObject
4+
{
5+
public JsonDmxDeviceObject()
6+
{ }
7+
8+
private string name;
9+
public string Name { get; set; }
10+
11+
private int startAddress;
12+
public int StartAddress { get; set; }
13+
14+
private int deviceType;
15+
public int DeviceType { get; set; }
16+
17+
private int numberOfChannels;
18+
public int NumberOfChannels { get; set; }
19+
}
20+
}

0 commit comments

Comments
 (0)