void QmitkDiffusionDicomImport::CreateConnections()
{
  if ( m_Controls )
  {
    connect( m_Controls->m_AddFoldersButton, SIGNAL(clicked()), this, SLOT(DicomLoadAddFolderNames()) );
    connect( m_Controls->m_DeleteFoldersButton, SIGNAL(clicked()), this, SLOT(DicomLoadDeleteFolderNames()) );
    connect( m_Controls->m_DicomLoadStartLoadButton, SIGNAL(clicked()), this, SLOT(DicomLoadStartLoad()) );
    connect( m_Controls->m_DicomLoadAverageDuplicatesCheckbox, SIGNAL(clicked()), this, SLOT(AverageClicked()) );
    connect( m_Controls->m_OutputSetButton, SIGNAL(clicked()), this, SLOT(OutputSet()) );
    connect( m_Controls->m_OutputClearButton, SIGNAL(clicked()), this, SLOT(OutputClear()) );
    connect( m_Controls->m_Remove, SIGNAL(clicked()), this, SLOT(Remove()) );
  }
}
Exemple #2
0
void kbd_CfgLines(char line)
{
  static unsigned long key_rows[4] = {KEY_ROW0, KEY_ROW1, KEY_ROW2, KEY_ROW3};
  for (char i = 0; i < 4; i++)
    if (i == line)
    {
      OutputClr(key_rows[i]);
    }
    else
    {
      OutputSet(key_rows[i]);
    };
}
Exemple #3
0
/*************************************************************************
 * Function Name: main
 * Parameters: none
 *
 * Return: none
 *
 * Description: main
 *
 *************************************************************************/
