Skip to content

Commit

Permalink
AC25
Browse files Browse the repository at this point in the history
  • Loading branch information
kuvbur committed Nov 10, 2021
1 parent 407bae7 commit 55bb4a2
Show file tree
Hide file tree
Showing 376 changed files with 7,896 additions and 339 deletions.
8 changes: 8 additions & 0 deletions .idea (1)/pygdl.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
8 changes: 8 additions & 0 deletions .idea/pygdl.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 46 additions & 40 deletions Exemple/batch_addparam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,60 @@
import convert
import batch_modify
import gdl_gsm
from shutil import copy
import subprocess
import sys

force_conv = True

def set_path(path):
path = os.path.abspath(path)
if not os.path.exists(path):
os.makedirs(path, exist_ok=True)
return os.path.abspath(path)


# =============================================================================
# Имена файлов с параметрами
# =============================================================================
add_file = ['Перемычки']

add_file = ['Mep_param']
force_conv = True # Нужно ли конвертировать gsm в xml или брать сразу из папки xml_conv
version = 25
# =============================================================================
curr_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
convert_temp_dir = os.path.abspath(os.path.join(curr_dir, 'CONVERT', 'xml'))
convert_old_dir = os.path.abspath(os.path.join(curr_dir, 'CONVERT', 'gsm'))
convert_new_dir = os.path.abspath(os.path.join(curr_dir, 'CONVERT', 'gsm_out'))
# Располагаем исходные файлы в папке 'gsm'
# Промежуточные файлы будут сохранены в папку 'xml'
# Откуда конвертер переводит их формат gsm и копирует в папку 'gdlnew'

curr_dir = "D:\\"
os.chdir(curr_dir)
convert_old_dir = set_path(os.path.join(curr_dir, 'gsm'))
convert_temp_dir = set_path(os.path.join(curr_dir, 'xml'))
convert_new_dir = set_path(os.path.join(curr_dir, 'gsmnew'))
base = batch_modify.get_base()

param = {}
for from_fname in add_file:
abs_gsm_from_name = convert.get_fname_gsm(from_fname+".gsm")
abs_xml_from_name = convert.get_fname_xml(from_fname+".xml")
if os.path.isfile(abs_xml_from_name)==False or force_conv:
r =convert.gsm2xml(abs_xml_from_name,abs_gsm_from_name,22)
from_obj = gdl_gsm.gdl_gsm(abs_xml_from_name, base)
# param_from = from_obj.get_param_list()
# for k in param_from.keys():
# try:
# h = param_from[k]['Fix']
# except KeyError:
# param_from[k]['Fix'] = True
# if param_from[k]['Fix'] == False:
# param[k] = param_from[k]

# convert_temp_dir = os.path.abspath(os.path.join(curr_dir,'CONVERT','xml','conv'))
# convert_old_dir = os.path.abspath(os.path.join(curr_dir,'CONVERT','gsm','conv'))
# convert.gsm2xml_batch(convert_temp_dir, convert_old_dir, 22)
# for root, dirs, files in os.walk(convert_temp_dir):
# for nm in files:
# if nm.find(".xml")>0: #Рисунки и текстовые файлы не нужны
# fname_xml = os.path.join(root, nm) #Полный путь к файлу
# test_obj = gdl_gsm.gdl_gsm(fname_xml, base)
# test_obj.set_param_dic(param)
# test_obj.set_defult_pen()
# test_obj.close()
# copy(fname_xml, "D:\\xml")
# if os.path.isfile('D:\\gdl_log.txt'):
# os.remove('D:\\gdl_log.txt')
# p = subprocess.Popen("D:\\2gdl.bat", shell=True, stdout = subprocess.PIPE)
# stdout, stderr = p.communicate()
abs_gsm_from_name = os.path.join(convert_old_dir, from_fname + ".gsm")
abs_xml_from_name = os.path.join(convert_temp_dir, from_fname + ".xml")
if not os.path.isfile(abs_xml_from_name) or force_conv:
r = convert.gsm2xml(abs_xml_from_name, abs_gsm_from_name, version)
from_obj = gdl_gsm.gdl_gsm(abs_xml_from_name, base)
param_from = from_obj.get_param_list()
for k in param_from.keys():
try:
h = param_from[k]['Fix']
except KeyError:
param_from[k]['Fix'] = True
if not param_from[k]['Fix']:
param[k] = param_from[k]

if force_conv:
convert.gsm2xml_batch(convert_temp_dir, convert_old_dir, version)
for root, dirs, files in os.walk(convert_temp_dir):
for nm in files:
if nm.find(".xml") > 0: # Рисунки и текстовые файлы не нужны
fname_xml = os.path.join(root, nm) # Полный путь к файлу
test_obj = gdl_gsm.gdl_gsm(fname_xml, base)
n_del = test_obj.del_param_dic(param)
n_err, n_mod, n_new, n_skip = test_obj.set_param_dic(param)
print('%s - Error : %d, Del : %d, Modify : %d, New : %d, Skip : %d' % (
nm, n_err, n_del, n_mod, n_new, n_skip))
test_obj.set_defult_pen()
test_obj.close()
convert.xml2gsm_batch(convert_temp_dir, convert_new_dir, version)
Binary file added LP_XMLConverter23/Add-Ons/GDL/GDL Data In-Out.gdx
Binary file not shown.
Binary file added LP_XMLConverter23/Add-Ons/GDL/GDL DateTime.gdx
Binary file not shown.
Binary file not shown.
Binary file added LP_XMLConverter23/Add-Ons/GDL/GDL MVO Name.gdx
Binary file not shown.
Binary file added LP_XMLConverter23/Add-Ons/GDL/GDL MacAddr.gdx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added LP_XMLConverter23/AlgMath.dll
Binary file not shown.
Binary file added LP_XMLConverter23/AttributeManager.DLL
Binary file not shown.
Binary file added LP_XMLConverter23/BIMData.dll
Binary file not shown.
Binary file added LP_XMLConverter23/BasicMath.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions LP_XMLConverter23/BinFileTypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
List Setup File lis GSAC .LIS
Binary List Criteria File lic GSAC CRIT
LightWorks Image File lwi GSAC LWI
Binary file added LP_XMLConverter23/Brep.dll
Binary file not shown.
Binary file added LP_XMLConverter23/BrepOperations.dll
Binary file not shown.
Binary file added LP_XMLConverter23/BuiltInLibrary.dll
Binary file not shown.
Binary file added LP_XMLConverter23/Classification.dll
Binary file not shown.
Binary file added LP_XMLConverter23/CommandConnection.dll
Binary file not shown.
Loading

0 comments on commit 55bb4a2

Please sign in to comment.