测试更改

master
CZ 4 months ago
parent cafa281716
commit 159655c002

@ -19,4 +19,22 @@ public static class HttpUtil
await response.Content.ReadAsStringAsync();
}
}
public static async void SendGetRequest(string url)
{
try
{
HttpResponseMessage response = await httpClient.GetAsync(url);
if (response.IsSuccessStatusCode)
{
await response.Content.ReadAsStringAsync();
}
}
catch
{
}
}
}

@ -80,7 +80,7 @@ public class CarCtrlState : IState
// SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrUnLockCar);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrUnLockCar.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address08"));
SoundClient.SoundPlay(SoundEnum.music48);
}, false, () => { machine.ExceptionReason = ExceptionReason.UnLockCarError; }
, 10, InvokeStatus.None);
}

@ -140,7 +140,8 @@ public class CarPrepareState : IState
}, () =>
{
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address06"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address06"));
SoundClient.SoundPlay(SoundEnum.music06);
machine.ExceptionReason = ExceptionReason.CarInPositionError;
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCarInPositionTimeout.GetLed());
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrorCarInPositionTimeout);
@ -170,13 +171,14 @@ public class CarPrepareState : IState
}, () =>
{
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address03"));
SoundClient.SoundPlay(SoundEnum.music43);
//machine.ExceptionReason = ExceptionReason.ConnTBoxError;
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrorTBoxConn);
}, false, () =>
{
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address03"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address03"));
SoundClient.SoundPlay(SoundEnum.music43);
//machine.ExceptionReason = ExceptionReason.ConnTBoxError;
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrorTBoxConn.GetLed());
@ -214,7 +216,8 @@ public class CarPrepareState : IState
}, () =>
{
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address03"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address03"));
SoundClient.SoundPlay(SoundEnum.music43);
//machine.ExceptionReason = ExceptionReason.ConnTBoxError;
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrorTBoxConn);
}, false, () =>
@ -279,7 +282,8 @@ public class CarPrepareState : IState
// SoundApi.PlayOneSound(InfoEnum.SwapInfo.ErrorSelectPack);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrorSelectPack.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address09"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address09"));
SoundClient.SoundPlay(SoundEnum.music09);
}, false, () => { machine.ExceptionReason = ExceptionReason.CloudCarDataUploadError; }
, 20, InvokeStatus.None);
}
@ -321,7 +325,7 @@ public class CarPrepareState : IState
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrorSelectPack.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address09"));
SoundClient.SoundPlay(SoundEnum.music49);
_log.Info($"SelectPack error CanSwap={machine.SwapOrderBatteryInfo.CanSwap}");
}
else
@ -336,7 +340,8 @@ public class CarPrepareState : IState
{
machine.ExceptionReason = ExceptionReason.SelectPackError;
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address09"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address09"));
SoundClient.SoundPlay(SoundEnum.music49);
// SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrorSelectPack);
}
, false, () => { }, 10, InvokeStatus.None);

@ -107,10 +107,7 @@ public class DoSwappingState : IState
}, () =>
{
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address30"));
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrStartSwap);
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address01"));
SoundClient.SoundPlay(SoundEnum.music70);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrStartSwap.GetLed());
},false, () => { },10,InvokeStatus.None);
}
@ -132,7 +129,8 @@ public class DoSwappingState : IState
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoUnPack.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address11"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address11"));
SoundClient.SoundPlay(SoundEnum.music51);
machine.UnOldBatteryFlag = ClientMgr.PlcClient.DisassembleDone;
if (machine.UnOldBatteryFlag)
@ -140,7 +138,13 @@ public class DoSwappingState : IState
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.UnOldBatteryFlag,
machine);
}
}, () => { SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoUnPack); }, false, () => { }, 10,
},
() =>
{
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoUnPack);
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(SoundEnum.music51);
}, false, () => { }, 10,
InvokeStatus.None);
}
@ -163,7 +167,8 @@ public class DoSwappingState : IState
{
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoPack);
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address12"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address12"));
SoundClient.SoundPlay(SoundEnum.music52);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoPack.GetLed());
},false, () => { },
10,InvokeStatus.None);
@ -182,9 +187,8 @@ public class DoSwappingState : IState
InfoEnum.BusinessSwappingForCloudState.SwapFinish;
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
machine.BusinessSwappingStateUpdateTime = DateTime.Now;
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoPackFinish);
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address13"));
SoundClient.SoundPlay(SoundEnum.music52);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoPackFinish.GetLed());
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.FinishNewBatteryFlag,

