This commit is contained in:
“虞渠成” 2026-06-17 17:46:30 +08:00
parent 2df886825f
commit 9728ded717
3 changed files with 60 additions and 45 deletions

View File

@ -113,7 +113,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 32, y: 0} m_AnchoredPosition: {x: 32, y: 0}
m_SizeDelta: {x: 510.04, y: 40} m_SizeDelta: {x: 510.04, y: 50}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!222 &3667549666672144347 --- !u!222 &3667549666672144347
CanvasRenderer: CanvasRenderer:
@ -3574,7 +3574,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 42, y: -131.00002} m_AnchoredPosition: {x: 42, y: -131.00002}
m_SizeDelta: {x: -82, y: 40} m_SizeDelta: {x: -82, y: 50}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!222 &2401397262880063041 --- !u!222 &2401397262880063041
CanvasRenderer: CanvasRenderer:
@ -8909,8 +8909,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -20} m_AnchoredPosition: {x: 0, y: -25}
m_SizeDelta: {x: 0, y: 40} m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7009481007586245550 --- !u!222 &7009481007586245550
CanvasRenderer: CanvasRenderer:
@ -9063,7 +9063,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 37.5, y: -20} m_AnchoredPosition: {x: 37.5, y: -25}
m_SizeDelta: {x: 25, y: 15} m_SizeDelta: {x: 25, y: 15}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8177967827359391044 --- !u!222 &8177967827359391044
@ -13202,8 +13202,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 224, y: -47.5} m_AnchoredPosition: {x: 227.5, y: -47.5}
m_SizeDelta: {x: 224, y: 100} m_SizeDelta: {x: 231, y: 100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &420311766918268298 --- !u!222 &420311766918268298
CanvasRenderer: CanvasRenderer:
@ -13971,10 +13971,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 3059856189105058401} m_Father: {fileID: 3059856189105058401}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 37.5, y: -25}
m_SizeDelta: {x: 0, y: 15} m_SizeDelta: {x: 25, y: 15}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5386126697989012692 --- !u!222 &5386126697989012692
CanvasRenderer: CanvasRenderer:
@ -14296,10 +14296,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 3059856189105058401} m_Father: {fileID: 3059856189105058401}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: -25}
m_SizeDelta: {x: 0, y: 40} m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7943735609059804478 --- !u!222 &7943735609059804478
CanvasRenderer: CanvasRenderer:
@ -14342,7 +14342,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: asdasdasdasdas m_Text:
--- !u!1 &7683716516984799381 --- !u!1 &7683716516984799381
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -17860,57 +17860,57 @@ PrefabInstance:
- target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 129 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 40 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 3004683929350944418, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 290.5 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 36 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 36 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 193 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 4945690470202459900, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -20 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6318456875706447668, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 6318456875706447668, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
@ -17940,7 +17940,7 @@ PrefabInstance:
- target: {fileID: 6907178496425977240, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 6907178496425977240, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 33 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6907178496425977240, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 6907178496425977240, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
@ -17955,32 +17955,32 @@ PrefabInstance:
- target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 530 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 295 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 7472144947167662218, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -60 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7704356682676814282, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 7704356682676814282, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 307 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8522928427075772141, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 8522928427075772141, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
@ -18120,27 +18120,27 @@ PrefabInstance:
- target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 530 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 295 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b, - target: {fileID: 9222942918291704188, guid: 6c019d3e48ae06e4c94bd3f2b59f7c5b,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -283 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []

View File

@ -1724,7 +1724,7 @@ namespace Kill.UI.Pages
} }
/// <summary> /// <summary>
/// 通过WiFi保存定时任务 /// 通过WiFi保存定时任务与BLE WriteScheduleTasks协议一致每任务7字节不含TaskId
/// </summary> /// </summary>
public async Task SaveScheduleTasksAsync(List<ScheduleTask> tasks) public async Task SaveScheduleTasksAsync(List<ScheduleTask> tasks)
{ {
@ -1734,12 +1734,12 @@ namespace Kill.UI.Pages
return; return;
} }
// 将List转为byte数组 // 每条任务7字节不含TaskId与BLE WriteScheduleTasks保持一致
byte[] data = new byte[tasks.Count * 8]; byte[] data = new byte[tasks.Count * 7];
for (int i = 0; i < tasks.Count; i++) for (int i = 0; i < tasks.Count; i++)
{ {
byte[] taskBytes = tasks[i].ToBytes(); byte[] taskBytes = tasks[i].ToBytesWithoutTaskId();
Array.Copy(taskBytes, 0, data, i * 8, 8); Array.Copy(taskBytes, 0, data, i * 7, 7);
} }
bool success = await SendBleCommandByWifiAsync( bool success = await SendBleCommandByWifiAsync(

View File

@ -545,12 +545,27 @@ namespace Kill.UI.Pages
{ {
LoadingUI.Show(); LoadingUI.Show();
var tasksToSave = new List<ScheduleTask>(); var tasksToSave = new List<ScheduleTask>();
for (int i = 0; i < _scheduleTasks.Count; i++) for (int i = 0; i < _scheduleTasks.Count && i < MAX_SCHEDULE_COUNT; i++)
{ {
var task = _scheduleTasks[i]; var task = _scheduleTasks[i];
task.TaskId = (byte)i; task.TaskId = (byte)i;
tasksToSave.Add(task); tasksToSave.Add(task);
} }
// 补齐到5个任务空任务用全0填充与BLE保持一致
while (tasksToSave.Count < MAX_SCHEDULE_COUNT)
{
tasksToSave.Add(new ScheduleTask
{
TaskId = (byte)tasksToSave.Count,
Enabled = false,
StartHour = 0,
StartMinute = 0,
EndHour = 0,
EndMinute = 0,
Mode = ScheduleTaskMode.Standby,
Repeat = 0
});
}
await HomePageCtrl.Instance?.SaveScheduleTasksAsync(tasksToSave); await HomePageCtrl.Instance?.SaveScheduleTasksAsync(tasksToSave);
LoadingUI.Hide(); LoadingUI.Hide();
return; return;