Skip to content

Commit

Permalink
Add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
hrntsm committed Dec 28, 2021
1 parent 4275e31 commit 9089c6a
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 60 deletions.
16 changes: 14 additions & 2 deletions KarambaConnect/RH7K2/S2K/CrossSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ public static List<CroSec> GetCroSec(StbSections sections, CroSecFamilyName fami
private static List<CroSec> StbSecColumnRcToK3dCroSec(IEnumerable<StbSecColumn_RC> columns)
{
var k3dCroSecList = new List<CroSec>();
if (columns == null)
{
return k3dCroSecList;
}

foreach (StbSecColumn_RC column in columns)
{
string name;
CroSec_Beam k3dCroSec;
object figure = column.StbSecFigureColumn_RC.Item;
var material = Material.StbToRcFemMaterial(column.strength_concrete);
FemMaterial_Isotrop material = Material.StbToRcFemMaterial(column.strength_concrete);
switch (figure)
{
case StbSecColumn_RC_Rect rect:
Expand All @@ -84,11 +88,15 @@ private static List<CroSec> StbSecColumnRcToK3dCroSec(IEnumerable<StbSecColumn_R
private static List<CroSec> StbSecBeamRcToK3dCroSec(IEnumerable<StbSecBeam_RC> girders)
{
var k3dCroSecList = new List<CroSec>();
if (girders == null)
{
return k3dCroSecList;
}

foreach (StbSecBeam_RC girder in girders)
{
double width, depth;
var material = Material.StbToRcFemMaterial(girder.strength_concrete);
FemMaterial_Isotrop material = Material.StbToRcFemMaterial(girder.strength_concrete);
object[] figures = girder.StbSecFigureBeam_RC.Items;

switch (figures[0])
Expand Down Expand Up @@ -125,6 +133,10 @@ private static List<CroSec> StbSecBeamRcToK3dCroSec(IEnumerable<StbSecBeam_RC> g
private static List<CroSec> StbSecSteelToK3dCroSec(StbSections sections, FemMaterial material, CroSecFamilyName familyName)
{
var k3dCroSecList = new List<CroSec>();
if (sections.StbSecSteel == null)
{
return k3dCroSecList;
}

SetRollHSection(sections, material, familyName, k3dCroSecList);
SetBuildHSection(sections, material, familyName, k3dCroSecList);
Expand Down
125 changes: 67 additions & 58 deletions KarambaConnect/RH7K2/S2K/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,65 +47,74 @@ public static FemMaterial_Isotrop StbToRcFemMaterial(string stbStrengthFc)
{
double fc, gamma;
const double Nu = 0.2d;
// マッチしなかった場合は Fc21 相当で返す
switch (stbStrengthFc.ToLower())

if (stbStrengthFc == null)
{
fc = 21;
gamma = 23;
}
else
{
case "fc18":
fc = 18;
gamma = 23;
break;
case "fc21":
fc = 21;
gamma = 23;
break;
case "fc24":
fc = 24;
gamma = 23;
break;
case "fc27":
fc = 27;
gamma = 23;
break;
case "fc30":
fc = 30;
gamma = 23;
break;
case "fc33":
fc = 33;
gamma = 23;
break;
case "fc36":
fc = 36;
gamma = 23;
break;
case "fc40":
fc = 40;
gamma = 23.5;
break;
case "fc42":
fc = 42;
gamma = 23.5;
break;
case "fc45":
fc = 45;
gamma = 23.5;
break;
case "fc50":
fc = 50;
gamma = 24;
break;
case "fc55":
fc = 55;
gamma = 24;
break;
case "fc60":
fc = 60;
gamma = 24;
break;
default:
fc = 21;
gamma = 23;
break;
// マッチしなかった場合は Fc21 相当で返す
switch (stbStrengthFc.ToLower())
{
case "fc18":
fc = 18;
gamma = 23;
break;
case "fc21":
fc = 21;
gamma = 23;
break;
case "fc24":
fc = 24;
gamma = 23;
break;
case "fc27":
fc = 27;
gamma = 23;
break;
case "fc30":
fc = 30;
gamma = 23;
break;
case "fc33":
fc = 33;
gamma = 23;
break;
case "fc36":
fc = 36;
gamma = 23;
break;
case "fc40":
fc = 40;
gamma = 23.5;
break;
case "fc42":
fc = 42;
gamma = 23.5;
break;
case "fc45":
fc = 45;
gamma = 23.5;
break;
case "fc50":
fc = 50;
gamma = 24;
break;
case "fc55":
fc = 55;
gamma = 24;
break;
case "fc60":
fc = 60;
gamma = 24;
break;
default:
fc = 21;
gamma = 23;
break;
}
}

#if karamba1
Expand Down

0 comments on commit 9089c6a

Please sign in to comment.