Editor工具开发实用篇:EditorGUI/EditorGUILayout的区别和EditorGUILayout的方法介绍
目录
一:EditorGUI和EditorGUILayout区别
二:EditorGUILayout
1.EditorGUILayout.BeginFadeGroup(float value);
2.EditorGUILayout.BeginHorizontal EditorGUILayout.BeginVertical
3.EditorGUILayout.BeginScrollView
4.EditorGUILayout.BeginToggleGroup&&EditorGUILayout.Toggle
5.EditorGUILayout.BoundsField EditorGUILayout.BoundsIntField public static Color ColorField 等等等....
6.EditorGUILayout.DropdownButton
7.EditorGUILayout.BeginBuildTargetSelectionGrouping
8.EditorGUILayout.EnumFlagsField
9.EditorGUILayout.EnumPopup
10.EditorGUILayout.Foldout
11.EditorGUILayout.GetControlRect
12.EditorGUILayout.GradientField
13.EditorGUILayout.HelpBox
14.EditorGUILayout.IntSlider||EditorGUILayout.Slider
15.EditorGUILayout.ObjectField
16.EditorGUILayout.PrefixLabel
17.EditorGUILayout.PropertyField
18.EditorGUILayout.SelectableLabel
19.EditorGUILayout.Space();
三.所有代码:
一:EditorGUI和EditorGUILayout区别
官方的api给出的是:EditorGUILayout是EditorGUI的自动布局版本
什么意思呢?
如果我们进入到EditorGUI和EditorGUILayout的代码里可以看到EditorGUI类里有的方法 基本在EditorGUILayout类里都有相对应的方法
区别就是:
EditorGUI类的方法基本上都要传入一个参数Rect包含了位置和大小而EditorGUILayout不需要
这样看的话我们着重了解一下EditorGUILayout类
二:EditorGUILayout
常用方法:
1.EditorGUILayout.BeginFadeGroup(float value);
解释: 开始一个可隐藏/显示的组,并且过渡将生成动画。
eg:
private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(0)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}
效果:
修改值为0.5f
private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(0.5f)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}
效果:
修改为1
private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(1)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}
效果:
2.EditorGUILayout.BeginHorizontal
EditorGUILayout.BeginVertical
解释:开始一个水平组/垂直组
eg:
EditorGUILayout.BeginHorizontal();GUILayout.Button("H_Btn1");GUILayout.Button("H_Btn2");EditorGUILayout.EndHorizontal();EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();
效果:
3.EditorGUILayout.BeginScrollView
解释:开始一个自动布局的滚动视图。
eg:
scrolpos = EditorGUILayout.BeginScrollView(scrolpos, GUILayout.Width(80), GUILayout.Height(80));GUILayout.Label("item1111111111111");GUILayout.Label("item2");GUILayout.Label("item3");GUILayout.Label("item4");GUILayout.Label("item5");EditorGUILayout.EndScrollView();
效果:
4.EditorGUILayout.BeginToggleGroup&&EditorGUILayout.Toggle
BeginToggleGroup 解释:开始一个垂直组,带有可一次性启用或禁用所有控件的开关
Toggle 解释:创建一个开关
eg:
bool showToggle;private void OnGUI() {showToggle = EditorGUILayout.BeginToggleGroup("toggleGroup", showToggle);EditorGUILayout.Toggle("toggle1", showToggle);EditorGUILayout.Toggle("toggle2", !showToggle);EditorGUILayout.EndToggleGroup();}
效果:
5.EditorGUILayout.BoundsField
EditorGUILayout.BoundsIntField
public static Color ColorField 等等等....
unity的api 或者C# api 的一些类型的展示
eg:
Bounds Bounds;BoundsInt boundsInt;Color color;private void OnGUI() {EditorGUILayout.BeginVertical();Bounds = EditorGUILayout.BoundsField(Bounds);boundsInt = EditorGUILayout.BoundsIntField(boundsInt);color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();}
效果:
6.EditorGUILayout.DropdownButton
解释:创建一个能够对鼠标按下做出反应的按钮,用于显示您自己的下拉菜单内容
eg:
private void OnGUI() {
EditorGUILayout.BeginVertical();GUIContent dropDown = new GUIContent("菜单");if(EditorGUILayout.DropdownButton(dropDown, FocusType.Keyboard)) {GenericMenu genericMenu = new GenericMenu();genericMenu.AddItem(new GUIContent("文件"), true, Select);genericMenu.AddItem(new GUIContent("工具"), false, Select);genericMenu.AddSeparator("");genericMenu.AddItem(new GUIContent("设置/设置1"), true, Select);genericMenu.AddItem(new GUIContent("设置/设置2"), false, Select);genericMenu.AddItem(new GUIContent("主题/1"), true, Select);genericMenu.AddSeparator("主题/");genericMenu.AddItem(new GUIContent("主题/2"), false, Select);genericMenu.AddDisabledItem(new GUIContent("不可更改"));Rect rect = GUILayoutUtility.GetLastRect();genericMenu.DropDown(rect);}EditorGUILayout.EndVertical();
}private void Select() {Debug.Log("Select");}
效果:
修改:
Rect rect = GUILayoutUtility.GetLastRect();
genericMenu.DropDown(rect);
为:
genericMenu.ShowAsContext();
效果:
拓展:GenericMenu 创建自定义上下文菜单和下拉菜单。
变量
allowDuplicateNames
允许菜单具有多个同名的菜单项。
公共函数
AddDisabledItem
向菜单添加已禁用的项。
AddItem
向菜单添加一个项。
AddSeparator
向菜单添加一个分隔符项。
DropDown
在给定屏幕矩形中显示菜单。
GetItemCount
获取菜单中的项数。
ShowAsContext
右键单击时在鼠标下显示菜单。
委托
MenuFunction
回调函数,菜单项选中时调用。
MenuFunction2
带有用户数据的回调函数,菜单项选中时调用。
7.EditorGUILayout.BeginBuildTargetSelectionGrouping
解释:开始构建目标组并返回所选 BuildTargetGroup。
eg:
BuildTargetGroup buildTargetGroup = EditorGUILayout.BeginBuildTargetSelectionGrouping();if(buildTargetGroup == BuildTargetGroup.Android) {GUILayout.Button("A_Btn1");GUILayout.Button("A_Btn2");} else if(buildTargetGroup == BuildTargetGroup.iOS) {GUILayout.Button("I_Btn1");GUILayout.Button("I_Btn2");} else if(buildTargetGroup == BuildTargetGroup.Standalone) {GUILayout.Button("S_Btn1");GUILayout.Button("S_Btn2");} else if(buildTargetGroup == BuildTargetGroup.WebGL) {GUILayout.Button("W_Btn1");GUILayout.Button("W_Btn2");}EditorGUILayout.EndBuildTargetSelectionGrouping();
效果:
8.EditorGUILayout.EnumFlagsField
解释:单击后,系统会为枚举类型的每个值显示带有选项的菜单。
eg:
public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
CONENUM cONENUM;private void OnGUI() {EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumFlagsField(cONENUM);EditorGUILayout.EndVertical();
}
效果:
9.EditorGUILayout.EnumPopup
解释:创建一个枚举弹出选择字段
eg:
public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
CONENUM cONENUM;private void OnGUI() {EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumPopup("ENUM", cONENUM);EditorGUILayout.EndVertical();
}
效果:
10.EditorGUILayout.Foldout
解释:创建一个左侧带有折叠箭头的标签
eg:
bool foldout = false;private void OnGUI() {EditorGUILayout.BeginVertical();foldout = EditorGUILayout.Foldout(foldout, "这个是什么意思,带折叠箭头的标签???");if(foldout) {GUILayout.Label("来吧展示!");}EditorGUILayout.EndVertical();
}
效果:
11.EditorGUILayout.GetControlRect
解释:获取编辑器控件的矩形。
eg:
Rect controlRect;string selectPath;private void OnGUI() {EditorGUILayout.BeginVertical();controlRect = EditorGUILayout.GetControlRect(true, 100);selectPath = EditorGUI.TextField(controlRect, selectPath);EditorGUILayout.EndVertical();
}
效果:
12.EditorGUILayout.GradientField
解释:创建一个用于编辑 Gradient 的字段。
eg:
Gradient gradient = new Gradient();private void OnGUI() {EditorGUILayout.BeginVertical();gradient = EditorGUILayout.GradientField(gradient);EditorGUILayout.EndVertical();}
效果:
13.EditorGUILayout.HelpBox
解释:创建一个带有发送给用户的消息的帮助框。
eg:
private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.HelpBox("一个带有发送给用户消息的帮助框?", MessageType.Error);EditorGUILayout.EndVertical();}
效果:
14.EditorGUILayout.IntSlider||EditorGUILayout.Slider
解释:创建一个滑动条,用户可以进行拖动以在最小值和最大值之间更改整数值。
eg:
int sliderValue = 0;private void OnGUI() {EditorGUILayout.BeginVertical();sliderValue = EditorGUILayout.IntSlider(sliderValue, 0, 100);EditorGUILayout.EndVertical();}
效果:
注: EditorGUILayout.Slider 区别是支持浮点类型
15.EditorGUILayout.ObjectField
解释:生成一个可接收任何对象类型的字段。
eg:
UnityEngine.Object obj;private void OnGUI() {EditorGUILayout.BeginVertical();obj = EditorGUILayout.ObjectField(obj, typeof(UnityEngine.Object), true);EditorGUILayout.EndVertical();}
效果:
16.EditorGUILayout.PrefixLabel
解释:创建一个显示在特定控件前的标签。
eg:
Color color;
private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.PrefixLabel("Color");color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();}
效果:
17.EditorGUILayout.PropertyField
解释:为 SerializedProperty 生成一个字段
eg:
public class TestBtn: MonoBehaviour {[HideInInspector]public string _name;private void OnGUI() {EditorGUILayout.BeginHorizontal();if(GUILayout.Button(_name)) {}EditorGUILayout.EndHorizontal();}
}
[CustomEditor(typeof(TestBtn))]
public class TestBtnTool : Editor {SerializedProperty serializedProperty;GUIContent gUIContent;private void Awake() {//反射拿到_name 赋值给serializedPropertyif(serializedObject.FindProperty("_name") != null) {serializedProperty = serializedObject.FindProperty("_name");}gUIContent = new GUIContent("L_Name");}public override void OnInspectorGUI() {base.OnInspectorGUI();if(serializedProperty != null) {EditorGUILayout.PropertyField(serializedProperty, gUIContent);//保存 serializedObject serializedObject是TestBtn 的序列化serializedObject.ApplyModifiedProperties();}}
}
效果:
修改L_Name
18.EditorGUILayout.SelectableLabel
解释:生成一个可选择标签字段。(用于显示可复制粘贴的只读信息。)
eg:
private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.SelectableLabel("1");EditorGUILayout.SelectableLabel("2");EditorGUILayout.SelectableLabel("3");EditorGUILayout.EndVertical();
}
修改:
注:1 2 3 可复制
19.EditorGUILayout.Space();
用在两个控件中间 会有一个空格
eg:
EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");//EditorGUILayout.Space();GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();
效果:
使用后:
三.所有代码:
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;public class EditorToolWindowOne: EditorWindow {public static EditorToolWindowOne inst;float progress;[MenuItem("EditorTool/OpenWindowOne")]public static void CreateWindow() {inst = GetWindow<EditorToolWindowOne>(true, "这是一个浮动窗口");inst.Show();}private void Awake() {}Vector2 scrolpos = new Vector2(100, 100);bool showToggle;Bounds Bounds;BoundsInt boundsInt;Color color;CONENUM cONENUM;bool foldout = false;Rect controlRect;string selectPath;Gradient gradient = new Gradient();int sliderValue = 0;UnityEngine.Object obj;private void OnGUI() {BuildTargetGroup buildTargetGroup = EditorGUILayout.BeginBuildTargetSelectionGrouping();if(buildTargetGroup == BuildTargetGroup.Android) {GUILayout.Button("A_Btn1");GUILayout.Button("A_Btn2");} else if(buildTargetGroup == BuildTargetGroup.iOS) {GUILayout.Button("I_Btn1");GUILayout.Button("I_Btn2");} else if(buildTargetGroup == BuildTargetGroup.Standalone) {GUILayout.Button("S_Btn1");GUILayout.Button("S_Btn2");} else if(buildTargetGroup == BuildTargetGroup.WebGL) {GUILayout.Button("W_Btn1");GUILayout.Button("W_Btn2");}EditorGUILayout.EndBuildTargetSelectionGrouping();if(EditorGUILayout.BeginFadeGroup(1)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");EditorGUILayout.Space();GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();scrolpos = EditorGUILayout.BeginScrollView(scrolpos, GUILayout.Width(80), GUILayout.Height(80));GUILayout.Label("item1111111111111");GUILayout.Label("item2");GUILayout.Label("item3");GUILayout.Label("item4");GUILayout.Label("item5");EditorGUILayout.EndScrollView();showToggle = EditorGUILayout.BeginToggleGroup("toggleGroup", showToggle);EditorGUILayout.Toggle("toggle1", showToggle);EditorGUILayout.Toggle("toggle2", !showToggle);EditorGUILayout.EndToggleGroup();EditorGUILayout.BeginVertical();Bounds = EditorGUILayout.BoundsField(Bounds);boundsInt = EditorGUILayout.BoundsIntField(boundsInt);color = EditorGUILayout.ColorField(color);GUIContent dropDown = new GUIContent("菜单");if(EditorGUILayout.DropdownButton(dropDown, FocusType.Keyboard)) {GenericMenu genericMenu = new GenericMenu();genericMenu.AddItem(new GUIContent("文件"), true, Select);genericMenu.AddItem(new GUIContent("工具"), false, Select);genericMenu.AddSeparator("");genericMenu.AddItem(new GUIContent("设置/设置1"), true, Select);genericMenu.AddItem(new GUIContent("设置/设置2"), false, Select);genericMenu.AddItem(new GUIContent("主题/1"), true, Select);genericMenu.AddSeparator("主题/");genericMenu.AddItem(new GUIContent("主题/2"), false, Select);genericMenu.AddDisabledItem(new GUIContent("不可更改"));genericMenu.ShowAsContext();//Rect rect = GUILayoutUtility.GetLastRect();//genericMenu.DropDown(rect);}EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumFlagsField("enum", cONENUM);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumPopup("ENUM", cONENUM);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();foldout = EditorGUILayout.Foldout(foldout, "这个是什么意思,带折叠箭头的标签???");if(foldout) {GUILayout.Label("来吧展示!");}EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();controlRect = EditorGUILayout.GetControlRect(true, 100);selectPath = EditorGUI.TextField(controlRect, selectPath);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();gradient = EditorGUILayout.GradientField(gradient);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.HelpBox("一个带有发送给用户消息的帮助框?", MessageType.Error);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();sliderValue = EditorGUILayout.IntSlider(sliderValue, 0, 100);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();obj = EditorGUILayout.ObjectField(obj, typeof(UnityEngine.Object), true);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.PrefixLabel("Color");color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.SelectableLabel("1");EditorGUILayout.SelectableLabel("2");EditorGUILayout.SelectableLabel("3");EditorGUILayout.EndVertical();}private void Select() {Debug.Log("Select");}
}
public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
效果:
如果有不对的地方希望能指出来 感激不尽。
另外,不熟悉的代码一定要写一下加深记忆 只用看的记不了太久。
相关文章:
Editor工具开发实用篇:EditorGUI/EditorGUILayout的区别和EditorGUILayout的方法介绍
目录 一:EditorGUI和EditorGUILayout区别 二:EditorGUILayout 1.EditorGUILayout.BeginFadeGroup(float value); 2.EditorGUILayout.BeginHorizontal EditorGUILayout.BeginVertical 3.EditorGUILayout.BeginScrollView 4.EditorGUILayout.BeginT…...
(五十二)大白话不断在表中插入数据时,物理存储是如何进行页分裂的?.md
上回我们讲到了数据页的物理存储结构,数据页之间是组成双向链表的,数据页内部的数据行是组成单向链表的,每个数据页内根据主键做了一个页目录 然后一般来说,你没有索引的情况下,所有的数据查询,其实在物理…...
Unity 渲染顺序
Unity中的渲染顺序自上而下大致分为三层渲染优先级 Camera depth > Sorting Layer > Order in Layer > RenderQueueCamera depth:越小越优先(大的显示在小的前面)如图:尽管Sphere距离摄像机较远,但由于Camera_Sphere dep…...
短视频美颜sdk人脸编辑技术详解、美颜sdk代码分析
短视频美颜sdk中人脸编辑技术可以将人像风格进行转变,小编认为这也是未来的美颜sdk的一个重要发展方向,下文小编将为大家讲解一下短视频美颜sdk中人脸编辑的关键点。 一、人脸编辑的细分关键点 1、年龄 通过更改人脸的年龄属性,可用于模仿人…...
error: expected declaration specifiers or ‘...’ before ‘(’ token
一、问题 最近写函数时,遇到了一个比较奇怪的问题,相信也好多人遇到一下的问题: error: expected declaration specifiers or ‘...’ before ‘(’ token代码如下: #include<stdio.h> struct stu{char *name;int score;…...
系列七、索引
一、索引概述 1.1、概述 索引(index)是帮助MySQL高效获取数据的数据结构(有序)。在数据之外,数据库系统还维护着满足特定查找算法的数据结构,这些数据结构以某种方式引用(指向)数据, 这样就可以…...
Java开发 - Elasticsearch初体验
目录 前言 什么是es? 为什么要使用es? es查询的原理? es需要准备什么? es基本用法 创建工程 添加依赖 创建操作es的文件 使用ik分词插件 Spring Data 项目中引入Spring Data 添加依赖 添加配置 创建操作es的业务逻…...
mysql进阶
mysql进阶视图视图是一个基于查询的虚拟表,封装了一条sql语句,通俗的解释,视图就是一条select查询之后的结果集,视图并不存储数据,数据仍旧存储在表中。创建视图语句:create view view_admin as select * from admin使…...
SD卡损坏了?储存卡恢复数据就靠这3个方法
作为一种方便的储存设备,SD卡在我们的日常生活中使用非常广泛。但是,有时候我们可能会遇到SD卡损坏的情况,这时候里面存储的数据就会受到影响。SD卡里面保存着我们很多重要的数据,有些还是工作必须要使用的。 如果您遇到了这种情…...
springboot+实践(总结到位)
一。【SpringBoot注解-1】 牛逼:云深i不知处 【SpringBoot注解-1】:常见注解总览_云深i不知处的博客-CSDN博客 二。【SpringBoot-3】Lombok使用详解 【SpringBoot-3】Lombok使用详解_云深i不知处的博客-CSDN博客_springboot lombok 三࿰…...
CorelDRAW2023新功能有哪些?最新版cdr下载安装教程
使用 CorelDRAW2023,随时随都能进行设计创作。在 Windows或Mac上使用专为此平台设计的直观界面,以自己的风格尽情自由创作。同全球数百万信赖CorelDRAW Graphics Suite 的艺术家、设计者及小型企业主一样,大胆展现真我,创作出众的…...
PLC 程序设计标准化方法
PLC 程序设计的标准化方法先从内容或者方法层面进行流程的分解,将分解的内容称为要素,要素的有机结合便构成了标准化的设计。流程标准化设计完成之后需要对各个要素分别进行标准化的设计。2.1、 PLC 程序设计的要素分解与有机结合根据软件程序设计的一般性方法结合PLC 程序设计…...
设计模式-笔记
文章目录七大原则单例模式桥模式 bridge观察者模式 observer责任链模式 Chain of Responsibility命令模式 Command迭代器模式 Iterator中介者模式 Mediator享元模式 Flyweight Pattern组合模式 composite装饰模式 Decorator外观模式 Facade简单工厂模式工厂方法模式工厂抽象模式…...
【全志T113-S3_100ask】12-3 Linux蓝牙通信实战(基于BlueZ的C语言BLE蓝牙编程)
【全志T113-S3_100ask】12-3 Linux蓝牙通信实战(基于BlueZ的C语言BLE蓝牙编程 背景(一)获取BlueZ源码(二)首次编译2-1 编写Makefile2-2 make编译2-3 首次测试2-3-1 开发板操作2-3-2 安卓端操作(三)源码分析3-1 程序入口3-2 蓝牙设备名称3-3 GATT服务(四)实战4-1 添加B…...
Java学习之路003——集合
1、 代码演示 【1】新增一个类,用来测试集合。先创建一组数组,数组可以存放不同的数据类型。对于Object类型的数组元素,可以通过.getClass方法获取到具体类型。 【2】如果数组指定类型为int的时候,使用.getClass()就会提示错误。 …...
生成和查看dump文件
在日常开发中,即使代码写得有多谨慎,免不了还是会发生各种意外的事件,比如服务器内存突然飙高,又或者发生内存溢出(OOM)。当发生这种情况时,我们怎么去排查,怎么去分析原因呢? 1. 什么是dump文…...
K8S集群1.24使用docker作为容器运行时出现就绪探针间歇性异常
文章目录1. 环境介绍2. 异常信息3. 分析问题3.1 kubernetes 健康检查3.1.1 存活探针3.1.2 就绪探针3.1.3 启动探针3.2 检测方法4. 解决办法1. 环境介绍 组件版本kubernetes1.24.2docker18.03.1-cecri-docker0.2.6 2. 异常信息 最近监测到 kubernetes 集群上 calico-node Pod 运…...
士大夫身份第三方水电费第三方
package com.snmocha.snbpm.job;import org.springframework.stereotype.Component;import com.xxl.job.core.handler.annotation.XxlJob;import lombok.extern.slf4j.Slf4j;/*** Demo定时任务.* Author:zhoudd* Date:2023-01-15*/ Component Slf4j publ…...
RDO一体化部署OpenStack
RDO一体化部署OpenStack 环境准备 安装centos7 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J785hZvT-1677578418769)(C:\Users\HONOR\AppData\Roaming\Typora\typora-user-images\image-20230228171254675.png)] 使用vmware安装安装centos7&a…...
CC2530+ESP8266使用MQTT协议上传阿里云的问题
ATMQTTPUB<LinkID>,<"topic">,<"data">,<qos>,<retain>LinkID: 当前只支持 0 topic: 发布主题, 最长 64 字节 data: 发布消息, data 不能包含 \0, 请确保整条 ATMQTTPUB 不超过 AT 指令的最大长度限制 qos: 发布服务质量, 参…...
Java基础:爬虫
1.本地爬虫 Pattern:表示正则表达式 Matcher:文本匹配器,作用按照正则表达式的规则去读取字符串,从头开始读取。在大串中去找符合匹配规则的子串。 1.2.获取Pattern对象 通过Pattern p Pattern.compile("正则表达式");获得 1.3.获取Matc…...
纯手动搭建大数据集群架构_记录008_搭建Hbase集群_配置集群高可用---大数据之Hadoop3.x工作笔记0169
首先准备安装包 然后将安装包分发到集群的其他机器上去 然后因为运行hbase需要zookeeper支持,所以这里首先要去,启动zk 走到/opt/module/hadoop-3.1.3/bin/zk.sh 然后 zk.sh start 启动一下,可以看到启动了已经 然后zk.sh status 可以看zookeeper的状态 然后我们再去启动一下…...
Linux系统认知——驱动认知
文章目录一、驱动相关概念1.什么是驱动2.被驱动设备分类3.设备文件的主设备号和次设备号4.设备驱动整体调用过程二、基于框架编写驱动代码1.驱动代码框架2.驱动代码的编译和测试三、树莓派I/O口驱动的编写1.微机的总线地址、物理地址、虚拟地址介绍2.通过树莓派芯片手册确定需要…...
Spring boot装载模板代码并自动运行
Spring boot装载模板代码涉及的子模块及准备省心Clickhouse批量写JSON多层级数据自动映射值模板代码生成及移交控制权给Spring IOC涉及的子模块及准备 最近比较有空,之前一直好奇,提交到线上考试的代码是如何执行测试的,在实现了基础的demo后…...
全国领先——液力悬浮仿生型人工心脏上市后在同济医院成功植入
2023年2月22日,华中科技大学同济医学院附属同济医院(同济医院)心脏大血管外科团队举办了一场气氛热烈的小规模庆祝活动,魏翔主任、程才副主任、王星宇副主任医师和李师亮医师到场,为终末期心衰患者黄先生“庆生”&…...
基于蚂蚁优化算法的柔性车间调度研究(Python代码实现)
👨🎓个人主页:研学社的博客💥💥💞💞欢迎来到本博客❤️❤️💥💥🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密…...
云原生周刊:开源漏洞仍然是开发人员面临的挑战 | 2023.2.27
Synopsys 发布了最新一期的开源安全年度报告,开源安全和风险分析 (OSSRA)。这份报告由Synopsys 网络安全研究中心 (CyRC)创建,着眼于 Black Duck 审计服务团队进行的 1,700 多次商业代码库审计的结果。 自 2019 年以来,OSSRA 所有 17 家企业…...
Docker学习总结
1、镜像操作 1.1 拉取、查看镜像 步骤一: 首先去镜像仓库搜索nginx镜像,比如[DockerHub]( Docker Hub Container Image Library | App Containerization ) : 步骤二: 根据查看到的镜像名称,拉取自己需要的镜像 通过命令&…...
Android 9.0系统源码_通知服务(三)应用发送状态栏通知的流程
前言 应用发送一个显示在状态栏上的通知,对于移动设备来说是很常见的一种功能需求,本篇文章我们将会结合Android9.0系统源码具体来分析一下,应用调用notificationManager触发通知栏通知功能的源码流程。 一、应用触发状态栏通知 应用可以通…...
python中的序列——笔记
一、介绍 ABC语言时一个致力于为初学者设计编程环境的长达十年的研究项目。 Python也从ABC那里继承了用统一的风格去处理序列数据这一特点。不管是哪种数据结构,字符串、列表、字节序列、数组、XML元素,抑或是数据库查询结果,它们都共用一套…...
taobao.user.seller.get( 查询卖家用户信息 )
¥开放平台基础API必须用户授权 查询卖家用户信息(只能查询有店铺的用户) 只能卖家类应用调用。 公共参数 请求地址: HTTP地址 http://gw.api.taobao.com/router/rest 公共请求参数: 公共响应参数: 请求参数 点击获取key和secret请求示例…...
WebRTC Qos策略
1.WebRTC 用于提升 QoS 的方法:NACK、FEC、SVC、JitterBuffer、IDR Request、PACER、Sender Side BWE、VFR(动态帧率调整策略)https://blog.csdn.net/CrystalShaw/article/details/80432267丢包重传NACK:一种通知技术,…...
Mysql数据查询
文章目录1 group by子句2 回溯统计3 having子句1 group by子句 group by子句**:分组统计,根据某个字段将所有的结果分类,并进行数据统计分析 分组的目的不是为了显示数据,一定是为了统计数据group by子句一定是出现在where子句之…...
Kafka入门(五)
下面聊聊Kafka常用命令 1、Topic管理命令 以topic:test_1为例 1.1、创建topic ./bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 3 --partitions 3 --topic test_1参数说明: –bootstrap-server:…...
如何快速在windows系统中切换node.js版本
前言 最近在同时维护公司的两个项目,一个是新项目,另一个是老项目,二者所依赖的node版本是不一致的。 这就导致我在切换项目的时候必须重新安装对应版本的 node.js,否则就会报各种神马错误。 但这一卸一装可着实烦死个银…...
设计模式-单例模式(java)
单例是一种常用的设计模式,它的目的是确保一个类只有一个实例,并提供一个全局访问点。在Java编程语言中,实现单例有多种方法,本篇文章将介绍其中的两种实现方式。 方式一:饿汉式单例模式 饿汉式单例模式是最简单的实…...
Revit中复合墙图层的规则和CAD识别翻模墙
一、Revit中用于指定复合墙图层的规则,具体内容? 在编辑复合墙的结构时,请使用“指定图层”工具将“编辑部件”对话框中的行指定给图层或预览窗格中的区域,并遵循这些原则。 在预览窗格中,样本墙的各个行必须保持从左到右的顺序显…...
【DL】Paddle BML Codelab环境使用说明 - 知识点目录
《Paddle BML Codelab环境使用说明》 1. 编辑区 Code Cell 1.1 Code Cell 操作 Magic关键字/魔术命令 Magic命令含义%timeit测试单行语句的执行时间%%timeit测试代码块的执行时间%matplotlib inline显示matplotlib生成的图形%run调用外部python脚本%pdb 调试程序%pwd 查看当…...
python正则表达式处理文本-re模块
python正则表达式处理文本-re模块 1.概述 正则表达式通常用于含有大量文本处理的应用当中。例如,它们经常用作开发者使用的文本编辑程序的搜索模式,包括 vi,emacs 和现代集成开发环境。它们也是 Unix 命令行工具的组成部分,例如…...
换了固态硬盘需要重装系统吗?教你如何实现不重装系统!
电脑大家都用过嘛,如果您的计算机装的还是机械硬盘,想必阁下肯定是修身养性的高手,因为在这个浮躁的社会中,是很少有人能够忍受5分钟甚至更久的开机时间的,不仅开机慢,应用程序的响应速度也很慢,…...
网上医疗预约挂号系统
技术:Java、JSP等摘要:网上医疗预约挂号系统是主要是对居民的保健、护理、疾病预防等健康信息实行有效的预约挂号管理。医疗机构为居民建立完整的健康档案,安排体检以及实施免疫等预防措施。而基于Web的远程保健平台以网上医疗预约挂号系统为…...
专题:一看就会的C++类模板讲解 (1)
目录 一.类模板的作用 二.类模板的定义: 三.类模板的声明格式: 四.类模板对象 五.再举一个例子 一.类模板的作用 面向对象的程序设计编程实践中,我们可能会面临这样的问题:要实现比较两个数的大小。明明比较两个数的方法都一样…...
什么是“奥卡姆剃刀”,如何用“奥卡姆剃刀”解决复杂问题?复杂问题简单化
什么是“奥卡姆剃刀”,如何用“奥卡姆剃刀”解决复杂问题?复杂问题简单化问题什么是“奥卡姆剃刀”?如何使用“奥卡姆剃刀”解决问题复杂问题简单化“汉隆剃刀”小结问题 假设你在夜空中看到一颗闪闪发光的「不明飞行物」,你认为这会是什么呢…...
角谷定理(递归)
已知有角谷定理: 输入一个自然数,若为偶数,则把它除以2,若为奇数,则把它乘以3加1。经过如此有限次运算后,总可以得到自然数值1。求经过多少次可得到自然数1。如:例如数据22的变化过程ÿ…...
数学小课堂:微积分复盘(高等数学本质上是对趋势的动态描述,是对各种相关性抽象的表述。)
文章目录 引言I 复盘1.1 概念和表述1.2 现实与虚构1.3 有穷和无穷1.4 静态和动态1.5 直觉和逻辑II 通过数学逻辑,理解人生。2.1 精明与聪明2.2 朋友和理性的对手2.3 攒钱和赚钱2.4 荣誉和财富引言 高等数学本质上是对趋势的动态描述,是对各种相关性抽象的表述。 I 复盘 1.…...
JAVA线程池原理详解一
JAVA线程池原理详解一 一. 线程池的优点 线程是稀缺资源,使用线程池可以减少创建和销毁线程的次数,每个工作线程都可以重复使用。可以根据系统的承受能力,调整线程池中工作线程的数量,防止因为消耗过多内存导致服务器崩溃。 二…...
Windows平台Unity Camera场景实现轻量级RTSP服务和RTMP推送
技术背景随着VR技术在医疗、军事、农业、学校、景区、消防、公共安全、研学机构、展厅展馆,商场等场所普及,开发者对Unity平台下的直播体验提出了更高的要求。技术实现Unity平台下的RTMP推流、RTMP、RTSP播放前几年已经覆盖了Windows、Linux、Android、i…...
LSB 题解
今天来刷一道Misc的题目,LSB原理进行图片隐写 LSB原理 LSB是一种利用人类视觉的局限性设计的幻术 PNG和BMP图片中的图像像素一般是由RGB(RED红 GREEN绿 BLUE蓝)三原色组成 记住,JPG图片是不适合使用LSB隐写的,JPG图片对像数进行了有损压缩…...
离线部署docker与镜像
离线部署docker与镜像 1.离线部署docker 1).在docker官网上下载,合适的安装文件 本次使用的是“docker-20.10.9.tgz ” 下载地址:https://download.docker.com/linux/static/stable/x86_64/ [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下…...
Linux文件系统介绍(上)
使用 Linux 系统时,需要作出的决策之一就是为存储设备选用什么文件系统。大多数 Linux 发行版在安装时会非常贴心地提供默认的文件系统,大多数入门级用户想都不想就用了默认的那个。 使用默认文件系统未必就不好,但了解一下可用的选择有时也会…...