ScreenManager: MainScreen: name: 'main' HomeScreen: name: 'home' LoginScreen: name: 'login' ProfileScreen: name: "profile" HistoryScreen: name: 'history' ModifyCurrentParamScreen: name: 'modify_current_param' ModifyVoltageParamScreen: name: 'modify_voltage_param' ModifyLeakageParamScreen: name: 'modify_leakage_param' ModifySystemParamScreen: name: 'modify_system_param' ModifyProtectionParamScreen: name: 'modify_protection_param' RealTimeCurveScreen: name: 'real_time_curve' ControlCommandScreen: name: 'control_command' AboutScreen: name: 'about' : MDFloatLayout: Image: source: 'assets/img.png' size_hint: 1, 1 allow_stretch: True keep_ratio: False width: dp(360) height: dp(720) pos_hint: {'center_x': 0.5, 'center_y': 0.5} MDLabel: text: "欢 迎 使 用!" font_name: "BPoppins" font_size: "23sp" pos_hint: {'center_y': 0.53} halign: "center" # color: rgba(0, 0, 59, 255) color: get_color_from_hex("#0c5edaff") MDLabel: text: "矿用上位机测试软件---Jfen" font_name: "MPoppins" font_size: "13sp" size_hint_x: 0.85 pos_hint: {'center_x': 0.5,'center_y': 0.45} halign: "center" color: rgba(127, 127, 127, 255) Button: text: "进 入 使 用" size_hint: None, None font_name: "BPoppins" width: dp(350) height: dp(59) pos_hint: {'center_x': 0.5, 'center_y': 0.23} background_color: 0,0,0,0 on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" root.manager.current = "login" canvas.before: Color: rgb: rgba(52, 0, 231, 255) RoundedRectangle: size: self.size pos: self.pos radius: [5] : MDFloatLayout: md_bg_color: 1, 1, 1, 1 BoxLayout: orientation: 'vertical' size_hint_y: None height: "54dp" pos_hint: {"top": 1} MDTopAppBar: title: "测试软件" title_font_style: "H5" halign: 'center' elevation: 10 left_action_items: [["menu", lambda x: nav_drawer.set_state('toggle')]] MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' # app.book_history() ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.895} MDList: id : image_label_grid padding: "20dp", "40dp", "12dp", "17dp" spacing: "50dp" MDCard: size_hint: None, None width: self.parent.width - dp(50) # Set the size of the box height: "225dp" pos_hint: {"center_x": 0.5, "center_y": 0.3} # Center the box elevation: 5 # Add shadow (elevation) padding: "20dp","5dp","5dp","10dp" spacing: "10dp" orientation: 'vertical' MDLabel: text: "测试程序" font_name: "MPoppins" font_size: "13sp" size_hint_x: 1 pos_hint: {'center_x': 0.5,'center_y': 0.3} color: rgba(127, 127, 127, 255) MDRaisedButton: text: "know more..." size_hint: None, None size: "100dp", "25dp" pos_hint: {"center_x": 0.5} on_release: root.manager.current= "home" MDLabel: text: "测试" font_name: "BPoppins" font_size: "24sp" pos_hint: {'center_x': 0.45} halign: 'center' bold: True color: rgba(0, 0, 0, 255) MDCard: size_hint: None, None width: self.parent.width-dp(50) # Set the size of the box height: "225dp" pos_hint: {"center_x": 0.5, "center_y": 0.3} # Center the box elevation: 5 # Add shadow (elevation) padding: "20dp","10dp","5dp","10dp" spacing: "10dp" orientation: 'vertical' MDTextField: id: book_pos_name text: "测试" hint_text: "text" font_name: "MPoppins" font_size: "15sp" helper_text_mode: "on_focus" icon_right: "alphabetical" icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.475, "center_y": 0.8} size_hint_x: None width: 335 on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: 0.5 rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDRaisedButton: text: "测试2" size_hint: None, None size: "150dp", "25dp" pos_hint: {"center_x": 0.5} on_release: app.where_is_book() MDLabel: id : book_pos text: "测试3" halign: 'center' bold: True font_name: "BPoppins" font_size: "13sp" size_hint_x: 1 color: rgba(127, 127, 127, 255) Widget: MDNavigationDrawer: id: nav_drawer size_hint: None, 1 width:Window.size[1]-425 radius: [0,0] MDNavigationDrawerMenu: MDNavigationDrawerHeader: id : user title: "欢迎使用" text: "功能总览" title_font_style: "H5" text_font_style: "Caption" text_color: "#6c7272" text_font_size: '13sp' title_color: "#00f0ff" title_font_size: '25sp' spacing: '4dp' padding: "12dp", 0, 0, "5dp" MDNavigationDrawerDivider: MDNavigationDrawerLabel: text: "Profile" TwoLineIconListItem: id : user text: "" secondary_text:"View profile" divider:None spacing: '4dp' bold: True padding: "1dp",0,0,"1dp" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "profile" IconLeftWidget: MDFloatingActionButton: icon: "account" size_hint: 1.5, 1.5 MDNavigationDrawerDivider: # MDNavigationDrawerLabel: # text: "菜单" MDLabel: text: "菜单" font_style: "H6" theme_text_color: "Custom" text_color: "#000000ff" size_hint_y: None height: "40dp" padding: "12dp", "12dp" DrawerClickableItem: icon: "home-outline" text: "主页" font_style: "H6" theme_text_color: "Custom" text_color: "#000000ff" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" DrawerClickableItem: icon: "current-dc" # right_text: '+99' # text_right_color: "#4a4930" text: "电流设置" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" DrawerClickableItem: icon: 'meter-electric-outline' text: "电压设置" font_style: "H6" theme_text_color: "Custom" text_color: "#000000ff" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" DrawerClickableItem: icon: 'resistor' text: "漏电设置" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" DrawerClickableItem: icon: 'shield-lock-outline' text: "保护设置" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') app.clear_text() root.manager.current = "home" DrawerClickableItem: icon: 'cog-outline' text: "系统设置" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" DrawerClickableItem: icon: 'alert-circle-outline' right_text: '+99' text_right_color: "#4a4930" text: "故障记录" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" MDNavigationDrawerDivider: MDLabel: text: "功能" font_style: "H6" theme_text_color: "Custom" text_color: "#000000ff" size_hint_y: None height: "40dp" padding: "12dp", "12dp" DrawerClickableItem: icon: 'chart-bell-curve-cumulative' text: "实时曲线" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" # nav_drawer.set_state('close') root.manager.current = "history" DrawerClickableItem: icon: 'tools' text: "控制命令" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "profile_edit" MDNavigationDrawerDivider: MDNavigationDrawerLabel: text: "Help" DrawerClickableItem: icon: 'information-outline' text: "预留" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" DrawerClickableItem: icon: 'message-alert-outline' text: "预留" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "left" nav_drawer.set_state('close') root.manager.current = "home" MDNavigationDrawerDivider: DrawerClickableItem: icon: 'logout' text: "退出" font_style: "H6" on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "down" nav_drawer.set_state('close') root.manager.current = "main" app.clear_text() : Image: source: "assets/bg_img.jpg" # Path to your gradient size: self.size allow_stretch: True keep_ratio: False MDFloatLayout: mg_bd_color: 1,1,1,1 MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} user_font_size: "30sp" theme_text_color: "Custom" text_color: rgba(26,24,58,255) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "main" app.on_press_back_arrow() MDLabel: text: "欢迎使用等待认证中..." font_name: "BPoppins" font_size: "26sp" size_hint_x: None width: dp(350) pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(0, 0, 59, 255) MDLabel: id : wifi_status_text text: app.wifi_status_text font_name: "MPoppins" size_hint_x: None width: dp(350) font_size: "18sp" pos_hint: {'center_x': 0.5,'center_y': 0.70} color: rgba(135, 133, 193, 255) Button: text: "wifi认证登录" font_name: "BPoppins" size_hint: None, None width: dp(300) height: dp(59) pos_hint: {'center_x': 0.5, 'center_y': 0.37} background_color: 0,0,0,0 on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "up" app.on_start() app.verify(False) canvas.before: Color: rgb: rgba(52, 0, 231, 255) RoundedRectangle: size: self.size pos: self.pos radius: [5] : MDFloatLayout: md_bg_color: 1,1,1,1 spacing: '5dp' BoxLayout: orientation: 'vertical' MDTopAppBar: title: "My Profile" font_style: 'H5' specific_text_color: [0, 0, 0, 1] halign: 'center' elevation: 0 md_bg_color: [1,1,1,1] spacing: "2dp" MDLabel: id: profile_user_name text: "" halign: 'center' Widget: MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} user_font_size: "30sp" theme_text_color: "Custom" text_color: rgba(26,24,58,255) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = 'right' root.manager.current = "home" app.on_press_back_arrow() AnchorLayout: anchor_y: 'top' BoxLayout: orientation: 'vertical' padding: "12dp", "12dp", "12dp", "12dp" spacing: "0dp" Widget: # Add a spacer to push the MDLabel down a bit size_hint_y: None height: "70dp" BoxLayout: orientation: 'horizontal' size_hint_y: None height: '30dp' MDLabel: text: "信息" font_name: "BPoppins" font_size: "14sp" color: [0,0,0,1] size_hint_y: None height: self.texture_size[1]+50 padding: "15dp" pos_hint: {'center_y': 0.85} MDFloatingActionButton: icon: 'account-edit' padding: "12dp" pos_hint: {'center_y': 0.85, 'center_x': 0.9} size_hint: 0.2,1 on_release: root.manager.current = 'profile_edit' ScrollView: MDList: spacing: "0dp" OneLineIconListItem: id: profile_user_name text: "" IconLeftWidget: icon: "" OneLineIconListItem: id : profile_user_pass text: "" IconLeftWidget: icon: "" OneLineIconListItem: id : profile_modbus_ip text: "" IconLeftWidget: icon: "" OneLineIconListItem: id : profile_modbus_port text: "" IconLeftWidget: icon: "" OneLineIconListItem: id : profile_wifi_ssid text: "" IconLeftWidget: icon: "wifi" OneLineIconListItem: id : profile_nfc_id text: "" IconLeftWidget: icon: "nfc" OneLineIconListItem: id : profile_reserve text: "" IconLeftWidget: icon: "" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' # app.book_history() MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "测试历史" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "故障历史" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: md_bg_color: 1,1,1,1 spacing: '5dp' BoxLayout: orientation: 'vertical' MDTopAppBar: title: "Edit your Details" font_style: 'H5' specific_text_color: [0, 0, 0, 1] halign: 'center' elevation: 0 md_bg_color: [1,1,1,1] spacing: "2dp" Widget: MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} user_font_size: "30sp" theme_text_color: "Custom" text_color: rgba(26,24,58,255) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "profile" app.on_press_back_arrow() app.secure_profile() ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.895} MDList: id : image_label_grid padding: "20dp", "40dp", "12dp", "17dp" spacing: "50dp" MDLabel: text: "User" color: rgba(0, 0, 0, 255) font_name: "BPoppins" font_size: '15sp' pos_hint: {'center_x': 0.5, 'center_y': 0.90} size_hint_x: None width: dp(335) MDLabel: text: "User_pass" color: rgba(0, 0, 0, 255) font_name: "BPoppins" font_size: '15sp' pos_hint: {'center_x': 0.5, 'center_y': 0.78} size_hint_x: None width: dp(335) MDLabel: text: "Wifi_SSID" color: rgba(0, 0, 0, 255) font_name: "BPoppins" font_size: '15sp' pos_hint: {'center_x': 0.5, 'center_y': 0.66} size_hint_x: None width: dp(335) MDLabel: text: "Modbus_IP" color: rgba(0, 0, 0, 255) font_name: "BPoppins" font_size: '15sp' pos_hint: {'center_x': 0.5, 'center_y': 0.54} size_hint_x: None width: dp(335) MDLabel: text: "Modbus_Port" color: rgba(0, 0, 0, 255) font_name: "BPoppins" font_size: '15sp' pos_hint: {'center_x': 0.5, 'center_y': 0.42} size_hint_x: None width: dp(335) MDLabel: text: "Reserve" color: rgba(0, 0, 0, 255) font_name: "BPoppins" font_size: '15sp' pos_hint: {'center_x': 0.5, 'center_y': 0.30} size_hint_x: None width: dp(335) MDTextField: id: edit_user_name text: "" hint_text: "Enter Name*" font_name: "MPoppins" font_size: "15sp" helper_text: "Provide your fullname" helper_text_mode: "on_focus" icon_right: "alphabetical" icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.5, "center_y": 0.8425} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: dp(0.5) rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDTextField: id: edit_user_pass text: "" hint_text: "User_pass*" font_name: "MPoppins" font_size: "15sp" helper_text: "Provide your password" helper_text_mode: "on_focus" readonly: True icon_right: "dialpad" input_filter: 'int' max_text_length: 8 icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.5, "center_y": 0.7225} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: dp(0.5) rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDTextField: id: edit_modbus_ip text: "" hint_text: "Modbus_IP*" font_name: "MPoppins" font_size: "15sp" readonly: True helper_text: "Provide your Modbus_IP" helper_text_mode: "on_focus" icon_right: "network" min_text_length: 11 icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.5, "center_y": 0.6025} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: 0.5 rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDTextField: id:edit_modbus_port text: "" hint_text: "Modbus_Port*" font_name: "MPoppins" font_size: "15sp" readonly: True helper_text: "unable to change number directly" helper_text_mode: "on_focus" icon_right: "dialpad" icon_color: app.theme_cls.primary_color input_filter: 'int' max_text_length: 10 pos_hint: {"center_x": 0.5, "center_y": 0.4825} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: dp(0.5) rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDTextField: id: edit_nfc_id text: "" hint_text: "NFC_ID*" font_name: "MPoppins" font_size: "15sp" helper_text: "Provide your NFC_ID" helper_text_mode: "on_focus" icon_right: "nfc" min_text_length: 11 icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.5, "center_y": 0.3625} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: 0.5 rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDTextField: id: edit_wifi_ssid text: "" hint_text: "wifi ssid*" font_name: "MPoppins" font_size: "15sp" helper_text: "Provide your wifi ssid" helper_text_mode: "on_focus" icon_right: "roman-numeral-2" min_text_length: 11 icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.5, "center_y": 0.2425} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: dp(0.5) rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 MDTextField: id: edit_reserve text: "" hint_text: "Reserve*" font_name: "MPoppins" font_size: "15sp" helper_text: "Provide your Reserve" helper_text_mode: "on_focus" icon_right: "nfc" min_text_length: 11 icon_color: app.theme_cls.primary_color pos_hint: {"center_x": 0.5, "center_y": 0.1225} size_hint_x: None width: dp(335) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) canvas.before: Color: rgb: rgba(127, 127, 127, 255) Line: width: dp(0.5) rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 Button: text: "保存配置" font_name: "BPoppins" size_hint: 0.66, 0.065 pos_hint: {'center_x': 0.5, 'center_y': 0.17} background_color: 0,0,0,0 on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction = "up" app.edit_profile() app.secure_profile() canvas.before: Color: rgb: rgba(52, 0, 231, 255) RoundedRectangle: size: self.size pos: self.pos radius: [25] : MDFloatLayout: # 使用浮动布局,可以自由控制子组件的位置 orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' # 水平居中锚点 anchor_y: 'center' # 垂直居中锚点 BoxLayout: orientation: 'vertical' size_hint_y: None height: "54dp" pos_hint: {"top": 1} MDTopAppBar: title: "实时曲线" title_font_style: "H5" halign: 'center' elevation: 10 MDBottomAppBar: # 底部导航栏 height: "62dp" elevation: 10 # 阴影高度 MDActionBottomAppBarButton: # 首页按钮 icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: # 控制按钮 icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: # 历史报警按钮 icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: # 实时曲线按钮 icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: # 返回按钮(箭头) icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) # 按下时改变光标 on_touch_up: app.change_cursor(False) # 释放时恢复光标 on_release: root.manager.transition.direction = 'right' # 页面切换方向 root.manager.current = "home" # 返回首页 app.on_press_back_arrow() # 执行返回操作 ScrollView: # 可滚动区域 id: real_time_scroll_view size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.895} MDList: id: real_time_md_list padding: "20dp", "40dp", "12dp", "17dp" spacing: "50dp" BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 0:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_0 comm_address: 0 unit: "倍数" text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) MDLabel: text: "倍数" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "right" BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 1:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_1 comm_address: 1 unit: "A" text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 2:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_2 comm_address: 2 unit: "A" text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 3:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_3 comm_address: 3 unit: "A" text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 4:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_4 comm_address: 4 unit: "A" text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 5:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_5 comm_address: 5 unit: "A" text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) BoxLayout: orientation: 'horizontal' spacing: dp(10) size_hint_y: None height: dp(60) MDLabel: text: "寄存器 6:" font_name: "MPoppins" font_size: "18sp" color: (135/255, 133/255, 193/255, 1) size_hint_x: 0.4 halign: "left" MDTextField: id: register_value_field_6 comm_address: 6 text: "" font_name: "MPoppins" font_size: "18sp" size_hint_x: 0.6 input_filter: "int" on_text_validate: app.modify_register(self, self.text) # CurveWidget: # size_hint_y: None # height: dp(300) : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "测试" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "测试" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "Reading Chronicle" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "Reflecting on Read and Returned" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "测试" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "测试" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "Reading Chronicle" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "Reflecting on Read and Returned" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "Reading Chronicle" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "Reflecting on Read and Returned" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow() MDLabel: text: "Reading Chronicle" font_name: "BPoppins" font_size: "24sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.9} color: rgba(0, 0, 59, 255) MDLabel: text: "Reflecting on Read and Returned" font_name: "MPoppins" font_size: "18sp" size_hint_x: None width: dp(400) padding:"12dp" pos_hint: {'center_x': 0.5,'center_y': 0.85} color: rgba(135, 133, 193, 255) ScrollView: size_hint: 1, None height: self.parent.height - dp(150) pos_hint: {'top':0.81} MDList: id : history_grid padding: "1dp", "50dp", "12dp", "30dp" spacing: "50dp" : MDFloatLayout: orientation: 'vertical' md_bd_color: 1,1,1,1 anchor_x: 'center' anchor_y: 'center' MDBottomAppBar: height: "62dp" elevation: 10 MDActionBottomAppBarButton: icon: "home" pos_hint:{'center_x':0.15, 'center_y': 0.5} on_press: root.manager.current = 'home' MDActionBottomAppBarButton: icon: "tools" pos_hint:{'center_x':0.38, 'center_y': 0.5} on_press: root.manager.current = 'control_command' MDActionBottomAppBarButton: icon: "alert" pos_hint:{'center_x':0.61, 'center_y': 0.5} on_press: root.manager.current = 'history' MDActionBottomAppBarButton: icon: "chart-bell-curve-cumulative" pos_hint:{'center_x':0.85, 'center_y': 0.5} on_press: root.manager.current = 'real_time_curve' MDIconButton: icon: "arrow-left" pos_hint: {'center_y': 0.95} theme_text_color: "Custom" text_color: rgba(26,24,58,255) size_hint_x: None width: dp(500) on_touch_down: app.change_cursor(True) on_touch_up: app.change_cursor(False) on_release: root.manager.transition.direction= 'right' root.manager.current= "home" app.on_press_back_arrow()