Skip to content

Commit

Permalink
Set First Universe in examples to 0
Browse files Browse the repository at this point in the history
And remove Limitation on 2.x.x.x in Example
Because users not read Code Properly
  • Loading branch information
patrick-dmxc committed Mar 28, 2024
1 parent 3605433 commit 07710ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ControlerRDMExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
{
try
{
var outputConfig = new PortConfig((byte)i, i, true, false) { PortNumber = (byte)i, Type = EPortType.OutputFromArtNet, GoodOutput = EGoodOutput.ContiniuousOutput | EGoodOutput.DataTransmitted, };
var outputConfig = new PortConfig((byte)i, new PortAddress((ushort)(i - 1)), true, false) { PortNumber = (byte)i, Type = EPortType.OutputFromArtNet, GoodOutput = EGoodOutput.ContiniuousOutput | EGoodOutput.DataTransmitted, };
outputConfig.AddAdditionalRdmUIDs(generateUIDs());
controllerInstance.AddPortConfig(outputConfig);
controllerInstance.AddPortConfig(new PortConfig((byte)(i+4), i, false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet });
controllerInstance.AddPortConfig(new PortConfig((byte)(i+4), new PortAddress((ushort)(i - 1)), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet });
}
catch (Exception ex)

Check warning on line 37 in ControlerRDMExample/Program.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used
{
Expand Down
6 changes: 3 additions & 3 deletions Examples/ControllerExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY);

//Set Networkinterfaces
var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));
//var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
//ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));

// Create Instance
ControllerInstance controllerInstance = new ControllerInstance();
controllerInstance.Name = controllerInstance.ShortName = "Controller Example";

// Configure Ports
for (byte i = 1; i <= 32; i++)
controllerInstance.AddPortConfig(new PortConfig(i,new PortAddress (i), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet});
controllerInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet});

// Add Instance
ArtNet.Instance.AddInstance(controllerInstance);
Expand Down
8 changes: 4 additions & 4 deletions Examples/NodeInputExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY);

//Set Networkinterfaces
var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));
//var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
//ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));

// Create Instance
NodeInstance nodeInstance = new NodeInstance();
nodeInstance.Name = nodeInstance.ShortName = "Node Input Example";

// Configure Input Ports
for (byte i = 1; i <= 4; i++)
nodeInstance.AddPortConfig(new PortConfig(i, new PortAddress(i), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet });
nodeInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet });

for (byte i = 11; i <= 14; i++)
nodeInstance.AddPortConfig(new PortConfig(i, new PortAddress(i), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet });
nodeInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet });

// Add Instance
ArtNet.Instance.AddInstance(nodeInstance);
Expand Down
6 changes: 3 additions & 3 deletions Examples/NodeOutputExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY);

//Set Networkinterfaces
var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));
//var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
//ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));

// Create Instance
NodeInstance nodeInstance = new NodeInstance();
nodeInstance.Name = nodeInstance.ShortName = "Node Output Example";

// Configure Output Ports
for (byte i = 1; i <= 32; i++)
nodeInstance.AddPortConfig(new PortConfig(i, new PortAddress(i), true, false) { PortNumber = (byte)i, Type = EPortType.OutputFromArtNet, GoodOutput = EGoodOutput.ContiniuousOutput | EGoodOutput.DataTransmitted });
nodeInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), true, false) { PortNumber = (byte)i, Type = EPortType.OutputFromArtNet, GoodOutput = EGoodOutput.ContiniuousOutput | EGoodOutput.DataTransmitted });

// Listen for new Data
nodeInstance.DMXReceived += (sender, e) =>
Expand Down

0 comments on commit 07710ed

Please sign in to comment.