int main(void)
{
  MamInit();
  // Init clock
  InitClock();
  // Init GPIO
  GpioInit();
  // Init VIC
  init_VIC();

  // Enable TIM0 clocks  
  PCONP_bit.PCTIM0 = 1; // enable clock  
  PCLKSEL0_bit.PCLK_TIMER0 = 1; //timer clock = pclk

  // Init Time0
  T0TCR_bit.CE = 0;     // counting  disable
  T0TCR_bit.CR = 1;     // set reset
  T0TCR_bit.CR = 0;     // release reset
  T0CTCR_bit.CTM = 0;   // Timer Mode: every rising PCLK edge
  T0MCR_bit.MR0I = 1;   // Enable Interrupt on MR0
  T0MCR_bit.MR0R = 1;   // Enable reset on MR0
  T0MCR_bit.MR0S = 0;   // Disable stop on MR0
  // set timer 0 period
  T0PR = 18-1;
  T0MR0 = (TIMER0_IN_FREQ)/(18 * TIMER0_TICK_PER_SEC);
  // init timer 0 interrupt
  T0IR_bit.MR0INT = 1;  // clear pending interrupt
  VIC_SetVectoredIRQ(Timer0IntrHandler,0,VIC_TIMER0);
  VICINTENABLE |= 1UL << VIC_TIMER0;
  T0TCR_bit.CE = 1;     // counting Enable
  
  __enable_interrupt();
  
  LcdInitPio();
  BoardInit();
  SysSpiInitPio();
  DacInitPio();
  AdcInitPio();
  InitAdc();
  LcdInitModule();
  LcdClear();
  
 // LcdLine(10,32,130, 32);
//  LcdLine(60,10,60, 60);
//  LcdLine(70,10,70, 60);
//  LcdRect(10,20,40, 50);
 // LcdRect(10,1,80, 7);

 /* SetFont(BIG_FONT);

  LcdLine(10, 28, 120, 28);
  LcdLine(10, 45, 120, 45);
 // LcdRect(10, 30, 50, 43);
  
  LcdText(50, 20, 200, 36, "-123456789.0");
  */
  /*
  LcdBmp(10, 20, BMP_HN_WIDTH, BMP_HN_HEIGHT, bmp_hn); 
  LcdBmp(10, 35, BMP_O2_WIDTH, BMP_O2_HEIGHT, bmp_o2); 
  DrawCheckBox(8, 8, 0, 1);
  DrawCheckBox(20, 8, 1, 1);*/
  
 // DrawMainScreen();
  DrawParamScreen();
  LcdClear();
  //DrawMenuScreen();
  
  DrawDOutTestScreen();
  
  LcdDraw();
  
  OutputSet(LCD_LED);

  InitMessages();
  InitKeyb();
  InitCursor();
  InitAdc();
  
//  SetCursorPos(100, 32);
  SendMessage(MSG_EDITOR_SCREEN_ACTIVATE);
  
  int debug = 0, debug2 = 0;
  char s[4];
  
  /*
      LcdClear();
      for(char i = 0; i < 16; i++)
        LcdLine(i * 8, 0, i * 8, 63);
      LcdDraw();
    */  
 // debug = ReadTemp() / 32;
  debug = 3855.0 + 20.0 * ((402.0 - 3855.0) / 20.0);
  unsigned int dac_codes[4] = {0, 0, 0, 0};
  dac_codes[0] = debug;
//  unsigned int dac_codes[4] = {0, 0, 0, 4095};
   WriteToDac(dac_codes);  
 // char adc_codes[4] = {0x58, 0, 0, 0};
 // char adc_codes2[4] = {0, 0, 0, 0,};
  
  char state = 0;
  while(1)
  {
/*
  WriteIntToFram(0, 100);
 
  ReadIntFromFram(0, &debug);  
 */ 
    /*
  WriteToDac(dac_codes);
    */
  /*
  switch(state)
    {
    case 0:
      //if(GetTimer(KEYB_TIMER) > 100)
      if(GetMessage(MSG_R_ENCODER_PRESSED))
      {
           OutputSet(LED11);
           OutputClr(LED12);
           OutputClr(LED13);
           OutputSet(LED15);
           ResetTimer(KEYB_TIMER);
           SendMessage(MSG_CUR_DEACTIVATE);
           state = 1;
      };
      break;
    case 1:
    //  if(GetTimer(KEYB_TIMER) > 100)
      if(GetMessage(MSG_R_ENCODER_PRESSED))      
      {
           OutputClr(LED11);
           OutputSet(LED12);
           OutputClr(LED13);
           OutputClr(LED15);           
           ResetTimer(KEYB_TIMER);
           SendMessage(MSG_CUR_ACTIVATE);
           state = 0;
      };
      break;
    case 2:
//      if(GetTimer(KEYB_TIMER) > 100)
      if(GetMessage(MSG_KEY_PRESSED))      
      {
           OutputClr(LED11);
           OutputClr(LED12);
           OutputSet(LED13);
           OutputClr(LED15);           
           ResetTimer(KEYB_TIMER);
           state = 3;
      };
      break;
    case 3:
     // if(GetTimer(KEYB_TIMER) > 100)
      if(GetMessage(MSG_KEY_PRESSED))      
      {
           OutputClr(LED11);
           OutputClr(LED12);
           OutputClr(LED13);
           OutputSet(LED15);           
           ResetTimer(KEYB_TIMER);
           state = 0;
      };
      break;      
    };
  
    if (GetMessage(MSG_L_ENCODER_CW))
    {
      debug++;
      sprintf(s, "%d", debug);
   //   LcdClear();
      LcdText(0, 0, 63, 9, s);  
      LcdDraw();
    };
     if (GetMessage(MSG_L_ENCODER_CCW))
    {
      debug--;
      sprintf(s, "%d", debug);
    //  LcdClear();
      LcdText(0, 0, 63, 9, s);  
      LcdDraw();      
    };
    
    if (GetMessage(MSG_R_ENCODER_CW))
    {
      debug2++;
      sprintf(s, "%d", debug2);
    //  LcdClear();
      LcdText(100, 0, 127, 9, s);  
      LcdDraw();
    };
     if (GetMessage(MSG_R_ENCODER_CCW))
    {
      debug2--;
      sprintf(s, "%d", debug2);
   //   LcdClear();
      LcdText(100, 0, 127, 9, s);  
      LcdDraw();      
    };
    */
 //   ProcessEditorScreen();
 //   ProcessEditor();
    
    ProcessAdc();
    ProcessCursor();
    ProcessKeyb();
    ProcessMessages();
  }
}