summaryrefslogtreecommitdiff
path: root/convert.sh
diff options
context:
space:
mode:
authorPrashant S2020-06-17 15:50:03 +0530
committerGitHub2020-06-17 15:50:03 +0530
commit28919cd78c16c128a49878c3da9a8cefe16c1b93 (patch)
tree618b5e417f740e33245b1f3a36c7b2dc41798895 /convert.sh
parentb61d34b7bcc13a7ff2fe6d15b7defbc5516d0a17 (diff)
parentad42b5437d316ab5e04bc3bee65346fc98ecd1fe (diff)
downloadEsim-Pspice-to-kicad-convertor-28919cd78c16c128a49878c3da9a8cefe16c1b93.tar.gz
Esim-Pspice-to-kicad-convertor-28919cd78c16c128a49878c3da9a8cefe16c1b93.tar.bz2
Esim-Pspice-to-kicad-convertor-28919cd78c16c128a49878c3da9a8cefe16c1b93.zip
Merge pull request #5 from prashantsinalkar/master
updated files and fixed issues
Diffstat (limited to 'convert.sh')
-rwxr-xr-xconvert.sh29
1 files changed, 17 insertions, 12 deletions
diff --git a/convert.sh b/convert.sh
index 30436ad..97dc42a 100755
--- a/convert.sh
+++ b/convert.sh
@@ -1,16 +1,21 @@
#!/bin/bash
#Log file location
-log="/var/log/psicekicad.log"
+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
+convertedSchematic=$1
+filepath=$2
+username=$3
cwd=`pwd`
+echo $filepath
+echo $convertedSchematic
echo "">>$log
echo "The paramters to the script is : ">>$log
@@ -25,29 +30,29 @@ echo "">>$log
#Create Directory for every User
-if [ -d $convertedSchematic/$username ];then
- echo "User directory $username is already available">>$log
+if [ -d $convertedSchematic ];then
+ echo "User directory $convertedSchematic is already available">>$log
else
- mkdir -p $convertedSchematic/$username
+ mkdir -p $convertedSchematic
fi
-echo "The converted file will be present at $convertedSchematic/$username">>$log
+echo "The converted file will be present at $convertedSchematic">>$log
#Creating directory for uploaded Project
-mkdir -p $convertedSchematic/$username/$filewithoutExt
+mkdir -p $convertedSchematic/$filewithoutExt
#Converting PSpice to Kicad Schematic
echo "Calling Schematic conversion script" >>$log
-/var/www/html/esim_in/sites/all/modules/pspice_to_kicad/schConverter64 $filepath $convertedSchematic/$username/$filewithoutExt/$filename 2>&1>>$log
+python3.7 $cmd_path1$cmd_path2$parser_command $filepath $convertedSchematic/$filewithoutExt
#Converting to Zip file
-cd $convertedSchematic/$username
+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/$username/$filewithoutExt
+rm -rf $convertedSchematic/$filewithoutExt
echo "###########End PSICE to KICAD Conversion#########################">>$log
echo " ">>$log