Example #1
0
/********************************************************************
 *	サンプリング・コマンド
 ********************************************************************
   HIDASP_SAMPLING(param,count) ---> return  header[16] + packet[count];
-------------
	a/d	|
	a	| rate | count | ch(s) | trig-mode | trig-ch | port-sel | rep | 
	d	| rate | count | ch(s) | trig-mode | trig-ch | port-sel | rep |
 */
void cmd_sampling(void)
{
	int   size = BSWAP16(PacketFromPC.size);
	sample_init(&PacketFromPC);
	sample_read(sampling_buf,size);
	USBwrite(sampling_buf,size);
}
Example #2
0
static SamplePlugin *
sample_new (XfcePanelPlugin *plugin)
{
  SamplePlugin   *sample;
  GtkOrientation  orientation;
  GtkWidget      *label;

  /* allocate memory for the plugin structure */
  sample = panel_slice_new0 (SamplePlugin);

  /* pointer to plugin */
  sample->plugin = plugin;

  /* read the user settings */
  sample_read (sample);

  /* get the current orientation */
  orientation = xfce_panel_plugin_get_orientation (plugin);

  /* create some panel widgets */
  sample->ebox = gtk_event_box_new ();
  gtk_widget_show (sample->ebox);

  sample->hvbox = gtk_box_new (orientation, 2);
  gtk_widget_show (sample->hvbox);
  gtk_container_add (GTK_CONTAINER (sample->ebox), sample->hvbox);

  /* some sample widgets */
  label = gtk_label_new (_("Sample"));
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (sample->hvbox), label, FALSE, FALSE, 0);

  label = gtk_label_new (_("Plugin"));
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (sample->hvbox), label, FALSE, FALSE, 0);

  return sample;
}