Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WenchenLie committed Aug 26, 2024
1 parent 2d7ca3c commit c5d14ca
Show file tree
Hide file tree
Showing 5 changed files with 3,880 additions and 4,013 deletions.
6 changes: 3 additions & 3 deletions core/run_OS.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ proc run_OS_tcl {N m mat_lib story_mat th_path SF dt mode_num has_damping zeta_m
file mkdir "$path/temp_NLMDOF_results"
# 1 base node
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_reaction.txt" $path $gm_name] -time -node 1 -dof 1 reaction
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_acc.txt" $path $gm_name] -time -node $static_node -dof 1 accel
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_vel.txt" $path $gm_name] -time -node $static_node -dof 1 vel
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_disp.txt" $path $gm_name] -time -node $static_node -dof 1 disp
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_acc.txt" $path $gm_name] -node $static_node -dof 1 accel
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_vel.txt" $path $gm_name] -node $static_node -dof 1 vel
recorder Node -file [format "%s/temp_NLMDOF_results/%s_base_disp.txt" $path $gm_name] -node $static_node -dof 1 disp
# 2 floor nodes
set floor_nodes [list]
for {set i 0} {$i < $N} {incr i} {lappend floor_nodes [expr 2 + $i]}
Expand Down
40 changes: 33 additions & 7 deletions core/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QPoint
from PyQt5.QtWidgets import QApplication, QMessageBox, QFileDialog, QDialog,\
QTableWidgetItem, QMainWindow, QMenu, QTableWidgetItem, QHeaderView,\
QTableWidget, QLabel, QTextEdit
QTableWidget, QLabel

import core
from ui.main_win import Ui_MainWindow
Expand All @@ -35,8 +35,8 @@


SOFTWARE = '非线性多自由度时程分析软件'
VERSION = 'V2.0.1'
DATE = '2024.08.25'
VERSION = 'V2.0.2'
DATE = '2024.08.26'
TEMP_PATH = Path(os.getenv('TEMP')).as_posix()
ROOT = Path(__file__).parent.parent

Expand Down Expand Up @@ -1335,7 +1335,16 @@ def choose_gm(self):
self.main.gm_t.append(t)
self.main.gm_N += 1
self.main.gm_dt.append(dt)
self.main.gm_name.append(os.path.basename(path).split('.')[0])
gm_name_original = os.path.basename(path).split('.')[0]
gm_name = gm_name_original
n = 2
while True: # 避免重复地震动名称
if gm_name in self.main.gm_name:
gm_name = gm_name_original + f' ({n})'
n += 1
else:
break
self.main.gm_name.append(gm_name)
self.main.gm_unit.append('g')
self.main.gm_PGA.append(max(abs(th)))
self.close_win()
Expand Down Expand Up @@ -1373,8 +1382,16 @@ def choose_records_file(self):
self.main.gm_N += 1
self.main.gm_dt.append(dt)
name = records.get_record_name()[i].replace('/', '_')
name = name.replace('\\', '_')
self.main.gm_name.append(name)
gm_name_original = name.replace('\\', '_')
gm_name = gm_name_original
n = 2
while True: # 避免重复地震动名称
if gm_name in self.main.gm_name:
gm_name = gm_name_original + f' ({n})'
n += 1
else:
break
self.main.gm_name.append(gm_name)
self.main.gm_unit.append('g')
self.main.gm_PGA.append(max(abs(th)))
self.close_win()
Expand Down Expand Up @@ -1425,7 +1442,16 @@ def choose_gm1(self):
t, th = data[:, 0], data[:, 1]
dt = t[1] - t[0]
self.main.gm.append(th)
self.main.gm_name.append(Win_importGM1.gm_name[idx])
gm_name_original = Win_importGM1.gm_name[idx]
gm_name = gm_name_original
n = 2
while True: # 避免重复地震动名称
if gm_name in self.main.gm_name:
gm_name = gm_name_original + f' ({n})'
n += 1
else:
break
self.main.gm_name.append(gm_name)
self.main.gm_N += 1
self.main.gm_dt.append(dt)
self.main.gm_NPTS.append(len(th) - 1)
Expand Down
Binary file modified resource_rc/N.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c5d14ca

Please sign in to comment.