Skip to content

Commit

Permalink
Merge pull request #4 from laorange/v3.x
Browse files Browse the repository at this point in the history
v3.0.3
  • Loading branch information
laorange authored Jun 7, 2022
2 parents 79c28f6 + 0ac0586 commit 589a2eb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ import (
var dist embed.FS

func main() {
print("这个黑框是复合材料性能计算程序的本地后台服务,请勿在结束使用前关闭它")

rand.Seed(time.Now().UnixNano())
PORT := strconv.Itoa(8000 + rand.Intn(1000)) // 在8000-9000随机挑一个作为端口

url := `http://127.0.0.1:`+PORT+"/dist/"

println("这个黑框是复合材料性能计算程序的本地后台服务,请勿在结束使用前关闭它")
println("您可以访问 " + url + " 来使用程序")

http.Handle("/", http.FileServer(http.FS(dist)))

// windows
exec.Command(`cmd`, `/c`, `start`, `http://127.0.0.1:`+PORT+"/dist/").Start()
// exec.Command(`cmd`, `/c`, `start`, url).Start()

// mac
// exec.Command(`open`, `http://127.0.0.1:`+PORT+"/dist/").Start()
exec.Command(`open`, url).Start()

http.ListenAndServe(":"+PORT, nil)
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dev": "vite",
"build": "vue-tsc --noEmit && vite build --base=./",
"build-flask": "vue-tsc --noEmit && vite build --base=/static/",
"build-go": "vue-tsc --noEmit && vite build --base=/dist/",
"preview": "vite preview"
},
"dependencies": {
Expand Down
14 changes: 12 additions & 2 deletions src/components/FooterArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ function open(href: string) {
<template>
<donate-dialog v-model="showDonateDialog"></donate-dialog>
<el-footer>
<div>Made with ❤️ by <span @click="open('https://github.com/laorange')" style="cursor: pointer">GitHub@laorange</span></div>
<el-button type="success" :icon="Trophy" @click="showDonateDialog=true" size="small">赞赏支持</el-button>
<div>源代码: <a href="https://github.com/laorange/LaminateCalculation">GitHub</a> | <a href="https://gitee.com/laorange/LaminateCalculation">Gitee</a></div>
<div class="donate-button-area">
<div>Developed by <span @click="open('https://github.com/laorange')" style="cursor: pointer">GitHub@laorange</span></div>
<el-button type="success" :icon="Trophy" @click="showDonateDialog=true" size="small">赞赏支持</el-button>
</div>
</el-footer>
</template>

<style scoped>
.el-footer {
display: flex;
flex-direction: column;
justify-content: space-around;
height: 100px;
}
.donate-button-area {
display: flex;
flex-direction: row;
justify-items: center;
Expand Down
4 changes: 2 additions & 2 deletions src/components/LayerAttributeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ function letSymmetric() {
</template>
</n-dynamic-input>

<n-divider v-if="store.inputtedLayerInfos.length > 0">
<el-button @click="letSymmetric">关于此处上下对称</el-button>
<n-divider v-if="store.inputtedLayerInfos.length > 1">
<el-button @click="letSymmetric">需要上下对称?点击此处</el-button>
</n-divider>
</div>
</template>
Expand Down
8 changes: 4 additions & 4 deletions src/components/result-area/LayerResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ defineProps<{ layer: Layer }>()
<vue-latex :expression="tex.formula.souplesse_equation_lt"/>
</div>
<div class="result-block">
<vue-latex :expression="`柔度矩阵\\mathrm{souplesse\\ matrix}_{lt} = ${tex.matrix33(layer.souplesse_matrix_on_coordinate_L_T)}`"/>
<vue-latex :expression="`\\mathrm{Matrice\\ de\\ souplesse}_{lt} = ${tex.matrix33(layer.souplesse_matrix_on_coordinate_L_T)}`"/>
</div>
<div class="result-block">
<vue-latex :expression="tex.formula.souplesse_equation_xy"/>
</div>
<div class="result-block">
<vue-latex :expression="`柔度矩阵\\mathrm{souplesse\\ matrix}_{xy} = ${tex.matrix33(layer.souplesse_matrix_on_coordinate_X_Y)}`"/>
<vue-latex :expression="`\\mathrm{Matrice\\ de\\ souplesse}_{xy} = ${tex.matrix33(layer.souplesse_matrix_on_coordinate_X_Y)}`"/>
</div>

<n-divider/>
Expand All @@ -42,13 +42,13 @@ defineProps<{ layer: Layer }>()
<vue-latex :expression="tex.formula.raideur_equation_lt"/>
</div>
<div class="result-block">
<vue-latex :expression="`刚度矩阵\\mathrm{raideur\\ matrix}_{lt} = ${tex.matrix33(layer.raideur_matrix_on_coordinate_L_T)}`"/>
<vue-latex :expression="`\\mathrm{Matrice\\ de\\ raideur}_{lt} = ${tex.matrix33(layer.raideur_matrix_on_coordinate_L_T)}`"/>
</div>
<div class="result-block">
<vue-latex :expression="tex.formula.raideur_equation_xy"/>
</div>
<div class="result-block">
<vue-latex :expression="`刚度矩阵\\mathrm{raideur\\ matrix}_{xy}\\ (\\bar{E}) = ${tex.matrix33(layer.raideur_matrix_on_coordinate_X_Y)}`"/>
<vue-latex :expression="`\\mathrm{Matrice\\ de\\ raideur}_{xy}\\ (\\bar{E}) = ${tex.matrix33(layer.raideur_matrix_on_coordinate_X_Y)}`"/>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion src/latex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const tex = {
B_ij: `B_{i j}=\\sum\\limits_{k=1^{e r} p l i}\\limits^{k=n^{\\mathrm{e} m e} p l i} \\bar{E}_{i j}^{k} \\frac{z_{k}^{2}-z_{k-1}^{2}}{2}`,
C_ij: `C_{i j}=\\sum\\limits_{k=1^{e r} p l i}\\limits^{k=n^{\\mathrm{e} m e} p l i} \\bar{E}_{i j}^{k} \\frac{z_{k}^{3}-z_{k-1}^{3}}{3}`,

modules_apparents_matrix: `\\left\\{\\begin{array}{c}\\varepsilon_{o x} \\\\ \\varepsilon_{o y} \\\\ \\gamma_{o x y}\\end{array}\\right\\}=\\mathrm{h}[A]^{-1}\\left\\{\\begin{array}{c}\\sigma_{0 x} \\\\ \\sigma_{0 y} \\\\ \\sigma_{0 x y}\\end{array}\\right\\} = \\left[\\begin{array}{ccc}\\frac{1}{\\bar{E}_{x}} & -\\frac{\\bar{v}_{y x}}{\\bar{E}_{y}} & \\frac{\\bar{\\eta}_{x y}}{\\bar{G}_{x y}} \\\\ -\\frac{\\bar{v}_{x y}}{\\bar{E}_{x}} & \\frac{1}{\\overline{{E}}_{y}} & \\frac{\\bar{\\mu}_{x y}}{\\bar{G}_{x y}} \\\\ \\bar{\\eta}_{x} & \\bar{\\mu}_{y} & 1 \\\\ \\overline{\\bar{E}}_{x} & \\overline{\\bar{E}}_{y} & \\overline{\\bar{G}}_{x y}\\end{array}\\right]\\left\\{\\begin{array}{l}\\sigma_{0 x} \\\\ \\sigma_{0 y} \\\\ \\sigma_{0 x y}\\end{array}\\right\\}`,
modules_apparents_matrix: `\\left\\{\\begin{array}{c}\\varepsilon_{o x} \\\\ \\varepsilon_{o y} \\\\ \\gamma_{o x y}\\end{array}\\right\\}=\\mathrm{h}[A]^{-1}\\left\\{\\begin{array}{c}\\sigma_{0 x} \\\\ \\sigma_{0 y} \\\\ \\sigma_{0 x y}\\end{array}\\right\\} = \\left[\\begin{array}{ccc}\\frac{1}{\\bar{E}_{x}} & -\\frac{\\bar{v}_{y x}}{\\bar{E}_{y}} & \\frac{\\bar{\\eta}_{x y}}{\\bar{G}_{x y}} \\\\ -\\frac{\\bar{v}_{x y}}{\\bar{E}_{x}} & \\frac{1}{\\overline{{E}}_{y}} & \\frac{\\bar{\\nu}_{x y}}{\\bar{G}_{x y}} \\\\ \\bar{\\eta}_{x} & \\bar{\\nu}_{y} & 1 \\\\ \\overline{\\bar{E}}_{x} & \\overline{\\bar{E}}_{y} & \\overline{\\bar{G}}_{x y}\\end{array}\\right]\\left\\{\\begin{array}{l}\\sigma_{0 x} \\\\ \\sigma_{0 y} \\\\ \\sigma_{0 x y}\\end{array}\\right\\}`,
matrix_A: `\\left\\{\\begin{array}{c}\\sigma_{0 x} \\\\ \\sigma_{0 y} \\\\ \\sigma_{0 x y}\\end{array}\\right\\}=\\frac{1}{h}\\left[\\begin{array}{lll}A_{11} & A_{12} & A_{13} \\\\ A_{21} & A_{22} & A_{23} \\\\ A_{31} & A_{32} & A_{33}\\end{array}\\right]\\left\\{\\begin{array}{c}\\varepsilon_{o x} \\\\ \\varepsilon_{o y} \\\\ \\gamma_{o x y}\\end{array}\\right\\}`,

matrix_T: `\\left\\{\\begin{array}{l}\\sigma_{l} \\\\ \\sigma_{t} \\\\ \\sigma_{l t}\\end{array}\\right\\}=\\left[\\begin{array}{ccc}c^{2} & s^{2} & -2 c s \\\\ s^{2} & c^{2} & 2 c s \\\\ c s & -c s & c^{2}-s^{2}\\end{array}\\right]\\left\\{\\begin{array}{c}\\sigma_{x} \\\\ \\sigma_{y} \\\\ \\sigma_{x y}\\end{array}\\right\\}=[T]\\left\\{\\begin{array}{c}\\sigma_{x} \\\\ \\sigma_{y} \\\\ \\sigma_{x y}\\end{array}\\right\\}`,
Expand Down

0 comments on commit 589a2eb

Please sign in to comment.