更新部分UI展示

This commit is contained in:
AFeiJia 2024-06-26 08:01:17 +08:00
parent 7ac40f8ca5
commit 9b93a87fe1
16 changed files with 895 additions and 108 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,277 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7071918393306086895
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1324714318626163629}
- component: {fileID: 3492220215965296684}
- component: {fileID: 3083583273910577969}
m_Layer: 5
m_Name: BeltScaleName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1324714318626163629
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7071918393306086895}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8452045265935338667}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 75, y: -15}
m_SizeDelta: {x: 200, y: 20}
m_Pivot: {x: 0, y: 1}
--- !u!222 &3492220215965296684
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7071918393306086895}
m_CullTransparentMesh: 1
--- !u!114 &3083583273910577969
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7071918393306086895}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 12
m_fontSizeBase: 12
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &7667543269356215635
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6297810662057895824}
- component: {fileID: 2326501715299067172}
- component: {fileID: 3473458235709709869}
m_Layer: 5
m_Name: BeltScaleRealTimeValue
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6297810662057895824
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7667543269356215635}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8452045265935338667}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 75, y: -38}
m_SizeDelta: {x: 200, y: 20}
m_Pivot: {x: 0, y: 1}
--- !u!222 &2326501715299067172
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7667543269356215635}
m_CullTransparentMesh: 1
--- !u!114 &3473458235709709869
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7667543269356215635}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 7189cdc95f54eb84ba6a7b8655aebb40, type: 2}
m_sharedMaterial: {fileID: 1594732787684875815, guid: 7189cdc95f54eb84ba6a7b8655aebb40,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 12
m_fontSizeBase: 12
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8452045265935338666
GameObject:
m_ObjectHideFlags: 0
@ -12,7 +284,7 @@ GameObject:
- component: {fileID: 8452045265935338645}
- component: {fileID: 8452045265935338644}
- component: {fileID: 6792933745276284637}
- component: {fileID: 6053792245040113255}
- component: {fileID: 2871858460242980863}
m_Layer: 5
m_Name: BeltScaleIcon
m_TagString: Untagged
@ -31,7 +303,9 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 1
m_Children: []
m_Children:
- {fileID: 1324714318626163629}
- {fileID: 6297810662057895824}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -92,7 +366,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_distance: 0
_multi: 0.1
--- !u!114 &6053792245040113255
--- !u!114 &2871858460242980863
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -101,7 +375,10 @@ MonoBehaviour:
m_GameObject: {fileID: 8452045265935338666}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a3449b44ff76a714386383fa244e9516, type: 3}
m_Script: {fileID: 11500000, guid: 9d978e80c1de5d04e8847fd3c90119bd, type: 3}
m_Name:
m_EditorClassIdentifier:
DeviceBase: {fileID: 0}
DeviceIndex:
BeltScaleName: {fileID: 3083583273910577969}
BeltScaleRealTimeValue: {fileID: 3473458235709709869}

View File

@ -2136,7 +2136,7 @@ RectTransform:
- {fileID: 4429255973012104144}
- {fileID: 4429255974279884733}
m_Father: {fileID: 4429255973983485186}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -2392,7 +2392,7 @@ RectTransform:
- {fileID: 4429255972620222503}
- {fileID: 4429255973404320440}
m_Father: {fileID: 4429255973983485186}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -9111,6 +9111,7 @@ RectTransform:
- {fileID: 4429255974138316161}
- {fileID: 4429255973568103553}
- {fileID: 4429255974364797519}
- {fileID: 3552742215992316342}
- {fileID: 4429255974415563133}
- {fileID: 4429255972970845266}
- {fileID: 4429255973002258894}
@ -12214,7 +12215,7 @@ RectTransform:
- {fileID: 4429255974369155110}
- {fileID: 4429255972964496856}
m_Father: {fileID: 4429255973983485186}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -14231,3 +14232,79 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &7197139530577202285
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3552742215992316342}
- component: {fileID: 741447845495703907}
- component: {fileID: 4923109714766594862}
m_Layer: 0
m_Name: Image (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3552742215992316342
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7197139530577202285}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4429255973983485186}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -280, y: -84}
m_SizeDelta: {x: 166, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &741447845495703907
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7197139530577202285}
m_CullTransparentMesh: 1
--- !u!114 &4923109714766594862
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7197139530577202285}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: ac6832923c682004eac02899fd114f54, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1

View File

