[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: pcb.projectman.patch
User: pcjc2
Date: 06/09/20 12:56:22
Added: . pcb.projectman.patch
Log:
Initial commit of PCB patch for xgsch2pcb
Revision Changes Path
1.1 eda/geda/xgsch2pcb/support/pcb.projectman.patch
Index: pcb.projectman.patch
===================================================================
Index: src/action.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/action.c,v
retrieving revision 1.91
diff -U3 -p -r1.91 action.c
--- src/action.c 1 Sep 2006 02:07:49 -0000 1.91
+++ src/action.c 13 Sep 2006 21:30:52 -0000
@@ -5203,6 +5203,7 @@ ActionSaveTo (int argc, char **argv, int
{
char *function;
char *name;
+ int retval;
function = argv[0];
name = argv[1];
@@ -5217,7 +5218,15 @@ ActionSaveTo (int argc, char **argv, int
}
if (strcasecmp (function, "Layout") == 0)
{
- SavePCB (PCB->Filename);
+ retval = SavePCB (PCB->Filename);
+
+ if ( retval == STATUS_OK )
+ printf( "001 - Ok\n" );
+ else if ( retval == STATUS_ERROR )
+ printf( "002 - Error\n" );
+ else
+ printf( "003 - Unknown\n" );
+
return 0;
}
@@ -5231,6 +5240,7 @@ ActionSaveTo (int argc, char **argv, int
fclose (fp);
SetChangedFlag (True);
}
+ printf( "001 - Ok\n" );
return 0;
}
@@ -5244,6 +5254,7 @@ ActionSaveTo (int argc, char **argv, int
fclose (fp);
SetChangedFlag (True);
}
+ printf( "001 - Ok\n" );
return 0;
}
@@ -5266,6 +5277,7 @@ ActionSaveTo (int argc, char **argv, int
SetChangedFlag (True);
}
}
+ printf( "001 - Ok\n" );
return 0;
}
@@ -5317,32 +5329,43 @@ ActionLoadFrom (int argc, char **argv, i
char *function;
char *name;
char fname[256];
+ int retval;
if (argc < 2)
- AFAIL (loadfrom);
+ {
+ printf( "002 - Error\n" );
+ AFAIL (loadfrom);
+ }
function = argv[0];
name = argv[1];
HideCrosshair (True);
+ retval = STATUS_ERROR;
+
if (strcasecmp (function, "ElementToBuffer") == 0)
{
- if (LoadElementToBuffer (PASTEBUFFER, name, True))
- SetMode (PASTEBUFFER_MODE);
+ if (LoadElementToBuffer (PASTEBUFFER, name, True))
+ {
+ retval = STATUS_OK;
+ SetMode (PASTEBUFFER_MODE);
+ }
}
-
else if (strcasecmp (function, "LayoutToBuffer") == 0)
{
- if (LoadLayoutToBuffer (PASTEBUFFER, name))
- SetMode (PASTEBUFFER_MODE);
+ if (LoadLayoutToBuffer (PASTEBUFFER, name))
+ {
+ retval = STATUS_OK;
+ SetMode (PASTEBUFFER_MODE);
+ }
}
-
+
else if (strcasecmp (function, "Layout") == 0)
{
if (!PCB->Changed ||
gui->confirm_dialog (_("OK to override layout data?"), 0))
- LoadPCB (name);
+ retval = LoadPCB (name);
}
else if (strcasecmp (function, "Netlist") == 0)
@@ -5351,15 +5375,22 @@ ActionLoadFrom (int argc, char **argv, i
SaveFree (PCB->Netlistname);
PCB->Netlistname = StripWhiteSpaceAndDup (name);
FreeLibraryMemory (&PCB->NetlistLib);
- if (!ReadNetlist (PCB->Netlistname))
+ if (!( retval = ReadNetlist (PCB->Netlistname)))
hid_action ("NetlistChanged");
}
else if (strcasecmp (function, "Revert") == 0 && PCB->Filename && (!PCB->Changed || gui->confirm_dialog(_("OK to override changes?"), 0)))
{
strcpy(fname,PCB->Filename); /*Calling LoadPCB(PCB->Filename) changes the content of PCB->Filename.*/
- LoadPCB(fname);
+ retval = LoadPCB(fname);
}
+ if ( retval == STATUS_OK )
+ printf( "001 - Ok\n" );
+ else if ( retval == STATUS_ERROR )
+ printf( "002 - Error\n" );
+ else
+ printf( "003 - Unknown\n" );
+
RestoreCrosshair (True);
return 0;
}
@@ -6481,9 +6512,79 @@ ActionExecuteFile (int argc, char **argv
}
fclose (fp);
+
+ printf( "001 - Ok\n" );
+ return 0;
+}
+
+/* --------------------------------------------------------------------------- */
+
+static const char setchangedflag_syntax[] =
+"SetChangedFlag()";
+
+static const char setchangedflag_help[] =
+"Sets the dirty flag on the layout.";
+
+/* %start-doc actions SetChangedFlag
+
+When invoked, sets the changed flag on a layout
+
+%end-doc */
+
+static int
+ActionSetChangedFlag (int argc, char **argv, int x, int y)
+{
+ SetChangedFlag( True );
+
return 0;
}
+
+/* --------------------------------------------------------------------------- */
+
+static const char clrchangedflag_syntax[] =
+"ClrChangedFlag()";
+
+static const char clrchangedflag_help[] =
+"Clears the dirty flag on the layout.";
+
+/* %start-doc actions ClrChangedFlag
+
+When invoked, clears the changed flag on a layout
+
+%end-doc */
+
+static int
+ActionClrChangedFlag (int argc, char **argv, int x, int y)
+{
+ SetChangedFlag( False );
+
+ return 0;
+}
+
+
+/* --------------------------------------------------------------------------- */
+static const char hello_syntax[] =
+"Hello()";
+
+static const char hello_help[] =
+"Prints \"001 - Ok\", on stdout to verify the --listen interface is working.";
+
+/* %start-doc actions Hello
+
+When invoked, prints "001 - Ok" on stdout to verify the --listen interface is working
+
+%end-doc */
+
+static int
+ActionHello (int argc, char **argv, int x, int y)
+{
+ printf( "001 - Ok\n" );
+
+ return 0;
+}
+
+
/* --------------------------------------------------------------------------- */
HID_Action action_action_list[] = {
@@ -6593,6 +6694,12 @@ HID_Action action_action_list[] = {
movetocurrentlayer_help, movetocurrentlayer_syntax},
{"New", 0, ActionNew,
new_help, new_syntax},
+ {"SetChangedFlag", 0, ActionSetChangedFlag,
+ setchangedflag_help, setchangedflag_syntax },
+ {"ClrChangedFlag", 0, ActionClrChangedFlag,
+ clrchangedflag_help, clrchangedflag_syntax },
+ {"Hello", 0, ActionHello,
+ hello_help, hello_syntax }
};
REGISTER_ACTIONS (action_action_list)
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs