feat(resample): 实验性功能新增「重采样」(位于「自由标记」上方)
- Lane::ResampleItem + resample/resampleItems/resamplePanel/resampleScroll, 并在 LaneCarry / SplitLane / PruneLaneSignalItems / RemapAfterSignalInsert|Removal 同步 - 面板:可滚动分组列表(信号色条目栏 + 复选框 + 展开三角),展开后 4 行: 最大/最小数据间隔(只读,勾选时一次性缓存,绘制不扫描采样)+ 重采样间隔/频率(输入) - 输入框联动:改间隔同步频率,改频率同步间隔(输入单位分别为秒 / Hz) - 「构建为新信号」:DataSet::AppendGroupAxis 追加新时间轴 + InsertDerivedSignal, 采样值先按公式/系数/绝对值/镜像/Y偏移变换再等间隔线性插值,时间轴偏移不烘值 - 新信号名 <原信号> (重采样 <自适应单位频率>);Utf8Util::FormatFrequency 为唯一实现 - 非单调轴 / 点太少 / 间隔过大 / 点数超 2000 万 ⇒ 拒绝构建并给出自绘提示 - 顺带加入 FormulaEval(公式编译/求值,供 ApplyDrawTransform 与后续 UI 使用)
This commit is contained in:
1 parent
30e9d65c30
commit
1e1c2432ae
19 files changed
+1979
-56
No files matched your search
@@ -587,6 +587,26 @@ namespace jdi
|
||||
inline const wchar_t* const kWeakPeakTitle = L"弱峰调整"; /**< 弱峰调整面板标题。 */
|
||||
inline const wchar_t* const kBuildSignalLabel = L"构建为新信号"; /**< 逐条目面板底部按钮文案(均值滤波 / 弱峰调整共用)。 */
|
||||
|
||||
// ---- 「重采样」面板 ----
|
||||
/** 「重采样」面板标题。 */
|
||||
inline const wchar_t* const kResampleTitle = L"重采样";
|
||||
/** 只读统计行标签:最大数据间隔。 */
|
||||
inline const wchar_t* const kResampleMaxIntervalLabel = L"最大数据间隔";
|
||||
/** 只读统计行标签:最小数据间隔。 */
|
||||
inline const wchar_t* const kResampleMinIntervalLabel = L"最小数据间隔";
|
||||
/** 输入行标签:重采样间隔(秒)。 */
|
||||
inline const wchar_t* const kResampleIntervalLabel = L"重采样间隔";
|
||||
/** 输入行标签:重采样频率(Hz)。 */
|
||||
inline const wchar_t* const kResampleFrequencyLabel = L"重采样频率";
|
||||
/**
|
||||
* @brief 重采样间隔的合法区间(秒)。
|
||||
*
|
||||
* 下限取 1ns(再小已经没有实际意义的采样率,且会让新信号的采样数爆炸);
|
||||
* 上限取 1e6 秒。
|
||||
*/
|
||||
inline const double kResampleIntervalMin = 1.0e-9;
|
||||
inline const double kResampleIntervalMax = 1.0e6;
|
||||
|
||||
// ---- 「均值滤波」面板的两行参数滑块(用户 2026-10-30 要求)----
|
||||
/**
|
||||
* 标签一律**不带 `X` / `N`**:滑块的量程本身已经说明是数值,符号只会让标签变长。
|
||||
@@ -1034,7 +1054,7 @@ namespace jdi
|
||||
*/
|
||||
inline const EdgePanelKind kEdgePanelKinds[] = {EdgePanelKind::COUNT, EdgePanelKind::CENTER,
|
||||
EdgePanelKind::MEAN, EdgePanelKind::PEAK,
|
||||
EdgePanelKind::MARK};
|
||||
EdgePanelKind::MARK, EdgePanelKind::RESAMPLE};
|
||||
|
||||
/** 实验性功能浮动面板的种类数(遍历与命中测试统一用它,避免新增功能时漏改)。 */
|
||||
inline const int kEdgePanelKindCount = static_cast<int>(sizeof(kEdgePanelKinds) / sizeof(kEdgePanelKinds[0]));
|
||||
@@ -1274,6 +1294,36 @@ namespace jdi
|
||||
return FormatValue(seconds) + L"s";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 时间间隔的显示文本(**不带** "Δt:" 前缀)。
|
||||
*
|
||||
* 「重采样」面板的「最大 / 最小数据间隔」两行用它:单位随间隔长短自适应
|
||||
*(`FormatDurationCompound`:1h 1min 2s / 5s 60ms / 120us …)。
|
||||
*
|
||||
* @param [IN] seconds 时间间隔(秒)。
|
||||
* @return 文本。
|
||||
*/
|
||||
inline std::wstring FormatIntervalText(double seconds)
|
||||
{
|
||||
if (!std::isfinite(seconds) || seconds <= 0.0)
|
||||
{
|
||||
return L"—";
|
||||
}
|
||||
return FormatDurationCompound(seconds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 频率的显示文本(单位在 Hz / kHz / MHz / GHz 之间自适应,保留小数)。
|
||||
*
|
||||
* @param [IN] hertz 频率(Hz)。
|
||||
* @return 形如 "1.2 kHz" 的文本;非法值返回 "—"。
|
||||
*/
|
||||
inline std::wstring FormatFrequencyText(double hertz)
|
||||
{
|
||||
// 唯一实现在 `Utf8Util::FormatFrequency`(宿主构建派生信号名时也用它)。
|
||||
return FormatFrequency(hertz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 按比例缩放颜色的 alpha 通道(用于提示浮层淡出)。
|
||||
* @param [IN] argb 原始 0xAARRGGBB 颜色。
|
||||
|
||||
Reference in new issue
Block a user