@ -44,7 +44,7 @@ public class StationReadyState : IState
return null;
}
//plc是否是远程模式
//plc是否是自动模式
var plcIsAuto = PlcIsAuto(machine);
if (InvokeStatus.Done != plcIsAuto)
{
@ -109,7 +109,8 @@ public class StationReadyState : IState
() =>
{
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address25"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address25"));
SoundClient.SoundPlay(SoundEnum.music65);
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoStationModel) ;
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoStationModel.GetLed());
}, true, () => { }, 5, InvokeStatus.None);
@ -134,7 +135,8 @@ public class StationReadyState : IState
//LED显示-欢迎光临_换电站点_正在营业
string welcomeContent = "欢迎光临换电站!(正在营业)";
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address01"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address01"));
SoundClient.SoundPlay(SoundEnum.music41);
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.WelcomeInfo);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.WelcomeInfo.GetLed());
isRemote = true;
@ -143,7 +145,8 @@ public class StationReadyState : IState
},
() =>
{SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address26"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address26"));
SoundClient.SoundPlay(SoundEnum.music66);
// SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoStationModelRemoteErr)
;
}, true, () => { }, 5, InvokeStatus.None);
@ -212,7 +215,8 @@ public class StationReadyState : IState
{
machine.LedTool.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address02"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address02"));
SoundClient.SoundPlay(SoundEnum.music74);
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrorReadRfid);
//LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
@ -288,7 +292,8 @@ public class StationReadyState : IState
{
machine.LedTool!.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address02"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address02"));
SoundClient.SoundPlay(SoundEnum.music42);
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrorReadRfid);
//LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
}, false, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }, 10,

@ -152,7 +152,8 @@ public class SwapDoneState : IState
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed());
// SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.ErrLockCar);
var SoundClient = AppInfo.Container.Resolve<SoundClient>();
SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address19"));
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address19"));
SoundClient.SoundPlay(SoundEnum.music59);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrLockCar.GetLed());
}, false, () => { machine.ExceptionReason = ExceptionReason.LockCarError; }
, 10, InvokeStatus.None);

@ -0,0 +1,44 @@
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Const;
using HybirdFrameworkDriver.ModbusTcpMaster;
using Service.Fire.Msg;
namespace Service.Fire.Client;
[Scope]
public class FireClient: ModbusTcpMaster
{
public FireClient()
{
ReadAction = BatchRead;
Ip = "192.168.3.100";
Port = 23;
Duration = 1000;
AutoReConnect = true;
ByteSeq = EndingConst.ByteSeq.BA;
WordSeq= EndingConst.WordSeq.CD;
}
private void BatchRead(ModbusTcpMaster master)
{
bool resul = Connected;
var bytes01 = master.Read("x=3;1", 80).Content;
var bytes02 = master.Read("x=3;1", 80).Content;
if (bytes01 != null)
{
FireMgr.DataValidityTime = DateTime.Now;
ModbusDecoder.Decode<FireMsg>(bytes02, FireMgr.FireMsg, EndingConst.ByteSeq.AB,
EndingConst.WordSeq.DC);
}
if (bytes02 != null)
{
FireMgr.DataValidityTime = DateTime.Now;
//ModbusDecoder.Decode<UpsRemoteComm>(bytes02, UpsMgr.UpsRemoteComm, EndingConst.ByteSeq.AB,
// EndingConst.WordSeq.DC);
}
}
}

@ -0,0 +1,37 @@
using Autofac;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using Service.Fire.Msg;
namespace Service.Fire.Client;
[Scope]
public class FireMgr
{
public static FireClient? FireClient;
public static readonly FaultMsg FaultMsg = new ();
public static readonly FireMsg FireMsg = new ();
/// <summary>
/// 数据有效时间。单位秒
/// </summary>
static int DataTimeSeconds = 20;
/// <summary>
/// 数据刷新时间
/// </summary>
public static DateTime DataValidityTime = DateTime.Now;
public static void UpsInit()
{
if (FireClient == null)
{
FireClient = AppInfo.Container.Resolve<FireClient>();
}
Task.Run(() => FireClient.Connect());
}
}

