当前位置: 首页 > news >正文

气候系统设计

基础概念

一个星球(例如地球)的气候系统主要是一些基本参数基于公转周期(年)和自转周期(日)的变化,这其中会有两个变化因素:地理位置(经纬度)和天气变化(冷暖空气流动或台风等)。

公转、自转及时间

时间决定于星球的公转周期形成年、星球的自转周期形成日,其下可以更细分出来月、时分秒等。

另外以地球为例,计时还和经度(时区)相关,部分区域可能还有夏令时等。维度决定了日出日落时间的区别,比如会出现极昼极夜等。

基本气候参数

温度:

湿度:

压强:

云量:

日照强度:

风速(方向、强度):

降雨强度:

降雪强度:

雾霾(颜色、强度):

雷暴:打雷闪电出现的频次和强度

另外有些衍生参数:

积水量:

积雪量:

积尘量:

气候影响因素

时间变化(四季和昼夜):

全年随着四季变化,各种基础参数指标会有个变化的曲线;基本所有的气候参数的基础值从这里产生;

极昼太阳远近会有基础气候参数变化,极夜太阳远近也有一些基础气候参数变化(可能比较小),然后中间维度区域在日出和日落事件发生后会逐渐做昼夜切换。

天气变化:

由于随机变化的冷暖气流变化,引起短期和随机的基础气候变化。可以分为:降水天气(雨、雪、冰雹)、雷暴天气、雾霾天气、强风天气(含飓风)。注意部分天气可能会同时发生,比如雷阵雨,同时包含下雨和雷暴甚至同时包含狂风。

游戏逻辑:

由于特殊的技能需要或者BOSS状态等也可能会引起气候参数的变化,此类状态变化独立于自然气候变化并且具有更高优先级,消失后会过渡回自然天气。

系统设计

中间全局管理器ClimateCoordinator用来管理各种基本气候参数,并且会在当前参数值和目标参数值之间做自然过渡。

特定区域内的气候可以根据四季、昼夜等时间变化做变化,另外会有一系列区域内会出现的天气变化,他们应用时也会影响区域内的基础气象参数。游戏逻辑可以在任何时候直接操作ClimateCoordinator来实现从自然天气到游戏逻辑参数的过渡。

对于需要根据气候表现做表演的对象,直接根据ClimateCoordinator中的值来进行对应值修改或者效果表现即可,如果表现参数和气候参数不直接对应可以添加中间对象转换。

方案

中间状态ClimateCoordinator

class CLIMATERUNTIME_API UClimateCoordinator : public UTickableWorldSubsystem
{
...void RegistVolume(AClimateVolume* Volume);void UnRegistVolume(AClimateVolume* Volume);void BindEarthGlobalInfo(UClimateEarthGlobalInfoComponent* Component);void UnbindEarthGlobalInfo(UClimateEarthGlobalInfoComponent* Component);// 0~1: degree of a yearUFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")const float GetYearDegree() const;// 0~1: degree of a dayUFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")const float GetDayDegree() const;UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")const FDateTime GetDateTime() const { return AreaDateTime; }UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")void SetDateTime(const FDateTime& DateTime) { AreaDateTime = DateTime; }UFUNCTION(BlueprintCallable, Category = "RuntimeClimate")const int32 GetTimeScalar() const;UFUNCTION(BlueprintCallable, Category = "RuntimeClimate")void SetTimeScalar(const int32 TimeScalar);UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")void OverwriteTemperature(bool bOverwirte, const float Temperature, const float FadeDuration);UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")const float GetTemperature() const;UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")void OverwriteHumidity(bool bOverwirte, const float Humidity, const float FadeDuration);UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")const float GetHumidity() const;
...
}

地理信息

