添加项目文件。
This commit is contained in:
49
WPFWCSDemo/Common/ConnectionUrl.cs
Normal file
49
WPFWCSDemo/Common/ConnectionUrl.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WPFWCSDemo.Common
|
||||
{
|
||||
public class ConnectionUrl
|
||||
{
|
||||
/// <summary>
|
||||
/// wms连接url
|
||||
/// </summary>
|
||||
public static string wms = $"{ConfigurationManager.AppSettings["WmsIP"]}:{ConfigurationManager.AppSettings["WmsPort"]}";
|
||||
/// <summary>
|
||||
/// 输送机IP
|
||||
/// </summary>
|
||||
public static string Conv = $"{ConfigurationManager.AppSettings["Conv"]}";
|
||||
/// <summary>
|
||||
/// 1#提升机IP
|
||||
/// </summary>
|
||||
public static string lift1 = $"{ConfigurationManager.AppSettings["Lift1"]}";
|
||||
/// <summary>
|
||||
/// 2#提升机IP
|
||||
/// </summary>
|
||||
public static string lift2 = $"{ConfigurationManager.AppSettings["Lift2"]}";
|
||||
/// <summary>
|
||||
/// 1#穿梭车IP
|
||||
/// </summary>
|
||||
public static string rGV1 = $"{ConfigurationManager.AppSettings["RGV1"]}";
|
||||
/// <summary>
|
||||
/// 2#穿梭车IP
|
||||
/// </summary>
|
||||
public static string rGV2 = $"{ConfigurationManager.AppSettings["RGV2"]}";
|
||||
/// <summary>
|
||||
/// 1#堆垛机IP
|
||||
/// </summary>
|
||||
public static string stacker1 = $"{ConfigurationManager.AppSettings["Stacker1"]}";
|
||||
/// <summary>
|
||||
/// 2#堆垛机IP
|
||||
/// </summary>
|
||||
public static string stacker2 = $"{ConfigurationManager.AppSettings["Stacker2"]}";
|
||||
/// <summary>
|
||||
/// 3#堆垛机IP
|
||||
/// </summary>
|
||||
public static string stacker3 = $"{ConfigurationManager.AppSettings["Stacker3"]}";
|
||||
}
|
||||
}
|
||||
33
WPFWCSDemo/Common/Converters/ColorToBrushConverter.cs
Normal file
33
WPFWCSDemo/Common/Converters/ColorToBrushConverter.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace WPFWCSDemo.Common.Converters
|
||||
{
|
||||
[ValueConversion(typeof(Color), typeof(Brush))]
|
||||
public class ColorToBrushConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is Color color)
|
||||
{
|
||||
return new SolidColorBrush(color);
|
||||
}
|
||||
return Binding.DoNothing;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is SolidColorBrush brush)
|
||||
{
|
||||
return brush.Color;
|
||||
}
|
||||
return default(Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
67
WPFWCSDemo/Common/CustomAttributes/TimerTaskAttribute.cs
Normal file
67
WPFWCSDemo/Common/CustomAttributes/TimerTaskAttribute.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Quartz;
|
||||
using Quartz.Impl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WPFWCSDemo.Common.CustomAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class TimerTaskAttribute:Attribute
|
||||
{
|
||||
public int Second { get; set; }
|
||||
public int Minute { get; set; }
|
||||
public int Hour { get; set; }
|
||||
|
||||
private IScheduler _scheduler;
|
||||
|
||||
/// <summary>
|
||||
/// Quartz调度任务注册
|
||||
/// </summary>
|
||||
/// <param name="className">类名</param>
|
||||
/// <param name="jobName">作业名称</param>
|
||||
/// <param name="triggerName">触发器名称</param>
|
||||
/// <param name="group">任务组名称</param>
|
||||
private async void GetScheduleJob(Type className, string jobName, string triggerName, string group, int time)
|
||||
{
|
||||
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
||||
_scheduler = schedulerFactory.GetScheduler().Result;
|
||||
await _scheduler.Start();
|
||||
|
||||
var method = typeof(JobBuilder)
|
||||
.GetMethods()
|
||||
.First(m => m.Name == "Create" && m.IsGenericMethod);
|
||||
|
||||
var genericMethod = method.MakeGenericMethod(className);
|
||||
var jobBuilder = genericMethod.Invoke(null, null);
|
||||
|
||||
//任务处理---注册任务
|
||||
IJobDetail job = ((JobBuilder)jobBuilder)
|
||||
//.Create<className>()
|
||||
.WithIdentity(jobName, group)
|
||||
.DisallowConcurrentExecution()
|
||||
.Build();
|
||||
|
||||
//任务处理---触发器
|
||||
ITrigger trigger = TriggerBuilder
|
||||
.Create()
|
||||
.WithIdentity(triggerName, group)
|
||||
.StartNow()
|
||||
.WithSimpleSchedule(x => x
|
||||
.WithInterval(TimeSpan.FromMilliseconds(time))
|
||||
.RepeatForever())
|
||||
.Build();
|
||||
|
||||
await _scheduler.ScheduleJob(job, trigger);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
79
WPFWCSDemo/Common/RGVStation.cs
Normal file
79
WPFWCSDemo/Common/RGVStation.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WPFWCSDemo.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// RGV取放货站点
|
||||
/// </summary>
|
||||
public class RGVStation
|
||||
{
|
||||
/// <summary>
|
||||
/// 环穿运行设备数量
|
||||
/// </summary>
|
||||
public const int RGVCount = 13;
|
||||
|
||||
/// <summary>
|
||||
/// H线供实垛 1001
|
||||
/// </summary>
|
||||
public const int LineH_Goods_In = 1001;
|
||||
/// <summary>
|
||||
/// M线供实垛 1003
|
||||
/// </summary>
|
||||
public const int LineM_Goods_In = 1003;
|
||||
/// <summary>
|
||||
/// L线供实垛 1005
|
||||
/// </summary>
|
||||
public const int LineL_Goods_In = 1005;
|
||||
/// <summary>
|
||||
/// G1线供实垛 1007
|
||||
/// </summary>
|
||||
public const int LineG1_Goods_In = 1007;
|
||||
/// <summary>
|
||||
/// G2线供实垛 1008
|
||||
/// </summary>
|
||||
public const int LineG2_Goods_In = 1008;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 立库口送实垛1-1009
|
||||
/// </summary>
|
||||
public const int LineToWarehouse1_Out = 1009;
|
||||
/// <summary>
|
||||
/// 立库口送实垛2-1010
|
||||
/// </summary>
|
||||
public const int LineToWarehouse2_Out = 1010;
|
||||
/// <summary>
|
||||
/// G线送实垛-1011
|
||||
/// </summary>
|
||||
public const int LineG_Goods_Out = 1011;
|
||||
/// <summary>
|
||||
/// H线送实垛-1012
|
||||
/// </summary>
|
||||
public const int LineH_Goods_Out = 1012;
|
||||
|
||||
//==============================================================================================
|
||||
|
||||
/// <summary>
|
||||
/// 供空托 1013
|
||||
/// </summary>
|
||||
public const int LineGH_Pallets_In = 1013;
|
||||
|
||||
/// <summary>
|
||||
/// 放空托1 1002
|
||||
/// </summary>
|
||||
public const int LineH_Pallets_Out = 1002;
|
||||
/// <summary>
|
||||
/// 放空托2 1004
|
||||
/// </summary>
|
||||
public const int LineG_Pallets_Out = 1004;
|
||||
/// <summary>
|
||||
/// 放空托3 1006
|
||||
/// </summary>
|
||||
public const int LineLM_Pallets_Out = 1006;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user