119 lines
3.1 KiB
C#
119 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net.Http.Headers;
|
|
using System.Text;
|
|
|
|
namespace dcnsanplanung.bewertung.M149_3
|
|
{
|
|
public enum CalculateMethods
|
|
{
|
|
Dichtheit = 1,
|
|
Standsicherheit = 2,
|
|
Betriebsicherheit = 4
|
|
}
|
|
|
|
public enum Geltungsbereich
|
|
{
|
|
biegesteif,
|
|
biegeweich
|
|
}
|
|
public abstract class AbstractCode
|
|
{
|
|
private CalculateMethods VerfügbareMethoden;
|
|
string beschreibung;
|
|
protected string Ch1 = "";
|
|
protected string Ch2 = "";
|
|
protected float Q1;
|
|
protected float Q2;
|
|
protected int DN;
|
|
|
|
public AbstractCode(string beschreibung, CalculateMethods calculateMethods, int DN = -1)
|
|
{
|
|
this.beschreibung = beschreibung;
|
|
this.VerfügbareMethoden = calculateMethods;
|
|
}
|
|
|
|
protected virtual int CalculateSK()
|
|
{
|
|
return 6;
|
|
}
|
|
|
|
protected virtual int CalculateDK()
|
|
{
|
|
return 6;
|
|
}
|
|
protected virtual int CalculateBK()
|
|
{
|
|
return 6;
|
|
}
|
|
|
|
public virtual void WriteCH1(string Ch1)
|
|
{
|
|
this.Ch1 = Ch1;
|
|
}
|
|
public virtual void WriteCH2(string Ch2)
|
|
{
|
|
this.Ch2 = Ch2;
|
|
}
|
|
public virtual void WriteQ1(float Q1)
|
|
{
|
|
this.Q1 = Q1;
|
|
}
|
|
|
|
public virtual void WriteQ2(float Q2)
|
|
{
|
|
this.Q2 = Q2;
|
|
}
|
|
}
|
|
public class BAA : AbstractCode
|
|
{
|
|
Geltungsbereich geltungsbereich;
|
|
public BAA(Geltungsbereich geltungsbereich) : base("Verformung", CalculateMethods.Standsicherheit | CalculateMethods.Betriebsicherheit)
|
|
{
|
|
this.geltungsbereich = geltungsbereich;
|
|
}
|
|
|
|
protected override int CalculateSK()
|
|
{
|
|
switch(geltungsbereich)
|
|
{
|
|
case Geltungsbereich.biegesteif:
|
|
{
|
|
switch (Q1)
|
|
{
|
|
case >= 7: return 0;
|
|
case >= 4: return 1;
|
|
case >= 3: return 2;
|
|
case >= 1: return 3;
|
|
default: return 4;
|
|
}
|
|
}
|
|
case Geltungsbereich.biegeweich:
|
|
{
|
|
switch (Q1)
|
|
{
|
|
case >= 15: return 0;
|
|
case >= 10: return 1;
|
|
case >= 6: return 2;
|
|
case >= 2: return 3;
|
|
default: return 4;
|
|
}
|
|
}
|
|
|
|
default: return 6;
|
|
}
|
|
}
|
|
protected override int CalculateBK()
|
|
{
|
|
switch(Q1)
|
|
{
|
|
case >= 50: return 0;
|
|
case >= 40: return 1;
|
|
case >= 25: return 2;
|
|
case >= 10: return 3;
|
|
default: return 4;
|
|
}
|
|
}
|
|
}
|
|
}
|