blob: 97dc42a68732e36010d59fb430d337a495af1391 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/bash
#Log file location
log="/tmp/psicekicad.log"
cmd_path1="/home/prashant/www/html/drupal/drupal_7.x/r_fossee_in/sites/all/modules/custom/pspice_to_kicad/"
cmd_path2="eSim_PSpice_to_KiCad_Python_Parser/lib/PythonLib/"
parser_command="parser.py "
echo "###########Start Conversion from PSPICE to KICAD#################" >> $log
echo "" >>$log
echo "The Conversion starts at `date`" >> $log
####Getting Parameter
convertedSchematic=$1
filepath=$2
username=$3
cwd=`pwd`
echo $filepath
echo $convertedSchematic
echo "">>$log
echo "The paramters to the script is : ">>$log
echo "File : $filepath">>$log
echo "Username : $username">>$log
filename=`basename $filepath`
filewithoutExt="${filename%.*}"
echo "File name is : $filename">>$log
echo "File name without extension : $filewithoutExt">>$log
echo "">>$log
#Create Directory for every User
if [ -d $convertedSchematic ];then
echo "User directory $convertedSchematic is already available">>$log
else
mkdir -p $convertedSchematic
fi
echo "The converted file will be present at $convertedSchematic">>$log
#Creating directory for uploaded Project
mkdir -p $convertedSchematic/$filewithoutExt
#Converting PSpice to Kicad Schematic
echo "Calling Schematic conversion script" >>$log
python3.7 $cmd_path1$cmd_path2$parser_command $filepath $convertedSchematic/$filewithoutExt
#Converting to Zip file
cd $convertedSchematic
#sudo zip -rq -rm $zipname $filewithoutExt
echo "Creating zip file of converted project">>$log
zip -r $filewithoutExt{.zip,} 2>&1>>$log
echo "The zip file is present at `pwd`">>$log
cd $cwd
rm -rf $convertedSchematic/$filewithoutExt
echo "###########End PSICE to KICAD Conversion#########################">>$log
echo " ">>$log
exit
|