You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.8 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection;
using SlnMesnac.Business;
using SlnMesnac.Repository;
using SlnMesnac.Repository.service;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* 版权所有 (c) 2024 WenJY 保留所有权利。
* CLR版本4.0.30319.42000
* 机器名称T14-GEN3-7895
* 命名空间SlnMesnac.WPF.ViewModel
* 唯一标识82a9c020-20a4-4f1a-8a87-2081004da0c9
*
* 创建者WenJY
* 电子邮箱:
* 创建时间2024-11-29 9:36:57
* 版本V1.0.0
* 描述:
*
*--------------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.WPF.ViewModel
{
public partial class FixedPointViewModel : ObservableObject
{
private readonly BusbarInfoBusiness busbarInfoBusiness;
private readonly FixedPointBusiness fixedPointBusiness;
public FixedPointViewModel(int fixedPointTitle)
{
busbarInfoBusiness = App.ServiceProvider.GetService<BusbarInfoBusiness>();
fixedPointBusiness = App.ServiceProvider.GetService<FixedPointBusiness>();
FixedPointTitle = $"{fixedPointTitle}#电柜定点巡检";
}
public string _fixedPointTitle = "定点巡检";
public string FixedPointTitle
{
get => _fixedPointTitle;
set => SetProperty(ref _fixedPointTitle, value);
}
private ObservableCollection<base_busbar_info> _busbarInfoItems = new ObservableCollection<base_busbar_info>();
public ObservableCollection<base_busbar_info> BusbarInfoItems
{
get => _busbarInfoItems;
set => SetProperty(ref _busbarInfoItems, value);
}
public void QueryBusbarInfo(int cabinetCode)
{
busbarInfoBusiness.QueryBusbarInfo(cabinetCode, out List<base_busbar_info> info,false);
BusbarInfoItems = new ObservableCollection<base_busbar_info>(info);
}
private bool isFlag = false;
[RelayCommand]
public void StartFixedPoint(base_busbar_info busbar_Info)
{
var code = busbar_Info.busbarCode;
fixedPointBusiness.StartFixedPoint(busbar_Info);
}
[RelayCommand]
public void EndFixedPoint(base_busbar_info busbar_Info)
{
var code = busbar_Info.busbarCode;
fixedPointBusiness.EndFixedPoint(busbar_Info);
}
}
}