class AEarthInfo : public AInfo
{
...float Latitude = 45.0f;float Longitude = -73.0f;float NorthOffset = 0;float BaseElevation = 0;int32 TimeZone = -5.0;int32 Year = 2022;int32 Month = 5;int32 Day = 17;int32 Hours = 12;int32 Minutes = 0;int32 Seconds = 0;uint8 bIsDaylightSavingTime : 1;int32 DSTStartMonth = 6;int32 DSTStartDay = 1;int32 DSTEndMonth = 8;int32 DSTEndDay = 31;int32 TimeScalar = 0;...
}

区域气候盒子

class CLIMATERUNTIME_API AClimateVolume : public AVolume
{
...int32 Priority = 0;uint32 bEnabled : 1;uint32 bUnbound : 1;virtual void PostRegisterAllComponents() override;virtual void PostUnregisterAllComponents() override;virtual void Tick(float DeltaSeconds) override;uint32 bTemperatureValid : 1;float Temperature = 20;float TemperatureUpdateSpeed = 0.01;
...
}

一系列表演辅助类

雾效影响组件:

UCLASS(ClassGroup = (Climate), meta = (BlueprintSpawnableComponent))
class CLIMATERUNTIME_API UClimateFogComponent : public UActorComponent
{GENERATED_UCLASS_BODY()public:virtual void OnRegister() override;virtual void OnUnregister() override;virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;UPROPERTY(EditAnywhere, Category = ExponentialHeightFog)FRuntimeFloatCurve ExponentialHeightFogDensityCurveFloat;UPROPERTY(EditAnywhere, Category = ExponentialHeightFog)FRuntimeCurveLinearColor ExponentialHeightFogScatteringColorCurveFloat;private:UPROPERTY(Transient)class UExponentialHeightFogComponent* ManagedComponent = nullptr;UPROPERTY(Transient)class UClimateCoordinator* ClimateCoordinator = nullptr;
};

根据经纬度、时区等信息计算日出、日落时间的计算函数:

