缺少代码差异信息,无法生成具体的commit message。请提供code differences内容以便分析并生成符合Angular规范的提交信息。

当您提供代码差异后,我将按照以下格式生成:

```
<type>(<scope>): <subject>

<body>
```

其中type会根据更改类型选择(feat、fix、docs、style、refactor等),scope表示影响范围,subject简要描述变更内容,body详细说明修改内容。
This commit is contained in:
link2026
2026-06-07 14:17:18 +08:00
parent 074d99715d
commit 77a4ee1c37
66 changed files with 2676 additions and 548 deletions

View File

@@ -1,4 +1,5 @@
import Foundation
import CoreGraphics
import SwiftData
enum IndicatorStatus: String, Codable, CaseIterable {
@@ -55,6 +56,14 @@ final class Indicator {
/// (IndicatorSource.rawValue) SwiftData ,
var sourceRaw: String = IndicatorSource.manual.rawValue
/// VL 0-based;box (0...1)
///
var sourcePageIndex: Int?
var sourceBoxX: Double?
var sourceBoxY: Double?
var sourceBoxWidth: Double?
var sourceBoxHeight: Double?
init(name: String,
value: String,
unit: String,
@@ -66,7 +75,12 @@ final class Indicator {
asset: Asset? = nil,
pinned: Bool = false,
seriesKey: String? = nil,
source: IndicatorSource = .manual) {
source: IndicatorSource = .manual,
sourcePageIndex: Int? = nil,
sourceBoxX: Double? = nil,
sourceBoxY: Double? = nil,
sourceBoxWidth: Double? = nil,
sourceBoxHeight: Double? = nil) {
self.name = name
self.value = value
self.unit = unit
@@ -79,6 +93,11 @@ final class Indicator {
self.pinned = pinned
self.seriesKey = seriesKey
self.sourceRaw = source.rawValue
self.sourcePageIndex = sourcePageIndex
self.sourceBoxX = sourceBoxX
self.sourceBoxY = sourceBoxY
self.sourceBoxWidth = sourceBoxWidth
self.sourceBoxHeight = sourceBoxHeight
}
var status: IndicatorStatus {
@@ -88,6 +107,22 @@ final class Indicator {
var source: IndicatorSource {
IndicatorSource(rawValue: sourceRaw) ?? .manual
}
var hasEvidenceBox: Bool {
evidenceRect != nil && sourcePageIndex != nil
}
var evidenceRect: CGRect? {
guard let x = sourceBoxX,
let y = sourceBoxY,
let width = sourceBoxWidth,
let height = sourceBoxHeight,
x >= 0, y >= 0, width > 0, height > 0,
x + width <= 1, y + height <= 1 else {
return nil
}
return CGRect(x: x, y: y, width: width, height: height)
}
}
@Model