gEDA-user: rat not connected, can't find it
DJ Delorie
dj at delorie.com
Thu Apr 10 10:00:22 EDT 2008
> On Thu, Apr 10, 2008 at 9:54 AM, DJ Delorie <dj at delorie.com> wrote:
> > Oh crap, now I'm going to have to write it.
>
> And now I'm going to have upgrade ;-)
Wrote it. http://www.delorie.com/pcb/findrat.c
#include <stdio.h>
#include <math.h>
#include "global.h"
#include "data.h"
#include "hid.h"
#include "error.h"
static int
findrat (int argc, char **argv, int x, int y)
{
RatType *r;
if (PCB->Data->RatN == 0)
{
Message("No Rats");
return 0;
}
r = & (PCB->Data->Rat[0]);
gui->set_crosshair (r->Point1.X, r->Point1.Y, HID_SC_PAN_VIEWPORT);
return 0;
}
static HID_Action findrat_action_list[] = {
{"FindRat", NULL, findrat,
NULL, NULL}
};
REGISTER_ACTIONS (findrat_action_list)
void
pcb_plugin_init()
{
register_findrat_action_list();
}
More information about the geda-user
mailing list