Merge pull request '녹화, 캡처 기능 추가' (#13) from dev/jym/240311_00 into main
Reviewed-on: http://220.90.135.190:3000/UVCXR/ChunilENG/pulls/13
This commit was merged in pull request #13.
This commit is contained in:
986716
Assets/Scenes/Main.unity
986716
Assets/Scenes/Main.unity
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9acf3d160f8100439e770a6c857e2b3
|
||||
guid: 4912d9d95991bda4b9196a98368e42b2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -66,6 +66,8 @@ namespace CHN
|
||||
popupCanvas.panel_workconditionanalysis.onSearchData += httpManager.SearchWorkConditions;
|
||||
popupCanvas.panel_workconditionanalysis.onChangedDropdownValue += workConditionsManager.ChangeMainChartData;
|
||||
|
||||
popupCanvas.panel_worktimeanalysis.onSearchData += httpManager.SearchWorkTime;
|
||||
|
||||
libraryManager.onUpdateMachineFilters += popupCanvas.panel_library.UpdateFileterList;
|
||||
libraryManager.onLibraryFilterigComplete += popupCanvas.panel_library.AddLibrarayButtons;
|
||||
libraryManager.onTargetSetting += controller.SetTargetPos;
|
||||
@@ -86,6 +88,7 @@ namespace CHN
|
||||
|
||||
httpManager.onMachineKPIData += machineKPIManager.SetMachineKPI;
|
||||
httpManager.onWorkConditionsfacilityData += popupCanvas.panel_workconditionanalysis.SetFacilityDropDown;
|
||||
httpManager.onWorkConditionsfacilityData += popupCanvas.panel_worktimeanalysis.SetFacilityDropDown;
|
||||
httpManager.onSendWorkConditionsData += workConditionsManager.SetWorkConditionsData;
|
||||
|
||||
workConditionsManager.onSendChartLabels += popupCanvas.panel_workconditionanalysis.SetChartLabels;
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace CHN
|
||||
보압,
|
||||
주변온도,
|
||||
주변습도,
|
||||
|
||||
}
|
||||
public class Panel_WorkConditionAnalysis : PanelBase
|
||||
{
|
||||
@@ -112,7 +111,7 @@ namespace CHN
|
||||
ChartDatas.gameObject.SetActive(true);
|
||||
|
||||
data = workConditionsData;
|
||||
ITEMCD.text = data.data.rows[0].ITEMCD;
|
||||
//ITEMCD.text = data.data.rows[0].ITEMCD;
|
||||
|
||||
SetDataColumnDropDown();
|
||||
OnDropdownValueChanged(0);
|
||||
@@ -147,6 +146,7 @@ namespace CHN
|
||||
}
|
||||
private void SetDataColumnDropDown()
|
||||
{
|
||||
dropdownValues.Clear();
|
||||
Dropdown_DataColumn.ClearOptions();
|
||||
List<TMP_Dropdown.OptionData> optionList = new List<TMP_Dropdown.OptionData>();
|
||||
optionList.Add(new TMP_Dropdown.OptionData("보압 (Peak)"));
|
||||
|
||||
@@ -3,22 +3,84 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using WI;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using System;
|
||||
|
||||
namespace CHN
|
||||
{
|
||||
public class Panel_WorkTimeAnalysis : PanelBase
|
||||
{
|
||||
private Button Button_StartDay;
|
||||
private Button Button_EndDay;
|
||||
private TextMeshProUGUI Text_StartDay;
|
||||
private TextMeshProUGUI Text_EndDay;
|
||||
private TMP_Dropdown Dropdown_Facility;
|
||||
private TMP_InputField InputField_WorkOrderNumber;
|
||||
private Button Button_Search;
|
||||
private Button Button_Close;
|
||||
private TextMeshProUGUI ITEMCD;
|
||||
|
||||
private UI_Calendar ui_Calendar;
|
||||
|
||||
public Action<string, string, string, string> onSearchData;
|
||||
public override void AfterAwake()
|
||||
{
|
||||
ui_Calendar = transform.GetComponentInChildren<UI_Calendar>(true);
|
||||
|
||||
Button_Close.onClick.AddListener(() => SetActive(false));
|
||||
Button_StartDay.onClick.AddListener(OnClickStartDayBtn);
|
||||
Button_EndDay.onClick.AddListener(OnClickEndDayBtn);
|
||||
Button_Search.onClick.AddListener(OnClickSearchBtn);
|
||||
|
||||
ui_Calendar.Close();
|
||||
|
||||
Text_StartDay.text = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
Text_EndDay.text = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
|
||||
SetActive(false);
|
||||
}
|
||||
public void Open()
|
||||
{
|
||||
SetActive(true);
|
||||
}
|
||||
|
||||
private void OnClickStartDayBtn()
|
||||
{
|
||||
ui_Calendar.Open(Text_StartDay);
|
||||
}
|
||||
private void OnClickEndDayBtn()
|
||||
{
|
||||
ui_Calendar.Open(Text_EndDay);
|
||||
}
|
||||
|
||||
public void SetFacilityDropDown(WorkConditionFacilityData facilityData)
|
||||
{
|
||||
Dropdown_Facility.ClearOptions();
|
||||
string[] data = facilityData.data;
|
||||
|
||||
List<TMP_Dropdown.OptionData> optionList = new List<TMP_Dropdown.OptionData>();
|
||||
|
||||
foreach (string str in data)
|
||||
{
|
||||
optionList.Add(new TMP_Dropdown.OptionData(str));
|
||||
}
|
||||
|
||||
Dropdown_Facility.AddOptions(optionList);
|
||||
Dropdown_Facility.value = 0;
|
||||
}
|
||||
|
||||
private void OnClickSearchBtn()
|
||||
{
|
||||
DateTime startDate = Convert.ToDateTime(Text_StartDay.text);
|
||||
DateTime endDate = Convert.ToDateTime(Text_EndDay.text);
|
||||
|
||||
string startDateString = startDate.ToString("yyyy-MM-ddTHH:mm:ssZ");
|
||||
string endDateString = endDate.ToString("yyyy-MM-ddTHH:mm:ssZ");
|
||||
string MCHCD = Dropdown_Facility.options[Dropdown_Facility.value].text;
|
||||
string WO = InputField_WorkOrderNumber.text;
|
||||
|
||||
onSearchData?.Invoke(startDateString, endDateString, MCHCD, WO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace CHN
|
||||
public Action<MachineKPIData> onMachineKPIData;
|
||||
public Action<WorkConditionFacilityData> onWorkConditionsfacilityData;
|
||||
public Action<WorkConditionsData> onSendWorkConditionsData;
|
||||
public Action<WorkTimeData> onSendWorkTimeData;
|
||||
|
||||
[OptionSection]
|
||||
string httpSetting;
|
||||
@@ -77,8 +78,7 @@ namespace CHN
|
||||
|
||||
public WorkConditionFacilityData workConditionFacilityData;
|
||||
public WorkConditionsData workConditionsData;
|
||||
|
||||
|
||||
public WorkTimeData workTimeData;
|
||||
public void Start()
|
||||
{
|
||||
HTTPConnect();
|
||||
@@ -190,6 +190,43 @@ namespace CHN
|
||||
onSendWorkConditionsData?.Invoke(workConditionsData);
|
||||
}
|
||||
}
|
||||
public void SearchWorkTime(string startDate, string endDate, string MCHCD, string WO)
|
||||
{
|
||||
var WorkConditionRequest = new WorkConditionsRequestBody
|
||||
{
|
||||
startDate = startDate,
|
||||
endDate = endDate,
|
||||
MCHCD = MCHCD,
|
||||
WO = WO
|
||||
};
|
||||
|
||||
var path = testHttpServer + workingTimeAPI;
|
||||
|
||||
var json = JsonUtility.ToJson(WorkConditionRequest);
|
||||
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(WorkTimePost(path, json));
|
||||
}
|
||||
IEnumerator WorkTimePost(string url, string jsonData)
|
||||
{
|
||||
var request = new UnityWebRequest(url, "POST");
|
||||
byte[] bodyRaw = new UTF8Encoding().GetBytes(jsonData);
|
||||
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||
request.downloadHandler = new DownloadHandlerBuffer();
|
||||
request.SetRequestHeader("access-token", apiKey);
|
||||
request.SetRequestHeader("Content-Type", "application/json");
|
||||
|
||||
yield return request.SendWebRequest();
|
||||
|
||||
if (request.result == UnityWebRequest.Result.Success)
|
||||
{
|
||||
var payload = Encoding.UTF8.GetString(request.downloadHandler.data);
|
||||
var response = JsonConvert.DeserializeObject<WorkTimeData>(payload);
|
||||
|
||||
workTimeData = response;
|
||||
onSendWorkTimeData?.Invoke(workTimeData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,11 @@ public class Panel_ToolBar : PanelBase
|
||||
var path = handler.FinalPath;
|
||||
if (record_saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
//if (File.Exists(path))
|
||||
//{
|
||||
// Debug.Log("File is Already");
|
||||
//}
|
||||
//else
|
||||
File.Move(path, record_saveFileDialog.FileName);
|
||||
}
|
||||
else
|
||||
|
||||
18
Assets/WorkSpace/Personal/JYM/UI_BarChart.cs
Normal file
18
Assets/WorkSpace/Personal/JYM/UI_BarChart.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using WI;
|
||||
public class UI_BarChart : UIBase
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/WorkSpace/Personal/JYM/UI_BarChart.cs.meta
Normal file
11
Assets/WorkSpace/Personal/JYM/UI_BarChart.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73dda23a1c40df24198e96475ff7b7fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -50,6 +50,14 @@ public class WorkConditionsManager : MonoBehaviour, ISingle
|
||||
graphDatas.Clear();
|
||||
mainChartLabels.Clear();
|
||||
|
||||
originPeakData.Clear();
|
||||
originTemperatureData.Clear();
|
||||
originHumidityData.Clear();
|
||||
originCycleTimeData.Clear();
|
||||
|
||||
originChartLabels.Clear();
|
||||
|
||||
|
||||
foreach (var row in workConditionsData.data.rows)
|
||||
{
|
||||
originPeakData.Add(ConvertStringToInt(row.C027));
|
||||
|
||||
Reference in New Issue
Block a user