103
LAMPIRAN
104
Lampiran 1. Gambar Piktorial Mesin Pemupuk Dosis Variabel
105
Skala : 1:16
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Mesin Pemupuk Dosis Variabel
Hal: A-4 1
424 782 1235
Tampak Atas 4940
722
555
Lampiran 2. Gambar Ortogonal Mesin Pemupuk Dosis Variabel
106
685
1842
685
565
Tampak Kanan
Tampak Depan Skala : 1:40
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Mesin Pemupuk Dosis Variabel
Hal: A-4 2
107
M
L K J
Lampiran 3. Gambar Komponen Mesin Pemupuk Dosis Variabel
I
H
G
F E D C A
B
Skala : 1:30
NO
KETERANGAN
A B C D E F G H I J K L M
Tiga Titik Gandeng Universal Joint Sistem Transmisi Puli Sabuk Gearbox Kopling Cakar Blower Rangka Utama Pembagi Aliran Udara Rangka Hopper Penjatah Pupuk Hopper Rangka Diffuser Diffuser
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Mesin Pemupuk Dosis Variabel
Hal: A-4 3
Lampiran 4. Gambar Piktorial Tiga Titik Gandeng 108
Skala : 1:4
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Tiga Titik Gandeng
Hal: A-4 A-1
109
NO A B C D
KETERANGAN Besi kotak hollow 40x40x2 mm Poros stainless steel 201 diameter 15mm Besi plat strip lebar 40 mm tebal 5 mm Besi kotak penampang 40x20 mm
30 5
D
360 15
70
C
Lampiran 5. Gambar Ortogonal Tiga Titik Gandeng
Tampak Atas
B
A
600 570
110 70 10
∅15 R20 14°
∅15
150 R20
570 600
Tampak Depan
Tampak Kanan Skala : 1:10
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Tiga Titik Gandeng
Hal: A-4 A-2
Lampiran 6. Gambar Piktorial Universal Joint
UJUNG GEAR BOX
Skala : 1:2
Digambar : Pandu Gunawan
Peringatan
110
Satuan : milimeter
UJUNG PTO TRAKTOR
Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Universal Joint
Hal: A-4 B-1
111
NO A D
A
B C D
B
KETERANGAN Kepala Universal Joint, modifikasi joint stir Toyota Starlet 1995. Poros baja karbon S45C diameter 20mm Pin kunci busing Stainless Steel 201 diameter 4mm Busing baja karbon S45C diameter 30mm
C Gambar Potongan A-A
Potongan A-A ∅4 70 20
20
40
10
50
Lampiran 7. Gambar Orthogonal Universal Joint
Tampak Atas
660 60
220
100
200
60
30 50
Tampak Depan
Tampak Kanan
Skala : 1:2
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Universal Joint
Hal: A-4 B-2
112 Lampiran 8. Gambar Piktorial Sistem Puli Sabuk
UJUNG GEAR BOX
UJUNG UNIVERSAL JOINT
Skala : 1:2
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Sistem Puli-Sabuk
Hal: A-4 C-1
113
NO A B C
KETERANGAN Sabuk-V tipe A ukuran 18 Puli alumunium 3.5" Poros baja karbon diameter 20 mm
145 30
33
52
Tampak Atas 20
A
∅95
B
∅89
Lampiran 9. Gambar Orthogonal Sistem Puli Sabuk
∅60
Potongan B-B
295
200
C
∅20
Tampak Depan
Tampak Kanan
Potongan B-B
Skala : 1:4
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Sistem Puli-Sabuk
Hal: A-4 C-2
114 Lampiran 10. Gambar Piktorial Gear Box
UJUNG BLOWER
Skala : 1:2
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter
UJUNG UNIVERSAL JOINT
Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Gearbox
Hal: A-4 D-1
115
35
27 20
Spesifikasi Gearbox 1. Tipe : TA-30 2. Produsen : Bonfiglioli 3. Negara : Italia 3. Rasio : 1:10 4. Bahan : Besi 5. Tipe gear : Hubungan gigi roda 6. Pelumas : SAE 10
15 50
256 60
Tampak Atas 15
20
∅100 ∅50
Lampiran 11. Gambar Orthogonal Gear Box
125
20
20
∅12 20
∅270 ∅80 ∅50
Tampak Depan
∅60
Tampak Kanan Skala : 1:5
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Sistem Puli-Sabuk
Hal: A-4 D-2
Lampiran 12. Gambar Piktorial Blower
116
Skala : 1:4
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Blower
Hal: A-4 E-1
117
Spesifikasi Blower 1. Tipe : CZR-750 2. Produsen : CKE 3. Negara : China 3. Rpm : 2800 4. Bahan : Alumunium 5. Tipe blower : Sentrifugal 6. Kapasitas : 1170 CMH
300 260 100 16
50
Tampak Atas
Lampiran 13. Gambar Orthogonal Blower
∅460 ∅170
510 ∅120
280
∅105 ∅90
200
20
30 180
Tampak Depan
50
Tampak Kanan Skala : 1:10
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Blower
Hal: A-4 E-2
118 Lampiran 14. Gambar Piktorial Rangka Utama
Skala : 1:8
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Rangka Utama
Hal: A-4 F-1
119
Spesifikasi Rangka Utama 1. Bahan : Besi Siku 40x40x2 2. Pengerjaan : Las listrik 3. Penyelesaian : Gerinda halus dan dempul 4. Pengecatan : Tiga lapis (cat dasar-warna-pernis)
660 300
200
160
500
Tampak Atas
Lampiran 15. Gambar Orthogonal Rangka Utama
662
20 30 15
250
1100
225 39 820 585
565 40
200
711
420
500
Tampak Depan
Tampak Kanan Skala : 1:20
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Rangka Utama
Hal: A-4 F-2
Lampiran 16. Gambar Piktorial Pembagi Aliran Udara
120
Dudukan ke rangka hopper
Skala : 1:4
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Pembagi Aliran Udara
Hal: A-4 G-1
121
Spesifikasi Pembagi Aliran Udara 1. Bahan : HDPE 2. Pengerjaan : Perekatan lem resin 3. Penyelesaian : Gerinda halus dan dempul 4. Pengecatan : Tiga lapis (cat dasar-warna-pernis)
80 60
∅205 40 32
Tampak Atas
Lampiran 17. Gambar Orthogonal Pembagi Aliran Udara
32
5
40
168
130 408
605
40
539
144 392
440
270
77
Tampak Depan
Tampak Kanan Skala : 1:10
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Pembagi Aliran Udara
Hal: A-4 G-2
122 Lampiran 18. Gambar Piktorial Rangka Hopper
Skala : 1:8
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Rangka Hopper
Hal: A-4 H-1
123
Spesifikasi Pembagi Aliran Udara 1. Material : Stainless Steel 201 2. Konstruksi : SS 201 kotak 40x30mm 3. Metode las : Las Argon
320
320
1400
320
Lampiran 19. Gambar Piktorial Rangka Hopper
320
1400
Tampak Atas 700
200
550 140
210
102
113
360
Tampak Depan
Tampak Kanan Skala : 1:16
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Rangka Hopper
Hal: A-4 H-2
124 Lampiran 20. Gambar Piktorial Hopper dan Penjatah Pupuk
Skala : 1:8
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Hopper dan Penjatah Pupuk
Hal: A-4 I-1
125
Spesifikasi Hopper 1. Bahan : Akrilik tebal 5 mm 2. Pengerjaan : Perekatan lem resin 3. Penyelesaian : Gerinda halus dan flame burner
300
280
34
53
Lampiran 21. Gambar Orthogonal Hopper dan Penjatah Pupuk
Tampak Atas
300
236 319
534 210 127 215 42 ∅66 70
Tampak Depan
38
Tampak Kanan Skala : 1:10
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Hopper dan Penjatah Pupuk
Hal: A-4 I-2
Lampiran 22. Gambar Piktorial Rangka Diffuser dan Diffuser
126
Skala : 1:16
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Piktorial Rangka Diffuser dan Diffuser
Hal: A-4 J-1
Gambar Komponen Diffuser Skala: 1:5 Bahan: Alumunium
184
Tampak Atas Potongan E-E
40
Bilah Pengarah Pupuk
127 Lampiran 23. Gambar Orthogonal Rangka Diffuser dan Diffuser
Tampak Atas 130
Tampak Depan
Tampak Kanan
Potongan E-E
4940 504
2193 1115 1242
1200
500 468 685
Tampak Depan
600
Skala : 1:40
Digambar : Pandu Gunawan
Peringatan
Satuan : milimeter
Tampak Kanan
Tgl : 26-11-2012 Departmen Teknik Mesin Pertanian
Diperiksa : Dr. Ir. Radite P. A. S., M. Agr
Gambar Orthogonal Rangka Diffuser dan Diffuser
Hal: A-4 I-2
128
Lampiran 24. Kode Program Navigasi Mikrokontroler ATmega 16 #include <mega16.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <delay.h> #include
#define pi 3.141592653589793 #define a_ 6378137.0 #define e_2 0.006739497 #define slope 1.570796327 //-0.043956044 // bit j=0; char NMEA_data[90]; unsigned int motor,trigger,trigger2,tipe=1; unsigned int i; unsigned int waktu_awal,waktu_akhir,selisih; unsigned int ms,detik,fix; char GPS_data[90]; char *soort,*latitude,*longitude,*tijd,*latitude_card,*longitude_card,*quality; float latitude0,Lat,Lon,waktu,waktu1; unsigned int fix,inisial=1, int_x,int_y; float Lat,Lon,dx,dy1,dy,x,y,y1,y_awal,latitude0,latdeg,latmin,Lat0,Lon0,Kx,Ky,kec; char temp0[10]; char temp1[10]; char temp2[10]; char temp3[10]; char temp4[10]; char temp5[10]; char temp6[5]; char temp7[5]; eeprom float save3; eeprom float save4; eeprom float save5; eeprom float save6; #define blok 9+1 //8 //+1 untuk mendetiksi out of area pada titik 0 #define jejer 5 //6 unsigned int dosis[blok][jejer]; int spin[4]; float a[4][3], b[4][3],a_dos[4],b_dos[4]; // Timer1 overflow interrupt service routine interrupt [TIM1_OVF] void timer1_ovf_isr(void) { // Reinitialize Timer1 value TCNT1H=0xFA24 >> 8; TCNT1L=0xFA24 & 0xff; // Place your code here ms++; if(ms%1000==0)detik++; }
void selisih_waktu(void) { waktu_akhir=ms; selisih=waktu_akhir-waktu_awal; itoa(selisih,temp0); lcd_gotoxy(13,0); lcd_putsf(" "); lcd_gotoxy(13,0); lcd_puts(temp0); //delay_ms(100); } void panjang_string(char *data) { char panjang;
129
panjang=strlen(data); lcd_gotoxy(12,1); itoa(panjang,temp4); lcd_puts(temp4); } void par_dos(void){ /* jejer 1 jejer 2 jejer 3 jejer 4 dosis[0][0]=0; dosis[0][1]=0; dosis[0][2]=0; mendeteksi out of range pada titik 0 dosis[1][0]=250; dosis[1][1]=250; dosis[1][2]=250; dosis[2][0]=250; dosis[2][1]=250; dosis[2][2]=250; dosis[3][0]=250; dosis[3][1]=250; dosis[3][2]=250; dosis[4][0]=250; dosis[4][1]=250; dosis[4][2]=250; dosis[5][0]=250; dosis[5][1]=250; dosis[5][2]=250; dosis[6][0]=250; dosis[6][1]=250; dosis[6][2]=250; dosis[7][0]=250; dosis[7][1]=250; dosis[7][2]=250; dosis[8][0]=250; dosis[8][1]=250; dosis[8][2]=250; dosis[9][0]=250; dosis[9][1]=250; dosis[9][2]=250; //tsp a[0][0]=3.278; a[1][0]=2.919; a[2][0]=-2.419; a[3][0]=4.993; b[0][0]=2.382; b[1][0]=1.947; b[2][0]=1.734; b[3][0]=3.225; //npk a[0][1]=0.324; a[1][1]=0.359; a[2][1]=0.626; a[3][1]=2.819; a_dos[0]=1.0167;//1.2707; a_dos[1]=0.964; a_dos[2]=1.2167; a_dos[3]=1.258; b[0][1]=0.939; b[1][1]=1.639; b[2][1]=0.819; b[3][1]=1.034; b_dos[0]=10.5;//0.6667; b_dos[1]=-3.4667; b_dos[2]=-0.2333; b_dos[3]=4.3; //urea a[0][2]=-0.9; a[1][2]=4.982; a[2][2]=1.102; a[3][2]=2.783; b[0][2]=1.513; b[1][2]=1.478; b[2][2]=1.374; b[3][2]=1.72; } void system_init(void) { PORTD=0xff; DDRD=0x00; PORTD.2=1; DDRD.2=0; PORTD.3=1; DDRC=0xff; PORTC=0x00; // Timer/Counter 1 initialization // Clock source: System Clock // Clock value: 1500.000 kHz TCCR1A=0x00; TCCR1B=0x02; TCNT1H=0xFA; TCNT1L=0x24;
jejer 5 jejer 6*/ dosis[0][3]=0; dosis[0][4]=0; dosis[1][3]=250; dosis[2][3]=250; dosis[3][3]=250; dosis[4][3]=250; dosis[5][3]=250; dosis[6][3]=250; dosis[7][3]=250; dosis[8][3]=250; dosis[9][3]=250;
dosis[1][4]=250; dosis[2][4]=250; dosis[3][4]=250; dosis[4][4]=250; dosis[5][4]=250; dosis[6][4]=250; dosis[7][4]=250; dosis[8][4]=250; dosis[9][4]=250;
//dosis[0][5]=0; //hanya untuk //dosis[1][5]=300; //dosis[2][5]=300; //dosis[3][5]=300; //dosis[4][5]=300; //dosis[5][5]=300; //dosis[6][5]=300; //dosis[7][5]=300; //dosis[8][5]=300;
130
ICR1H=0x00; ICR1L=0x00; OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x00; OCR1BL=0x00;
TIMSK=0x04; // USART initialization // Communication Parameters: 8 Data, 1 Stop, No Parity // USART Receiver: On // USART Transmitter: On // USART Mode: Asynchronous // USART Baud Rate: 19200 UCSRA=0x00; UCSRB=0x18; UCSRC=0x06; UBRRH=0x00; UBRRL=0x26; } void main(void) { system_init(); par_dos(); lcd_init(16); // Global enable interrupts for(i=0;i<80;i++) { NMEA_data[i]='0'; } #asm("sei") while (1) { waktu_awal=ms; i=0; NMEA_data[0]=getchar(); NMEA_data[0]=getchar(); while(NMEA_data[0]=='$'||NMEA_data[0]=='G') { i++; NMEA_data[i]=getchar(); if(NMEA_data[i]=='*') { strcpy(GPS_data,NMEA_data); soort = strtok(GPS_data, ","); tijd = strtok(NULL, ","); latitude = strtok(NULL, ","); latitude_card = strtok(NULL, ","); longitude = strtok(NULL, ","); longitude_card = strtok(NULL, ","); quality = strtok(NULL, ","); latitude0=atof(latitude); fix=atoi(quality); memmove(tijd, &tijd[5],8); waktu=atof(tijd); memmove(latitude, &latitude[3],9); Lat=atof(latitude); memmove(longitude, &longitude[4],10); Lon=atof(longitude); //delay_ms(19); if(inisial==1) { detik=0; while(1) { ftoa(Lat,5,temp2); lcd_gotoxy(0,0);
131
lcd_puts(temp2); ftoa(Lon,5,temp3); lcd_gotoxy(0,1); lcd_puts(temp3); if(PIND.2==0){ inisial=2; lcd_clear(); lcd_putsf("please wait...!"); Lat0=Lat; Lon0=Lon; latdeg = latitude0 / 100.; latmin = (latitude0 - latdeg * 100.); latitude0 = -(latdeg + (latmin / 60.)); Kx=(a_*cos(latitude0*pi/180.))/sqrt(1-(e_2*pow(sin(latitude0*pi/180.),2))); Ky=(a_*(1-e_2))/pow(1-e_2*pow(cos(latitude0*pi/180.),2),1.5); save3=Lat0; save4=Lon0; save5=Kx; save6=Ky; delay_ms(1000); goto mulai; } if(detik>=4){ inisial=2; Lat0=save3; Lon0=save4; Kx=save5; Ky=save6; goto mulai; } } } break;} } mulai: lcd_clear(); dx=fabs(Kx*(Lon-Lon0)*pi/180./60.); dy=fabs(Ky*(Lat-(Lat0))*pi/180./60.); x= fabs(dx*cos(slope)-dy*sin(slope)); y= fabs(dx*sin(slope)+dy*cos(slope)); trigger=(int)(y/5);//(int)y_dir/5;// trigger2=(int)(x/5); y_awal=y; if(waktu1!=waktu) { if(trigger
waktu1=waktu; y1=y; //dx1=dx; ftoa(x,2,temp0); ftoa(y,2,temp1); itoa(fix,temp5); itoa(trigger,temp6); itoa(trigger2,temp7); lcd_gotoxy(0,0); lcd_puts(temp0); lcd_gotoxy(0,1); lcd_puts(temp1);
132
lcd_gotoxy(13,1); lcd_puts(temp5); lcd_gotoxy(10,0); lcd_puts(temp6); lcd_gotoxy(13,0); lcd_puts(temp7); int_x=(int)(x*100.); int_y=(int)(y*100.); j++; if(trigger
}
133
Lampiran 25. Kode Program GPS3 /* * Created by SharpDevelop. * User: Pandu Gunawan * Date: 6/18/2012 * Time: 7:15 PM * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Imaging; using System.Data; using System.Globalization; using System.IO; using System.Linq; using System.IO.Ports; using System.Text; using System.Collections.Generic; using System.Windows.Forms; using System.Threading; namespace GPS3 { /// <summary> /// Description of MainForm. /// public partial class MainForm : Form { PointF Origin=new PointF (25.0f,25.0f); int oriX=25,oriY=25,X,Y; //float m=13.1f; //float n=13.1f; float m=10.1f; float n=10.1f; float HorizontalCells=10.0f; //buat ke float! float VerticalCells=6.0f; SizeF GridCellSize=new SizeF(5.0f,5.0f); float[,] blok= new float[10000,10000]; int counter=0,counter1=0,counter2=0; public MainForm() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); // // TODO: Add constructor code after the InitializeComponent() call. // } private void buka_txt() { //int counter3=0,counter4=0,counter5=0; //int counter6=0,counter7=0,counter8=0,counter9=0,counter10=0; //int counter11=0,counter12=0,counter13=0,counter14=0,counter20=0; //int counter15=0,counter16=0,counter17=0,counter18=0,counter19=0; long counter3=0,counter4=0,counter5=0; long counter6=0,counter7=0,counter8=0,counter9=0,counter10=0; long counter11=0,counter12=0,counter13=0,counter14=0,counter20=0; long counter15=0,counter16=0,counter17=0,counter18=0,counter19=0; String X2,Y2,z; int i=0,j=0; int [,] nilai= new int[10000,10000]; //float a=14.1f,b=15.1f; //int A1=13,B1=15; float a=10.1f,b=10.1f; //nilainya harus dikalibrasi!!
134
int A1=10,B1=10; float[] x3= new float[100000]; float[] y3= new float[1000000]; float[] x4= new float[100000]; float[] y4= new float[100000]; int[] x5=new int[1000000]; int[] y5=new int[1000000]; string[] x6=new string[100000]; string[] y6=new string[100000]; float[] rotor1=new float[100000]; float[] rotor2=new float[100000]; float[] rotor3=new float[100000]; float[] rotor4=new float[100000]; float[] dosis1=new float[100000]; float[] dosis2=new float[100000]; float[] dosis3=new float[100000]; float[] dosis4=new float[100000]; float[] dosisrata=new float[1000000]; string[] d1=new string[100000]; string[] d2=new string[100000]; string[] d3=new string[100000]; string[] d4=new string[100000]; string[] d5=new string[100000]; float[] pointX=new float[100000]; float[] pointY=new float[100000]; int isiX=0,isiY=0; int counter31=0; //PointF[] points= new PointF[10000]; PointF[] points2= new PointF[10000]; PointF batas= new PointF(); //string line; string baris; nilai[0,0]=0; nilai[0,1]=300; nilai[0,2]=300; nilai[0,3]=270; nilai[0,4]=300; nilai[0,5]=300; nilai[0,6]=300; nilai[0,7]=300; nilai[0,8]=300; nilai[0,9]=0; nilai[1,0]=0; nilai[1,1]=300; nilai[1,2]=300; nilai[1,3]=300; nilai[1,4]=300; nilai[1,5]=300; nilai[1,6]=300; nilai[1,7]=300; nilai[1,8]=300; nilai[1,9]=0; nilai[2,0]=0; nilai[2,1]=300; nilai[2,2]=300; nilai[2,3]=300; nilai[2,4]=300; nilai[2,5]=300; nilai[2,6]=300; nilai[2,7]=300; nilai[2,8]=300; nilai[2,9]=0; nilai[3,0]=0; nilai[3,1]=300; nilai[3,2]=300; nilai[3,3]=300; nilai[3,4]=270; nilai[3,5]=300; nilai[3,6]=300; nilai[3,7]=300; nilai[3,8]=300;
135
nilai[3,9]=0; nilai[4,0]=0; nilai[4,1]=300; nilai[4,2]=270; nilai[4,3]=300; nilai[4,4]=300; nilai[4,5]=300; nilai[4,6]=300; nilai[4,7]=300; nilai[4,8]=300; nilai[4,9]=0; nilai[5,0]=0; nilai[5,1]=300; nilai[5,2]=300; nilai[5,3]=300; nilai[5,4]=300; nilai[5,5]=300; nilai[5,6]=300; nilai[5,7]=300; nilai[5,8]=300; nilai[5,9]=0; //baca file n tulis per baris System.IO.StreamReader teks= new System.IO.StreamReader("d:\\kompilasi28.txt"); while((baris = teks.ReadLine()) != null) { string[] isi=new string[10]; isi=baris.Split('\t'); this.richTextBox2.AppendText(baris+"\n"); rotor1[counter7]=Convert.ToSingle(isi[1]); rotor2[counter8]=Convert.ToSingle(isi[2]); rotor3[counter9]=Convert.ToSingle(isi[3]); rotor4[counter10]=Convert.ToSingle(isi[4]); dosis1[counter11]=(rotor1[counter7]*2.2844f)+8.2628f; dosis2[counter12]=(rotor2[counter8]*3.5716f)+5.2496f; dosis3[counter13]=(rotor3[counter9]*2.7497f)-6.6106f; dosis4[counter14]=(rotor4[counter10]*3.2918f)+8.3161f; dosisrata[counter19]=Convert.ToInt16(isi[7]); //((dosis1[counter11]+dosis2[counter12]+dosis3[counter13]+dosis4[counter14])/4.0f); d1[counter15]=Convert.ToString(dosis1[counter11]); d2[counter16]=Convert.ToString(dosis2[counter12]); d3[counter17]=Convert.ToString(dosis3[counter13]); d4[counter18]=Convert.ToString(dosis4[counter14]); d5[counter20]=Convert.ToString(dosisrata[counter19]); x3[counter3]=Convert.ToSingle(isi[5]); y3[counter3]=Convert.ToSingle(isi[6]); x4[counter4]=((x3[counter3]/100.0f)*a)+25; y4[counter4]=((y3[counter3]/100.0f)*b)+25; x5[counter5]=Convert.ToInt16(x4[counter4]); y5[counter5]=Convert.ToInt16(y4[counter4]); x6[counter6]=Convert.ToString(x5[counter5]); y6[counter6]=Convert.ToString(y5[counter5]); richTextBox3.AppendText(x6[counter6]+"\n"); richTextBox4.AppendText(y6[counter6]+"\n"); //richTextBox3.AppendText(d1[counter15]+"\n"); //richTextBox4.AppendText(d2[counter16]+"\n"); //richTextBox5.AppendText(d3[counter17]+"\n"); //richTextBox6.AppendText(d5[counter20]+"\n"); Graphics g = panel1.CreateGraphics(); Bitmap bmp=new Bitmap(panel1.Width,panel1.Height,PixelFormat.Format32bppPArgb);
136
Color backColor=bmp.GetPixel(1,1); bmp.MakeTransparent(backColor); X=(x5[counter5])/((5*A1)+25); Y=(y5[counter5])/((5*B1)+25); //X=(x5[counter5])/((5*A1)); //Y=(y5[counter5])/((5*B1)); X2=Convert.ToString(X); Y2=Convert.ToString(Y); z=Convert.ToString(counter5); //richTextBox5.AppendText(X2+"\n"); //richTextBox6.AppendText(z+"\n"); if (dosisrata[counter19]==nilai[X,Y]) { bmp.SetPixel(x5[counter5],y5[counter5],Color.Blue); } else bmp.SetPixel(x5[counter5],y5[counter5],Color.Red); g.DrawImageUnscaled(bmp,0,0); counter3++; counter4++; counter5++; counter6++; counter7++; counter8++; counter9++; counter10++; counter11++; counter12++; counter13++; counter14++; counter15++; counter16++; counter17++; counter18++; counter19++; } } private void buat_grid() { PointF titik; float[] titikX=new float[10000]; float[] titikY=new float[10000]; int isiX=0,isiY=0; string[,] s=new string[100,100]; string line; //float a=13.1f,b=13.1f; float a=10.1f,b=10.1f; float[] x= new float[10000]; float[] y= new float[10000]; float[] x2= new float[10000]; float[] y2= new float[10000]; PointF[] points= new PointF[10000]; //SizeF GridCellSize=new SizeF(5.0f,5.0f); Graphics graf=panel1.CreateGraphics(); Pen pencil=new Pen(Color.Green,2); pencil.DasHSTyle=System.Drawing.Drawing2D.DasHSTyle.Dot; PointF startP=new PointF(); PointF endP=new PointF(); PointF startPv=new PointF(); PointF endPv=new PointF(); PointF coba=new PointF(); Graphics g = panel1.CreateGraphics(); System.IO.StreamReader file= new System.IO.StreamReader("d:\\test3.txt"); while((line = file.ReadLine()) != null) {
137
string[] words=new string[10]; words=line.Split(','); counter++; this.richTextBox1.AppendText(line+"\n"); x[counter1]=Convert.ToSingle(words[0]); y[counter1]=Convert.ToSingle(words[1]); x2[counter2]=(x[counter1]*a)+25; y2[counter2]=(y[counter1]*b)+25; counter1++; counter2++; } Pen pen = new Pen(Color.Blue,2); for (int l = 0; l <=counter1; l++) { points[l]= new PointF(x2[l],y2[l]); } g.DrawLines(pen,points); file.Close(); //gambar grid horizontal startP.X=Origin.X; endP.X=(Origin.X)+(VerticalCells*(GridCellSize.Width*m)); for (int i = 1; i <= HorizontalCells; i++) { startP.Y=Origin.Y+((i*GridCellSize.Height)*n); endP.Y=startP.Y; graf.DrawLine(pencil,startP,endP); } //gambar grid vertikal startP.Y=Origin.Y; endP.Y=Origin.Y+(HorizontalCells*(GridCellSize.Height*n)); for (int j = 1; j < VerticalCells; j++) { startP.X=(Origin.X)+((j*GridCellSize.Width)*m); endP.X=startP.X; graf.DrawLine(pencil,startP,endP); } s[0,0]="head"; s[0,1]="300"; s[0,2]="300"; s[0,3]="300"; s[0,4]="270"; s[0,5]="300"; s[0,6]="300"; s[0,7]="300"; s[0,8]="300"; s[0,9]="bottom"; s[1,0]="head"; s[1,1]="300"; s[1,2]="300"; s[1,3]="300"; s[1,4]="300"; s[1,5]="300"; s[1,6]="300"; s[1,7]="300"; s[1,8]="300"; s[1,9]="bottom"; s[2,0]="head"; s[2,1]="300"; s[2,2]="300"; s[2,3]="300"; s[2,4]="300"; s[2,5]="300"; s[2,6]="300"; s[2,7]="300"; s[2,8]="300"; s[2,9]="bottom"; s[3,0]="head"; s[3,1]="300"; s[3,2]="300"; s[3,3]="300"; s[3,4]="270";
138
s[3,5]="300"; s[3,6]="300"; s[3,7]="300"; s[3,8]="300"; s[3,9]="bottom"; s[4,0]="head"; s[4,1]="300"; s[4,2]="270"; s[4,3]="300"; s[4,4]="300"; s[4,5]="300"; s[4,6]="300"; s[4,7]="300"; s[4,8]="300"; s[4,9]="bottom"; s[5,0]="head"; s[5,1]="300"; s[5,2]="300"; s[5,3]="300"; s[5,4]="300"; s[5,5]="300"; s[5,6]="300"; s[5,7]="300"; s[5,8]="300"; s[5,9]="bottom"; for (int w = 0; w < HorizontalCells; w++) { for (int z = 0; z < VerticalCells; z++) { coba.Y=Origin.Y+((w*GridCellSize.Height)*n); titikY[isiY]=coba.Y; coba.X=(Origin.X)+((z*GridCellSize.Width)*m); titikX[isiX]=coba.X; graf.DrawString(s[z,w],new Font("Tahoma",10),Brushes.Black,titikX[isiX],titikY[isiY]); isiX++; isiY++; } }
}
void Button1Click(object sender, EventArgs e) { //baca_koordinat(); buat_grid(); buka_txt(); } void Button2Click(object sender, EventArgs e) { //SaveBitmap(); int width=panel1.Size.Width; int height=panel1.Size.Height; using (Bitmap bmp=new Bitmap(width,height)) { panel1.DrawToBitmap(bmp,new Rectangle(0,0,width,height)); bmp.Save(@"D:\\testBMP.jpeg",ImageFormat.Jpeg); }
} }