After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 434 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 265 KiB |
After Width: | Height: | Size: 539 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 815 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 378 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1 @@
|
|||||||
|
############### 请在右侧图形化界面,全屏展示界面,完成本关卡 ###################
|
@ -0,0 +1,6 @@
|
|||||||
|
xrandr --addmode VNC-0 "1920x1080"
|
||||||
|
xrandr --output VNC-0 --mode "1920x1080"
|
||||||
|
nohup python3 x5/FunctionDisplay_X5.py &
|
||||||
|
echo "编译成功"
|
||||||
|
echo "运行成功"
|
||||||
|
echo "测评成功"
|
@ -0,0 +1,26 @@
|
|||||||
|
self.func_input = Entry(bottom_frame, font=self.font_style, width=40)
|
||||||
|
self.func_input.grid(row=0, column=0, columnspan=6, padx=(15,0), pady=5)
|
||||||
|
self.add_func_button = Button(bottom_frame, text="用户命名并新增基本函数", command=self.add_function)
|
||||||
|
self.add_func_button.grid(row=0, column=6, columnspan=2,padx=10, pady=15, sticky="ne")
|
||||||
|
Label(bottom_frame, text="x步长", font=("Lucida Grande", 18)).place(x=15,y=80)
|
||||||
|
self.x_step = Entry(bottom_frame, font=self.font_style, width=10)
|
||||||
|
self.x_step.place(x=135, y=70, width=215,height=52)
|
||||||
|
Label(bottom_frame, text="x个数", font=("Lucida Grande", 18)).place(x=15,y=155)
|
||||||
|
self.x_count = Entry(bottom_frame, font=self.font_style, width=10)
|
||||||
|
self.x_count.place(x=135, y=150, width=215,height=52)
|
||||||
|
|
||||||
|
Label(bottom_frame, text="坐标轴", font=("Lucida Grande", 20)).grid(row=2, column=4,padx=(150,0))
|
||||||
|
self.quadrant = IntVar()
|
||||||
|
self.quadrant.set(4)
|
||||||
|
Radiobutton(bottom_frame, text="四象限", command=self.update_quadrant,
|
||||||
|
value=4, variable=self.quadrant).grid(row=1, column=5, sticky="sw",padx=(0,135))
|
||||||
|
Radiobutton(bottom_frame, text="一象限", command=self.update_quadrant,
|
||||||
|
value=1, variable=self.quadrant).grid(row=3, column=5, sticky="nw",padx=(0,135))
|
||||||
|
Label(bottom_frame, text="x放大倍数", font=("Lucida Grande", 18)).place(x=750,y=80)
|
||||||
|
self.x_scale = Entry(bottom_frame, font=self.font_style, width=10)
|
||||||
|
self.x_scale.grid(row=1, column=6, padx=(70,0), sticky="se")
|
||||||
|
Label(bottom_frame, text="y放大倍数", font=("Lucida Grande", 18)).place(x=750,y=160)
|
||||||
|
self.y_scale = Entry(bottom_frame, font=self.font_style, width=10)
|
||||||
|
self.y_scale.grid(row=3, column=6, sticky="ne")
|
||||||
|
Button(bottom_frame, text="输出", command=self.print_function, width=5) \
|
||||||
|
.grid(row=1, rowspan=3, column=8, padx=(30,0),sticky="w")
|
After Width: | Height: | Size: 185 KiB |
@ -0,0 +1 @@
|
|||||||
|
{"xy": "x*y", "sinx": "sin(x)", "cosx": "cos(x)", "y": "sin(x)*cos(x)", "SinPlusCon": "sin(x)+cos(x)", "tanx": "tan(x)"}
|
@ -0,0 +1,57 @@
|
|||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
class FunctionUtil:
|
||||||
|
def __init__(self):
|
||||||
|
self.filename = "./function.json"
|
||||||
|
self.data = {}
|
||||||
|
self.load()
|
||||||
|
|
||||||
|
def load(self):
|
||||||
|
"""
|
||||||
|
加载文件数据
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
with open(self.filename, 'r', encoding="utf-8") as f:
|
||||||
|
self.data = json.load(f)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
"""
|
||||||
|
将函数保存至json文件当中
|
||||||
|
"""
|
||||||
|
with open(self.filename, "w", encoding="utf-8") as f:
|
||||||
|
json.dump(self.data, f)
|
||||||
|
|
||||||
|
def check_function_exit(self, function):
|
||||||
|
"""
|
||||||
|
检查用户输入的函数是否包含用户自定义函数
|
||||||
|
"""
|
||||||
|
for key in self.data.keys():
|
||||||
|
if function.find(key) >=0:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def add_function(self, key, value):
|
||||||
|
"""
|
||||||
|
添加函数
|
||||||
|
"""
|
||||||
|
self.data[key.strip()] = value.strip()
|
||||||
|
self.save()
|
||||||
|
|
||||||
|
def get_function_by_iter(self, key):
|
||||||
|
result = key
|
||||||
|
for dict_key in self.data.keys():
|
||||||
|
if result.find(dict_key) >= 0:
|
||||||
|
value = result.replace(dict_key, self.data[dict_key])
|
||||||
|
result = self.replace_values_recursive(value)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def replace_values_recursive(self, value):
|
||||||
|
for key in self.data:
|
||||||
|
if key in value:
|
||||||
|
replacement = self.data[key]
|
||||||
|
value = value.replace(key, replacement)
|
||||||
|
return value
|
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 434 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 265 KiB |
After Width: | Height: | Size: 539 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 815 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 378 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 1.7 KiB |