@ -213,7 +213,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b02ea4de31030054fa95651a1e50677f, type: 3}
m_Name:
m_EditorClassIdentifier:
current_panel: {fileID: 0}
VideoName: {fileID: 0}
CloseButton: {fileID: 0}
WebPage: {fileID: 0}
@ -252,9 +251,9 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 128.7, y: -33.6}
m_SizeDelta: {x: 200, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 28.699997, y: -33.6}
m_SizeDelta: {x: 460, y: 30}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &8656760002331249330
CanvasRenderer:
m_ObjectHideFlags: 0

View File

@ -9719,7 +9719,7 @@ PrefabInstance:
- target: {fileID: 8743207627307298368, guid: aeee7ba5ac6938244b429ea1d9014a8d,
type: 3}
propertyPath: m_SizeDelta.y
value: 442
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: aeee7ba5ac6938244b429ea1d9014a8d, type: 3}
@ -14910,6 +14910,16 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 151840903}
m_Modifications:
- target: {fileID: 3552742215992316342, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_SizeDelta.x
value: 30
objectReference: {fileID: 0}
- target: {fileID: 3552742215992316342, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_SizeDelta.y
value: 30
objectReference: {fileID: 0}
- target: {fileID: 4429255972613017464, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_IsActive
@ -15015,6 +15025,11 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4429255973004689782, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4429255973136742853, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_Name
@ -15415,6 +15430,12 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4923109714766594862, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: b4fb85040e319364d9616d190ef48ef6,
type: 3}
- target: {fileID: 7023963978842396236, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_AnchorMax.y
@ -15440,6 +15461,16 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -17
objectReference: {fileID: 0}
- target: {fileID: 7197139530577202285, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_Name
value: CutLine
objectReference: {fileID: 0}
- target: {fileID: 7197139530577202285, guid: a4a7b5dfbd396014a86e6429b859c417,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a4a7b5dfbd396014a86e6429b859c417, type: 3}
--- !u!1 &4432356494526894953

View File

@ -29,6 +29,10 @@ public class DeviceBase : MonoBehaviour
/// </summary>
public static List<DeviceBase> BeltScaleList = new List<DeviceBase>();
/// <summary>
/// 对应的UI
/// </summary>
public DeviceUIBase DeviceUI;
/// <summary>
/// 摄像机字段表
/// </summary>
[SerializeField]

View File

@ -111,6 +111,8 @@ public class ApiManager : Singleton<ApiManager>
StartCoroutine(GetBeltScale());
}
#region
/// <summary>
/// 接口-获取相机列表
/// </summary>
@ -142,7 +144,13 @@ public class ApiManager : Singleton<ApiManager>
}
}));
}
#endregion
#region
/// <summary>
/// 获取堆场列表
/// </summary>
/// <returns></returns>
IEnumerator GetYardInformation()
{
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
@ -171,7 +179,38 @@ public class ApiManager : Singleton<ApiManager>
}
}));
}
/// <summary>
/// 获取堆场库存信息
/// </summary>
/// <returns></returns>
public IEnumerator GetYardStorage<T>(string _SILO_CODE, Action<List<T>> _callback)
{
yield return null;
var _get_yard_storage = IpAddress + ApiDic["GetYardStorage"];
StartCoroutine(RequestBase.Get(_get_yard_storage, new Dictionary<string, string>() { ["SILO_CODE"] = _SILO_CODE }, (_data, _error) =>
{
if (_error != null)
{
}
else
{
Debug.Log(_data);
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
_callback?.Invoke(_t_object);
}
}));
}
#endregion
#region
/// <summary>
/// 获取皮带秤列表信息
/// </summary>
/// <returns></returns>
IEnumerator GetBeltScale()
{
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
@ -201,35 +240,11 @@ public class ApiManager : Singleton<ApiManager>
}));
}
/// <summary>
/// »ñÈ¡¶Ñ³¡¿â´æÐÅÏ¢
/// </summary>
/// <returns></returns>
public IEnumerator GetYardStorage<T>(string _SILO_CODE, Action<List<T>> _callback)
{
yield return null;
var _get_yard_storage = IpAddress + ApiDic["GetYardStorage"];
StartCoroutine(RequestBase.Get(_get_yard_storage, new Dictionary<string, string>() { ["SILO_CODE"] = _SILO_CODE }, (_data, _error) =>
{
if (_error != null)
{
}
else
{
Debug.Log(_data);
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
_callback?.Invoke(_t_object);
}
}));
}
/// <summary>
/// 获取皮带秤实时数据信息
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="_pipeCode"></param>
/// <param name="_pipeCode">皮带秤编号</param>
/// <param name="_callback"></param>
/// <returns></returns>
public IEnumerator GetMeasureScaleRealTimeData<T>(string _pipeCode, Action<T> _callback)
@ -256,7 +271,7 @@ public class ApiManager : Singleton<ApiManager>
/// 获取皮带秤历史数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="_pipeCode"></param>
/// <param name="_pipeCode">皮带秤编号</param>
/// <param name="_callback"></param>
/// <returns></returns>
public IEnumerator PostMeasureScaleHistroyData<T>(string _pipeCode, string _start_time, string _end_time, Action<List<T>> _callback)
@ -291,6 +306,8 @@ public class ApiManager : Singleton<ApiManager>
}));
}
#endregion
/// <summary>
/// 模糊查询
/// </summary>