void CalcSunPositionByLocationAndDateTime(float Latitude, float Longitude, float TimeZone, bool bIsDaylightSavingTime, const FDateTime& CalcTime, FClimateSunPosition& SunPositionData)
{float TimeOffset = TimeZone;if (bIsDaylightSavingTime){TimeOffset += 1.0f;}double LatitudeRad = FMath::DegreesToRadians(Latitude);// Get the julian day (number of days since Jan 1st of the year 4713 BC)double JulianDay = CalcTime.GetJulianDay() + (CalcTime.GetTimeOfDay().GetTotalHours() - TimeOffset) / 24.0;double JulianCentury = (JulianDay - 2451545.0) / 36525.0;// Get the sun's mean longitude , referred to the mean equinox of julian datedouble GeomMeanLongSunDeg = FMath::Fmod(280.46646 + JulianCentury * (36000.76983 + JulianCentury * 0.0003032), 360.0);double GeomMeanLongSunRad = FMath::DegreesToRadians(GeomMeanLongSunDeg);// Get the sun's mean anomalydouble GeomMeanAnomSunDeg = 357.52911 + JulianCentury * (35999.05029 - 0.0001537 * JulianCentury);double GeomMeanAnomSunRad = FMath::DegreesToRadians(GeomMeanAnomSunDeg);// Get the earth's orbit eccentricitydouble EccentEarthOrbit = 0.016708634 - JulianCentury * (0.000042037 + 0.0000001267 * JulianCentury);// Get the sun's equation of the centerdouble SunEqOfCtr = FMath::Sin(GeomMeanAnomSunRad) * (1.914602 - JulianCentury * (0.004817 + 0.000014 * JulianCentury))+ FMath::Sin(2.0 * GeomMeanAnomSunRad) * (0.019993 - 0.000101 * JulianCentury)+ FMath::Sin(3.0 * GeomMeanAnomSunRad) * 0.000289;// Get the sun's true longitudedouble SunTrueLongDeg = GeomMeanLongSunDeg + SunEqOfCtr;// Get the sun's true anomaly//	double SunTrueAnomDeg = GeomMeanAnomSunDeg + SunEqOfCtr;//	double SunTrueAnomRad = FMath::DegreesToRadians(SunTrueAnomDeg);// Get the earth's distance from the sun//	double SunRadVectorAUs = (1.000001018*(1.0 - EccentEarthOrbit*EccentEarthOrbit)) / (1.0 + EccentEarthOrbit*FMath::Cos(SunTrueAnomRad));// Get the sun's apparent longitudedouble SunAppLongDeg = SunTrueLongDeg - 0.00569 - 0.00478 * FMath::Sin(FMath::DegreesToRadians(125.04 - 1934.136 * JulianCentury));double SunAppLongRad = FMath::DegreesToRadians(SunAppLongDeg);// Get the earth's mean obliquity of the eclipticdouble MeanObliqEclipticDeg = 23.0 + (26.0 + ((21.448 - JulianCentury * (46.815 + JulianCentury * (0.00059 - JulianCentury * 0.001813)))) / 60.0) / 60.0;// Get the oblique correctiondouble ObliqCorrDeg = MeanObliqEclipticDeg + 0.00256 * FMath::Cos(FMath::DegreesToRadians(125.04 - 1934.136 * JulianCentury));double ObliqCorrRad = FMath::DegreesToRadians(ObliqCorrDeg);// Get the sun's right ascensiondouble SunRtAscenRad = FMath::Atan2(FMath::Cos(ObliqCorrRad) * FMath::Sin(SunAppLongRad), FMath::Cos(SunAppLongRad));double SunRtAscenDeg = FMath::RadiansToDegrees(SunRtAscenRad);// Get the sun's declinationdouble SunDeclinRad = FMath::Asin(FMath::Sin(ObliqCorrRad) * FMath::Sin(SunAppLongRad));double SunDeclinDeg = FMath::RadiansToDegrees(SunDeclinRad);double VarY = FMath::Pow(FMath::Tan(ObliqCorrRad / 2.0), 2.0);// Get the equation of timedouble EqOfTimeMinutes = 4.0 * FMath::RadiansToDegrees(VarY * FMath::Sin(2.0 * GeomMeanLongSunRad) - 2.0 * EccentEarthOrbit * FMath::Sin(GeomMeanAnomSunRad) + 4.0 * EccentEarthOrbit * VarY * FMath::Sin(GeomMeanAnomSunRad) * FMath::Cos(2.0 * GeomMeanLongSunRad) - 0.5 * VarY * VarY * FMath::Sin(4.0 * GeomMeanLongSunRad) - 1.25 * EccentEarthOrbit * EccentEarthOrbit * FMath::Sin(2.0 * GeomMeanAnomSunRad));// Get the hour angle of the sunrisedouble HASunriseDeg = FMath::RadiansToDegrees(FMath::Acos(FMath::Cos(FMath::DegreesToRadians(90.833)) / (FMath::Cos(LatitudeRad) * FMath::Cos(SunDeclinRad)) - FMath::Tan(LatitudeRad) * FMath::Tan(SunDeclinRad)));//	double SunlightDurationMinutes = 8.0 * HASunriseDeg;// Get the local time of the sun's rise and setdouble SolarNoonLST = (720.0 - 4.0 * Longitude - EqOfTimeMinutes + TimeOffset * 60.0) / 1440.0;double SunriseTimeLST = SolarNoonLST - HASunriseDeg * 4.0 / 1440.0;double SunsetTimeLST = SolarNoonLST + HASunriseDeg * 4.0 / 1440.0;// Get the true solar timedouble TrueSolarTimeMinutes = FMath::Fmod(CalcTime.GetTimeOfDay().GetTotalMinutes() + EqOfTimeMinutes + 4.0 * Longitude - 60.0 * TimeOffset, 1440.0);// Get the hour angle of current timedouble HourAngleDeg = TrueSolarTimeMinutes < 0 ? TrueSolarTimeMinutes / 4.0 + 180 : TrueSolarTimeMinutes / 4.0 - 180.0;double HourAngleRad = FMath::DegreesToRadians(HourAngleDeg);// Get the solar zenith angledouble SolarZenithAngleRad = FMath::Acos(FMath::Sin(LatitudeRad) * FMath::Sin(SunDeclinRad) + FMath::Cos(LatitudeRad) * FMath::Cos(SunDeclinRad) * FMath::Cos(HourAngleRad));double SolarZenithAngleDeg = FMath::RadiansToDegrees(SolarZenithAngleRad);// Get the sun elevationdouble SolarElevationAngleDeg = 90.0 - SolarZenithAngleDeg;double SolarElevationAngleRad = FMath::DegreesToRadians(SolarElevationAngleDeg);double TanOfSolarElevationAngle = FMath::Tan(SolarElevationAngleRad);// Get the approximated atmospheric refractiondouble ApproxAtmosphericRefractionDeg = 0.0;if (SolarElevationAngleDeg <= 85.0){if (SolarElevationAngleDeg > 5.0){ApproxAtmosphericRefractionDeg = 58.1 / TanOfSolarElevationAngle - 0.07 / FMath::Pow(TanOfSolarElevationAngle, 3) + 0.000086 / FMath::Pow(TanOfSolarElevationAngle, 5) / 3600.0;}else{if (SolarElevationAngleDeg > -0.575){ApproxAtmosphericRefractionDeg = 1735.0 + SolarElevationAngleDeg * (-518.2 + SolarElevationAngleDeg * (103.4 + SolarElevationAngleDeg * (-12.79 + SolarElevationAngleDeg * 0.711)));}else{ApproxAtmosphericRefractionDeg = -20.772 / TanOfSolarElevationAngle;}}ApproxAtmosphericRefractionDeg /= 3600.0;}// Get the corrected solar elevationdouble SolarElevationcorrectedforatmrefractionDeg = SolarElevationAngleDeg + ApproxAtmosphericRefractionDeg;// Get the solar azimuth double tmp = FMath::RadiansToDegrees(FMath::Acos(((FMath::Sin(LatitudeRad) * FMath::Cos(SolarZenithAngleRad)) - FMath::Sin(SunDeclinRad)) / (FMath::Cos(LatitudeRad) * FMath::Sin(SolarZenithAngleRad))));double SolarAzimuthAngleDegcwfromN = HourAngleDeg > 0.0 ? FMath::Fmod(tmp + 180.0, 360.0) : FMath::Fmod(540.0 - tmp, 360.0);// offset elevation angle to fit with UE coords systemSunPositionData.Elevation = 180.0f + SolarElevationAngleDeg;SunPositionData.CorrectedElevation = 180.0f + SolarElevationcorrectedforatmrefractionDeg;SunPositionData.Azimuth = SolarAzimuthAngleDegcwfromN;SunPositionData.SolarNoon = FTimespan::FromDays(SolarNoonLST);SunPositionData.SunriseTime = FTimespan::FromDays(SunriseTimeLST);SunPositionData.SunsetTime = FTimespan::FromDays(SunsetTimeLST);
}