@ -0,0 +1,17 @@
using HybirdFrameworkDriver.ModbusTcpMaster;
namespace Service.Fire.Msg;
public class FaultMsg
{
/// <summary>
/// 主电故障
/// </summary>
public ModbusProperty<bool> MainPowerFault { get; set; } = new(32768, start: 1, length: 1);
/// <summary>
/// 备电故障
/// </summary>
public ModbusProperty<bool> BackupFault { get; set; } = new(32768, start: 2, length: 2);
}

@ -0,0 +1,57 @@
using HybirdFrameworkDriver.ModbusTcpMaster;
namespace Service.Fire.Msg;
public class FireMsg
{
/// <summary>
/// 1房复合探测器光电探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo01 { get; set; } = new(1);
/// <summary>
/// 2房复合探测器感温探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo02 { get; set; } = new(2);
/// <summary>
/// 3房复合探测器光电探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo03 { get; set; } = new(3);
/// <summary>
/// 4房复合探测器感温探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo04 { get; set; } = new(4);
/// <summary>
/// 5房复合探测器光电探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo05 { get; set; } = new(5);
/// <summary>
/// 6房复合探测器感温探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo06 { get; set; } = new(6);
/// <summary>
/// 7房光电探测器光电探测器
/// </summary>
public ModbusProperty<ushort> EqmInfo07 { get; set; } = new(7);
/// <summary>
/// 8房手报按钮手动按钮
/// </summary>
public ModbusProperty<ushort> EqmInfo08 { get; set; } = new(8);
/// <summary>
/// 9房启停按钮启停按钮
/// </summary>
public ModbusProperty<ushort> EqmInfo09 { get; set; } = new(9);
/// <summary>
/// 10房声光报警器声光报警器
/// </summary>
public ModbusProperty<ushort> EqmInfo10 { get; set; } = new(10);
/// <summary>
/// 11房输出模块状态指示灯
/// </summary>
public ModbusProperty<ushort> EqmInfo11 { get; set; } = new(11);
/// <summary>
/// 12房火灾显示盘区域显示盘
/// </summary>
public ModbusProperty<ushort> EqmInfo12 { get; set; } = new(12);
}

@ -64,11 +64,11 @@ public class LedClient
private static void Connect()
{
Log.Info($"begin connect {_ip}:{_port}");
/*Log.Info($"begin connect {_ip}:{_port}");
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.NoDelay = true;
_socket.Connect(_ip, _port);
Log.Info($"end connect {_ip}:{_port} {_socket.Connected}");
Log.Info($"end connect {_ip}:{_port} {_socket.Connected}");*/
}
public static bool InnerSend(byte[] bytes)

