skip to Main Content

gemta



  • using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using DevExpress.XtraEditors;
    using GemtaApp;
    using System.Data.Entity;
    using DevExpress.XtraCharts;

    namespace MyGemta.Formlar
    {
    public partial class frmAkuKapasiteHesapla : Form
    {
    public frmAkuKapasiteHesapla()
    {
    InitializeComponent();
    }

    GemtaAppEntities db = new GemtaAppEntities();

    //ChartControl chart = new ChartControl();
    //Series series1 = new Series(sure.ToString(), ViewType.Bar);

    private void frmAkuKapasiteHesapla_Load(object sender, EventArgs e)
    {
    searchLookUpEdit_ilgiliKisi.Properties.DataSource = (from x in db.tblMUSTERI
    select new
    {
    x.ID,
    x.ADSOYAD,
    FIRMA = x.tblFIRMALISTE.FIRMAAD
    }).ToList();

    searchLookUpEdit_Firma.Properties.DataSource = (from x in db.tblFIRMALISTE
    select new
    {
    x.ID,
    x.FIRMAAD
    }).ToList();

    }

    decimal[] Akim = new decimal[11];
    decimal[] TimeConst = new decimal[11];
    decimal[] sure = new decimal[11];
    decimal[] KtConst = new decimal[11];
    double x3, x2;
    decimal t3, t2;
    decimal[] PeriodSize = new decimal[11];

    private void txtSure1_EditValueChanged(object sender, EventArgs e)
    {

    }

    decimal TotalCapacity, RequiredCapacity;

    private void BtnHesapla_Click(object sender, EventArgs e)
    {
    try
    {
    decimal Temp = 0.9m * decimal.Parse(txtSistemGerilim.Text);
    Akim[1] = decimal.Parse(txtGuc1.Text) / Temp;
    Akim[2] = decimal.Parse(txtGuc2.Text) / Temp;
    Akim[3] = decimal.Parse(txtGuc3.Text) / Temp;
    Akim[4] = decimal.Parse(txtGuc4.Text) / Temp;
    Akim[5] = decimal.Parse(txtGuc5.Text) / Temp;
    Akim[6] = decimal.Parse(txtGuc6.Text) / Temp;
    Akim[7] = decimal.Parse(txtGuc7.Text) / Temp;
    Akim[8] = decimal.Parse(txtGuc8.Text) / Temp;
    Akim[9] = decimal.Parse(txtGuc9.Text) / Temp;
    Akim[10] = decimal.Parse(txtGuc10.Text) / Temp;

    }
    catch
    {
    decimal Temp = 0.9m * decimal.Parse(txtSistemGerilim.Text);
    Akim[1] = decimal.Parse(txtGuc1.Text) / Temp;
    Akim[2] = decimal.Parse(txtGuc2.Text) / Temp;
    Akim[3] = decimal.Parse(txtGuc3.Text) / Temp;
    Akim[4] = decimal.Parse(txtGuc4.Text) / Temp;
    Akim[5] = decimal.Parse(txtGuc5.Text) / Temp;
    Akim[6] = decimal.Parse(txtGuc6.Text) / Temp;
    Akim[7] = decimal.Parse(txtGuc7.Text) / Temp;
    Akim[8] = decimal.Parse(txtGuc8.Text) / Temp;
    Akim[9] = decimal.Parse(txtGuc9.Text) / Temp;
    Akim[10] = decimal.Parse(txtGuc10.Text) / Temp;
    }

    sure[1] = decimal.Parse(txtSure1.Text);
    sure[2] = decimal.Parse(txtSure2.Text);
    sure[3] = decimal.Parse(txtSure3.Text);
    sure[4] = decimal.Parse(txtSure4.Text);
    sure[5] = decimal.Parse(txtSure5.Text);
    sure[6] = decimal.Parse(txtSure6.Text);
    sure[7] = decimal.Parse(txtSure7.Text);
    sure[8] = decimal.Parse(txtSure8.Text);
    sure[9] = decimal.Parse(txtSure9.Text);
    sure[10] = decimal.Parse(txtSure10.Text);

    TimeConst[1] = sure[1] + sure[2] + sure[3] + sure[4] + sure[5] + sure[6] + sure[7] + sure[8] + sure[9] + sure[10];
    TimeConst[2] = TimeConst[1] – sure[1];
    TimeConst[3] = TimeConst[2] – sure[2];
    TimeConst[4] = TimeConst[3] – sure[3];
    TimeConst[5] = TimeConst[4] – sure[4];
    TimeConst[6] = TimeConst[5] – sure[5];
    TimeConst[7] = TimeConst[6] – sure[6];
    TimeConst[8] = TimeConst[7] – sure[7];
    TimeConst[9] = TimeConst[8] – sure[8];
    TimeConst[10] = TimeConst[9] – sure[9];

    for (int i = 1; i < 11; i++)// KtConst Hesaplanır { // KtConst[1] Hesabı---------------- x3 = Math.Pow(double.Parse(TimeConst[i].ToString()), 3);// timeconst[i] in 3 üssü x2 = Math.Pow(double.Parse(TimeConst[i].ToString()), 2);// timeconst[i] in 2 üssü t3 = decimal.Parse(x3.ToString());// hesaplananlar decimal değere dönüştürülür t2 = decimal.Parse(x2.ToString()); KtConst[i] = 0.000000007m * t3 - (0.00001m * t2) + 0.0229m * TimeConst[i] + 0.252m; } // Period Size Ah hesaplamansı-- bu kısım iptal edildi aşağıdaki şekilde yazıldı, akım 0 ise periodsize 0 alınacak ve hesaba dahil edilmeyecek //PeriodSize[1] = Akim[1] * KtConst[1]; //PeriodSize[2] = (Akim[2] - Akim[1]) * KtConst[2]; //PeriodSize[3] = (Akim[3] - Akim[2]) * KtConst[3]; //PeriodSize[4] = (Akim[4] - Akim[3]) * KtConst[4]; //PeriodSize[5] = (Akim[5] - Akim[4]) * KtConst[5]; //PeriodSize[6] = (Akim[6] - Akim[5]) * KtConst[6]; //PeriodSize[7] = (Akim[7] - Akim[6]) * KtConst[7]; //PeriodSize[8] = (Akim[8] - Akim[7]) * KtConst[8]; //PeriodSize[9] = (Akim[9] - Akim[8]) * KtConst[9]; //PeriodSize[10] = (Akim[10] - Akim[9]) * KtConst[10]; // Period Size Ah hesaplamansı if (Akim[1]==0) { PeriodSize[1] = 0; } else { PeriodSize[1] = Akim[1] * KtConst[1]; } if (Akim[2] == 0) { PeriodSize[2] = 0; } else { PeriodSize[2] = (Akim[2] - Akim[1]) * KtConst[2]; } if (Akim[3] == 0) { PeriodSize[3] = 0; } else { PeriodSize[3] = (Akim[3] - Akim[2]) * KtConst[3]; } if (Akim[4] == 0) { PeriodSize[4] = 0; } else { PeriodSize[4] = (Akim[4] - Akim[3]) * KtConst[4]; } if (Akim[5] == 0) { PeriodSize[5] = 0; } else { PeriodSize[5] = (Akim[5] - Akim[4]) * KtConst[5]; } if (Akim[6] == 0) { PeriodSize[6] = 0; } else { PeriodSize[6] = (Akim[6] - Akim[5]) * KtConst[6]; } if (Akim[7] == 0) { PeriodSize[7] = 0; } else { PeriodSize[7] = (Akim[7] - Akim[6]) * KtConst[7]; } if (Akim[8] == 0) { PeriodSize[8] = 0; } else { PeriodSize[8] = (Akim[8] - Akim[7]) * KtConst[8]; } if (Akim[9] == 0) { PeriodSize[9] = 0; } else { PeriodSize[9] = (Akim[9] - Akim[8]) * KtConst[9]; } if (Akim[10] == 0) { PeriodSize[10] = 0; } else { PeriodSize[10] = (Akim[10] - Akim[9]) * KtConst[10]; } TotalCapacity = 0; for (int i = 1; i < 11; i++) { TotalCapacity += PeriodSize[i]; } RequiredCapacity = TotalCapacity * decimal.Parse(txtYaslanmaFaktor.Text) * decimal.Parse(txtTasarimMarj.Text) * decimal.Parse(txtSicaklikFaktor.Text); if (RequiredCapacity>230)
    {
    txtSonucAkuAdet.Text = (decimal.Parse(txtSistemGerilim.Text) / 2).ToString();
    }
    else if (RequiredCapacity <= 230) { txtSonucAkuAdet.Text = (decimal.Parse(txtSistemGerilim.Text) / 12).ToString(); } txtSonucAkuAh.Text = RequiredCapacity.ToString("0.##") + "Ah"; } } }


This Post Has 0 Comments

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.

Back To Top