1.将侧位使用改为人形

2.入口加箭头
old
xiaoguo 2 years ago
parent 778dd68270
commit d0f452d01b

@ -48,13 +48,12 @@ namespace GuideScreen.Common.Services
/// </summary>
/// <param name="entity"></param>
void UpdateToiletPositionRecordTotalByToday(string toiletPosition, string note);
/// <summary>
/// 更新 当日能耗记录信息
/// </summary>
/// <param name="name"></param>
/// <param name="note"></param>
void UpdateEnergyMonitoringByToday(string name, string note, float value);
/// <param name="name">设备对应的点位名称</param>
/// <param name="note">描述</param>
/// <param name="dateTime">如果时间为空则默认今日</param>
void UpdateEnergyMonitoringByToday(string name, string note, float value, DateTime? dateTime = null);
/// <summary>
/// 根据日期获取能耗信息

@ -71,8 +71,8 @@ namespace GuideScreen.Common.Services.Impl
public List<PLCDeviceRecordDayModel> GetToiletPositionRecordTotalByToday()
{
var begDateTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
var endDateTime=begDateTime.AddDays(1).AddMilliseconds(-1);
var page= GetPLCDeviceRecordDayList(PLCDeviceNames.ToiletPosition,string.Empty, begDateTime,endDateTime,0,0);
var endDateTime = begDateTime.AddDays(1).AddMilliseconds(-1);
var page = GetPLCDeviceRecordDayList(PLCDeviceNames.ToiletPosition, string.Empty, begDateTime, endDateTime, 0, 0);
var list = page.Content;
return list;
@ -80,10 +80,10 @@ namespace GuideScreen.Common.Services.Impl
}
/// <summary>
/// 更新 设备记录信息
/// 更新 侧位今日使用记录信息
/// </summary>
/// <param name="entity"></param>
public void UpdateToiletPositionRecordTotalByToday(string toiletPosition,string note)
public void UpdateToiletPositionRecordTotalByToday(string toiletPosition, string note)
{
var entity = new PLCDeviceRecordDayEntity
{
@ -104,30 +104,38 @@ namespace GuideScreen.Common.Services.Impl
/// <summary>
/// 更新 当日能耗记录信息
/// </summary>
/// <param name="name"></param>
/// <param name="note"></param>
public void UpdateEnergyMonitoringByToday(string name, string note, float value)
/// <param name="name">设备对应的点位名称</param>
/// <param name="note">描述</param>
/// <param name="dateTime">如果时间为空则默认今日</param>
public void UpdateEnergyMonitoringByToday(string name, string note, float value, DateTime? dateTime = null)
{
var entity = new PLCDeviceRecordDayEntity
{
DeviceName = PLCDeviceNames.EnergyMonitoring,
PointName = name,
PointNote = note,
Day = DateTime.Now.ToString("yyyy-MM-dd")
};
if (dateTime.HasValue)
{
entity.Day = dateTime.Value.ToString("yyyy-MM-dd");
}
else
{
entity.Day = DateTime.Now.ToString("yyyy-MM-dd");
}
var detail = this.deviceRecordRepository.GetPLCDeviceRecordDayDetail(entity);
if (detail == null)
{
detail = entity;
}
detail.RecordValue= Convert.ToDecimal(value);
detail.RecordValue = Convert.ToDecimal(value);
this.deviceRecordRepository.UpdatePLCDeviceRecordDay(detail);
}
/// <summary>
/// 根据日期获取能耗信息
/// </summary>
public decimal GetEnergyMonitoringByDay(string name,DateTime dt)
public decimal GetEnergyMonitoringByDay(string name, DateTime dt)
{
var entity = new PLCDeviceRecordDayEntity
{

@ -56,7 +56,7 @@ namespace GuideScreen.Common.Services.Impl
};
}
public void Load()
{
@ -108,12 +108,12 @@ namespace GuideScreen.Common.Services.Impl
/// <returns></returns>
public IDictionary<string, int> ToiletPositionRecordTotalByToday()
{
var list = deviceRecordService.GetToiletPositionRecordTotalByToday();
//厕所侧位使用统计
var toilets = new Dictionary<string, int>
{
["男厕1"] = GetToiletPositionNum(list,PLCPointNameByToiletPosition.ToiletManStatus1),
["男厕1"] = GetToiletPositionNum(list, PLCPointNameByToiletPosition.ToiletManStatus1),
["男厕2"] = GetToiletPositionNum(list, PLCPointNameByToiletPosition.ToiletManStatus2),
["男厕3"] = GetToiletPositionNum(list, PLCPointNameByToiletPosition.ToiletManStatus3),
["男厕4"] = GetToiletPositionNum(list, PLCPointNameByToiletPosition.ToiletManStatus4),
@ -127,7 +127,7 @@ namespace GuideScreen.Common.Services.Impl
}
private int GetToiletPositionNum(List<PLCDeviceRecordDayModel> list,string toiletPositionName)
private int GetToiletPositionNum(List<PLCDeviceRecordDayModel> list, string toiletPositionName)
{
if (list == null || list.Count == 0)
{
@ -154,7 +154,7 @@ namespace GuideScreen.Common.Services.Impl
case PLCDeviceNames.ToiletPosition:
if (e.GetValue<bool>())
{
deviceRecordService.UpdateToiletPositionRecordTotalByToday(e.Name,e.Note);
deviceRecordService.UpdateToiletPositionRecordTotalByToday(e.Name, e.Note);
}
break;
//记录环境信息
@ -178,16 +178,16 @@ namespace GuideScreen.Common.Services.Impl
public float GetTodayElectricityConsumption(float total)
{
//获取昨天用电总量
decimal yesterday = deviceRecordService.GetEnergyMonitoringByDay(PLCPointNameByEnergyMonitoring.ElectricityConsumption,DateTime.Now.AddDays(-1));
decimal yesterday = deviceRecordService.GetEnergyMonitoringByDay(PLCPointNameByEnergyMonitoring.ElectricityConsumption, DateTime.Now.AddDays(-1));
//如果昨日没有记录或为0,就将当前用电量添加当昨日防止今日用电量为0
if (yesterday == 0)
if (yesterday > 0)
{
deviceRecordService.UpdateEnergyMonitoringByToday(PLCPointNameByEnergyMonitoring.ElectricityConsumption, "用电量", total);
return 0;
return total - float.Parse(yesterday.ToString());
}
if (yesterday>0)
else
{
return total - float.Parse(yesterday.ToString());
deviceRecordService.UpdateEnergyMonitoringByToday(PLCPointNameByEnergyMonitoring.ElectricityConsumption, "用电量", total, DateTime.Now.AddDays(-1));
}
return 0;

File diff suppressed because it is too large Load Diff

@ -114,10 +114,10 @@ namespace GuideScreen.UI
}
catch (Exception ex)
{
ErrorDialog("获取点位错误:"+ ex.Message);
ErrorDialog("获取点位错误:" + ex.Message);
ex.WriteErrorLog();
}
}));
@ -138,26 +138,26 @@ namespace GuideScreen.UI
case 1:
if (use)
{
pBoxManPit1.Image = Resources.pitFull;
pBoxManPitOne.Image = Resources.man;
toilets["男厕1"]++;
}
else
{
pBoxManPit1.Image = Resources.pitEmpty;
pBoxManPitOne.Image = Resources.man_empty;
}
pBoxManPit1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
//pBoxManPit1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
break;
case 2:
if (use)
{
pBoxManPit2.Image = Resources.pitFull;
pBoxManPitTwo.Image = Resources.man;
toilets["男厕2"]++;
}
else
{
pBoxManPit2.Image = Resources.pitEmpty;
pBoxManPitTwo.Image = Resources.man_empty;
}
pBoxManPit2.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
//pBoxManPit2.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
break;
case 3:
if (use)
@ -206,34 +206,34 @@ namespace GuideScreen.UI
case 1:
if (use)
{
pBoxPitWoman1.Image = Resources.pitFull;
pBoxPitWomanOne.Image = Resources.woman;
toilets["女厕1"]++;
}
else
{
pBoxPitWoman1.Image = Resources.pitEmpty;
pBoxPitWomanOne.Image = Resources.woman_empty;
}
break;
case 2:
if (use)
{
pBoxPitWoman2.Image = Resources.pitFull;
pBoxPitWomanTwo.Image = Resources.woman;
toilets["女厕2"]++;
}
else
{
pBoxPitWoman2.Image = Resources.pitEmpty;
pBoxPitWomanTwo.Image = Resources.woman_empty;
}
break;
case 3:
if (use)
{
pBoxPitWoman3.Image = Resources.pitFull;
pBoxPitWomanThree.Image = Resources.woman;
toilets["女厕3"]++;
}
else
{
pBoxPitWoman3.Image = Resources.pitEmpty;
pBoxPitWomanThree.Image = Resources.woman_empty;
}
break;
default:
@ -460,8 +460,8 @@ namespace GuideScreen.UI
lblElectricityMeter.Text = Convert.ToInt32(e.GetValue<float>()).ToString();
//今日电量
var str = Convert.ToInt32(plcController.GetTodayElectricityConsumption(e.GetValue<float>())).ToString();
str= str.Aggregate(string.Empty, (c, i) => c + i + " ");
lblElectricQuantity.Text = $"今日耗电量 {str} 千瓦时";
str = str.Aggregate(string.Empty, (c, i) => c + i + " ");
lblElectricQuantity.Text = $"今日耗电量 {str} 千瓦时";
break;
//用水量
@ -471,22 +471,22 @@ namespace GuideScreen.UI
case PLCPointNameByEnvironmentalMonitoring.Temperature:
var temperature = e.GetValue<float>();
lblEnvirTempl.Text = Math.Round(temperature, 1).ToString() + " °C";
processEnvirTempl.Value=Convert.ToInt32(temperature);
processEnvirTempl.Value = Convert.ToInt32(temperature);
break;
case PLCPointNameByEnvironmentalMonitoring.Humidity:
var envirHumidity = e.GetValue<float>();
lblEnvirHumidity.Text = Math.Round(envirHumidity, 1).ToString() + " %";
processLineEnvirHumidity.Value= Convert.ToInt32(envirHumidity);
processLineEnvirHumidity.Value = Convert.ToInt32(envirHumidity);
break;
case PLCPointNameByEnvironmentalMonitoring.NH3:
var enviHydrogenSulfide = e.GetValue<float>();
lblEnviHydrogenSulfide.Text = Math.Round(enviHydrogenSulfide, 2).ToString() + " PPM";
processEnviHydrogenSulfide.Value=Convert.ToInt32(enviHydrogenSulfide);
processEnviHydrogenSulfide.Value = Convert.ToInt32(enviHydrogenSulfide);
break;
case PLCPointNameByEnvironmentalMonitoring.H2S:
var ammoniaGas = e.GetValue<float>();
lblAmmoniaGas.Text = Math.Round(ammoniaGas, 1).ToString() + " PPM";
processEnviAmmoniaGas.Value= Convert.ToInt32(ammoniaGas);
processEnviAmmoniaGas.Value = Convert.ToInt32(ammoniaGas);
break;
#endregion
@ -499,13 +499,13 @@ namespace GuideScreen.UI
break;
//运行电流1
case PLCPointNameByVacuumPumpingStation.RunningCurrent1:
var runningCurrent = e.GetValue<Int16>();
analogMeterElectricity1.Value= runningCurrent;
var runningCurrent = e.GetValue<Int16>();
analogMeterElectricity1.Value = runningCurrent;
lblElectricity1.Text = $"{runningCurrent} A";
break;
//运行频率1
case PLCPointNameByVacuumPumpingStation.RunningFrequency1:
var runningFrequency= e.GetValue<Int16>();
var runningFrequency = e.GetValue<Int16>();
analogMeterFrequency1.Value = runningFrequency;
lblFrequency1.Text = $"{runningFrequency} HZ";
break;
@ -556,7 +556,7 @@ namespace GuideScreen.UI
//1号泵运行时间
case PLCPointNameByVacuumPumpingStation.PumpAccumulatedStartTime1:
var pumpAccumulatedStartTime1 = e.GetValue<Int16>();
LedDisplayOneTime.Text = pumpAccumulatedStartTime1.ToString("D5")+"H";
LedDisplayOneTime.Text = pumpAccumulatedStartTime1.ToString("D5") + "H";
break;
//2号泵运行时间
case PLCPointNameByVacuumPumpingStation.PumpAccumulatedStartTime2:
@ -650,7 +650,7 @@ namespace GuideScreen.UI
/// <summary>
/// 模拟今日用水量
/// </summary>
private void SetDayWarter()
private void SetDayWarter()
{
var values = toilets.Values.Sum();
if (values == 0)
@ -675,7 +675,8 @@ namespace GuideScreen.UI
//星期
lblweek.Text = DateTime.Today.ToString("dddd", new System.Globalization.CultureInfo("zh-CN"));
//零点以后更新的数据
if (dateTime.ToString("HH:mm:ss") == zeroTime) {
if (dateTime.ToString("HH:mm:ss") == zeroTime)
{
//更新厕位使用情况
toilets = plcController.ToiletPositionRecordTotalByToday();
@ -731,6 +732,5 @@ namespace GuideScreen.UI
plcController.Stop();
}
}
}

File diff suppressed because it is too large Load Diff

@ -184,6 +184,7 @@
<Content Include="Sources\1wc.png" />
<Content Include="Sources\anhuaqing.png" />
<Content Include="Sources\anqi.png" />
<None Include="Sources\arrows.png" />
<Content Include="Sources\biaotidikuang.png" />
<Content Include="Sources\chongdian.png" />
<Content Include="Sources\GIS-TL_压力流量点.png" />
@ -191,6 +192,7 @@
<Content Include="Sources\logo.ico" />
<Content Include="Sources\logo.png" />
<Content Include="Sources\man.png" />
<None Include="Sources\man_empty.png" />
<Content Include="Sources\pitEmpty.png" />
<Content Include="Sources\pitFull.png" />
<Content Include="Sources\sale.png" />
@ -265,6 +267,7 @@
<Content Include="Sources\weather\999.png" />
<Content Include="Sources\wendu.png" />
<Content Include="Sources\woman.png" />
<None Include="Sources\woman_empty.png" />
<Content Include="Sources\变频器 4.png" />
<Content Include="Sources\变频器 5.png" />
<Content Include="Sources\变频器6.png" />

@ -670,6 +670,36 @@ namespace GuideScreen.UI.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap arrows {
get {
object obj = ResourceManager.GetObject("arrows", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap man {
get {
object obj = ResourceManager.GetObject("man", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap man_empty {
get {
object obj = ResourceManager.GetObject("man_empty", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@ -709,5 +739,25 @@ namespace GuideScreen.UI.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap woman {
get {
object obj = ResourceManager.GetObject("woman", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap woman_empty {
get {
object obj = ResourceManager.GetObject("woman_empty", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

@ -118,6 +118,15 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="arrows" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\arrows.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="man" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\man.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="man_empty" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\man_empty.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pitEmpty" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\pitEmpty.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -130,6 +139,12 @@
<data name="urinateFull" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\urinateFull.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="woman" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\woman.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="woman_empty" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\woman_empty.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_100" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sources\weather\100.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Loading…
Cancel
Save