Delphi ve lazarusta Yaptıgım Ohm Kanunu Programı(Acık kaynak kodları ile)

hasanzincir

Paylaşımcı üye
Katılım
17 Haz 2007
Mesajlar
684
Puanları
131
Yaş
46
Ohm Kanunu hakıında yaptıgım basit bir programı sizlerle paylasmak istedim arkadaslar.Ayrıca acık kodlarınıda asagıya iliştirdim.Nacizane pek profesyonel degil ama bu işte usta arkadaşlar kodları inceleyip düşüncelerini açıklarsa benim için cok verimli olur!
Windows sürümü icin delphi linux sürümü icin Lazarus kullanılmıstır.

DELPHI ile yapılan

Kod:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, jpeg, ExtCtrls, Menus;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    ComboBox4: TComboBox;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    Image1: TImage;
    GroupBox1: TGroupBox;
    Label3: TLabel;
    Button1: TButton;
    ComboBox3: TComboBox;
    Label5: TLabel;
    Label6: TLabel;
    MainMenu1: TMainMenu;
    Dosya1: TMenuItem;
    Yardm1: TMenuItem;
    Hakknda1: TMenuItem;
    k1: TMenuItem;
    procedure Button1Click(Sender: TObject);
    procedure k1Click(Sender: TObject);
    procedure Hakknda1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin
//Voltaj Degerlerini Bulma Volt
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=R*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=I*R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1)AND (ComboBox4.ItemIndex=0) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))*1)+ ' Volt'
  else
//Direnç Değerini Bulma  Ohm
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/sqr(StrToFloat(Edit2.Text)))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/sqr(StrToFloat(Edit1.Text)))*1)+ ' Ohm'
  else
//Akım Değerini Bulma Amper
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text)))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text)))*1)+ ' Amper'
  else
//Güç Değerini Bulma Wat
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=E*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=I*E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=R*(I*I)
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* sqr(StrToFloat(Edit2.Text)))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=(I*I)*R
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))* StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))*1)+ ' Wat'
  else
//Kilo cinsinden

  //Voltaj Degerlerini Bulma KVolt
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=R*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=I*R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1)AND (ComboBox4.ItemIndex=1) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))/1000)+ ' KVolt'
  else
//Direnç Değerini Bulma  KOhm
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/sqr(StrToFloat(Edit2.Text)))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/sqr(StrToFloat(Edit1.Text)))/1000)+ ' KOhm'
  else
//Akım Değerini Bulma KAmper
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text)))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text)))/1000)+ ' KAmper'
  else
//Güç Değerini Bulma KWat
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=E*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=I*E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=R*(I*I)
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* sqr(StrToFloat(Edit2.Text)))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=(I*I)*R
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))* StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))/1000)+ ' KWat'
else
ShowMessage('Hatalı veya Eksik Giriş Yaptınız! Resimdeki Tablodan Faydalanınız.');

end;


procedure TForm1.k1Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Hakknda1Click(Sender: TObject);
begin
 ShowMessage('Tüm Hakları Hasan ZİNCİR e Aittir.');
end;

end.


Linux sürümü icin LAZARUS ta yapılan


Acık kaynak Kodları
Kod:
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    ComboBox3: TComboBox;
    ComboBox4: TComboBox;
    Edit1: TEdit;
    Edit2: TEdit;
    GroupBox1: TGroupBox;
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure ComboBox3Change(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.ComboBox3Change(Sender: TObject);
begin

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  //Voltaj Degerlerini Bulma Volt
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=R*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=I*R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1)AND (ComboBox4.ItemIndex=0) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))*1)+ ' Volt'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=0) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))*1)+ ' Volt'
  else
//Direnç Deðerini Bulma  Ohm
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/sqr(StrToFloat(Edit2.Text)))*1)+ ' Ohm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=0) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/sqr(StrToFloat(Edit1.Text)))*1)+ ' Ohm'
  else
//Akým Deðerini Bulma Amper
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text)))*1)+ ' Amper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=0) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text)))*1)+ ' Amper'
  else
//Güç Deðerini Bulma Wat
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=E*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=I*E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=R*(I*I)
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* sqr(StrToFloat(Edit2.Text)))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=(I*I)*R
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))* StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))*1)+ ' Wat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=0) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))*1)+ ' Wat'
  else
//Kilo cinsinden

  //Voltaj Degerlerini Bulma KVolt
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=R*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=I*R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=1)AND (ComboBox4.ItemIndex=1) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=P/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))/1000)+ ' KVolt'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=1) AND (ComboBox4.ItemIndex=1) then//E=KareKök[P*R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text)))/1000)+ ' KVolt'
  else
//Direnç Deðerini Bulma  KOhm
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E/I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))*1)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=E*E/P
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/sqr(StrToFloat(Edit2.Text)))/1000)+ ' KOhm'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=3) AND (ComboBox4.ItemIndex=1) then//R=P/I*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/sqr(StrToFloat(Edit1.Text)))/1000)+ ' KOhm'
  else
//Akým Deðerini Bulma KAmper
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=E/R
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=P/E
  Label3.Caption:= FloatToStr((StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=0) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text)))/1000)+ ' KAmper'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=0) AND (ComboBox3.ItemIndex=2) AND (ComboBox4.ItemIndex=1) then//I=KareKök[P/R]
  Label3.Caption:= FloatToStr((sqrt(StrToFloat(Edit2.Text)/StrToFloat(Edit1.Text)))/1000)+ ' KAmper'
  else
//Güç Deðerini Bulma KWat
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=E*I
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=I*E
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=2) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=R*(I*I)
  Label3.Caption:= FloatToStr((StrToFloat(Edit1.Text)* sqr(StrToFloat(Edit2.Text)))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=2) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=(I*I)*R
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))* StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=1) AND (ComboBox2.ItemIndex=3) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit1.Text))/StrToFloat(Edit2.Text))/1000)+ ' KWat'
  else
  if (ComboBox1.ItemIndex=3) AND (ComboBox2.ItemIndex=1) AND (ComboBox3.ItemIndex=0) AND (ComboBox4.ItemIndex=1) then//P=(E*E)/I
  Label3.Caption:= FloatToStr((sqr(StrToFloat(Edit2.Text))/StrToFloat(Edit1.Text))/1000)+ ' KWat'
else
ShowMessage('Hatalı veya Eksik Giriş Yaptınız! Resimdeki Tablodan Faydalanınız.');

end;

initialization
  {$I unit1.lrs}

end.
 
bi bitirmişsin sen bu delphi olayını parçalayacan anlaşılan yakında scada ayarında bişiler yaparsın diye düşünüom:)
 
elerine sağlı güzel Çalışma hocam
 
Cok teşekkür ederim daha biraz acemiyim delphi ve lazarusta ama ufak ufak oynuyorum!:p
 

Forum istatistikleri

Konular
130,124
Mesajlar
933,338
Kullanıcılar
453,198
Son üye
Emre0686

Yeni konular

Geri
Üst