@ -1,4 +1,5 @@
using Autofac;
using Common.Util;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
@ -71,12 +72,15 @@ public class SoundClient
/// </summary>
/// <param name="fileLoad">mp3 文件所在路径</param>
/// 例如:"D:\\Desktop\\Sound\\电池拆卸中请稍后.mp3"
public bool SoundPlay(string fileLoad)
public bool SoundPlay( SoundEnum soundEnum)
{
int result = NAudioClientDll.na_start_play_1(0, 0, fileLoad, 10);
/*int result = NAudioClientDll.na_start_play_1(0, 0, fileLoad, 10);
if (NAudioClientDll.RET_SUCCESS == result)
return true;
return false;
return false;*/
string url = "http://127.0.0.1:5039/" + (Convert.ToByte(soundEnum)).ToString();
HttpUtil.SendGetRequest(url);
return true;
}
/// <summary>
@ -91,4 +95,139 @@ public class SoundClient
return false;
return true;
}
}
public enum SoundEnum
{
music01=1,//车辆已到位,请停车
music02,//请将车辆行驶到指定位置
music03,//请按屏幕顺序操作车辆;
music04,//请尽快将车辆行驶到指定位置
music05,//认证失败,请联系站务人员
music06,//车站通讯故障,请联系站务
music07,//换电站模式错误,请联系站务
music08,//车辆型号不适配本站,请联系站务了解更多信息
music09,//车辆不符合换电要求,请驶离
music10,//请按屏幕顺序操作车辆;
music11,//无可用电池,请联系站务
music12,//请拉起手刹
music13,//请熄火车辆;
music14,//设备准备中,请勿操作车辆
music15,//请按下启动按钮,开始换电
music16,//开始换电
music17,//请使用手机APP启动换电
music18,//设备不允许换电,请联系站务
music19,//车机不允许换电,请联系站务
music20,//开始换电,请勿操作车辆
music21,//定位电池失败,请联系站务人员
music22,//电池定位不成功,请联系站务确认精度
music23,//车辆角度过大,请将车辆停正
music24,//电池定位结束,请联系站务确认精度
music25,//自动解锁失败,请联系站务手动解锁
music26,//电池解锁中,请稍候
music27,//电池拆卸完成
music28,//电池搬运中,请稍候
music29,//电池安装中,请稍候
music30,//自动上锁失败,请联系站务手动上锁
music31,//电池自动上锁中,请稍候
music32,//换电暂停,请联系站务确认锁状态
music33,//自检失败,请联系站务人员
music34,//换电完成,祝你一路顺风
music35,//突发紧急状况,请尽快撤离
music36,//换电暂停,请联系站务人员
music37,//您已进入危险区域,请尽快离开
music38,//车辆高压异常,请熄火车辆
music39,//车站通讯故障,请联系站务
music41=41,//[Info("欢迎光临换电站!(正在营业)","欢迎光临换电站!,本站正在营业中")]WelcomeInfo=1,
music42,//[Info("标签读写失败", "标签读写失败")] ErrorReadRfid ,
music43,//[Info("车辆连接失败", "车辆连接失败,请联系站务人员")] ErrorTBoxConn ,
music44,//[Info("云端校验失败", "云端校验失败,请联系站务人员")] ErrorCloudCheck ,
music45,//[Info("车辆已到位", "车辆已到位")] InfoCarInPosition ,
music46,//[Info("请熄火挂空挡拉手刹", "请熄火挂空挡拉手刹")] ErrorCarInPositionTimeout,
music47,//[Info("云平台下发换电失败", "云平台下发换电超时")] CloudSendSwapError ,
music48,//[Info("解锁车辆失败", "解锁车辆失败")] ErrUnLockCar ,
music49,//[Info("选包失败,请驶离", "选包失败,请驶离")] ErrorSelectPack ,
music50,//[Info("通道拍照定位失败,请在三分钟内重新调整车辆位置", "通道拍照定位失败,请在三分钟内重新调整车辆位置")]ErrChannelStatus=10,
music51,//[Info("电池拆卸中,请稍后", "电池拆卸中,请稍后")] InfoUnPack ,
music52,//[Info("电池安装中,请稍后", "电池安装中,请稍后")] InfoPack ,
music53,//[Info("电池包已安装完成", "电池包已安装完成")] InfoPackFinish ,
music54,//[Info("航车已回归安全位置", "航车已回归安全位置")] InfoToSafePosition ,
music55,//[Info("换电已完成,请驶离", "换电已完成,请驶离")] InfoCarLeave ,
music56,//[Info("换电失败,请驶离", "换电失败,请驶离")] ErrInfoCarLeave ,
music57,//[Info("电池入仓中,请稍后", "电池入仓中,请稍后")] InfoOldBatteryCarryIn ,
music58,//[Info("电池出仓中,请稍后", "电池出仓中,请稍后")] InfoNewBatteryCarryOut ,
music59,//[Info("车辆上锁失败", "车辆上锁失败")] ErrLockCar ,
music60,//[Info("通道的电池仓无可用换电电池","通道的电池仓无可用换电电池")] NoBatteryErr,
music61,//[Info("结束充电电池数量不足","通道的电池仓无可用换电电池")] LessOfFinishChargingErr,
music62,//[Info("空仓数量不足","通道的电池仓无可用换电电池")] LessOfEmptyBinErr,
music63,//[Info("符合soc限制数量不足","通道的电池仓无可用换电电池")] LessOfSocErr,
music64,//[Info("结束充电大于3分钟的数量不足","通道的电池仓无可用换电电池")] LessOf3MinuteErr,
music65,//[Info("换电站处于手动模式,不能自动换电","换电站处于手动模式,不能自动换电")] InfoStationModel,
music66,//[Info("换电站处于本地模式,不能远程换电","换电站处于本地模式,不能远程换电")] InfoStationModelRemoteErr,
music67,//[Info("车辆驶入","车辆驶入")] CarInInfo,
music68,//[Info("换电任务启动","换电任务启动")] StartSwapInfo,
music69,//[Info("航车拍照中,请稍后","航车拍照中,请稍后")] CarTakePhotoInfo,
music70,//[Info("启动换电失败,请联系站务人员","启动换电失败,请联系站务人员")] ErrStartSwap,
music71,//即将进行消防移仓,请通道车辆驶离
music72,//电池移仓中//
music73,//消防移仓中
music74,//开始读取标签失败
music75,
music76,
music77,
music78,
music79,
music80,
music81,
music82,
music83,
music84,
music85,
music86,
music87,
music88,
music89,
music90,
music91,
music92,
music93,
/*
*/
}

