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

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
Fishezzz committed May 20, 2019
1 parent d515425 commit 19220c7
Show file tree
Hide file tree
Showing 53 changed files with 11,698 additions and 332 deletions.
41 changes: 24 additions & 17 deletions DMX/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="DMX.Entities.LedMovinghead">
<Position X="0.5" Y="4" Width="2" />
<Position X="0.5" Y="5" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAIgoABIAOAACCAgAAIAAABABwQgQAgEAA=</HashCode>
<HashCode>AACAAAAAAAAIgoABIgOAACCAgAAIAAABABQggQAgAAA=</HashCode>
<FileName>Entities\LedMovinghead.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="DMX.Entities.LedSpot">
<Position X="10.5" Y="4" Width="2" />
<Position X="10.5" Y="5" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAABgQAAAAEAA=</HashCode>
<HashCode>AAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAABAAAAAAAAA=</HashCode>
<FileName>Entities\LedSpot.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DMX.Entities.LedPanel">
<Position X="8" Y="4" Width="2" />
<Position X="8" Y="5" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAAAABAAAAAAAAIAAAAAAAAAAAAABgQAAAAEAA=</HashCode>
<HashCode>AAAAAAAAAABAAAAAAAAIAAAAAAAAAAAAABAAAAAAAAA=</HashCode>
<FileName>Entities\LedPanel.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DMX.Entities.LaserMovinghead">
<Position X="3" Y="4" Width="2" />
<Position X="3" Y="5" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAgoABIAOAAACAgAAAAAABABgQAQAgEAA=</HashCode>
<HashCode>AAAAAAAAAAAAgoABIAOAAACAgAAAAAABABAAAQAgAAA=</HashCode>
<FileName>Entities\LaserMovinghead.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="DMX.Entities.LedScanner">
<Position X="5.5" Y="4" Width="2" />
<Position X="5.5" Y="5" Width="2" />
<TypeIdentifier>
<HashCode>IAAgAAAEAACAIAAAAAMIAAAAAAAAAAAAABgQAAAgEAA=</HashCode>
<HashCode>IAAgAAAEAACAIAAAAAMIAAAAAAAAAAAAABAAAAAgAAA=</HashCode>
<FileName>Entities\LedScanner.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DMX.DmxDevice">
<Position X="0.5" Y="12" Width="2" />
<Position X="13" Y="5" Width="2" />
<TypeIdentifier>
<HashCode>IAAAAAAAAAAAAAAAAAAAAAYAAAAmAAAAAAAAAAAAAAA=</HashCode>
<FileName>DmxDevice.cs</FileName>
<HashCode>IAAAAAAAAAAAAAAAAAAAAAYAAAAmAAAAAAAQAAAAEAA=</HashCode>
<FileName>Entities\DmxDevice.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DMX.Tabs.TabLedMovinghead">
<Position X="3" Y="0.5" Width="2.25" />
<TypeIdentifier>
<HashCode>ABAAAgAAAAAAAEAAAAAAAAAIAAACAAAAACAIAAAAAAA=</HashCode>
<HashCode>ABAEBBAAAAAAAEQAAAAAIAAIAAACACQAAAAIAAAAAAA=</HashCode>
<FileName>Tabs\TabLedMovinghead.xaml.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="DMX.Tabs.TabLaserMovinghead">
<Position X="0.5" Y="0.5" Width="2.25" />
<TypeIdentifier>
<HashCode>ABAAAAAAAAAAAAAAAAAAAAAKAAACAAAAAAAIAAAAAAA=</HashCode>
<HashCode>ABAAAAAAAAAAAAQEAAAAAAAIAAACAAQAAAAIAAAAAAA=</HashCode>
<FileName>Tabs\TabLaserMovinghead.xaml.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
Expand All @@ -71,7 +71,7 @@
<Class Name="DMX.Tabs.TabLedScanner" BaseTypeListCollapsed="true">
<Position X="5.5" Y="0.5" Width="2.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAA=</HashCode>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAI=</HashCode>
<FileName>Tabs\TabLedScanner.xaml.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
Expand All @@ -84,8 +84,15 @@
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Interface Name="DMX.Tabs.IDmxDeviceTabItem">
<Position X="13" Y="0.5" Width="2.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Tabs\IDmxDeviceTabItem.cs</FileName>
</TypeIdentifier>
</Interface>
<Enum Name="DMX.Entities.Enumerations.DmxDeviceTypes">
<Position X="3" Y="12" Width="1.75" />
<Position X="15.75" Y="5" Width="1.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAgAAAAAAAAAAAAABAAAAAIAAEAAAAAEQABA=</HashCode>
<FileName>Entities\Enumerations\DmxDeviceTypes.cs</FileName>
Expand Down
11 changes: 6 additions & 5 deletions DMX/DMX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="DmxDevice.cs" />
<Compile Include="JsonDmxDeviceObject.cs" />
<Compile Include="Entities\LaserMovinghead.cs" />
<Compile Include="Entities\LedScanner.cs" />
<Compile Include="Entities\Enumerations\DmxDeviceTypes.cs" />
Expand Down Expand Up @@ -156,19 +157,19 @@
<Resource Include="Resources\Images\Gobo Open.PNG">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\LedLaser.png">
<Resource Include="Resources\Images\Ayra_LedLaserMovinghead.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\LedMovinghead.png">
<Resource Include="Resources\Images\Skytec_LedMovinghead.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\LedPanel.png">
<Resource Include="Resources\Images\EuroLite_LedPanel.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\LedPar56.png">
<Resource Include="Resources\Images\Showtec_LedSpot.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\LedScanner.png">
<Resource Include="Resources\Images\Ayra_LedScanner.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>
Expand Down
28 changes: 16 additions & 12 deletions DMX/DmxDevice.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
using DMX.Entities.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DMX
{
public abstract class DmxDevice
public class DmxDevice
{
public DmxDevice(string name, int startAddress, DmxDeviceTypes deviceType, byte[] channels)
public DmxDevice(string name, int startAddress, DmxDeviceTypes deviceType, int numberOfChannels)
{
Name = name;
StartAddress = startAddress;
DeviceType = deviceType;
Channels = channels;
Channels = new byte[numberOfChannels];
}

public DmxDevice(JsonDmxDeviceObject jsonDmxDeviceObject)
{
Name = jsonDmxDeviceObject.Name;
StartAddress = jsonDmxDeviceObject.StartAddress;
DeviceType = Enum.IsDefined(typeof(DmxDeviceTypes), jsonDmxDeviceObject.DeviceType) ? (DmxDeviceTypes)jsonDmxDeviceObject.DeviceType : DmxDeviceTypes.Unknown;
Channels = new byte[jsonDmxDeviceObject.NumberOfChannels];
}

private readonly string name;
public string Name { get; }
public virtual string Name { get; }

private readonly int startAddress;
public int StartAddress { get; }
public virtual int StartAddress { get; }

private readonly DmxDeviceTypes deviceType;
public DmxDeviceTypes DeviceType { get; }
public virtual DmxDeviceTypes DeviceType { get; }

private byte[] channels;
public byte[] Channels { get; private set; }
private readonly byte[] channels;
public virtual byte[] Channels { get; private set; }
}
}
8 changes: 1 addition & 7 deletions DMX/Entities/Enumerations/DmxDeviceTypes.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DMX.Entities.Enumerations
namespace DMX.Entities.Enumerations
{
/// <summary>
/// Skytec_Mini_Spot_Led_Movinghead,
Expand Down
5 changes: 2 additions & 3 deletions DMX/Entities/LaserMovinghead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class LaserMovinghead : DmxDevice, INotifyPropertyChanged
const double DEGREES_PER_BYTE = 1 / 65535.0;

public LaserMovinghead(string name, int startAddress, DmxDeviceTypes deviceType)
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
{ }

// CH1 + CH2
Expand Down Expand Up @@ -65,8 +65,7 @@ public string ShutterStatus
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}