View File

@ -35,7 +35,7 @@ public class MainScene : Singleton<MainScene>
}
var _camera_icon = Instantiate(ModelRoot.Instance.CameraIconPrefab, ModelRoot.Instance.Canvas_3D);
_camera_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
_camera_icon.GetComponent<DeviceUIBase>().Init(DeviceBase.DeviceBaseList[i]);
_camera_icon.GetComponent<DeviceUIBase>().InitModel(DeviceBase.DeviceBaseList[i]);
break;
case DeviceType.BELT_SCALE:
if (ModelRoot.Instance.BeltScaleIconPrefab == null)
@ -44,7 +44,7 @@ public class MainScene : Singleton<MainScene>
}
var _belt_scale_icon = Instantiate(ModelRoot.Instance.BeltScaleIconPrefab, ModelRoot.Instance.Canvas_3D);
_belt_scale_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
_belt_scale_icon.GetComponent<DeviceUIBase>().Init(DeviceBase.DeviceBaseList[i]);
_belt_scale_icon.GetComponent<DeviceUIBase>().InitModel(DeviceBase.DeviceBaseList[i]);
break;
case DeviceType.YARD:
if (ModelRoot.Instance.YardIconPrefab == null)
@ -53,7 +53,7 @@ public class MainScene : Singleton<MainScene>
}
var _yard_icon = Instantiate(ModelRoot.Instance.YardIconPrefab, ModelRoot.Instance.Canvas_3D);
_yard_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
_yard_icon.GetComponent<DeviceUIBase>().Init(DeviceBase.DeviceBaseList[i]);
_yard_icon.GetComponent<DeviceUIBase>().InitModel(DeviceBase.DeviceBaseList[i]);
break;
default:
break;
@ -81,6 +81,7 @@ public class MainScene : Singleton<MainScene>
if (_camera != null)
{
DeviceBase.CameraList[i].T_BAS_CAMERA = _camera;
DeviceBase.CameraList[i].DeviceUI.InitData();
}
}
}
@ -99,6 +100,7 @@ public class MainScene : Singleton<MainScene>
if (_yard != null)
{
DeviceBase.YardList[i].T_BAS_YARD = _yard;
DeviceBase.YardList[i].DeviceUI.InitData();
}
}
}
@ -117,6 +119,7 @@ public class MainScene : Singleton<MainScene>
if (_belt_scale != null)
{
DeviceBase.BeltScaleList[i].T_BAS_ELEC_WEIGHTER = _belt_scale;
DeviceBase.BeltScaleList[i].DeviceUI.InitData();
}
}
}

View File

@ -113,6 +113,8 @@ public class UIManager : Singleton<UIManager>
_yard.GetComponent<MeshRenderer>().material.EnableKeyword("_ENABLE");
_yard.GetComponent<MeshRenderer>().material.SetFloat("_Strength", 1);
//所有模型高亮
}
}
}));
@ -158,6 +160,13 @@ public class UIManager : Singleton<UIManager>
UIRoot.Instance.VideoWebPage.SetWebPage(_camera_id, _custom_code, _monitor_id);
}
public void ShowCameraPage(T_BAS_CAMERA _T_BAS_CAMERA)
{
//拼接url
UIRoot.Instance.VideoWebPage.ShowPanel();
UIRoot.Instance.VideoWebPage.SetWebPage(_T_BAS_CAMERA);
}
/// <summary>
/// ´ò¿ªÆ¤´ø³Ó´°¿Ú
/// </summary>

View File

