Separation classes
This commit is contained in:
parent
7e636fab23
commit
3f948acca2
4 changed files with 80 additions and 59 deletions
|
|
@ -7,6 +7,9 @@ namespace DMX2
|
|||
{
|
||||
public class Conduite
|
||||
{
|
||||
|
||||
public static Conduite ConduiteCourante = new Conduite();
|
||||
|
||||
public Conduite()
|
||||
{
|
||||
|
||||
|
|
@ -18,9 +21,6 @@ namespace DMX2
|
|||
get {
|
||||
return circuits;
|
||||
}
|
||||
private set {
|
||||
circuits = value;
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<string, Sequenceur> sequenceurs= new Dictionary<string, Sequenceur>();
|
||||
|
|
@ -29,9 +29,6 @@ namespace DMX2
|
|||
get {
|
||||
return sequenceurs;
|
||||
}
|
||||
private set {
|
||||
sequenceurs = value;
|
||||
}
|
||||
}
|
||||
|
||||
List<UniversDMX> univers;
|
||||
|
|
@ -40,17 +37,10 @@ namespace DMX2
|
|||
get {
|
||||
return univers;
|
||||
}
|
||||
private set {
|
||||
univers = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public abstract class Sequenceur
|
||||
{
|
||||
}
|
||||
|
||||
public class Circuit
|
||||
{
|
||||
string name;
|
||||
|
|
@ -64,6 +54,14 @@ namespace DMX2
|
|||
}
|
||||
}
|
||||
|
||||
int id;
|
||||
|
||||
public int ID {
|
||||
get {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
int _curval;
|
||||
|
||||
public int ValeurCourante {
|
||||
|
|
@ -77,52 +75,6 @@ namespace DMX2
|
|||
|
||||
}
|
||||
|
||||
public class UniversDMX
|
||||
{
|
||||
|
||||
Grada[] _gradas = new Grada[512];
|
||||
|
||||
public enum FTransfer {
|
||||
lineaire,
|
||||
log,
|
||||
exp
|
||||
}
|
||||
public struct Grada {
|
||||
public Circuit circuitAssocié;
|
||||
public FTransfer fonctionTransfert;
|
||||
public float param1; // Paramètres pour fonction de transfert
|
||||
public float param2;
|
||||
}
|
||||
|
||||
public Grada[] Gradas {
|
||||
get
|
||||
{
|
||||
return _gradas;
|
||||
}
|
||||
}
|
||||
|
||||
public void CalculUnivers(int[] valeurs)
|
||||
{
|
||||
Grada g;
|
||||
Debug.Assert(valeurs.Length == _gradas.Length);
|
||||
for(int i = 0 ; i<512; i++)
|
||||
{
|
||||
g= _gradas[i];
|
||||
switch (g.fonctionTransfert) {
|
||||
case FTransfer.lineaire:
|
||||
valeurs[i] = g.circuitAssocié.ValeurCourante;
|
||||
break;
|
||||
case FTransfer.log:
|
||||
break;
|
||||
case FTransfer.exp:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@
|
|||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Conduite.cs" />
|
||||
<Compile Include="gtk-gui\DMX2.MainWindow.cs" />
|
||||
<Compile Include="UniversDMX.cs" />
|
||||
<Compile Include="Sequenceur.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
13
DMX-2.0/Sequenceur.cs
Normal file
13
DMX-2.0/Sequenceur.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DMX2
|
||||
{
|
||||
public abstract class Sequenceur
|
||||
{
|
||||
public Sequenceur ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
54
DMX-2.0/UniversDMX.cs
Normal file
54
DMX-2.0/UniversDMX.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace DMX2
|
||||
{
|
||||
public class UniversDMX
|
||||
{
|
||||
|
||||
Grada[] _gradas = new Grada[512];
|
||||
|
||||
public enum FTransfer {
|
||||
lineaire,
|
||||
log,
|
||||
exp
|
||||
}
|
||||
public struct Grada {
|
||||
public Circuit circuitAssocié;
|
||||
public FTransfer fonctionTransfert;
|
||||
public float param1; // Paramètres pour fonction de transfert
|
||||
public float param2;
|
||||
}
|
||||
|
||||
public Grada[] Gradas {
|
||||
get
|
||||
{
|
||||
return _gradas;
|
||||
}
|
||||
}
|
||||
|
||||
public void CalculUnivers(int[] valeurs)
|
||||
{
|
||||
Grada g;
|
||||
Debug.Assert(valeurs.Length == _gradas.Length);
|
||||
for(int i = 0 ; i<512; i++)
|
||||
{
|
||||
g= _gradas[i];
|
||||
switch (g.fonctionTransfert) {
|
||||
case FTransfer.lineaire:
|
||||
valeurs[i] = g.circuitAssocié.ValeurCourante;
|
||||
break;
|
||||
case FTransfer.log:
|
||||
break;
|
||||
case FTransfer.exp:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue