Rabu, 23 Agustus 2023

PERCOBAAN 5 MEMBUAT APLIKASI KONTAK SENJATA DENGAN MUSUH MELALUI MAP

    PERCOBAAN 5

  Membuat Laporan kondisi kontak senjata dengan musuh melalui Map


1.  Tujuan : Agar Bamasis mampu membuat laporan kondisi kontak senjata dengan musuh melalui map

2.  Alat dan bahan :

     a.    Laptop

     b.    Delphi

     c.    Anydesk/ Team viewer

     d.    image

     e.    Shape

     f.     Pixel

3.  Teori

     a.    Image dalam Map

 

Digunakan untuk menampilkan gambar di dalam aplikasi. Komponen ini memungkinkan untuk menampilkan berbagai format gambar (seperti BMP, JPEG, PNG, GIF, dsb) di dalam form aplikasi .

 

Gambar 1. Tampilan Image

  

     b.    Tool Shape

Dalam konteks aplikasi pengembangan perangkat lunak menggunakan Delphi, "tool shape" mengacu pada komponen atau elemen grafis yang digunakan untuk membuat, menggambar, dan menampilkan berbagai bentuk atau gambar dalam antarmuka pengguna aplikasi. Ini memungkinkan Anda untuk menciptakan visualisasi yang lebih menarik dan informatif dalam aplikasi Anda.

Gambar 2. Tampilan  Shape

    c.     Pixel

 

Adalah representasi dari titik terkecil citra digital atau gambar grafis dan dihitung per Inci (satuan metrik), titik terkecil inilah yang kemudian disebut dengan Pixel, yang merupakan singkatan dari akronim Bahasa Inggris ‘Picture Element.’

 



                        

 

4.  Langkah- Langkah Percobaan

    a.     Flowchart


     b.     Coding

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
  Vcl.Imaging.pngimage;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
    Shape4: TShape;
    Shape5: TShape;
    Shape6: TShape;
    Shape7: TShape;
    Shape8: TShape;
    Shape9: TShape;
    Shape10: TShape;
    Shape11: TShape;
    Shape12: TShape;
    Shape13: TShape;
    Shape14: TShape;
    Shape15: TShape;
    Shape16: TShape;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Button1: TButton;
    Button2: TButton;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
titik: integer;
status: string;
pos: string;

begin
titik := comboBox1.ItemIndex;
status := Edit1.Text;

if titik <> -1 then
begin
    //showmessage ( 'pos yang dipilih : ' + comobox1.items [titik]);
    pos := comboBox1.Items[titik];
end
else
begin
     //showmessage ('kosong');
     pos :='';
end;

if (pos='1') and (status='H') then
begin
  shape1.Brush.Color := clLime;
end
else if (pos='1') and (status='K') then
     begin
       shape1.Brush.Color:= clyellow;
     end
else if (pos='1') and (status='M') then
     begin
       shape1.Brush.Color:= clred;
     end
else if (pos='1') and (status='H') then
     begin
       shape1.Brush.Color:= cllime;
     end
else if (pos='2') and (status='K') then
     begin
       shape2.Brush.Color:= clyellow;
     end
else if (pos='2') and (status='M') then
     begin
       shape2.Brush.Color:= clred;
     end
else if (pos='2') and (status='H') then
     begin
       shape2.Brush.Color:= cllime;
     end
else if (pos='3') and (status='K') then
     begin
       shape3.Brush.Color:= clyellow;
     end
else if (pos='3') and (status='M') then
     begin
       shape3.Brush.Color:= clred;
     end
else if (pos='3') and (status='H') then
     begin
       shape3.Brush.Color:= cllime;
     end
else if (pos='4') and (status='K') then
     begin
       shape4.Brush.Color:= clyellow;
     end
else if (pos='4') and (status='M') then
     begin
       shape4.Brush.Color:= clred;
     end
else if (pos='4') and (status='H') then
     begin
       shape4.Brush.Color:= cllime;
     end
else if (pos='5') and (status='K') then
     begin
       shape5.Brush.Color:= clyellow;
     end
else if (pos='5') and (status='M') then
     begin
       shape5.Brush.Color:= clred;
     end
else if (pos='5') and (status='H') then
     begin
       shape5.Brush.Color:= cllime;
     end
else if (pos='6') and (status='K') then
     begin
       shape6.Brush.Color:= clyellow;
     end
else if (pos='6') and (status='M') then
     begin
       shape6.Brush.Color:= clred;
     end
else if (pos='6') and (status='H') then
     begin
       shape6.Brush.Color:= cllime;
     end
else if (pos='7') and (status='K') then
     begin
       shape7.Brush.Color:= clyellow;
     end
else if (pos='7') and (status='M') then
     begin
       shape7.Brush.Color:= clred;
     end
else if (pos='7') and (status='H') then
     begin
       shape7.Brush.Color:= cllime;
     end
else if (pos='8') and (status='K') then
     begin
       shape1.Brush.Color:= clyellow;
     end
else if (pos='8') and (status='M') then
     begin
       shape8.Brush.Color:= clred;
     end
else if (pos='8') and (status='H') then
     begin
       shape8.Brush.Color:= cllime;
     end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
form1.Close;
end;

end.

5.  Hasil dan pembahasan

    a.     hasil 



    b.     Pembahasan

pada percobaan diatas apabila dimasukan pada tool edit sandi atau password hiijau,kuning,dan merah maka pada shape yang dimasukan password akan berubah sesuai warna dari password yang dimasukan,untuk keluar dari program aplikasi kita klik tombol close.

 

6.  Kesimpulan

            Dalam percobaan tersebut, terdapat sebuah aplikasi atau tool edit sandi atau password. Jika warna-warna tertentu dimasukkan sebagai password (hijau, kuning, atau merah), bentuk atau tampilan yang mewakili password akan berubah sesuai dengan warna yang dimasukkan. Untuk keluar dari program aplikasi ini, pengguna hanya perlu mengklik tombol close.






0 komentar:

Posting Komentar

Cari Blog Ini

Diberdayakan oleh Blogger.

BTemplates.com

MEMBUAT ROBOT HUMANOID