参考

相关文章:

气候系统设计

基础概念 一个星球&#xff08;例如地球&#xff09;的气候系统主要是一些基本参数基于公转周期&#xff08;年&#xff09;和自转周期&#xff08;日&#xff09;的变化&#xff0c;这其中会有两个变化因素&#xff1a;地理位置&#xff08;经纬度&#xff09;和天气变化&…...

如何使用Thymeleaf给web项目中的网页渲染显示动态数据?

编译软件&#xff1a;IntelliJ IDEA 2019.2.4 x64 操作系统&#xff1a;win10 x64 位 家庭版 服务器软件&#xff1a;apache-tomcat-8.5.27 目录一. 什么是Thymeleaf&#xff1f;二. MVC2.1 为什么需要MVC&#xff1f;2.2 MVC是什么&#xff1f;2.3 MVC和三层架构之间的关系及工…...

01 | 电机常用语

1 电机常用术语 1.1 原点 原点是指步进电机在驱动直线运动机构时的起始点。 1.2 点动 点动是电动机控制方式中的一种。 点动由于在这一控制回路中没有自保,也没有并接其它的自动装置,只是按下控制回路的启动按钮,主回路才通电,松开启动按钮,主回路就没电了。最典型的是…...

Leetcode.2601 质数减法运算

