Non-Canonical input mode

noncanonical

I switched from canonical to non-canonical input mode.

res= 9 
myresponse[ 0]=[fe] 
myresponse[ 1]=[fe] 
myresponse[ 2]=[80] 
myresponse[ 3]=[e0] 
myresponse[ 4]=[14] 
myresponse[ 5]=[0a] 
myresponse[ 6]=[00] 
myresponse[ 7]=[32] 
myresponse[ 8]=[fd] 

Now I can get rid of my dirty hack described in my previous articleTX power control does not work.

SSB?

ssb

The above figure in SSB modes.

Added LSB and USB for the operating mode menu. This is not for operating on these mode, but for displaying the waterfall. The frequency range is dynamically changed according to the mode so that you get better resolution with CW modes.

ssb2

The above figure in CW modes.

if(       operating_mode == 0x03 || operating_mode == 0x07) { /* CW or CW-R */
  waterfall_scale_x     =   2.0;
} else if(operating_mode == 0x00 || operating_mode == 0x01) { /* LSB or USB */
  waterfall_scale_x     =   1.0;
} 

Waterfall in a separate window

window1

This is a multi-window mode.

  p = gdk_pixbuf_get_pixels(pixbuf) + (iwater                  ) * rowstride;
  q = gdk_pixbuf_get_pixels(pixbuf) + (iwater + WATERFALL_YSIZE) * rowstride;
  for(int j=0;j<WATERFALL_XSIZE;j++) {
       double tmp  = waterfall2[j];
       *p++ = *q++ = colormap_r(tmp);
       *p++ = *q++ = colormap_g(tmp);
       *p++ = *q++ = colormap_b(tmp);
  }

The parameter, WATERFALL_YSIZE, could be more flexible in this mode. You can directly resize the window using a mouse.

GdkPixbuf for waterfall (2)

wf2

Actually, GdkPixbuf is a two dimensional array by itself, so we do not need waterfall[i][j] anymore. A single line buffer, waterfall2[j], will suffice.

   for(int i=0; i<2;i++) {
     p = gdk_pixbuf_get_pixels(pixbuf) + (iwater + i * WATERFALL_YSIZE) * rowstride;
     for(int j=0;j<WATERFALL_XSIZE;j++) {
       double tmp = waterfall2[j];
       *p++ = colormap_r(tmp);
       *p++ = colormap_g(tmp);
       *p++ = colormap_b(tmp);
     }
   }
    
  background = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, WATERFALL_XSIZE, WATERFALL_YSIZE);

  scale_x     =   3.0;
  scale_y     =   1.0;
  offset_x    =   0;  
  offset_y    =  -(iwater+1);
  dest_x      =   0;  
  dest_y      =   0;  
  dest_width  =   w;  
  dest_height =   WATERFALL_YSIZE;
  gdk_pixbuf_composite(pixbuf, background, dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, GDK_INTERP_BILINEAR, 255);

  iwater++;
  if (iwater >= WATERFALL_YSIZE) iwater = 0;

In the first step, pixbuf, which is twice as large as minimally required, is updated in two locations. This is a redundant operation, but in this way, a scroll up is implemented with a single copy, gdk_pixbuf_composite().

GdkPixbuf for waterfall

pixbuf

I was using cairo_rectangle() for drawing waterfall, but perhaps doing it with GDK-PixBuf is more efficient.

rowstride = gdk_pixbuf_get_rowstride (pixbuf);
for(int i=0;i<i_max;i++) {
 p = gdk_pixbuf_get_pixels(pixbuf) + i * rowstride;
 for(int j=0;j<j_max;j++) {
  double tmp = waterfall[i][j];
  *p++ = colormap_r(tmp);
  *p++ = colormap_g(tmp);
  *p++ = colormap_b(tmp);
 }
}

scaling

gdk_pixbuf_composite() is used with non 1.0 scaling factors to get a smooth image.

Status Read from IC-7410

opmode3

My original intention was never to touch the panel of my rig, but to control everything from the software. Therefore, I was reading only two parameters from IC-7410 every 200mS or so, namely, the Signal Strength, and the current VFO frequency. The former is a must to draw the S-meter, and the latter is just for in case.

Now I am reading some more parameters so that my display will reflect the manipulations on the panel.

opmode2

The program is simple, but does not look very cool.

opmode5

My new page, IC-7410 Rig Control, is being updated slowly.