@ -4,6 +4,7 @@ using UnityEngine;
using UnityEngine.UI;
using TMPro;
using ZenFulcrum.EmbeddedBrowser;
using Competition.Mysql.Model;
/*
*
@ -61,4 +62,15 @@ public class VideoWebPage : PanelBase
var _url = ApiManager.Instance.ApiDic["VideoWebUrl"].Replace("IP", CallForTest.instance.ServerIP) + "?id=" + _camera_id + "&CobCustomId=" + _custom_code + "&EnterpriseCode=" + _monitor_id;
WebPage.Url = _url;
}
public void SetWebPage(T_BAS_CAMERA _T_BAS_CAMERA)
{
WebPage.Url = "";
VideoName.text = _T_BAS_CAMERA.CameraIName;
//Æ´½ÓÊÓƵµØÖ·
//T_BAS_CAMERA.CameraID, DeviceBase.T_BAS_CAMERA.CUSTOMS_CODE, DeviceBase.T_BAS_CAMERA.MONITOR_ID
var _url = ApiManager.Instance.ApiDic["VideoWebUrl"].Replace("IP", CallForTest.instance.ServerIP) +
"?id=" + _T_BAS_CAMERA.CameraID + "&CobCustomId=" + _T_BAS_CAMERA.CUSTOMS_CODE + "&EnterpriseCode=" + _T_BAS_CAMERA.MONITOR_ID;
WebPage.Url = _url;
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 88029d22370ce4847b628483b5bf6399
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
public class BeltScaleDeviceUI : DeviceUIBase,IPointerClickHandler
{
public TextMeshProUGUI BeltScaleName;
public TextMeshProUGUI BeltScaleRealTimeValue;
public override void InitData()
{
base.InitData();
BeltScaleName.text = DeviceBase.T_BAS_ELEC_WEIGHTER.WEIGHTER_NAME;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d978e80c1de5d04e8847fd3c90119bd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,51 +1,66 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class DeviceUIBase : MonoBehaviour, IPointerClickHandler
{
public DeviceBase DeviceBase;
public string DeviceIndex;
public void OnPointerClick(PointerEventData eventData)
{
Debug.Log(DeviceBase.DeviceType + "_" + DeviceBase.DeviceIndex);
switch (DeviceBase.DeviceType)
{
case DeviceType.CAMERA:
//打开相机窗口
Debug.Log(DeviceBase.T_BAS_CAMERA.ToString());
UIManager.Instance.ShowCameraPage(DeviceBase.T_BAS_CAMERA.CameraID, DeviceBase.T_BAS_CAMERA.CUSTOMS_CODE, DeviceBase.T_BAS_CAMERA.MONITOR_ID);
break;
case DeviceType.BELT_SCALE:
//打开皮带秤窗口
UIManager.Instance.ShowBeltScalePage(DeviceBase.T_BAS_ELEC_WEIGHTER);
break;
case DeviceType.YARD:
//打开堆区窗口
UIManager.Instance.ShowYardInformationPage(DeviceBase.T_BAS_YARD);
break;
default:
break;
}
}
public void Init(DeviceBase _device_base)
{
DeviceBase = _device_base;
DeviceIndex = _device_base.DeviceIndex;
switch (DeviceBase.DeviceType)
{
case DeviceType.CAMERA:
transform.name = "Camera_UI_" + DeviceIndex;
break;
case DeviceType.BELT_SCALE:
break;
case DeviceType.YARD:
break;
default:
break;
}
}
}
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class DeviceUIBase : MonoBehaviour, IPointerClickHandler
{
public DeviceBase DeviceBase;
public string DeviceIndex;
public virtual void OnPointerClick(PointerEventData eventData)
{
Debug.Log(DeviceBase.DeviceType + "_" + DeviceBase.DeviceIndex);
switch (DeviceBase.DeviceType)
{
case DeviceType.CAMERA:
//打开相机窗口
Debug.Log(JsonConvert.SerializeObject(DeviceBase.T_BAS_CAMERA));
//UIManager.Instance.ShowCameraPage(DeviceBase.T_BAS_CAMERA.CameraID, DeviceBase.T_BAS_CAMERA.CUSTOMS_CODE, DeviceBase.T_BAS_CAMERA.MONITOR_ID);
UIManager.Instance.ShowCameraPage(DeviceBase.T_BAS_CAMERA);
break;
case DeviceType.BELT_SCALE:
//打开皮带秤窗口
UIManager.Instance.ShowBeltScalePage(DeviceBase.T_BAS_ELEC_WEIGHTER);
break;
case DeviceType.YARD:
//打开堆区窗口
UIManager.Instance.ShowYardInformationPage(DeviceBase.T_BAS_YARD);
break;
default:
break;
}
}
/// <summary>
/// 初始化模型
/// </summary>
/// <param name="_device_base"></param>
public virtual void InitModel(DeviceBase _device_base)
{
DeviceBase = _device_base;
DeviceBase.DeviceUI = this;
DeviceIndex = _device_base.DeviceIndex;
switch (DeviceBase.DeviceType)
{
case DeviceType.CAMERA:
transform.name = "Camera_UI_" + DeviceIndex;
break;
case DeviceType.BELT_SCALE:
break;
case DeviceType.YARD:
break;
default:
break;
}
}
/// <summary>
/// 初始化数据
/// </summary>
public virtual void InitData()
{
}
}