题目链接 Leetcode.2601 质数减法运算 Rating &#xff1a; 1779 题目描述 给你一个下标从 0 开始的整数数组 nums&#xff0c;数组长度为 n 。 你可以执行无限次下述运算&#xff1a; 选择一个之前未选过的下标 i &#xff0c;并选择一个 严格小于 nums[i]的质数 ppp &…...

DP7416国产192K数字音频接收芯片兼容替代CS8416

目录192K 数字音频应用DP7416简介芯片特性192K 数字音频应用 采样率192khz&#xff0c;能将192,000hz以下的频率都录下来&#xff0c;而且对声波每秒连续采样192,000次。在回放的时候&#xff0c;这192,000个采样点按顺序播放&#xff0c;从而还原原来的声音。   过采样技术除…...

全球土壤湿度数据获取方法

土壤湿度亦称土壤含水率&#xff0c;表示土壤干湿程度的物理量。是土壤含水量的一种相对变量。通常用土壤含水量占干土重的百分数是示&#xff0c;亦称土壤质量湿度&#xff0c;如用土壤水分容积占土壤总容积的百分数表示&#xff0c;则称土壤容积湿度。通常说的土壤湿度&#…...

在proteus中仿真arduino实现矩阵键盘程序

矩阵键盘是可以解决我们端口缺乏的问题&#xff0c;当然&#xff0c;如果我们使用芯片来实现矩阵键盘的输入端口缺乏的问题将更加划算了&#xff0c;本文暂时不使用芯片来解决问题&#xff0c;而使用纯朴的8根线来实现矩阵键盘&#xff0c;目的是使初学者掌握原理。想了解使用芯…...

【ROS2指南-5】理解ROS2服务

目标&#xff1a;使用命令行工具了解 ROS 2 中的服务。 教程级别&#xff1a;初学者 时间&#xff1a; 10分钟 内容 背景 先决条件 任务 1 设置 2 ros2服务列表 3 ros2服务类型 4 ros2 服务查找 5 ros2界面展示 6 ros2 服务调用 概括 下一步 相关内容 背景 服务是 …...

探索Apache Hudi核心概念 (3) - Compaction

Compaction是MOR表的一项核心机制&#xff0c;Hudi利用Compaction将MOR表产生的Log File合并到新的Base File中。本文我们会通过Notebook介绍并演示Compaction的运行机制&#xff0c;帮助您理解其工作原理和相关配置。 1. 运行 Notebook 本文使用的Notebook是&#xff1a;《A…...

100Wqps异地多活,得物是怎么架构的?

说在前面 在40岁老架构师尼恩的数千读者群中&#xff0c;一直在指导大家简历和职业升级&#xff0c;前几天&#xff0c;指导了一个华为老伙伴的简历&#xff0c;小伙伴的优势在异地多活&#xff0c;但是在简历指导的过程中&#xff0c;尼恩发现&#xff1a; 异地多活的概念、异…...

35岁的测试工程师被公司强行辞退,感叹道:我以前就该好好努力了

曾经的高薪软件测试工程师&#xff0c;今年35岁了&#xff0c;被公司劝退了&#xff0c;外卖跑到凌晨&#xff0c;很累&#xff0c;但还是有一种想诉说的冲动。哪怕让大家觉得已经说得太多了&#xff0c;烦了&#xff0c;都成祥林嫂了&#xff0c;但是&#xff0c;我是真的想说…...

