/*    */ package signals;
/*    */ 
/*    */ public class Clock extends Signals
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/*    */   
/*    */   public Clock(String name)
/*    */   {
/*  9 */     this.name = name;
/* 10 */     this.clock = true;
/* 11 */     this.widthUnit = 20;
/*    */   }
/*    */   
/*    */   public Clock(String name, int period) {
/* 15 */     init(name, period);
/*    */   }
/*    */   
/*    */   public Clock(String name, int period, int clockDomain, float ratio) {
/* 19 */     this.clockDomainId = clockDomain;
/* 20 */     this.ratio = ratio;
/* 21 */     init(name, period);
/*    */   }
/*    */   
/*    */   public void init(String name, int period) {
/* 25 */     setId();
/* 26 */     this.clockDomainId = this.id;
/* 27 */     this.name = name;
/* 28 */     this.clock = true;
/* 29 */     this.widthUnit = period;
/*    */     
/* 31 */     boolean level = false;
/* 32 */     for (int i = 0; i < 200; i++) {
/* 33 */       if (level) this.wave[i] = 1;
/* 34 */       if (!level) this.wave[i] = 0;
/* 35 */       level = !level;
/*    */     }
/*    */   }
/*    */   
/*    */   public void generate(boolean beginOnRisingEdge) {
/* 40 */     boolean level = false;
/* 41 */     if (beginOnRisingEdge) {
/* 42 */       for (int i = 0; i < 500; i++) {
/* 43 */         if (level) this.wave[i] = 0;
/* 44 */         if (!level) this.wave[i] = 1;
/* 45 */         level = !level;
/*    */       }
/*    */       
/*    */     } else {
/* 49 */       for (int i = 0; i < 500; i++) {
/* 50 */         if (level) this.wave[i] = 1;
/* 51 */         if (!level) this.wave[i] = 0;
/* 52 */         level = !level;
/*    */       }
/*    */     }
/*    */   }
/*    */ }


/* Location:              F:\JAVA\WORKSPACE\chronoEditor_v2.3.jar!\signals\Clock.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */