url: http://paste.minad.de/index.php?nid=389
Notizname: Easy Motif Scaling von: - Sprache:

  1. /*Scaling*/
  2. /*-2.5V/2.5V*/
  3. float scal1[4]={0.000000,10.000000,-2.500000,5.000000};
  4. float grid1[4]={0.000000,1.000000,-2.500000,1.000000};
  5.  
  6. /*0V/5V*/
  7. float scal2[4]={0.000000,10.000000,0.000000,5.000000};
  8. float grid2[4]={0.000000,1.000000,0.000000,1.000000};
  9.  
  10. /*-5V/5V*/
  11. float scal3[5]={0.000000,10.000000,-5.000000,10.000000};
  12. float grid3[5]={0.000000,1.000000,-5.000000,2.000000};
  13.  
  14. /*-10V/10V*/
  15. float scal4[5]={0.000000,10.000000,-10.000000,20.000000};
  16. float grid4[5]={0.000000,1.000000,-10.000000,5.000000};
  17.  
  18. /*0V/10V*/
  19. float scal5[4]={0.000000,10.000000,0.000000,10.000000};
  20. float grid5[4]={0.000000,1.000000,0.000000,2.000000};
  21.  
  22. static void K1_Value (Widget parent, int data , XmToggleButtonCallbackStruct * cbs ){
  23. /*Abfrage welche Skalierung ausgewählt wird*/
  24. TypK1 = data;
  25.  
  26. /*Setzen der Skalierung*/
  27. if (TypK1 == 1) {
  28. XtVaSetValues(DI1_WS1, XwNscrollScale, scal1, NULL);
  29. XtVaSetValues(DI1_WS1, XwNscrollGridScale, grid1, NULL);
  30. }
  31.  
  32. if (TypK1 == 2) {
  33. XtVaSetValues(DI1_WS1, XwNscrollScale, scal2, NULL);
  34. XtVaSetValues(DI1_WS1, XwNscrollGridScale, grid2, NULL);
  35. }
  36.  
  37. if (TypK1 == 3) {
  38. XtVaSetValues(DI1_WS1, XwNscrollScale, scal3, NULL);
  39. XtVaSetValues(DI1_WS1, XwNscrollGridScale, grid3, NULL);
  40. }
  41.  
  42. if (TypK1 == 4) {
  43. XtVaSetValues(DI1_WS1, XwNscrollScale, scal4, NULL);
  44. XtVaSetValues(DI1_WS1, XwNscrollGridScale, grid4, NULL);
  45. }
  46.  
  47. if (TypK1 == 5) {
  48. XtVaSetValues(DI1_WS1, XwNscrollScale, scal5, NULL);
  49. XtVaSetValues(DI1_WS1, XwNscrollGridScale, grid5, NULL);
  50. }
  51. }
Pastelog:
erstellt 2013.06.16 18:49:46
Hits
768




© 2009-2010 rellig