ASP.NET动态Web开发技术第5章

第5章数据验证一.预习笔记 1.验证控件概述&#xff1a; 2.RequiredFieldValidator&#xff08;必填验证&#xff09; 常用属性1&#xff1a;ControlToValidator:被验证的输入控件的ID 常用属性2&#xff1a;Text&#xff1a;验证失败时&#xff0c;验证控件显示的文本 常用…...

【数据结构与算法篇】时间复杂度与空间复杂度

目录 一、数据结构和算法 1.什么是数据结构&#xff1f; 2.什么是算法&#xff1f; 3.数据结构和算法的重要性 二、算法的时间复杂度和空间复杂度 1.算法效率 2.算法的复杂度 3.复杂度在校招中的考察 4.时间复杂度 5.空间复杂度 6.常见复杂度对比 7.复杂度的OJ练…...

HTTP API接口设计规范

1. 所有请求使用POST方法 使用post&#xff0c;相对于get的query string&#xff0c;可以支持复杂类型的请求参数。例如日常项目中碰到get请求参数为数组类型的情况。 便于对请求和响应统一做签名、加密、日志等处理 2. URL规则 URL中只能含有英文&#xff0c;使用英文单词或…...

数据一致性校验(pt-table-checksum)

介绍 pt-table-checksum 和 pt-table-sync 是 percona 公司发布的、检查 MySQL 主从数据库数据一致性校验的工具。pt-table-checksum 利用 MySQL 复制原理&#xff0c;在主库执行校验和计算&#xff0c;并对比主从库校验和&#xff0c;由此判断主从库数据是否一致。如果发现数…...

Talk预告 | 新加坡国立大学郑奘巍 AAAI‘23 杰出论文:大批量学习算法加速推荐系统训练

本期为TechBeat人工智能社区第486期线上Talk&#xff01; 北京时间3月30日(周四)20:00&#xff0c;新加坡国立大学二年级博士生——郑奘巍的Talk将准时在TechBeat人工智能社区开播&#xff01; 他与大家分享的主题是: “大批量学习算法加速推荐系统训练”&#xff0c;届时将分…...

肖 sir_就业课__004项目流程(H模型)

项目流程&#xff1a; 一、面试提问&#xff08;h模型&#xff09; 1、你说下你们公司测试流程&#xff1f; 2、给你一个需求你会怎么做? 3、你讲下你的工作&#xff1f; 4、谈谈你是如何去测试&#xff1f; 答案&#xff1a;h模型 要求第一人称来写 讲解简化文字流程&#x…...

snipaste 截图工具——可以使图片悬浮在任何软件上,方便对比

一、下载 官网下载地址&#xff1a;Snipaste Downloads &#xff08;需要梯子&#xff09; CSDN下载地址&#xff1a;https://download.csdn.net/download/weixin_43042683/87671809 1. 下载 压缩包后&#xff0c;免安装&#xff0c;直接解压后既可以使用。 2. 点击Snipaste.…...

Docker 快速部署Springboot项目

编写Dockerfile文件 # Docker image for springboot file run # VERSION 0.0.1 # Author: # 基础镜像使用java FROM openjdk:8 # 作者 MAINTAINER laihx # VOLUME 指定了临时文件目录为/tmp。 # 其效果是在主机 /var/lib/docker 目录下创建了一个临时文件&#xff0c;并链接到…...

【LeetCode: 剑指 Offer II 112. 最长递增路径 | 递归 | DFS | 深度优先遍历 | 记忆化缓存表】

&#x1f34e;作者简介&#xff1a;硕风和炜&#xff0c;CSDN-Java领域新星创作者&#x1f3c6;&#xff0c;保研|国家奖学金|高中学习JAVA|大学完善JAVA开发技术栈|面试刷题|面经八股文|经验分享|好用的网站工具分享&#x1f48e;&#x1f48e;&#x1f48e; &#x1f34e;座右…...

hive 入门 一般用于正式环境 修改元数据(二)

