Initial commit

This commit is contained in:
ChiKyun Kim
2025-07-17 16:11:46 +09:00
parent 4865711adc
commit 4a1b1924ba
743 changed files with 230954 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
using AR;
using Microsoft.SqlServer.Server;
using Newtonsoft.Json.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace Project.Controller
{
public class ModelController : ApiController
{
//private static List<Item> _values = new List<Item> {
// new Item { Id = 1, Name = "USB2.0 연장선" },
// new Item { Id = 2, Name = "USB3.0 연장선" },
// new Item { Id =3, Name = "USB3.1 연장선" }
//};
// GET api/values
public IHttpActionResult Get()
{
HttpResponseMessage responsem = new HttpResponseMessage(HttpStatusCode.OK);
var data = new
{
model = PUB.Result.vModel.Title,
};
return Ok(data);
}
// GET api/values/5
public IHttpActionResult Get(int id)
{
//var value = DataManager.Items?.Find(v => v.Id == id) ?? null;
//if (value == null)
//{
// return NotFound();
//}
return Ok();
}
// POST api/values
[HttpGet]
public IHttpActionResult Set(string id)
{
//지정된 모델로 변경한다.
var msg = "";
if (id.isEmpty()) msg = "NO MODELNAME";
if (msg.isEmpty())
{
if (PUB.sm.Step == eSMStep.IDLE || PUB.sm.Step == eSMStep.FINISH)
{
var buf = id.Split(new char[] { '|' }, System.StringSplitOptions.RemoveEmptyEntries);
var modelname = buf[0];
var conv = true;
if (buf.Length == 2) conv = buf[1] == "1";
var modelVision = PUB.mdm.GetDataV(modelname);
if (modelVision == null)
{
msg = "NO MODELDATA";
}
else
{
VAR.BOOL[eVarBool.Use_Conveyor] = conv;
var rlt = PUB.SelectModelV(modelname, false);
if (rlt == false)
{
msg = "[OP]LOAD FAIL";
}
else
{
var motion = conv ? "Conveyor" : "Default";
rlt = PUB.SelectModelM("Conveyor");
if(rlt ==false)
{
msg = "[MT]LOAD FAIL";
}
}
}
}
else
{
msg = "NOT IDLE";
}
}
var data = new
{
Message = msg,
Result = (msg.isEmpty() ? true : false),
};
return Ok(data);
}
// PUT api/values/5
public IHttpActionResult Put(int id, [FromBody] JObject value)
{
return Ok();
}
// DELETE api/values/5
public IHttpActionResult Delete(int id)
{
return Ok();
}
}
}

View File

@@ -0,0 +1,88 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Runtime.Remoting.Contexts;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Web.Http.Results;
namespace Project.Controller
{
public class StateController : ApiController
{
//private static List<Item> _values = new List<Item> {
// new Item { Id = 1, Name = "USB2.0 연장선" },
// new Item { Id = 2, Name = "USB3.0 연장선" },
// new Item { Id =3, Name = "USB3.1 연장선" }
//};
// GET api/values
public IHttpActionResult Get()
{
HttpResponseMessage responsem = new HttpResponseMessage(HttpStatusCode.OK);
//responsem.Headers.Add("Content-Type", "application/json");
//ResponseMessageResult response = new ResponseMessageResult(responsem);
//return response;
//return this.Content(HttpStatusCode.OK, _values, mediaType)
return Ok();
//string json = JsonConvert.SerializeObject(_values, Formatting.Indented);
//return Ok(json);
}
// GET api/values/5
public IHttpActionResult Get(int id)
{
//var value = DataManager.Items?.Find(v => v.Id == id) ?? null;
//if (value == null)
//{
// return NotFound();
//}
return Ok();
}
// POST api/values
public IHttpActionResult Post([FromBody] JObject value)
{
//value.Id = DataManager.Items?.Count ?? 0;
//DataManager.Items.Add(value);
//DataManager.Save();
return CreatedAtRoute("DefaultApi", new { id = value }, value);
}
// PUT api/values/5
public IHttpActionResult Put(int id, [FromBody] JObject value)
{
//var index = DataManager.Items.FindIndex(v => v.Id == id);
//if (index == -1)
//{
// return NotFound();
//}
//DataManager.Items[index] = value;
//DataManager.Save();
return Ok();
}
// DELETE api/values/5
public IHttpActionResult Delete(int id)
{
//var index = DataManager.Items.FindIndex(v => v.Id == id);
//if (index == -1)
//{
// return NotFound();
//}
//DataManager.Items.RemoveAt(index);
//DataManager.Save();
return Ok();
}
}
}