// CH1 + CH2
Expand Down
5 changes: 2 additions & 3 deletions DMX/Entities/LedMovinghead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class LedMovinghead : DmxDevice, INotifyPropertyChanged
const double DEGREES_PER_BYTE = 1 / 65535.0;

public LedMovinghead(string name, int startAddress, DmxDeviceTypes deviceType)
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
{ }

// CH1 + CH2
Expand Down Expand Up @@ -89,8 +89,7 @@ private set
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}

// CH1 + CH2
Expand Down
8 changes: 1 addition & 7 deletions DMX/Entities/LedPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ public class LedPanel : DmxDevice
const int NUMBER_OF_CHANNELS = 48;

public LedPanel(string name, int startAddress, DmxDeviceTypes deviceType)
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
{ }

public void UpdateChannel(int channelNumber, byte value)
{
if (channelNumber >= 0 && channelNumber < Channels.Count())
Channels[channelNumber] = value;
}

public byte[] GetLedRGB(int ledNumber)
{
return new byte[3] { Channels[3 * ledNumber], Channels[(3 * ledNumber) + 1], Channels[(3 * ledNumber) + 2] };
Expand Down
14 changes: 4 additions & 10 deletions DMX/Entities/LedScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,23 @@ public class LedScanner : DmxDevice
const double DEGREES_PER_BYTE = 1 / 65535.0;

public LedScanner(string name, int startAddress, DmxDeviceTypes deviceType)
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
{ }

public void UpdateChannel(int channelNumber, byte value)
{
if (channelNumber >= 0 && channelNumber < Channels.Count())
Channels[channelNumber] = value;
}

// CH1 + CH2
public string GetRotationX()
{
return string.Format("X: {0:F2}°", MAX_X_ROTATION * ((Channels[0] << 8) + Channels[1]) * (double)DEGREES_PER_BYTE);
return string.Format("{0:F2}°", MAX_X_ROTATION * (((int)Channels[0] << 8) + (int)Channels[1]) * (double)DEGREES_PER_BYTE);
}
// CH3 + CH4
public string GetRotationY()
{
return string.Format("Y: {0:F2}°", MAX_Y_ROTATION * ((Channels[2] << 8) + Channels[3]) * (double)DEGREES_PER_BYTE);
return string.Format("{0:F2}°", MAX_Y_ROTATION * (((int)Channels[2] << 8) + (int)Channels[3]) * (double)DEGREES_PER_BYTE);
}
// CH5
public string GetAxisSpeed()
{
return string.Format("Speed: {0:F2}%", 100 * (1 - (Channels[4] / (double)255))); // 100->0%
return string.Format("{0:F2}%", 100 * (1 - (Channels[4] / (double)255))); // 100->0%
}
// CH6
public string GetDimmerStatus()
Expand Down
8 changes: 1 addition & 7 deletions DMX/Entities/LedSpot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ public class LedSpot : DmxDevice
const int NUMBER_OF_CHANNELS = 6;

public LedSpot(string name, int startAddress, DmxDeviceTypes deviceType)
: base(name, startAddress, deviceType, new byte[NUMBER_OF_CHANNELS])
: base(name, startAddress, deviceType, NUMBER_OF_CHANNELS)
{ }

public void UpdateChannel(int channelNumber, byte value)
{
if (channelNumber >= 0 && channelNumber < Channels.Count())
Channels[channelNumber] = value;
}

//// CH1 + CH2 + CH3
//public byte[] GetRGB()
//{
Expand Down
20 changes: 20 additions & 0 deletions DMX/JsonDmxDeviceObject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace DMX
{
public class JsonDmxDeviceObject
{
public JsonDmxDeviceObject()
{ }

private string name;
public string Name { get; set; }

private int startAddress;
public int StartAddress { get; set; }

private int deviceType;
public int DeviceType { get; set; }

private int numberOfChannels;
public int NumberOfChannels { get; set; }
}
}
Loading

0 comments on commit 19220c7

Please sign in to comment.