安装配置可参考 https://blog.csdn.net/weixin_43205308/article/details/130020674 1、如果启动过derby&#xff0c;最小初始化过 在安装路径下删除 derby.log metastore_db rm -rf derby.log metastore_db此处省略安装mysql数据库 2、配置MySQL 登录mysql mysql -uroot …...

在RedHat系统上使用firewall-cmd命令可以将端口打开

在RedHat系统上使用firewall-cmd命令可以将端口打开&#xff0c;具体操作如下&#xff1a; 首先&#xff0c;检查当前系统使用的防火墙服务&#xff0c;比如firewalld或iptables&#xff0c;使用以下命令&#xff1a; systemctl status firewalld # 检查firewalld服务 system…...

分享(五):免费可用的多种类 API 大全集合整理

前言 搜罗了各大平台整理了一波免费可以用的 API &#xff0c;有需要的收藏起来啦。 实名认证 运营商二要素 API &#xff1a;运营商校验此姓名、手机号码是否一致。 运营商三要素 API&#xff1a;运营商验证姓名、身份证号码、手机号码是否一致&#xff0c;返回验证结果称…...

8.1 假设验证的基本概念

学习目标&#xff1a; 要学习假设检验的基本概念&#xff0c;我会按照以下步骤进行&#xff1a; 了解假设检验的基本概念&#xff1a;假设检验是一种统计推断方法&#xff0c;用于判断某个假设是否成立。一般来说&#xff0c;假设检验包括原假设和备择假设两个假设&#xff0c…...

C语言基础

为了学习数据结构&#xff0c;整理一篇基础的C语言入门知识&#xff08;仅供自身学习用&#xff09; 条件运算符 语法&#xff1a;exp1 ? exp2 : exp3; exp1是条件表达式&#xff0c;如果结果为真&#xff0c;返回exp2 如果结果为假&#xff0c;返回exp3 if (a > b)max …...

Docker教程:如何将Helix QAC创建为一个容器并运行?

在这个Docker教程中&#xff0c;你将了解到如何将Helix QAC创建为一个容器化的镜像并运行。 Docker的基本定义是一个开源且流行的操作系统级虚拟化&#xff08;通常称为“容器化”&#xff09;技术&#xff0c;它是轻量级且可移植的&#xff0c;主要在Linux和Windows上运行。D…...

1676_MIT 6.828 xv6中的CPU alarm_资料翻译整理

全部学习汇总&#xff1a; GreyZhang/g_unix: some basic learning about unix operating system. (github.com) 我觉得看了几个MIT的课程之后让我觉得我的大学四年有点浪费时光&#xff0c;看起来MIT的课程的确是很有饱满度。 这里&#xff0c;再整理一份课程中的作业要求。 …...

记一次内存泄漏问题的排查

阶段一&#xff1a; 前段时间&#xff0c;突然发现服务在毫无征兆的情况下发生了重启。去看了一下容器退出的日志&#xff0c;发现内存利用率超过了100%&#xff0c;导致容器重启&#xff0c;进一步看了skyWalking&#xff0c;发现heap内存超了&#xff0c;当时只是简单的以为是…...

QML控件--Drawer

文章目录一、控件基本信息二、控件使用三、属性成员一、控件基本信息 Import Statement&#xff1a;import QtQuick.Controls 2.14 Since&#xff1a;Qt 5.7 Inherits&#xff1a;Popup 二、控件使用 Drawer&#xff1a;提供一个可以使用滑动手势打开和关闭的侧面板&#xff…...

PHY- PHY芯片概述

1 PHY概述 关于Internet Protocal的分层模型可以参考文章 :【Internet Protocal-OSI模型中的网络分层模型】,下面我们讲讲底层以太网控制器和收发器的知识。其主要是处理OSI模型中的物理层和链路层的事情。 在CAN/CANFD、FlexRay等总线中,有控制器Controller和收发器Transc…...