@ -1,11 +1,15 @@
using Autofac;
using Common.Const;
using Entity.DbModel.Station;
using Furion;
using HslCommunication;
using HslCommunication.ModBus;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Const;
using HybirdFrameworkDriver.ModbusTcpMaster;
using Repository.Station;
using Service.Execute.Utils;
using Service.Ups.Msg;
namespace Service.Ups;
@ -14,9 +18,9 @@ namespace Service.Ups;
[Scope]
public class UpsClient: ModbusTcpMaster
{
public EquipAlarmDefineRepository _equipAlarmDefineRepository;
public EquipAlarmRecordRepository _equipAlarmRecordRepository;
public EquipAlarmProcessRecordRepository _equipAlarmProcessRecordRepository;
public EquipAlarmDefineRepository _equipAlarmDefineRepository=AppInfo.Container.Resolve<EquipAlarmDefineRepository>();
public EquipAlarmRecordRepository _equipAlarmRecordRepository=AppInfo.Container.Resolve<EquipAlarmRecordRepository>();
public EquipAlarmProcessRecordRepository _equipAlarmProcessRecordRepository=AppInfo.Container.Resolve<EquipAlarmProcessRecordRepository>();
public UpsClient()
{
@ -32,9 +36,10 @@ public class UpsClient: ModbusTcpMaster
private void BatchRead(ModbusTcpMaster master)
{
bool resul = Connected;
ModbusTcpNet _client = new ModbusTcpNet(master.Ip, master.Port, 0x01);
/*ModbusTcpNet _client = new ModbusTcpNet(master.Ip, master.Port, 0x01);
OperateResult<byte[]> operateResult01 = _client.Read("x=3;" + 1, (ushort)81);
OperateResult<byte[]> operateResult02 = _client.Read("x=3;" + 1, (ushort)81);
*/
//0x03

@ -19,6 +19,7 @@ using Service.Execute;
using Service.Led;
using Service.Padar.Client;
using Service.RealTime;
using Service.Sound.SoundClient;
using Service.Ups;
using SqlSugar;
using SqlSugar.IOC;
@ -195,7 +196,7 @@ if (AppSettingsHelper.GetBool("led", "enable"))
//现场调试plc连接
AppInfo.Container = app.Services.GetAutofacRoot();
ClientMgr.InitClient();
//ClientMgr.InitClient();
//ups
if (AppSettingsHelper.GetBool("ups", "enable"))
@ -203,6 +204,8 @@ if (AppSettingsHelper.GetBool("ups", "enable"))
UpsMgr.UpsInit();
}
//new SoundClient().SoundConn();
//TaskInit.Init();
//PadarMgr.InitClient();
TaskInit.Init();

@ -175,4 +175,30 @@
<conversionPattern value="记录时间:%date 日志内容:%message%newline "/>
</layout>
</appender>
<logger name="Padar" additivity="false">
<level value="ALL" />
<appender-ref ref="Padar" />
</logger>
<appender name="Padar" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Padar.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="记录时间:%date 日志内容:%message%newline "/>
</layout>
</appender>
</log4net>

@ -1,10 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
// This code was generated by a tool.
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -14,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7154d68e0d36fea66b21b752820452a7e403f026")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyTitleAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
687beec018842b8209a9ad8c4008efa1d416b7203a9ffbdec331fbe2a5ad38f8
b24e7010e47a60342dee5f98453f768a67e7ca37

@ -1,10 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
// This code was generated by a tool.
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -14,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7154d68e0d36fea66b21b752820452a7e403f026")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyTitleAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

Loading…
Cancel
Save