Exemple #1
0
        public KendaliTombol(MetodeDeteksi metode)
        {
            mode               = metode;
            DaftarTombol       = new List <Control>();
            DaftarFungsi       = new List <FungsiTombol>();
            DaftarPosisiTombol = new List <int[][]>();
            daftarTimerTombol  = new List <Stopwatch>();

            PosisiMata    = new int[2][];
            PosisiMata[0] = new int[ukuranKorelasi];
            PosisiMata[1] = new int[ukuranKorelasi];

            PosisiMataAsli    = new int[2][];
            PosisiMataAsli[0] = new int[ukuranFilterMata];
            PosisiMataAsli[1] = new int[ukuranFilterMata];

            daftarHasilJarak      = new List <int>();
            daftarHasilKorelasiX  = new List <int>();
            daftarHasilKorelasiY  = new List <int>();
            daftarHasilKorelasiXY = new List <int>();

            daftarJarak      = new List <double[]>();
            daftarKorelasiX  = new List <double[]>();
            daftarKorelasiY  = new List <double[]>();
            daftarKorelasiXY = new List <double[]>();
        }
Exemple #2
0
 void UkurBaru(MetodeDeteksi metode, ArahTombol arah, int index)
 {
     pengukur        = new UCbutton1(new Action <HasilPengujian>(SelesaiUkur), metode, arah);
     pengukur.Parent = this;
     pengukur.Dock   = DockStyle.Fill;
     pengukur.BringToFront();
     indexUji = index;
 }
Exemple #3
0
        public UCbutton1(Action <HasilPengujian> fungsiSelesai, MetodeDeteksi metode, ArahTombol arah)
        {
            InitializeComponent();
            selesaiUji        = fungsiSelesai;
            hasilTekan        = new bool[jumlahSesi];
            hasilDurasiRespon = new double[jumlahSesi];

            kendali = new KendaliTombol(metode);
            kendali.TambahTombol(tombol, new FungsiTombol(HasilCekTombol));

            px = new List <double>();
            py = new List <double>();
            px.Add(0);
            py.Add(0);
            px.Add(0);
            py.Add(0);
            px.Add(0);
            py.Add(0);

            px[0] = 240;
            py[1] = 110;
            px[2] = 150;
            py[2] = 540;

            switch (arah)
            {
            case ArahTombol.Horizontal:
                metod = 0;
                break;

            case ArahTombol.Vertikal:
                metod = 1;
                break;

            case ArahTombol.Diagonal:
                metod = 2;
                break;
            }

            timer = new Stopwatch();
            timer.Start();

            updater          = new Timer();
            updater.Tick    += Update;
            updater.Interval = timeStep;
            updater.Start();
            kendali.Start();
        }