Commit 0d41a7a5 authored by jean-pierre charras's avatar jean-pierre charras

All: fix some issues in messages to translate. Remove fully outdated files

parent 4cbbce3a
......@@ -24,18 +24,20 @@ Contribute to KiCad (under Linux)
cd kicad_john
mkdir build; cd build
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Debug
to build a debug version
or
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Release
to build a release version
make -j 4 # this is for a 4 core machine
7) Repeat step 5 and 6 until satisfied.
8) Delete the "build" folder and create a patch:
cd kicad_john
rm -R ./build
bzr add .
bzr status
bzr diff > gui_better_zoom.patch
8) Create a patch:
in kicad_john:
if some files are added: bzr add [FILE...]
bzr diff > my_changes.patch
9) Send the patch file "gui_better_zoom.patch" to the KiCad developers mailing list.
9) Send the patch file "my_changes.patch" to the KiCad developers mailing list.
in the subject of the e-mail include the keyword "[PATCH]".
in the body of the e-mail clearly explain what you have done.
......
......@@ -9,12 +9,11 @@ AUTHORS.txt - The authors, contributors, document writers and translators li
CHANGELOG.txt - This years changelog (see for previous years Documentation/changelogs)
CMakeList.txt - CMAKE build tool script
COPYRIGHT.txt - A copy of the GNU General Public License Version 2
CTestConfig.txt - Support for CTest and CDash testing tools
Doxyfile - Doxygen preferences
CTestConfig.cmake - Support for CTest and CDash testing tools
Doxyfile - Doxygen config file for Kicad
INSTALL.txt - The release (binairy) installation instructions
TODO.txt - Todo list
uncrustify.cfg - Uncrustify code formatting tool preferences
version.txt - The current stable released version
uncrustify.cfg - Uncrustify config file for uncrustify sorces formatting tool
Subdirectories
--------------
......@@ -37,6 +36,6 @@ packaging - Files for packaging on Windows and Mac OSX
pcbnew - Sourcecode of the printed circuit board editor
polygon - Sourcecode of the polygon library
resources - Resources for installation, freedesktop mime-types for linux
scripts - Helper scripts. For building, sourcecode packaging, font setting, pcb adjusting.
scripts - Helper scripts. For building, sourcecode packaging.
template - Project template(s)
......@@ -281,7 +281,7 @@ bool DSNLEXER::IsSymbol( int aTok )
void DSNLEXER::Expecting( int aTok ) throw( IO_ERROR )
{
wxString errText;
errText.Printf( _("Expecting %s"), GetChars( GetTokenString( aTok ) ) );
errText.Printf( _("Expecting '%s'"), GetChars( GetTokenString( aTok ) ) );
THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() );
}
......@@ -298,7 +298,7 @@ void DSNLEXER::Expecting( const char* text ) throw( IO_ERROR )
void DSNLEXER::Unexpected( int aTok ) throw( IO_ERROR )
{
wxString errText;
errText.Printf( _("Unexpected %s"), GetChars( GetTokenString( aTok ) ) );
errText.Printf( _("Unexpected '%s'"), GetChars( GetTokenString( aTok ) ) );
THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() );
}
......
......@@ -452,7 +452,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile( wxCommandEvent& e
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAllFootprintFilter( wxCommandEvent& event )
{
if( IsOK( this, _( "OK to Delete FootprintFilter LIST" ) ) )
if( IsOK( this, _( "OK to delete the footprint filter list ?" ) ) )
{
m_FootprintFilterListBox->Clear();
m_ButtonDeleteAllFootprintFilter->Enable( false );
......
......@@ -253,11 +253,11 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
break;
case FIND_VALUE: // find value
msg_item.Printf( _( "value " ), GetChars( aSearchText ) );
msg_item.Printf( _( "value" ), GetChars( aSearchText ) );
break;
case FIND_FIELD: // find field. todo
msg_item.Printf( _( "field " ), GetChars( aSearchText ) );
msg_item.Printf( _( "field" ), GetChars( aSearchText ) );
break;
}
......
......@@ -305,10 +305,10 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
{
switch( Field->GetId() )
{
case REFERENCE: name = _( "Move reference" ); break;
case VALUE: name = _( "Move value" ); break;
case FOOTPRINT: name = _( "Move footprint field" ); break;
default: name = _( "Move field" ); break;
case REFERENCE: name = _( "Move Reference" ); break;
case VALUE: name = _( "Move Value" ); break;
case FOOTPRINT: name = _( "Move Footprint Field" ); break;
default: name = _( "Move Field" ); break;
}
msg = AddHotkeyName( name, s_Schematic_Hokeys_Descr,
......@@ -318,10 +318,10 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
switch( Field->GetId() )
{
case REFERENCE: name = _( "Rotate reference" ); break;
case VALUE: name = _( "Rotate value" ); break;
case FOOTPRINT: name = _( "Rotate footprint field" ); break;
default: name = _( "Rotate field" ); break;
case REFERENCE: name = _( "Rotate Reference" ); break;
case VALUE: name = _( "Rotate Value" ); break;
case FOOTPRINT: name = _( "Rotate Footprint Field" ); break;
default: name = _( "Rotate Field" ); break;
}
msg = AddHotkeyName( name, s_Schematic_Hokeys_Descr, HK_ROTATE );
......@@ -333,19 +333,19 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
{
case REFERENCE:
id = HK_EDIT_COMPONENT_REFERENCE;
name = _( "Edit reference" );
name = _( "Edit Reference" );
break;
case VALUE:
id = HK_EDIT_COMPONENT_VALUE;
name = _( "Edit value" );
name = _( "Edit Value" );
break;
case FOOTPRINT:
id = HK_EDIT_COMPONENT_FOOTPRINT;
name = _( "Edit footprint field" );
name = _( "Edit Footprint Field" );
break;
default:
id = HK_EDIT;
name = _( "Edit field" );
name = _( "Edit Field" );
break;
}
msg = AddHotkeyName( name, s_Schematic_Hokeys_Descr, id );
......
......@@ -267,11 +267,14 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
m_AttributsCtrl->SetItemToolTip( 0,
_( "Use this attribute for most non SMD components" ) );
_( "Use this attribute for most non SMD components\n"
"Components with this option are not put in the footprint position list file" ) );
m_AttributsCtrl->SetItemToolTip( 1,
_( "Use this attribute for SMD components.\nOnly components with this option are put in the footprint position list file" ) );
_( "Use this attribute for SMD components.\n"
"Only components with this option are put in the footprint position list file" ) );
m_AttributsCtrl->SetItemToolTip( 2,
_( "Use this attribute for \"virtual\" components drawn on board (like a old ISA PC bus connector)" ) );
_( "Use this attribute for \"virtual\" components drawn on board\n"
"(like a old ISA PC bus connector)" ) );
/* Controls on right side of the dialog */
switch( m_CurrentModule->GetAttributes() & 255 )
......
......@@ -237,7 +237,8 @@ bool DIALOG_GEN_MODULE_POSITION::CreateFiles()
if( singleFile )
msg.Printf( _( "Place file: <%s>\n" ), GetChars( fn.GetFullPath() ) );
else
msg.Printf( _( "Component side place file: <%s>\n" ), GetChars( fn.GetFullPath() ) );
msg.Printf( _( "Front side (top side) place file: <%s>\n" ),
GetChars( fn.GetFullPath() ) );
AddMessage( msg );
msg.Printf( _( "Footprint count %d\n" ), fpcount );
......@@ -268,7 +269,7 @@ bool DIALOG_GEN_MODULE_POSITION::CreateFiles()
// Display results
if( !singleFile )
{
msg.Printf( _( "Copper side place file: <%s>\n" ), GetChars( fn.GetFullPath() ) );
msg.Printf( _( "Back side (bottom side) place file: <%s>\n" ), GetChars( fn.GetFullPath() ) );
AddMessage( msg );
msg.Printf( _( "Footprint count %d\n" ), fpcount );
AddMessage( msg );
......
......@@ -2739,16 +2739,18 @@ BIU LEGACY_PLUGIN::biuParse( const char* aValue, const char** nptrptr )
if( errno )
{
m_error.Printf( _( "invalid float number in\nfile: <%s>\nline: %d\noffset: %d" ),
m_reader->GetSource().GetData(), m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
m_error.Printf( _( "invalid float number in file: <%s>\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
}
if( aValue == nptr )
{
m_error.Printf( _( "missing float number in\nfile: <%s>\nline: %d\noffset: %d" ),
m_reader->GetSource().GetData(), m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
m_error.Printf( _( "missing float number in file: <%s>\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
}
......@@ -2774,7 +2776,7 @@ double LEGACY_PLUGIN::degParse( const char* aValue, const char** nptrptr )
if( errno )
{
m_error.Printf( _( "invalid float number in\nfile: <%s>\nline: %d\noffset: %d" ),
m_error.Printf( _( "invalid float number in file: <%s>\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(), m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
......@@ -2782,7 +2784,7 @@ double LEGACY_PLUGIN::degParse( const char* aValue, const char** nptrptr )
if( aValue == nptr )
{
m_error.Printf( _( "missing float number in\nfile: <%s>\nline: %d\noffset: %d" ),
m_error.Printf( _( "missing float number in file: <%s>\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(), m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
......@@ -4333,7 +4335,7 @@ void LEGACY_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, PROPERTIES
if( wxFileExists( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format(
_( "library <%s> already exists, will not create anew" ),
_( "library <%s> already exists, will not create a new" ),
aLibraryPath.GetData() ) );
}
......
......@@ -574,7 +574,7 @@ void FOOTPRINT_EDIT_FRAME::OnSaveLibraryAs( wxCommandEvent& aEvent )
}
wxString msg = wxString::Format(
_( "Footprint library\n<%s> saved as\n<%s>" ),
_( "Footprint library <%s> saved as <%s>" ),
GetChars( curLibPath ), GetChars( dstLibPath ) );
DisplayInfoMessage( this, msg );
......
......@@ -89,7 +89,7 @@ double PCB_PARSER::parseDouble() throw( IO_ERROR )
if( errno )
{
wxString error;
error.Printf( _( "invalid floating point number in\nfile: <%s>\nline: %d\noffset: %d" ),
error.Printf( _( "invalid floating point number in file: <%s>\nline: %d, offset: %d" ),
GetChars( CurSource() ), CurLineNumber(), CurOffset() );
THROW_IO_ERROR( error );
......@@ -98,7 +98,7 @@ double PCB_PARSER::parseDouble() throw( IO_ERROR )
if( CurText() == tmp )
{
wxString error;
error.Printf( _( "missing floating point number in\nfile: <%s>\nline: %d\noffset: %d" ),
error.Printf( _( "missing floating point number in file: <%s>\nline: %d, offset: %d" ),
GetChars( CurSource() ), CurLineNumber(), CurOffset() );
THROW_IO_ERROR( error );
......
#!/usr/bin/perl -w
my $vernr = "0.0.2";
my $monthshort = "Mar";
my $monthlong = "March";
my $year = "2009";
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
###
# User defined settings
###
my $svn_path_remote = 'https://kicad.svn.sourceforge.net/svnroot/kicad/trunk';
my $svn_path_local = '/media/data/projects/applications/kicad/subversion/kicad-core';
my $build_path = '/home/jerry/builds/kicad';
## TODO
## Add debian package generation
## dh_make -e jerkejacobs@gmail.com -s -n
## debuild -us -uc
## TODO
###
# Commandline options
###
my $option_about = 0;
my $option_manual = 0;
my $option_help = 0;
my $option_build_binaries = 0;
my $option_svn_update = 0;
my $option_verbose = 1;
my $option_version = 0;
my $option_generate_makefiles = 0;
my $option_no_clear = 0;
my $option_install_binaries = 0;
my $no_options = 0; # No options given
###
# Commands
###
my $command_silent = '&> /dev/null'; # Nullify stderr and stdout from commands
my $command_cmake = "cmake -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DKICAD_AUIMANAGER=ON -DKICAD_AUITOOLBAR=ON $svn_path_local"; # Where cmake looks for CMakeLists.txt
my $command_svn_update = 'svn update'; # Subversion update command
###
# Help and about messages
###
my $about_message = "KiCad Devel, version $vernr, $monthshort $year, jerkejacobs\@gmail.org\n";
my $short_help = "No options given try `kicad_devel.pl --help' for more information.\n";
###########################################
########### Commandline options ###########
###########################################
if (@ARGV == 0)
{
print $short_help;
}
else
{
GetOptions('help|?' => \$option_help,
'man' => \$option_manual,
'build-binaries|compile' => \$option_build_binaries,
'svn-update' => \$option_svn_update,
'about' => \$option_about,
'version' => \$option_version,
'generate-makefiles' => \$option_generate_makefiles,
'install|install-binaries' => \$option_install_binaries,
'no-clear' => \$option_no_clear,
# Verbose settings
'quiet|noverbose' => sub { $option_verbose = 0 });
pod2usage(1) if $option_help;
pod2usage(-verbose => 2) if $option_manual;
}
###########################
########### Main ##########
###########################
# Init main function
main();
sub
main
{
# No commandline options given
if ($no_options) {
print $short_help;
exit(0);
}
# Option svn update given
if ($option_svn_update) {
svn_update();
}
# Generate makefiles
if ($option_generate_makefiles) {
generate_makefiles();
}
# Option build binaries given
if ($option_build_binaries) {
build_binaries();
}
# Install compiled binaries
if ($option_install_binaries) {
install_binaries();
}
exit(0);
}
###
# Clear the console screen
###
sub
clear_screen {
# Clear screen if no clear option is false
if ($option_no_clear == 0)
{
print `clear`;
}
else
{
print "\n\n";
}
}
###
# Print line of $_[1] char
# $_[0] = Number of chars before newline
# $_[1] = Char to print line of
###
sub
print_line {
for(my $i = 0; $i < $_[0]; ++$i) {
print $_[1];
}
print "\n";
}
###
# Execute cmake on svn_path_local to generate makefiles
# on build_path
###
sub
generate_makefiles {
# Print settings to output
if ($option_verbose == 1)
{
clear_screen();
print_line(80, '#');
print " Generating makefiles\n";
print_line(80, '#');
print " SVN Path : $svn_path_local\n";
print " Build Path : $build_path\n";
print " CMake Command : $command_cmake\n";
print_line(80, '#');
}
###
# Execute cmake command with correct verbose level output
###
# Execute command and dump output to console
if ($option_verbose == 0)
{
chdir $build_path;
`$command_cmake $command_silent`;
}
# Execute command and display output to console
if ($option_verbose == 1)
{
chdir $build_path
or die "Can't cd to $build_path";
print `$command_cmake`;
}
# Print output
if ($option_verbose == 1)
{
print_line(80, '#');
}
}
###
# Update local subversion repository on $svn_path_local
###
sub
svn_update
{
if ($option_verbose)
{
clear_screen();
print_line(80, '#');
print "Updating local subversion repository\n";
print_line(80, '#');
print "Repository path : $svn_path_local\n";
print "SVN Command : $command_svn_update\n";
print_line(80, '#');
chdir $svn_path_local
or die "Can't cd to $svn_path_local";
print `$command_svn_update`;
print_line(80, '#');
}
else
{
chdir $svn_path_local;
`$command_svn_update $command_silent`;
}
}
###
# Build the binaries on $build_path
###
sub
build_binaries
{
chdir $build_path
or die "Can't cd to $build_path";
system("make -j 4");
}
###
# Install the compiled binaries from $build_path
###
sub
install_binaries
{
chdir $build_path
or die "Can't cd to $build_path";
system("make install");
}
######## Begin of POD manual page ########
__END__
=head1 NAME
kicad_devel - KiCad development helper program
=head1 SYNOPSIS
kicad_devel [options]
Options:
--help -? brief help message
--man -M full program manual
--verbose -V set verbosity level
--about about information
--version -v display version information
--svn-update -svn-up update kicad subversion path
--build-binaries -compile compile sourcecode in build path
--install-binaries -install install compiled binaries
--no-clear dont clear the console screen after every command is executed
=head1 OPTIONS
=head2 HELP
=head1 DESCRIPTION
B<This program> will read the given input file(s) and do something
useful with the contents thereof.
=cut
#!/bin/sh
# RSS Feed Display Script by Hellf[i]re v0.1
#
# This script is designed for most any RSS Feed. As some feeds may
# not be
# completely compliant, it may need a bit of tweaking
#
# This script depends on curl.
# Gentoo: emerge -av net-misc/curl
# Debian: apt-get install curl
# Homepage: http://curl.haxx.se/
#
# Usage:
# .conkyrc: ${execi [time] /path/to/script/conky-rss.sh}
#
# Applications needed:
# bash, cat, grep, sed, curl
#
# Usage Example
# ${execi 300 /home/youruser/scripts/conky-rss.sh}
#RSS Setup
URI=http://sourceforge.net/export/rss2_keepsake.php?group_id=145591 #URI of RSS Feed
FEEDFILE="/tmp/kicad-svn-`date +%y%m%d-%H%M%S`.rss"
URLFILE="/tmp/kicad-svn-`date +%y%m%d-%H%M%S`.url"
# Get feed and save
EXEC="/usr/bin/curl -s" #Path to curl
`$EXEC $URI &> $FEEDFILE`
# Get commit description
cat $FEEDFILE | \
grep title | \
sed -e 's/[ \t]*//' | \
sed -e '/activity/d' | \
sed -e '/artifact/d' | \
sed -e 's/<title>//' | \
sed -e 's/<\!\[CDATA\[//' | \
sed -e 's/\]\]>//' | \
sed -e 's/<\/title>//'
# Space between descriptions and messages
echo ""
# Get viewvc urls only
cat $FEEDFILE | \
grep link | \
sed -e '/tracker/d' | \
sed -e '/export/d' | \
sed -e 's/[ \t]*//' | \
sed -e 's/<link>//' | \
sed -e 's/<\/link>//' &> $URLFILE
# Get commit messages from urls
exec < $URLFILE
while read LINE
do
curl -s "$LINE" | \
grep vc_log | \
sed -e 's/<td><pre class=\"vc_log\">//' | \
sed -e 's/<\/pre><\/td>//' | \
sed -e '/<style/d'
done
rm /tmp/kicad-svn-*
This source diff could not be displayed because it is too large. You can view the blob instead.
Dr:: 0,400,400;
ShC:: 0,700,600,0,900,900
ShR:: 0,0,0,0,0,0
ShO:: 0,0,0,0,0,0
Vias:: 0,700,600,0,400,400
infile: example.brd
outfile: processed.brd
1. edit a copy of configuration file 'pcb-dr-adjust.cfg' in project folder
a. Dr:: from,to,result:from_2,to_2,result_2
Replaces all drills (from...to] with 'result' value
b. Sh[C,R,O]:[|locked]: fromX,toX,resultX,fromY,toY,resultY; e.t.c.
C,R,O - different types of pads
locked/unlocked - process X and Y only if both checks match/independently
c. Vias:: the same as Shapes
d. infile: your_board_filename
e. outfile: your_out_filename
Should be not the same as infile now.
2. run pcb-dr-adjust.pl. Under Windows - download ActivePerl from http://activestate.com
Undex *nix - chmod 755 pcb-dr-adjust.cfg, execute "./pcb-dr-adjust.pl" or "path-to-svn/scripts/pcb-dr-adjust/pcb-dr-adjust.pl"
3. take a look at outfile and rename it manually if correct.
P.S. Next release I will add "make install" to *nix,*win32 makefiles to install it to bin folder.
I will try to make this tool as good as time permit. Any contributions welcome!
Enjoy!
\ No newline at end of file
Dr:: 0,400,400;
ShC:: 0,700,600,0,900,900
ShR:: 0,0,0,0,0,0
ShO:: 0,0,0,0,0,0
Vias:: 0,700,600,0,400,400
infile: example.brd
outfile: processed.brd
\ No newline at end of file
#!/usr/bin/perl -w
# version:0.01
# Script is written by Vladimir Kalyaev. You can copy and modify it, but
# this header should remain unchanged if any part of code is taken. Use
# it gently AS-IS without any warranties.
# Dedicated to my daughter Jacy.
open FH, "<pcb-dr-adjust.cfg" || die "can't load configuration file pcb-dr-adjust.cfg\n";
$totalBins=0;
print "Type\tLocked\tBin\tXmin\tXmax\tXnew\tYmin\tYmax\tYnew\n";
#$prev=0;
#@bins=();
$inp{"Dr"}[0] = qr!^(Dr\s+)(\d+)(\s+)(\d+)(\s+.*)$!;
$inp{"ShC"}[0] = qr!^(Sh\s+\"\d+\"\s+C\s+)(\d+)(\s+)(\d+)(\s+.*)$!;
$inp{"ShR"}[0] = qr!^(Sh\s+\"\d+\"\s+R\s+)(\d+)(\s+)(\d+)(\s+.*)$!;
$inp{"ShO"}[0] = qr!^(Sh\s+\"\d+\"\s+O\s+)(\d+)(\s+)(\d+)(\s+.*)$!;
$inp{"Vias"}[0] = qr!^(Po\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+)(\d+)(\s+)(\d+)(.*)$!;
#my ($pref,$curX,$space,$curY,$rest)=($1,$2,$3,$4,$5);
#< Po 3 72000 42500 72000 42500 450 450
#---
#> Po 3 72000 42500 72000 42500 620 450
while (<FH>)
{
s!\s+$!!;
$line=$_;
if ($line=~s!.*(Dr)::\s*!!)
{
$totalBins=3; $type=$1; $locked="u"; # Dr cant be "locked"!
while ($line=~m!(\d+),(\d+),(\d+)!g)
{
$inp{$type}[$totalBins]=[$1, $2, $3, 0, 0, 0];
$inp{$type}[1]=$locked;
print "$type\t$inp{$type}[1]\t$totalBins\t$inp{$type}[$totalBins]->[0]\t$inp{$type}[$totalBins]->[1]\t$inp{$type}[$totalBins]->[2]\n";
$totalBins++;
}
$inp{$type}[2]=$totalBins-1; $inp{$type}[1]=$locked;
}
if ($line =~s!.*(Sh.|Vias):(.?):\s*!!)
{
$totalBins=3; $type=$1;
if (defined $2) {$locked = $2;};
if ($locked =~ m!^\s*$!) {$locked="u";};
while ($line=~m!(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)!g)
{
$inp{$type}[1]=$locked;
$inp{$type}[$totalBins]=[$1, $2, $3, $4, $5, $6];
print "$type\t$inp{$type}[1]\t$totalBins\t$inp{$type}[$totalBins]->[0]\t$inp{$type}[$totalBins]->[1]\t$inp{$type}[$totalBins]->[2]\t$inp{$type}[$totalBins]->[3]\t$inp{$type}[$totalBins]->[4]\t$inp{$type}[$totalBins]->[5]\n";
$totalBins++;
}
$inp{$type}[2]=$totalBins-1; $inp{$type}[1]=$locked;
}
if ($line =~ s!infile:\s*(.+?)\s*$!!)
{
$infile=$1;
}
if ($line =~ s!outfile:\s*(.+?)\s*$!!)
{
$outfile=$1;
}
}
#Sh "1" C 1600 1600 0 0 0
#Sh "1" R 550 550 0 0 900
#R/C/O
#Dr 1200 0 0
if (!defined $infile) { $infile = "<example.brd";} else {$infile="<$infile";};
if (!defined $outfile) { $outfile = ">processed.brd";} else {$outfile=">$outfile";};
open FH, $infile || die "can't read inputfile ==$infile==\n";
open FHout, $outfile || die "can't open outfile ==$outfile==\n";
while (<FH>)
{
#print "before:$_|\n";
s!\s+$!!;
#chomp();# chop();
$curline=$_;
#print "after :$_|\n";
foreach $key (sort keys %inp)
{
# print "proc key:$key\n";
if ($_ =~ $inp{$key}[0])
{
# print "proc key:$key\n";
#Sh "6" C 550 550 0 0 900
#Sh "6" C ,550, ,550, 0 0 900
#Dr 320 0 0
#Dr ,320, ,0, 0
#$inp{"ShC"}[0] = qr!^(Sh\s+\"\d+\"\s+C\s+)(\d+)(\s+)(\d+)(\s+.*)$!;
my ($pref,$curX,$space,$curY,$rest)=($1,$2,$3,$4,$5);
# print "inp{$key}=$inp{$key}[0]\n";
# print "$curline\n";
# print "$1,$2,$3,$4,$5\n";
#--------------------------------
#0 - regexp
#1 - locked
#2 - totalBins
#3=>[1,2,3,4,5,6] - bins
#4=>....
#5=>....
$index=3;
$flagX=0; $flagY=0;
$newX =0; $newY =0;
# $curline = "bef:$pref,$curX,$space,$curY,$rest. locked=$inp{$key}[1], totalBins=$inp{$key}[2]\n";
# print $curline;
while ( ($index < $inp{$key}[2]+1) )
{
if (($flagX == 0) && ($curX > $inp{$key}[$index]->[0]) && ($curX <= $inp{$key}[$index]->[1]) )
{
$flagX=1; $newX=$inp{$key}[$index]->[2];
if ($inp{$key}[1] =~ m!l!i) { } else {$curX=$newX;};
}
if (($flagY == 0) && ($curY > $inp{$key}[$index]->[3]) && ($curY <= $inp{$key}[$index]->[4]) )
{
$flagY=1; $newY=$inp{$key}[$index]->[5];
if ($inp{$key}[1] =~ m!l!i) { } else {$curY=$newY;};
}
if (($inp{$key}[1] =~ m!l!i) && ($flagX =~ m!1!) && ($flagY =~ m!1!))
{
# This section means LOCKED = change together only
$curX=$newX;
$curY=$newY;
}
$index ++;
}
#--------------------------------
# $curline = "aft:$pref,$curX,$space,$curY,$rest.\n";
# print $curline;
$curline = "$pref$curX$space$curY$rest";
}
}
print FHout "$curline\n";
}
#$local = "TR|PL|EX|TQ|TA|SN|BA|BS|DT|BH|GL";
#$pcode = qr/^\s*($local)\d\w?\s+\d[A-Z]{2}\s*$/;
#@vcheck = ("SN12 6QL","G3 7XR","GLZ 7PX"," OX11 0EY","NW1 1AD");
#foreach $tp (@vcheck) {
# $tp =~ $pcode and print "$1\n";
# }
\ No newline at end of file
#!/bin/sh
# Copyright 2007 SoftPLC Corporation
# dick@softplc.com
# This script can operate on a *.brd file or a *.mod file and serves three purposes:
# 1) it resizes all the fonts to XSIZE and YSIZE
# 2) it sets the pen width of the fonts to PENWIDTH
# 3) it sets the "value" fields in all modules to "invisible"
# The two steps above correspond to the two regular expressions in the sed
# invocation below.
#----<configuration>----------------------------------------------------
# tenths of mils, e.g. 400 = .0400 inches
XSIZE=300
YSIZE=350
# tenths of mils
PENWIDTH=60
#----</configuration>--------------------------------------------------
if [ $# -ne 1 ]; then
echo "usage: $0 <boardfile.brd>"
exit 1
fi
sed \
-e "s/^\(T[0-9] -*[0-9]\{1,6\}\ -*[0-9]\{1,6\}\) -*[0-9]\{1,6\} -*[0-9]\{1,6\} \(-*[0-9]\{1,6\}\) [0-9]\{1,6\} \([NM] [IV] -*[0-9]\{1,6\} .*\)/\1 $YSIZE $XSIZE \2 $PENWIDTH \3/" \
-e "s/^\(T1 -*[0-9]\{1,6\}\ -*[0-9]\{1,6\} -*[0-9]\{1,6\} -*[0-9]\{1,6\} -*[0-9]\{1,6\} [0-9]\{1,6\} [NM]\) [IV] \(-*[0-9]\{1,6\} .*\)/\1 I \2/" \
$1 > out.tmp
# delete original and rename out.tmp to original
rm $1
mv out.tmp $1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment