2014-09-17 update 1
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Routing;
|
||||
using CrossLampControl.WebApi.Models;
|
||||
using ModBus.Net;
|
||||
|
||||
@@ -41,7 +42,9 @@ namespace CrossLampControl.WebApi.Controllers
|
||||
{
|
||||
light.SubLamp = LightLamp.Red.ToString();
|
||||
}
|
||||
light.SetStart(lamps[6]);
|
||||
return light;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CrossLampControl.WebApi.Models
|
||||
{
|
||||
public string MainLamp { get; set; }
|
||||
public string SubLamp { get; set; }
|
||||
public string StartPause { get; set; }
|
||||
|
||||
public Lamp()
|
||||
{
|
||||
@@ -17,10 +18,15 @@ namespace CrossLampControl.WebApi.Models
|
||||
SubLamp = LightLamp.Red.ToString();
|
||||
}
|
||||
|
||||
public Lamp(LightLamp mLamp, LightLamp sLamp)
|
||||
public void SetLamp(LightLamp mLamp, LightLamp sLamp)
|
||||
{
|
||||
MainLamp = mLamp.ToString();
|
||||
SubLamp = sLamp.ToString();
|
||||
}
|
||||
|
||||
public void SetStart(bool isStart)
|
||||
{
|
||||
StartPause = isStart ? "Start" : "Pause";
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user