¶Ô±ÈÐÂÎļþ |
| | |
| | | create table AccessInterfaceLog |
| | | ( |
| | | [Id] [bigint] NOT NULL, |
| | | [Action] [int] NOT NULL, |
| | | [OperateAddress] [nvarchar](200) NULL, |
| | | [OperateUserId] [nvarchar](200) NULL, |
| | | [OperateUserName] [nvarchar](200) NULL, |
| | | [IPAddress] [nvarchar](50) NULL, |
| | | [Param1] [nvarchar](200) NULL, |
| | | [Param2] [nvarchar](200) NULL, |
| | | [Param3] [nvarchar](200) NULL, |
| | | [ParaJSON] [nvarchar](max) NULL, |
| | | [ResultJson] [nvarchar](max) NULL, |
| | | [Keys] [nvarchar](max) NULL, |
| | | [CreatedTime] [datetimeoffset](7) NULL, |
| | | [UpdatedTime] [datetimeoffset](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL, |
| | | ) |
| | | |
| | | |
| | | --20231124 |
| | | |
| | | drop table KnifeToolEquipmentMonitor |
| | | drop table KnifeToolEquipmentInfo |
| | | drop table KnifeToolEquipmentInfoLog |
| | | drop table KnifeToolEquipmentUpdateLog |
| | | |
| | | |
| | | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KnifeToolEquipmentMonitor]') AND type in (N'U')) DROP TABLE [dbo].[KnifeToolEquipmentMonitor]; |
| | | CREATE TABLE [dbo].[KnifeToolEquipmentMonitor]( |
| | | [Id] [bigint] NOT NULL, |
| | | EquipmentID VARCHAR(32), |
| | | WorkingProcedure VARCHAR(32), |
| | | Remarks1 VARCHAR(255), |
| | | Remarks2 VARCHAR(255), |
| | | Remarks3 VARCHAR(255), |
| | | [CreatedTime] [datetime2](7) NULL, |
| | | [UpdatedTime] [datetime2](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL, |
| | | ); |
| | | |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤åå
·ä¿¡æ¯çæ§', 'SCHEMA', dbo, 'table', KnifeToolEquipmentMonitor, null, null; |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentMonitor, 'column', EquipmentID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥åºç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentMonitor, 'column', WorkingProcedure; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨1', 'SCHEMA', dbo, 'table', KnifeToolEquipmentMonitor, 'column', Remarks1; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨2', 'SCHEMA', dbo, 'table', KnifeToolEquipmentMonitor, 'column', Remarks2; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨3', 'SCHEMA', dbo, 'table', KnifeToolEquipmentMonitor, 'column', Remarks3; |
| | | |
| | | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KnifeToolEquipmentInfo]') AND type in (N'U')) DROP TABLE [dbo].[KnifeToolEquipmentInfo]; |
| | | CREATE TABLE [dbo].[KnifeToolEquipmentInfo]( |
| | | [Id] [bigint] NOT NULL, |
| | | EquipmentID VARCHAR(32), |
| | | WorkingProcedure VARCHAR(32), |
| | | Station VARCHAR(255), |
| | | KnifeToolID VARCHAR(255), |
| | | KnifeToolName VARCHAR(255), |
| | | StartLife INT, |
| | | CurrentLife INT, |
| | | ChangeStartTime [datetime2](7) NULL, |
| | | Remarks1 VARCHAR(255), |
| | | Remarks2 VARCHAR(255), |
| | | Remarks3 VARCHAR(255), |
| | | [CreatedTime] [datetime2](7) NULL, |
| | | [UpdatedTime] [datetime2](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL, |
| | | ); |
| | | |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤åå
·è¯¦æ
表', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, null, null; |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', EquipmentID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥åºç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', WorkingProcedure; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥ä½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', Station; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åå
·ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', KnifeToolID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åå
·åç§°', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', KnifeToolName; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶å¯¿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', StartLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å½å寿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', CurrentLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶é´', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', ChangeStartTime; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨1', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', Remarks1; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨2', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', Remarks2; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨3', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfo, 'column', Remarks3; |
| | | |
| | | |
| | | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KnifeToolEquipmentInfoLog]') AND type in (N'U')) DROP TABLE [dbo].[KnifeToolEquipmentInfoLog]; |
| | | CREATE TABLE [dbo].[KnifeToolEquipmentInfoLog]( |
| | | [Id] [bigint] NOT NULL, |
| | | EquipmentID VARCHAR(32), |
| | | WorkingProcedure VARCHAR(32), |
| | | Station VARCHAR(255), |
| | | KnifeToolID VARCHAR(255), |
| | | KnifeToolName VARCHAR(255), |
| | | StartLife INT, |
| | | CurrentLife INT, |
| | | ResidueLife INT, |
| | | ChangeStartTime [datetime2](7) NULL, |
| | | ChangeEndTime [datetime2](7) NULL, |
| | | Remarks1 VARCHAR(255), |
| | | Remarks2 VARCHAR(255), |
| | | Remarks3 VARCHAR(255), |
| | | [CreatedTime] [datetime2](7) NULL, |
| | | [UpdatedTime] [datetime2](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL, |
| | | ); |
| | | |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤åå
·æ´æ¢å±¥å表', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, null, null; |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', EquipmentID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥åºç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', WorkingProcedure; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥ä½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', Station; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åå
·ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', KnifeToolID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åå
·åç§°', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', KnifeToolName; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶å¯¿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', StartLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å½å寿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', CurrentLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å©ä½å¯¿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', ResidueLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶é´', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', ChangeStartTime; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶é´', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', ChangeEndTime; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨1', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', Remarks1; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨2', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', Remarks2; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨3', 'SCHEMA', dbo, 'table', KnifeToolEquipmentInfoLog, 'column', Remarks3; |
| | | |
| | | |
| | | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KnifeToolEquipmentUpdateLog]') AND type in (N'U')) DROP TABLE [dbo].[KnifeToolEquipmentUpdateLog]; |
| | | CREATE TABLE [dbo].[KnifeToolEquipmentUpdateLog]( |
| | | [Id] [bigint] NOT NULL, |
| | | EquipmentID VARCHAR(32), |
| | | WorkingProcedure VARCHAR(32), |
| | | Station VARCHAR(255), |
| | | KnifeToolID VARCHAR(255), |
| | | KnifeToolName VARCHAR(255), |
| | | StartLife INT, |
| | | CurrentLife INT, |
| | | ResidueLife INT, |
| | | ChangeStartTime [datetime2](7) NULL, |
| | | ChangeEndTime [datetime2](7) NULL, |
| | | OperateDesc VARCHAR(900), |
| | | Remarks1 VARCHAR(255), |
| | | Remarks2 VARCHAR(255), |
| | | Remarks3 VARCHAR(255), |
| | | [CreatedTime] [datetime2](7) NULL, |
| | | [UpdatedTime] [datetime2](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL, |
| | | ); |
| | | |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤åå
·æä½æ¥å¿è¡¨', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, null, null; |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', EquipmentID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥åºç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', WorkingProcedure; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å·¥ä½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', Station; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åå
·ç¼å·', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', KnifeToolID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åå
·åç§°', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', KnifeToolName; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶å¯¿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', StartLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å½å寿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', CurrentLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'å©ä½å¯¿å½', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', ResidueLife; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶é´', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', ChangeStartTime; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æ¢ä¸æ¶é´', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', ChangeEndTime; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'æä½æè¿°', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', OperateDesc; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨1', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', Remarks1; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨2', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', Remarks2; |
| | | EXEC sp_addextendedproperty 'MS_Description', '夿³¨3', 'SCHEMA', dbo, 'table', KnifeToolEquipmentUpdateLog, 'column', Remarks3; |
| | | |
| | | |
| | | |
| | | USE [iWare.SCADA] |
| | | GO |
| | | |
| | | /****** Object: Table [dbo].[EquipmentQualityConfig] Script Date: 2023/11/29 9:35:10 ******/ |
| | | SET ANSI_NULLS ON |
| | | GO |
| | | |
| | | SET QUOTED_IDENTIFIER ON |
| | | GO |
| | | |
| | | CREATE TABLE [dbo].[EquipmentQualityConfig]( |
| | | [Id] [bigint] NOT NULL, |
| | | [MeasureTool] [varchar](255) NULL, |
| | | [WorkingProcedure] [varchar](32) NULL, |
| | | [ParamCode] [varchar](255) NULL, |
| | | [ParamDesc] [varchar](255) NULL, |
| | | [StandardValue] [varchar](255) NULL, |
| | | [UpperTolerance] [varchar](255) NULL, |
| | | [LowerTolerance] [varchar](255) NULL, |
| | | [ParamColName] [varchar](255) NULL, |
| | | [DecimalPlaces] [int] NULL, |
| | | [Unit] [varchar](255) NULL, |
| | | [ParamType] [int] NULL, |
| | | [Remarks] [varchar](255) NULL, |
| | | [CreatedTime] [datetime2](7) NULL, |
| | | [UpdatedTime] [datetime2](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL |
| | | ) ON [PRIMARY] |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'éå
·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'MeasureTool' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'å·¥åº' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'WorkingProcedure' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'åæ°ç¼å·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'ParamCode' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'åæ°åç§°' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'ParamDesc' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'åä¹å¼' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'StandardValue' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ä¸å
¬å·®' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'UpperTolerance' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ä¸å
¬å·®' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'LowerTolerance' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'åæ°åå' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'ParamColName' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'åæ°ç±»å(1:ææ§ 2ï¼å
¶ä»)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'ParamType' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'夿³¨' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig', @level2type=N'COLUMN',@level2name=N'Remarks' |
| | | GO |
| | | |
| | | EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'è´¨éæ°æ®æ åå¼é
ç½®' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'EquipmentQualityConfig' |
| | | GO |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | ALTER TABLE EquipmentBaseInfo ADD CuttingFluidChangeTime Datetime2 NUll --å¢å 设å¤ååæ¶²æ´æ¢æ¶é´ãEditby baotian,2023-3-9ã |
| | | ALTER TABLE EquipmentBaseInfo ADD CuttingFluidChangeAlertThreshold int NUll --å¢å 设å¤ååæ¶²é¢è¦éå¼ãEditby baotian,2023-3-9ã |
| | | |
| | | |
| | | ALTER TABLE EquipmentBaseInfo ADD EquipmentCurrentMonitor bit NUll --å¢å æ¯å¦å
³é设å¤åè¦ãEditby baotian,2023-3-10ã |
| | | |
| | | |
| | | ALTER TABLE WorkPieceInfo ADD WorkPieceLastOfflineTime datetime NUll --å¢å 工件å®å·¥æ¶é´ãEditby baotian,2023-3-10ã |
| | | |
| | | |
| | | |
| | | --20231024 |
| | | ALTER TABLE WorkPieceProcess ADD OperationType nvarchar(50); |
| | | ALTER TABLE WorkPieceProcess ADD Remarks nvarchar(255); |
| | | |
| | | ALTER TABLE QualityDataInfo ADD OP10QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP20QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityStateCH3 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityStateCH4 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityStateCH5 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityStateCH6 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP40QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP60QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP80QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP10QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP20QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityReceiveTimeCH3 DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityReceiveTimeCH4 DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityReceiveTimeCH5 DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityReceiveTimeCH6 DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP40QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP60QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfo ADD OP80QualityReceiveTime DateTime; |
| | | |
| | | |
| | | ALTER TABLE QualityDataInfoLog ADD OP10QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP20QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityStateCH3 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityStateCH4 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityStateCH5 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityStateCH6 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP40QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP60QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP80QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP10QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP20QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityReceiveTimeCH3 DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityReceiveTimeCH4 DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityReceiveTimeCH5 DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityReceiveTimeCH6 DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP40QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP60QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP80QualityReceiveTime DateTime; |
| | | |
| | | ALTER TABLE QualityDataInfo ADD OP35QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD OP35QualityReceiveTime DateTime; |
| | | ALTER TABLE QualityDataInfoLog ADD OP35QualityState nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD OP35QualityReceiveTime DateTime; |
| | | --20231029 |
| | | |
| | | ALTER TABLE EquipmentCurrentMonitor ADD WarnType nvarchar(32) NUll --å¢å åè¦ä»£ç ãEditby baotian,2023-10-29ã |
| | | |
| | | ALTER TABLE WorkPieceProcess ALTER COLUMN QualityDataInfoID bigint; |
| | | ALTER TABLE WorkPieceInfoLog ADD LogAddTime DateTime; |
| | | ALTER TABLE WorkPieceInfoLog ADD LogAddRemark nvarchar(255) NUll |
| | | ALTER TABLE WorkPieceInfoLog ADD CompleteTime DateTime |
| | | |
| | | |
| | | --20231101 |
| | | |
| | | ALTER TABLE EquipmentCurrentMonitor ADD WarnTime datetime2;--æ°å¢åè¦æ¶é´ messageæ¶é´ |
| | | ALTER TABLE EquipmentCurrentMonitor ADD Warnmsg nvarchar(max);--æ°å¢åè¦å
容 message |
| | | ALTER TABLE EquipmentWorkingLog ADD WarnType nvarchar(max);--æ°å¢åè¦ç±»å messageæ¶é´ |
| | | ALTER TABLE EquipmentWorkingLog ADD Warnmsg nvarchar(max);--æ°å¢åè¦å
容 message |
| | | ALTER TABLE EquipmentWorkingLog ADD UpdateDesc nvarchar(255);--æ°å¢åæ´æè¿° |
| | | |
| | | ALTER TABLE EquipmentWorkingLog ADD WarnStartTime datetime2;--æ°å¢åè¦æ¶é´ messageæ¶é´ |
| | | ALTER TABLE EquipmentWorkingLog ADD WarnEndTime datetime2;--æ°å¢åè¦æ¶é´ messageæ¶é´ |
| | | |
| | | ALTER TABLE EquipmentWorkingLog ADD EquipmentState nvarchar(32); |
| | | ALTER TABLE EquipmentWorkingLog ADD EquipmentStateStartTime datetime2;--æ°å¢ç¶æå¼å§æ¶é´ messageæ¶é´ |
| | | ALTER TABLE EquipmentWorkingLog ADD EquipmentStateEndTime datetime2;--æ°å¢ç¶æç»ææ¶é´ messageæ¶é´ |
| | | |
| | | ALTER TABLE WorkPieceInfo ADD WorkingProcedureEndTime datetime2;--æ°å¢gå·¥åºç»ææ¶é´ |
| | | ALTER TABLE WorkPieceInfoLog ADD WorkingProcedureEndTime datetime2;--æ°å¢å·¥åºç»ææ¶é´ |
| | | --WorkPieceInfoLog表ç¸å
³å段å
¨é¨å¯ç©º |
| | | |
| | | |
| | | |
| | | USE [iWare.SCADA] |
| | | GO |
| | | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EquipmentFailureCode]') AND type in (N'U')) DROP TABLE [dbo].[EquipmentFailureCode]; |
| | | CREATE TABLE [dbo].[EquipmentFailureCode]( |
| | | [Id] [bigint] NOT NULL, |
| | | EquipmentID VARCHAR(255), |
| | | WorkingProcedure VARCHAR(255), |
| | | Code VARCHAR(255), |
| | | CodeType VARCHAR(255), |
| | | CodeLevel VARCHAR(255), |
| | | CodeDesc VARCHAR(255), |
| | | [Remarks] [nvarchar](255) NULL, |
| | | [CreatedTime] [datetimeoffset](7) NULL, |
| | | [UpdatedTime] [datetimeoffset](7) NULL, |
| | | [CreatedUserId] [bigint] NULL, |
| | | [CreatedUserName] [nvarchar](50) NULL, |
| | | [UpdatedUserId] [bigint] NULL, |
| | | [UpdatedUserName] [nvarchar](50) NULL, |
| | | [IsDeleted] [bit] NOT NULL |
| | | ); |
| | | |
| | | EXEC sp_addextendedproperty 'MS_Description', 'åè¦æ
é代ç 表;', 'SCHEMA', dbo, 'table', EquipmentFailureCode, null, null; |
| | | EXEC sp_addextendedproperty 'MS_Description', '设å¤ä»£å·', 'SCHEMA', dbo, 'table', EquipmentFailureCode, 'column', EquipmentID; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'è®¾å¤æå±å·¥åº', 'SCHEMA', dbo, 'table', EquipmentFailureCode, 'column', WorkingProcedure; |
| | | EXEC sp_addextendedproperty 'MS_Description', '代å·', 'SCHEMA', dbo, 'table', EquipmentFailureCode, 'column', Code; |
| | | EXEC sp_addextendedproperty 'MS_Description', '代å·ç±»åï¼1ï¼æ
é 2ï¼åè¦ï¼', 'SCHEMA', dbo, 'table', EquipmentFailureCode, 'column', CodeType; |
| | | EXEC sp_addextendedproperty 'MS_Description', '代å·çº§å«ï¼1,2,3级ï¼', 'SCHEMA', dbo, 'table', EquipmentFailureCode, 'column', CodeLevel; |
| | | EXEC sp_addextendedproperty 'MS_Description', 'ä»£å·æè¿°', 'SCHEMA', dbo, 'table', EquipmentFailureCode, 'column', CodeDesc; |
| | | |
| | | |
| | | |
| | | --20231109 |
| | | alter table WorkPieceInfo ADD OP80NewCode nvarchar(255) --OP80éæ°æå°äºç»´ç |
| | | alter table WorkPieceInfoLog ADD OP80NewCode nvarchar(255) --OP80éæ°æå°äºç»´ç |
| | | |
| | | --20231114 |
| | | ALTER TABLE EquipmentCurrentMonitor ALTER COLUMN Alertmsg nvarchar(max); |
| | | ALTER TABLE EquipmentWorkingLog ALTER COLUMN FailureMsg nvarchar(max); |
| | | |
| | | --20231121 |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityFilePathCH3 nvarchar(900); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityFilePathCH4 nvarchar(900); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityFilePathCH5 nvarchar(900); |
| | | ALTER TABLE QualityDataInfo ADD OP30QualityFilePathCH6 nvarchar(900); |
| | | |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityFilePathCH3 nvarchar(900); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityFilePathCH4 nvarchar(900); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityFilePathCH5 nvarchar(900); |
| | | ALTER TABLE QualityDataInfoLog ADD OP30QualityFilePathCH6 nvarchar(900); |
| | | |
| | | --20231123 |
| | | ALTER TABLE KnifeToolBaseInfo ADD KnifeToolChangeAlertThreshold int; --åå
·é¢è¦éå¼ |
| | | |
| | | |
| | | --20231205 |
| | | |
| | | ALTER TABLE v_get_equipment_alert ADD DetergentDesc nvarchar(900); |
| | | ALTER TABLE v_get_equipment_alert ADD KnifeToolDesc nvarchar(900); |
| | | ALTER TABLE v_get_equipment_alert ADD CuttingFluidDesc nvarchar(900); |
| | | ALTER TABLE v_get_equipment_alert ADD AlertDesc nvarchar(max); |
| | | |
| | | --20231206 |
| | | ALTER TABLE QualityDataInfo ADD QualityOP40To1 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD QualityOP40To1 nvarchar(32); |
| | | --20231207 |
| | | ALTER TABLE EquipmentBaseInfo ADD TactTime int; --çäº§èæ |
| | | |
| | | --20231216 |
| | | |
| | | ALTER TABLE QualityDataInfo ADD QualityOP80To10 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD QualityOP80To10 nvarchar(32); |
| | | |
| | | |
| | | ALTER TABLE QualityDataInfo ADD QualityOP30To8 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD QualityOP30To9 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD QualityOP30To10 nvarchar(32); |
| | | ALTER TABLE QualityDataInfo ADD QualityOP30To11 nvarchar(32); |
| | | |
| | | ALTER TABLE QualityDataInfoLog ADD QualityOP30To8 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD QualityOP30To9 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD QualityOP30To10 nvarchar(32); |
| | | ALTER TABLE QualityDataInfoLog ADD QualityOP30To11 nvarchar(32); |
| | | |
| | | |
| | | ALTER TABLE KnifeToolEquipmentUpdateLog ADD OperateType nvarchar(32); |
| | | |
| | | |
| | | ALTER TABLE QualityDataInfo ADD OP80QualityFilePath nvarchar(900); |
| | | ALTER TABLE QualityDataInfoLog ADD OP80QualityFilePath nvarchar(900); |
| | | ALTER TABLE QualityDataInfo ADD OP60QualityFilePath nvarchar(900); |
| | | ALTER TABLE QualityDataInfoLog ADD OP60QualityFilePath nvarchar(900); |
| | | ALTER TABLE QualityDataInfo ADD OP20QualityFilePath nvarchar(900); |
| | | ALTER TABLE QualityDataInfoLog ADD OP20QualityFilePath nvarchar(900); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | use [iWare.SCADA] |
| | | |
| | | --- EquipmentWorkingLogæ°å¢å¤é®åEquipId åæ´æ¶é´ç¹ï¼2023-02-23 |
| | | IF NOT EXISTS ( SELECT * |
| | | FROM syscolumns |
| | | WHERE id = OBJECT_ID('EquipmentWorkingLog') |
| | | AND name = 'EquipId' ) |
| | | BEGIN |
| | | ALTER TABLE dbo.EquipmentWorkingLog ADD EquipId BIGINT NOT NULL |
| | | END |
| | | GO |
| | | |
| | | IF NOT EXISTS ( SELECT * |
| | | FROM information_schema.KEY_COLUMN_USAGE |
| | | WHERE CONSTRAINT_NAME='FK_EquipmentWorkingLog_EquipmentBaseInfo_EquipId') |
| | | BEGIN |
| | | ALTER TABLE dbo.KnifeToolDataMonitor ADD constraint FK_EquipmentWorkingLog_EquipmentBaseInfo_EquipId FOREIGN KEY (EquipId) |
| | | references EquipmentBaseInfo(Id) |
| | | END |
| | | GO |
| | | |
| | | --- KnifeToolDataMonitoræ°å¢å¤é®åEquipId åæ´æ¶é´ç¹ï¼2023-02-23 |
| | | IF NOT EXISTS ( SELECT * |
| | | FROM syscolumns |
| | | WHERE id = OBJECT_ID('KnifeToolDataMonitor') |
| | | AND name = 'EquipId' ) |
| | | BEGIN |
| | | ALTER TABLE dbo.KnifeToolDataMonitor ADD EquipId BIGINT NOT NULL |
| | | END |
| | | GO |
| | | |
| | | IF NOT EXISTS ( SELECT * |
| | | FROM information_schema.KEY_COLUMN_USAGE |
| | | WHERE CONSTRAINT_NAME='FK_KnifeToolDataMonitor_EquipmentBaseInfo_EquipId') |
| | | BEGIN |
| | | ALTER TABLE dbo.KnifeToolDataMonitor ADD constraint FK_KnifeToolDataMonitor_EquipmentBaseInfo_EquipId FOREIGN KEY (EquipId) |
| | | references EquipmentBaseInfo(Id) |
| | | END |
| | | GO |
| | | |
| | | |
| | | |
| | | alter table [ThreadStatusMonitor] alter column Threadstatue int null |
| | | alter table [ThreadStatusMonitor] alter column Threadendtime datetime2(7) null |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <configuration> |
| | | <configSections> |
| | | <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
| | | <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
| | | </configSections> |
| | | <entityFramework> |
| | | <providers> |
| | | <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> |
| | | </providers> |
| | | </entityFramework> |
| | | <runtime> |
| | | <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
| | | <dependentAssembly> |
| | | <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> |
| | | <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> |
| | | </dependentAssembly> |
| | | </assemblyBinding> |
| | | </runtime> |
| | | </configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iTextSharp.text.pdf; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Globalization; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static log4net.Appender.RollingFileAppender; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.BLL |
| | | { |
| | | public class CommonManager |
| | | { |
| | | public static readonly CommonManager Instance = new CommonManager(); |
| | | /// <summary> |
| | | /// è§£æå·¥ä»¶å·äºç»´ç |
| | | /// </summary> |
| | | /// <param name="log"></param> |
| | | /// <returns></returns> |
| | | public WorkPieceLog GetWorkPieceID(WorkPieceLog log,LogType type) |
| | | { |
| | | try |
| | | { |
| | | if(log==null|| log.WorkPieceID.Trim().Length!=22) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $"è§£æå·¥ä»¶å·{CheckNULLForString(log.WorkPieceID)} {log.Id}äºç»´ç æ¶åºéï¼äºç»´ç æ ¼å¼ä¸å¯¹"); |
| | | return log; |
| | | } |
| | | log.WorkPieceIDTo1 = log.WorkPieceID.Substring(0, 2); |
| | | log.WorkPieceIDTo2 = log.WorkPieceID.Substring(2, 4); |
| | | log.WorkPieceIDTo3 = log.WorkPieceID.Substring(6, 6); |
| | | log.WorkPieceIDTo4 = log.WorkPieceID.Substring(12, 2); |
| | | log.WorkPieceIDTo5 = log.WorkPieceID.Substring(14, 4); |
| | | log.WorkPieceIDTo6 = log.WorkPieceID.Substring(18, 2); |
| | | log.WorkPieceIDTo7 = log.WorkPieceID.Substring(20, 2); |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $"è§£æå·¥ä»¶å·{CheckNULLForString(log.WorkPieceID)} {log.Id}äºç»´ç æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | return log; |
| | | } |
| | | public string CheckNULLForString(string str) |
| | | { |
| | | return string.IsNullOrEmpty(str) ? "" : str; |
| | | } |
| | | public string CheackPath(string path, int type, int time) |
| | | { |
| | | var directory = Path.GetDirectoryName(path); |
| | | if (!Directory.Exists(directory)) |
| | | { |
| | | Directory.CreateDirectory(directory); |
| | | } |
| | | if (!File.Exists(path)) |
| | | { |
| | | File.Create(path).Close(); |
| | | } |
| | | |
| | | string content = ""; |
| | | // åæ¥æ¥æºæ°æ® |
| | | using (StreamReader reader = new StreamReader(path)) |
| | | { |
| | | content = reader.ReadToEnd(); |
| | | |
| | | Console.WriteLine("读åçå
容æ¯ï¼" + content); |
| | | if (content == null || content == "") |
| | | { |
| | | switch (type) |
| | | { |
| | | case 1: content = DateTimeHelper.GetDateTime().AddYears(time).ToString(); break; |
| | | case 2: content = DateTimeHelper.GetDateTime().AddMonths(time).ToString(); break; |
| | | case 3: content = DateTimeHelper.GetDateTime().AddDays(time).ToString(); break; |
| | | case 4: content = DateTimeHelper.GetDateTime().AddHours(time).ToString(); break; |
| | | case 5: content = DateTimeHelper.GetDateTime().AddMinutes(time).ToString(); break; |
| | | case 6: content = DateTimeHelper.GetDateTime().AddSeconds(time).ToString(); break; |
| | | default: |
| | | content = DateTimeHelper.GetDateTime().ToString(); break; |
| | | } |
| | | //content = DateTimeHelper.GetDateTime().AddMinutes(-10).ToString(); |
| | | } |
| | | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// è§£æpdfæä»¶ |
| | | /// </summary> |
| | | /// <param name="filePath"></param> |
| | | /// <param name="getPdfValue"></param> |
| | | /// <returns></returns> |
| | | public static List<string> ReadPdfConntent(string filePath, string getPdfValue) |
| | | { |
| | | List<string> lst = new List<string>(); |
| | | try |
| | | { |
| | | |
| | | string pdffilename = filePath; |
| | | PdfReader pdfreader = new PdfReader(pdffilename); |
| | | int numberOfPages = pdfreader.NumberOfPages; |
| | | |
| | | //for (int i = 1; i <= numberOfPages; ++i) |
| | | //{ |
| | | // lst.Add(iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader,i)); |
| | | // text.AppendLine(); |
| | | //} |
| | | |
| | | string text = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfreader, 1); |
| | | |
| | | string[] words = text.Split('\n'); |
| | | |
| | | foreach (var item in words) |
| | | { |
| | | string value = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(item)); |
| | | |
| | | if (value.Contains(getPdfValue)) |
| | | { |
| | | string[] splitValue = value.Split(':'); |
| | | lst.Add(splitValue[1].Trim()); |
| | | } |
| | | } |
| | | |
| | | pdfreader.Close(); |
| | | return lst; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | public static DateTime? GetOP60Time(string datetime) |
| | | { |
| | | |
| | | try |
| | | { |
| | | string regex = @"^(\d{1,2})\.(\d{1,2})\.(\d{4})\/(\d{1,2}):(\d{1,2}):(\d{1,2})"; |
| | | var macth = RegexExtension.Match(datetime, regex, 20000); |
| | | if (macth.Success) |
| | | { |
| | | string date = $"{macth.Groups[3].Value}/{macth.Groups[2].Value}/{macth.Groups[1].Value} {macth.Groups[4].Value}:{macth.Groups[5].Value}:{macth.Groups[6].Value}"; |
| | | |
| | | DateTime Time; |
| | | if (DateTime.TryParseExact(date, "yyyy/MM/dd HH:mm:ss", CultureInfo.CurrentCulture, DateTimeStyles.None, out Time)) |
| | | { |
| | | return Time; |
| | | } |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.DLA.Dao; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | public class DataCaptureColumnDictManager |
| | | { |
| | | ///// <summary> |
| | | ///// è·å è°åº¦ç³»ç»å¯å¨ç¸å
³ |
| | | ///// </summary> |
| | | ///// <param name="edm"></param> |
| | | ///// <returns></returns> |
| | | //public static IList<DataCaptureColumnDict> GetCCSystem(DbModel edm) |
| | | //{ |
| | | // return edm.DataCaptureColumnDictList.Where(x => x.EquipmentID == "1").ToList();//.FirstOrDefault(); |
| | | //} |
| | | /// <summary> |
| | | /// è·å è°åº¦ç³»ç»å¯å¨ç¸å
³ |
| | | /// </summary> |
| | | /// <param name="edm"></param> |
| | | /// <returns></returns> |
| | | public static List<EquipmentBaseInfo> GetEquipmentBaseInfo() |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | // |
| | | //var a = db.EquipmentBaseInfos.Find(1);//主é®ä¸º1ç |
| | | var b = db.EquipmentBaseInfo.Where(o=>o.EquipmentId=="1").ToList(); |
| | | |
| | | |
| | | var query = db.EquipmentBaseInfo.Where(s => s.EquipmentId == "1").ToList();//è¿åIQueryable è¯´ææ¯å»¶è¿æ¥è¯¢ |
| | | |
| | | //æ¥è¯¢ææ |
| | | var query2 = db.EquipmentBaseInfo.ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ |
| | | //var query3 = db.DataCaptureConfigs.ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ |
| | | |
| | | return b; |
| | | |
| | | |
| | | //var ccSystem = DataCaptureColumnDictManager.GetEquipmentBaseInfo(edm); |
| | | //if (ccSystem == null) |
| | | //{ |
| | | // MessageBox.Show("请è系管çåç»´æ¤ç³»ç»è°åº¦ç¸å
³çæ°æ®!"); |
| | | // return; |
| | | //}; |
| | | } |
| | | //return edm.EquipmentBaseInfos.Find; |
| | | } |
| | | /// <summary> |
| | | /// å页æ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="pageIndex"></param> |
| | | /// <param name="pageSize"></param> |
| | | public static void pageselect(int pageIndex,int pageSize) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | var query3 = db.EquipmentBaseInfo.Skip((pageIndex - 1) * pageSize).Take(pageSize); |
| | | } |
| | | //CommonDao<EquipmentBaseInfo, EquipmentBaseInfo> CommonDao=new CommonDao<EquipmentBaseInfo, EquipmentBaseInfo>(); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.TableModelSC; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.BLL |
| | | { |
| | | public class DataCaptureConfigManager |
| | | { |
| | | public static List<DataCaptureConfig> GetDataCaptureConfigs() |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | //æ¥è¯¢æææªå 餿°æ® |
| | | var query = db.DataCaptureConfig.Where(o=>o.IsDeleted==false).ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ |
| | | return query; |
| | | } |
| | | } |
| | | |
| | | public static List<DataCaptureColumnConfig> GetDataCaptureColumnConfig() |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | //æ¥è¯¢ææ |
| | | var query = db.DataCaptureColumnConfig.Where(o=>1==1).ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ |
| | | |
| | | return query; |
| | | |
| | | |
| | | //var ccSystem = DataCaptureColumnDictManager.GetEquipmentBaseInfo(edm); |
| | | //if (ccSystem == null) |
| | | //{ |
| | | // MessageBox.Show("请è系管çåç»´æ¤ç³»ç»è°åº¦ç¸å
³çæ°æ®!"); |
| | | // return; |
| | | //}; |
| | | } |
| | | } |
| | | public static List<AlarmLog> getdate() |
| | | { |
| | | using (SCModel db = new SCModel()) |
| | | { |
| | | List<AlarmLog> query = db.AlarmLog.ToList(); |
| | | return query; |
| | | } |
| | | } |
| | | |
| | | public static void InsertDataCaptureConfig(DataCaptureConfig info) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | db.DataCaptureConfig.Add(info); |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | public static void UpdateDataCaptureConfig(DataCaptureConfig info,out string message) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | message = ""; |
| | | var model = db.DataCaptureConfig.Where(o => o.Id == info.Id).FirstOrDefault(); |
| | | if(model!=null && model.Id > 0) |
| | | { |
| | | var num=db.DataCaptureConfig.Where(o => o.DataCapturePointCode == info.DataCapturePointCode && o.Id != model.Id).Count(); |
| | | if(num>0) |
| | | { |
| | | message = $"æ¶éç¹ä»£ç {info.DataCapturePointCode}å·²åå¨ï¼ä¸è½éå¤ï¼è¯·ç¡®è®¤å忬¡ä¿®æ¹ï¼"; |
| | | return; |
| | | } |
| | | model.EquipmentID = info.EquipmentID; |
| | | model.WorkingProcedure = info.WorkingProcedure; |
| | | model.DataCapturePointCode = info.DataCapturePointCode; |
| | | model.DataCapturePointCname = info.DataCapturePointCname; |
| | | model.DataCaptureType = info.DataCaptureType; |
| | | model.DataCapturePLCType = info.DataCapturePLCType; |
| | | model.PLCIP = info.PLCIP; |
| | | model.PLCPort = info.PLCPort; |
| | | model.DbNumber = info.DbNumber; |
| | | model.Offset = info.Offset; |
| | | model.DataCaptureColumnType = info.DataCaptureColumnType; |
| | | db.SaveChanges(); |
| | | } |
| | | else |
| | | { |
| | | message = "å½åä¿®æ¹é¡¹ä¸åå¨ï¼è¯·å·æ°å忬¡ä¿®æ¹ï¼"; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static int DeleteDataCaptureConfig(DataCaptureConfig info) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | var config = db.DataCaptureConfig.FirstOrDefault(m => m.Id == info.Id); |
| | | if (config != null) |
| | | { |
| | | db.DataCaptureConfig.Remove(config); |
| | | } |
| | | return db.SaveChanges(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Runtime.CompilerServices; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// ç³»ç»åé |
| | | /// </summary> |
| | | public class SystemValue |
| | | { |
| | | #region PLC龿¥ |
| | | |
| | | public static object lockPlcService = new object(); |
| | | private static Dictionary<string, PLCService> plcServiceList = new Dictionary<string, PLCService>(); |
| | | |
| | | public static PLCService GetPLCService(DataCaptureConfig dataCaptureConfig) |
| | | { |
| | | PLCService plcService = null; |
| | | lock (lockPlcService) |
| | | { |
| | | if (plcServiceList.ContainsKey(dataCaptureConfig.PLCIP)) |
| | | { |
| | | plcService = plcServiceList[dataCaptureConfig.PLCIP]; |
| | | } |
| | | else |
| | | { |
| | | plcService = PLCManger.GetSinglePLCService(dataCaptureConfig); |
| | | plcServiceList.Add(dataCaptureConfig.PLCIP, plcService); |
| | | } |
| | | } |
| | | return plcService; |
| | | |
| | | } |
| | | |
| | | public static void PLCServiceReconnect(PLCService plcService) |
| | | { |
| | | if(plcService==null) |
| | | { |
| | | return; |
| | | } |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | |
| | | } |
| | | #endregion |
| | | /// <summary> |
| | | /// ç³»ç»å¯å¨çGUID |
| | | /// </summary> |
| | | public static string SystemStartGuid = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// æ¨¡å¼æ¯å¦å¯å¨ |
| | | /// </summary> |
| | | public static bool isStartedModel = false; |
| | | |
| | | /// <summary> |
| | | /// å»¶è¿çº¿ç¨æ§è¡çæ¶é´ï¼æ¯«ç§ï¼ |
| | | /// </summary> |
| | | public static int DelayExcuteNumber = 2000; |
| | | |
| | | |
| | | /// <summary> |
| | | /// PLCå°ååé符 ï¼ç¨äºåé DBå°åååç§»éç |
| | | /// </summary> |
| | | public static char PLCDBADDRESS_SEPARATE = '|'; |
| | | |
| | | |
| | | public static List<ThreadStatusMonitor> MainList=new List<ThreadStatusMonitor>(); |
| | | |
| | | private static object lockMainList = new object(); |
| | | public static async void UpdateMainList(ThreadStatusMonitor threadinfo) |
| | | { |
| | | await Task.Run(() => { |
| | | lock (lockMainList) |
| | | { |
| | | var info = MainList.Where(o => o.Threadcode == threadinfo.Threadcode).FirstOrDefault(); |
| | | if(info == null) |
| | | { |
| | | MainList.Add(threadinfo); |
| | | } |
| | | else |
| | | { |
| | | DateTime time = DateTime.Now; |
| | | info.Remarks = threadinfo.Remarks; |
| | | info.Threadendtime = time;//æ¯æ¬¡é½æ´æ° |
| | | info.Threadlastmodifytime = threadinfo.Threadlastmodifytime>DateTime.MinValue? threadinfo.Threadlastmodifytime: info.Threadlastmodifytime;//妿æä¼ ååæ´æ° |
| | | info.ThreadId = threadinfo.ThreadId; |
| | | info.ThreadFrequency = threadinfo.ThreadFrequency; |
| | | info.UpdatedTime = time; |
| | | info.UpdatedUserName = threadinfo.Threadcode; |
| | | if (info.Threadstatue == 1) |
| | | { |
| | | info.Threadlastmodifytime = time;//ææ°è·å°æ°æ® |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | #region OP05å·¥åº |
| | | |
| | | public static object lock5QRcodeList = new object(); |
| | | private static Dictionary<string, DateTime> _qRcodeList = new Dictionary<string, DateTime>(); |
| | | /// <summary> |
| | | /// OP05读åçäºç»´ç å表 //注æï¼ä½¿ç¨ä¸add åèµå¼é½éè¦æ·»å é lock5QRcodeList |
| | | /// </summary> |
| | | public static Dictionary<string, DateTime> QRcodeList |
| | | { |
| | | get { return _qRcodeList; } |
| | | set |
| | | { |
| | | _qRcodeList = value; |
| | | } |
| | | } |
| | | |
| | | private static object lockOP0501Runing = new object(); |
| | | private static object lockOP0502Runing = new object(); |
| | | private static object lockOP0503Runing = new object(); |
| | | private static object lockOP0504Runing = new object(); |
| | | private static object lockOP0506Runing = new object(); |
| | | private static object lockOP0507Runing = new object(); |
| | | private static bool _isAllowRuning_OP0501 = false; |
| | | private static bool _isAllowRuning_OP0502 = false; |
| | | private static bool _isAllowRuning_OP0503 = false; |
| | | private static bool _isAllowRuning_OP0504 = false; |
| | | private static bool _isAllowRuning_OP0506 = false; |
| | | private static bool _isAllowRuning_OP0507 = false; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP05å·¥åºæç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP0501 |
| | | { |
| | | get { return _isAllowRuning_OP0501; } |
| | | set { |
| | | lock (lockOP0501Runing) |
| | | { |
| | | _isAllowRuning_OP0501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP05å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP0502 |
| | | { |
| | | get { return _isAllowRuning_OP0502; } |
| | | set |
| | | { |
| | | lock (lockOP0502Runing) |
| | | { |
| | | _isAllowRuning_OP0502 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP05å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP0503 |
| | | { |
| | | get { return _isAllowRuning_OP0503; } |
| | | set |
| | | { |
| | | lock (lockOP0503Runing) |
| | | { |
| | | _isAllowRuning_OP0503 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP05å·¥åºå®ææ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP0504 |
| | | { |
| | | get { return _isAllowRuning_OP0504; } |
| | | set |
| | | { |
| | | lock (lockOP0504Runing) |
| | | { |
| | | _isAllowRuning_OP0504 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP0501Alert = new object(); |
| | | private static object lockOP0502Alert = new object(); |
| | | private static object lockOP0503Alert = new object(); |
| | | private static object lockOP0504Alert = new object(); |
| | | private static object lockOP0506Alert = new object(); |
| | | private static object lockOP0507Alert = new object(); |
| | | private static string _lbl_Alert_OP0501 = string.Empty; |
| | | private static string _lbl_Alert_OP0502 = string.Empty; |
| | | private static string _lbl_Alert_OP0503 = string.Empty; |
| | | private static string _lbl_Alert_OP0504 = string.Empty; |
| | | private static string _lbl_Alert_OP0506 = string.Empty; |
| | | private static string _lbl_Alert_OP0507 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP05å·¥åºæç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP0501 |
| | | { |
| | | get { return _lbl_Alert_OP0501; } |
| | | set |
| | | { |
| | | lock (lockOP0501Alert) |
| | | { |
| | | _lbl_Alert_OP0501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP05å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP0502 |
| | | { |
| | | get { return _lbl_Alert_OP0502; } |
| | | set |
| | | { |
| | | lock (lockOP0502Alert) |
| | | { |
| | | _lbl_Alert_OP0502 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP05å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP0503 |
| | | { |
| | | get { return _lbl_Alert_OP0503; } |
| | | set |
| | | { |
| | | lock (lockOP0503Alert) |
| | | { |
| | | _lbl_Alert_OP0503 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP05å·¥åºå®ææ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP0504 |
| | | { |
| | | get { return _lbl_Alert_OP0504; } |
| | | set |
| | | { |
| | | lock (lockOP0504Alert) |
| | | { |
| | | _lbl_Alert_OP0504 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP0506 |
| | | { |
| | | get { return _lbl_Alert_OP0506; } |
| | | set |
| | | { |
| | | lock (lockOP0506Alert) |
| | | { |
| | | _lbl_Alert_OP0506 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP0507 |
| | | { |
| | | get { return _lbl_Alert_OP0507; } |
| | | set |
| | | { |
| | | lock (lockOP0507Alert) |
| | | { |
| | | _lbl_Alert_OP0507 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP0501Value = new object(); |
| | | private static object lockOP0502Value = new object(); |
| | | private static object lockOP0503Value = new object(); |
| | | private static object lockOP0504Value = new object(); |
| | | private static object lockOP0506Value = new object(); |
| | | private static object lockOP0507Value = new object(); |
| | | private static string _value_OP0501 = string.Empty; |
| | | private static string _value_OP0502 = string.Empty; |
| | | private static string _value_OP0503 = string.Empty; |
| | | private static string _value_OP0504 = string.Empty; |
| | | private static string _value_OP0506 = string.Empty; |
| | | private static string _value_OP0507 = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// OP05å·¥åºæç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP0501 |
| | | { |
| | | get { return _value_OP0501; } |
| | | set |
| | | { |
| | | lock (lockOP0501Value) |
| | | { |
| | | _value_OP0501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP05å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP0502 |
| | | { |
| | | get { return _value_OP0502; } |
| | | set |
| | | { |
| | | lock (lockOP0502Value) |
| | | { |
| | | _value_OP0502 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP05å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP0503 |
| | | { |
| | | get { return _value_OP0503; } |
| | | set |
| | | { |
| | | lock (lockOP0503Value) |
| | | { |
| | | _value_OP0503 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP05å·¥åºå®ææ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP0504 |
| | | { |
| | | get { return _value_OP0504; } |
| | | set |
| | | { |
| | | lock (lockOP0504Value) |
| | | { |
| | | _value_OP0504 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string value_OP0506 |
| | | { |
| | | get { return _value_OP0506; } |
| | | set |
| | | { |
| | | lock (lockOP0506Value) |
| | | { |
| | | _value_OP0506 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string value_OP0507 |
| | | { |
| | | get { return _value_OP0507; } |
| | | set |
| | | { |
| | | lock (lockOP0507Value) |
| | | { |
| | | _value_OP0507 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region OP10å·¥åº |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP10å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP1001 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP10å·¥åºæµè¯å®ææ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP1002 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP10å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP1003 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP10å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP1004 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP10å·¥åºå®ææ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP1005 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP10å·¥åºåè¦æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP1006 = false; |
| | | public static bool isAllowRuning_OP1007 = false; |
| | | |
| | | |
| | | /// <summary> |
| | | /// çæ§OP10å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | private static string _lbl_Alert_OP1001 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP10å·¥åºæµè¯å®ææ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | private static string _lbl_Alert_OP1002 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP10å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | private static string _lbl_Alert_OP1003 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP10å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | private static string _lbl_Alert_OP1004 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP10å·¥åºå®ææ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | private static string _lbl_Alert_OP1005 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP10å·¥åºåè¦ä¿¡æ¯ |
| | | /// </summary> |
| | | private static string _lbl_Alert_OP1006 = string.Empty; |
| | | private static string _lbl_Alert_OP1007 = string.Empty; |
| | | |
| | | |
| | | /// <summary> |
| | | /// OP10å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP1001 = string.Empty; |
| | | /// <summary> |
| | | /// OP10å·¥åºæµè¯å®ææ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP1002 = string.Empty; |
| | | /// <summary> |
| | | /// OP10å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP1003 = string.Empty; |
| | | /// <summary> |
| | | /// OP10å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP1004 = string.Empty; |
| | | /// <summary> |
| | | /// OP10å·¥åºå®ææ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP1005 = string.Empty; |
| | | /// <summary> |
| | | /// OP10å·¥åºåè¦æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP1006 = string.Empty; |
| | | public static string value_OP1007 = string.Empty; |
| | | |
| | | private static object lockOP1001Alert = new object(); |
| | | private static object lockOP1002Alert = new object(); |
| | | private static object lockOP1003Alert = new object(); |
| | | private static object lockOP1004Alert = new object(); |
| | | private static object lockOP1005Alert = new object(); |
| | | private static object lockOP1006Alert = new object(); |
| | | private static object lockOP1007Alert = new object(); |
| | | |
| | | |
| | | public static string lbl_Alert_OP1001 |
| | | { |
| | | get { return _lbl_Alert_OP1001; } |
| | | set |
| | | { |
| | | lock (lockOP1001Alert) |
| | | { |
| | | _lbl_Alert_OP1001 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP1002 |
| | | { |
| | | get { return _lbl_Alert_OP1002; } |
| | | set |
| | | { |
| | | lock (lockOP1002Alert) |
| | | { |
| | | _lbl_Alert_OP1002 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP1003 |
| | | { |
| | | get { return _lbl_Alert_OP1003; } |
| | | set |
| | | { |
| | | lock (lockOP1003Alert) |
| | | { |
| | | _lbl_Alert_OP1003 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP1004 |
| | | { |
| | | get { return _lbl_Alert_OP1004; } |
| | | set |
| | | { |
| | | lock (lockOP1004Alert) |
| | | { |
| | | _lbl_Alert_OP1004 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP1005 |
| | | { |
| | | get { return _lbl_Alert_OP1005; } |
| | | set |
| | | { |
| | | lock (lockOP1005Alert) |
| | | { |
| | | _lbl_Alert_OP1005 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP1006 |
| | | { |
| | | get { return _lbl_Alert_OP1006; } |
| | | set |
| | | { |
| | | lock (lockOP1006Alert) |
| | | { |
| | | _lbl_Alert_OP1006 = value; |
| | | } |
| | | } |
| | | } |
| | | public static string lbl_Alert_OP1007 |
| | | { |
| | | get { return _lbl_Alert_OP1007; } |
| | | set |
| | | { |
| | | lock (lockOP1007Alert) |
| | | { |
| | | _lbl_Alert_OP1007 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region OP20å·¥åº |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP20å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP2001 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP20å·¥åºæµè¯å®ææ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP2002 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP20å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP2003 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP20å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP2004 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP20å·¥åºå®ææ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP2005 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP20å·¥åºåè¦æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP2006 = false; |
| | | |
| | | |
| | | /// <summary> |
| | | /// çæ§OP20å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string _lbl_Alert_OP2001 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP20å·¥åºæµè¯å®ææ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string _lbl_Alert_OP2002 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP20å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string _lbl_Alert_OP2003 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP20å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string _lbl_Alert_OP2004 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP20å·¥åºå®ææ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string _lbl_Alert_OP2005 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP20å·¥åºåè¦ä¿¡æ¯ |
| | | /// </summary> |
| | | public static string _lbl_Alert_OP2006 = string.Empty; |
| | | |
| | | |
| | | /// <summary> |
| | | /// OP20å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP2001 = string.Empty; |
| | | /// <summary> |
| | | /// OP20å·¥åºæµè¯å®ææ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP2002 = string.Empty; |
| | | /// <summary> |
| | | /// OP20å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP2003 = string.Empty; |
| | | /// <summary> |
| | | /// OP20å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP2004 = string.Empty; |
| | | /// <summary> |
| | | /// OP20å·¥åºå®ææ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP2005 = string.Empty; |
| | | /// <summary> |
| | | /// OP20å·¥åºåè¦æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP2006 = string.Empty; |
| | | #endregion |
| | | |
| | | |
| | | #region OP30å·¥åº |
| | | |
| | | private static object lockOP3001Runing = new object(); |
| | | private static object lockOP3002Runing = new object(); |
| | | private static object lockOP3003Runing = new object(); |
| | | private static object lockOP3004Runing = new object(); |
| | | private static bool _isAllowRuning_OP3001 = false; |
| | | private static bool _isAllowRuning_OP3002 = false; |
| | | private static bool _isAllowRuning_OP3003 = false; |
| | | private static bool _isAllowRuning_OP3004 = false; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3001 |
| | | { |
| | | get { return _isAllowRuning_OP3001; } |
| | | set |
| | | { |
| | | lock (lockOP3001Runing) |
| | | { |
| | | _isAllowRuning_OP3001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºæµé宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3002 |
| | | { |
| | | get { return _isAllowRuning_OP3002; } |
| | | set |
| | | { |
| | | lock (lockOP3002Runing) |
| | | { |
| | | _isAllowRuning_OP3002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3003 |
| | | { |
| | | get { return _isAllowRuning_OP3003; } |
| | | set |
| | | { |
| | | lock (lockOP3003Runing) |
| | | { |
| | | _isAllowRuning_OP3003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3004 |
| | | { |
| | | get { return _isAllowRuning_OP3004; } |
| | | set |
| | | { |
| | | lock (lockOP3004Runing) |
| | | { |
| | | _isAllowRuning_OP3004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP3001Alert = new object(); |
| | | private static object lockOP3002Alert = new object(); |
| | | private static object lockOP3003Alert = new object(); |
| | | private static object lockOP3004Alert = new object(); |
| | | private static string _lbl_Alert_OP3001 = string.Empty; |
| | | private static string _lbl_Alert_OP3002 = string.Empty; |
| | | private static string _lbl_Alert_OP3003 = string.Empty; |
| | | private static string _lbl_Alert_OP3004 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3001 |
| | | { |
| | | get { return _lbl_Alert_OP3001; } |
| | | set |
| | | { |
| | | lock (lockOP3001Alert) |
| | | { |
| | | _lbl_Alert_OP3001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3002 |
| | | { |
| | | get { return _lbl_Alert_OP3002; } |
| | | set |
| | | { |
| | | lock (lockOP3002Alert) |
| | | { |
| | | _lbl_Alert_OP3002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3003 |
| | | { |
| | | get { return _lbl_Alert_OP3003; } |
| | | set |
| | | { |
| | | lock (lockOP3003Alert) |
| | | { |
| | | _lbl_Alert_OP3003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3004 |
| | | { |
| | | get { return _lbl_Alert_OP3004; } |
| | | set |
| | | { |
| | | lock (lockOP3004Alert) |
| | | { |
| | | _lbl_Alert_OP3004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP3001Value = new object(); |
| | | private static object lockOP3002Value = new object(); |
| | | private static object lockOP3003Value = new object(); |
| | | private static object lockOP3004Value = new object(); |
| | | private static string _value_OP3001 = string.Empty; |
| | | private static string _value_OP3002 = string.Empty; |
| | | private static string _value_OP3003 = string.Empty; |
| | | private static string _value_OP3004 = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// OP30å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3001 |
| | | { |
| | | get { return _value_OP3001; } |
| | | set |
| | | { |
| | | lock (lockOP3001Value) |
| | | { |
| | | _value_OP3001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP30å·¥åºæµé宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3002 |
| | | { |
| | | get { return _value_OP3002; } |
| | | set |
| | | { |
| | | lock (lockOP3002Value) |
| | | { |
| | | _value_OP3002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP30å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3003 |
| | | { |
| | | get { return _value_OP3003; } |
| | | set |
| | | { |
| | | lock (lockOP3003Value) |
| | | { |
| | | _value_OP3003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP30å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3004 |
| | | { |
| | | get { return _value_OP3004; } |
| | | set |
| | | { |
| | | lock (lockOP3004Value) |
| | | { |
| | | _value_OP3004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP3005Runing = new object(); |
| | | private static bool _isAllowRuning_OP3005 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3005 |
| | | { |
| | | get { return _isAllowRuning_OP3005; } |
| | | set |
| | | { |
| | | lock (lockOP3005Runing) |
| | | { |
| | | _isAllowRuning_OP3005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3005Alert = new object(); |
| | | private static string _lbl_Alert_OP3005 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3005 |
| | | { |
| | | get { return _lbl_Alert_OP3005; } |
| | | set |
| | | { |
| | | lock (lockOP3005Alert) |
| | | { |
| | | _lbl_Alert_OP3005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP3005 = string.Empty; |
| | | private static object lockOP3005Value = new object(); |
| | | /// <summary> |
| | | /// OP30å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3005 |
| | | { |
| | | get { return _value_OP3005; } |
| | | set |
| | | { |
| | | lock (lockOP3005Value) |
| | | { |
| | | _value_OP3005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private static object lockOP3006Runing = new object(); |
| | | private static bool _isAllowRuning_OP3006 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3006 |
| | | { |
| | | get { return _isAllowRuning_OP3006; } |
| | | set |
| | | { |
| | | lock (lockOP3006Runing) |
| | | { |
| | | _isAllowRuning_OP3006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3006Alert = new object(); |
| | | private static string _lbl_Alert_OP3006 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3006 |
| | | { |
| | | get { return _lbl_Alert_OP3006; } |
| | | set |
| | | { |
| | | lock (lockOP3006Alert) |
| | | { |
| | | _lbl_Alert_OP3006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP3006 = string.Empty; |
| | | private static object lockOP3006Value = new object(); |
| | | /// <summary> |
| | | /// OP30å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3006 |
| | | { |
| | | get { return _value_OP3006; } |
| | | set |
| | | { |
| | | lock (lockOP3006Value) |
| | | { |
| | | _value_OP3006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP3007Runing = new object(); |
| | | private static bool _isAllowRuning_OP3007 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP30å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3007 |
| | | { |
| | | get { return _isAllowRuning_OP3007; } |
| | | set |
| | | { |
| | | lock (lockOP3007Runing) |
| | | { |
| | | _isAllowRuning_OP3007 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3007Alert = new object(); |
| | | private static string _lbl_Alert_OP3007 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP30å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3007 |
| | | { |
| | | get { return _lbl_Alert_OP3007; } |
| | | set |
| | | { |
| | | lock (lockOP3007Alert) |
| | | { |
| | | _lbl_Alert_OP3007 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP3007 = string.Empty; |
| | | private static object lockOP3007Value = new object(); |
| | | /// <summary> |
| | | /// OP30å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3007 |
| | | { |
| | | get { return _value_OP3007; } |
| | | set |
| | | { |
| | | lock (lockOP3007Value) |
| | | { |
| | | _value_OP3007 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region OP35å·¥åº |
| | | |
| | | private static object lockOP3501Runing = new object(); |
| | | private static object lockOP3502Runing = new object(); |
| | | private static object lockOP3503Runing = new object(); |
| | | private static object lockOP3504Runing = new object(); |
| | | private static bool _isAllowRuning_OP3501 = false; |
| | | private static bool _isAllowRuning_OP3502 = false; |
| | | private static bool _isAllowRuning_OP3503 = false; |
| | | private static bool _isAllowRuning_OP3504 = false; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3501 |
| | | { |
| | | get { return _isAllowRuning_OP3501; } |
| | | set |
| | | { |
| | | lock (lockOP3501Runing) |
| | | { |
| | | _isAllowRuning_OP3501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºæµé宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3502 |
| | | { |
| | | get { return _isAllowRuning_OP3502; } |
| | | set |
| | | { |
| | | lock (lockOP3502Runing) |
| | | { |
| | | _isAllowRuning_OP3502 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3503 |
| | | { |
| | | get { return _isAllowRuning_OP3503; } |
| | | set |
| | | { |
| | | lock (lockOP3503Runing) |
| | | { |
| | | _isAllowRuning_OP3503 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3504 |
| | | { |
| | | get { return _isAllowRuning_OP3504; } |
| | | set |
| | | { |
| | | lock (lockOP3504Runing) |
| | | { |
| | | _isAllowRuning_OP3504 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3501Alert = new object(); |
| | | private static object lockOP3502Alert = new object(); |
| | | private static object lockOP3503Alert = new object(); |
| | | private static object lockOP3504Alert = new object(); |
| | | private static string _lbl_Alert_OP3501 = string.Empty; |
| | | private static string _lbl_Alert_OP3502 = string.Empty; |
| | | private static string _lbl_Alert_OP3503 = string.Empty; |
| | | private static string _lbl_Alert_OP3504 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3501 |
| | | { |
| | | get { return _lbl_Alert_OP3501; } |
| | | set |
| | | { |
| | | lock (lockOP3501Alert) |
| | | { |
| | | _lbl_Alert_OP3501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3502 |
| | | { |
| | | get { return _lbl_Alert_OP3502; } |
| | | set |
| | | { |
| | | lock (lockOP3502Alert) |
| | | { |
| | | _lbl_Alert_OP3502 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3503 |
| | | { |
| | | get { return _lbl_Alert_OP3503; } |
| | | set |
| | | { |
| | | lock (lockOP3503Alert) |
| | | { |
| | | _lbl_Alert_OP3503 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3504 |
| | | { |
| | | get { return _lbl_Alert_OP3504; } |
| | | set |
| | | { |
| | | lock (lockOP3504Alert) |
| | | { |
| | | _lbl_Alert_OP3504 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP3501Value = new object(); |
| | | private static object lockOP3502Value = new object(); |
| | | private static object lockOP3503Value = new object(); |
| | | private static object lockOP3504Value = new object(); |
| | | private static string _value_OP3501 = string.Empty; |
| | | private static string _value_OP3502 = string.Empty; |
| | | private static string _value_OP3503 = string.Empty; |
| | | private static string _value_OP3504 = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// OP35å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3501 |
| | | { |
| | | get { return _value_OP3501; } |
| | | set |
| | | { |
| | | lock (lockOP3501Value) |
| | | { |
| | | _value_OP3501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP35å·¥åºæµé宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3502 |
| | | { |
| | | get { return _value_OP3502; } |
| | | set |
| | | { |
| | | lock (lockOP3502Value) |
| | | { |
| | | _value_OP3502 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP35å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3503 |
| | | { |
| | | get { return _value_OP3503; } |
| | | set |
| | | { |
| | | lock (lockOP3503Value) |
| | | { |
| | | _value_OP3503 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP35å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3504 |
| | | { |
| | | get { return _value_OP3504; } |
| | | set |
| | | { |
| | | lock (lockOP3504Value) |
| | | { |
| | | _value_OP3504 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP3505Runing = new object(); |
| | | private static bool _isAllowRuning_OP3505 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3505 |
| | | { |
| | | get { return _isAllowRuning_OP3505; } |
| | | set |
| | | { |
| | | lock (lockOP3505Runing) |
| | | { |
| | | _isAllowRuning_OP3505 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3505Alert = new object(); |
| | | private static string _lbl_Alert_OP3505 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3505 |
| | | { |
| | | get { return _lbl_Alert_OP3505; } |
| | | set |
| | | { |
| | | lock (lockOP3505Alert) |
| | | { |
| | | _lbl_Alert_OP3505 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP3505 = string.Empty; |
| | | private static object lockOP3505Value = new object(); |
| | | /// <summary> |
| | | /// OP35å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3505 |
| | | { |
| | | get { return _value_OP3505; } |
| | | set |
| | | { |
| | | lock (lockOP3505Value) |
| | | { |
| | | _value_OP3505 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private static object lockOP3506Runing = new object(); |
| | | private static bool _isAllowRuning_OP3506 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3506 |
| | | { |
| | | get { return _isAllowRuning_OP3506; } |
| | | set |
| | | { |
| | | lock (lockOP3506Runing) |
| | | { |
| | | _isAllowRuning_OP3506 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3506Alert = new object(); |
| | | private static string _lbl_Alert_OP3506 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3506 |
| | | { |
| | | get { return _lbl_Alert_OP3506; } |
| | | set |
| | | { |
| | | lock (lockOP3506Alert) |
| | | { |
| | | _lbl_Alert_OP3506 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP3506 = string.Empty; |
| | | private static object lockOP3506Value = new object(); |
| | | /// <summary> |
| | | /// OP35å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3506 |
| | | { |
| | | get { return _value_OP3506; } |
| | | set |
| | | { |
| | | lock (lockOP3506Value) |
| | | { |
| | | _value_OP3506 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP3507Runing = new object(); |
| | | private static bool _isAllowRuning_OP3507 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP35å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP3507 |
| | | { |
| | | get { return _isAllowRuning_OP3507; } |
| | | set |
| | | { |
| | | lock (lockOP3507Runing) |
| | | { |
| | | _isAllowRuning_OP3507 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP3507Alert = new object(); |
| | | private static string _lbl_Alert_OP3507 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP35å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP3507 |
| | | { |
| | | get { return _lbl_Alert_OP3507; } |
| | | set |
| | | { |
| | | lock (lockOP3507Alert) |
| | | { |
| | | _lbl_Alert_OP3507 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP3507 = string.Empty; |
| | | private static object lockOP3507Value = new object(); |
| | | /// <summary> |
| | | /// OP35å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP3507 |
| | | { |
| | | get { return _value_OP3507; } |
| | | set |
| | | { |
| | | lock (lockOP3507Value) |
| | | { |
| | | _value_OP3507 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region OP70å·¥åº |
| | | |
| | | private static object lockOP7001Runing = new object(); |
| | | private static object lockOP7002Runing = new object(); |
| | | private static object lockOP7003Runing = new object(); |
| | | private static object lockOP7004Runing = new object(); |
| | | private static bool _isAllowRuning_OP7001 = false; |
| | | private static bool _isAllowRuning_OP7002 = false; |
| | | private static bool _isAllowRuning_OP7003 = false; |
| | | private static bool _isAllowRuning_OP7004 = false; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7001 |
| | | { |
| | | get { return _isAllowRuning_OP7001; } |
| | | set |
| | | { |
| | | lock (lockOP7001Runing) |
| | | { |
| | | _isAllowRuning_OP7001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºæµé宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7002 |
| | | { |
| | | get { return _isAllowRuning_OP7002; } |
| | | set |
| | | { |
| | | lock (lockOP7002Runing) |
| | | { |
| | | _isAllowRuning_OP7002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7003 |
| | | { |
| | | get { return _isAllowRuning_OP7003; } |
| | | set |
| | | { |
| | | lock (lockOP7003Runing) |
| | | { |
| | | _isAllowRuning_OP7003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7004 |
| | | { |
| | | get { return _isAllowRuning_OP7004; } |
| | | set |
| | | { |
| | | lock (lockOP7004Runing) |
| | | { |
| | | _isAllowRuning_OP7004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP7001Alert = new object(); |
| | | private static object lockOP7002Alert = new object(); |
| | | private static object lockOP7003Alert = new object(); |
| | | private static object lockOP7004Alert = new object(); |
| | | private static string _lbl_Alert_OP7001 = string.Empty; |
| | | private static string _lbl_Alert_OP7002 = string.Empty; |
| | | private static string _lbl_Alert_OP7003 = string.Empty; |
| | | private static string _lbl_Alert_OP7004 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7001 |
| | | { |
| | | get { return _lbl_Alert_OP7001; } |
| | | set |
| | | { |
| | | lock (lockOP7001Alert) |
| | | { |
| | | _lbl_Alert_OP7001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7002 |
| | | { |
| | | get { return _lbl_Alert_OP7002; } |
| | | set |
| | | { |
| | | lock (lockOP7002Alert) |
| | | { |
| | | _lbl_Alert_OP7002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7003 |
| | | { |
| | | get { return _lbl_Alert_OP7003; } |
| | | set |
| | | { |
| | | lock (lockOP7003Alert) |
| | | { |
| | | _lbl_Alert_OP7003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7004 |
| | | { |
| | | get { return _lbl_Alert_OP7004; } |
| | | set |
| | | { |
| | | lock (lockOP7004Alert) |
| | | { |
| | | _lbl_Alert_OP7004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP7001Value = new object(); |
| | | private static object lockOP7002Value = new object(); |
| | | private static object lockOP7003Value = new object(); |
| | | private static object lockOP7004Value = new object(); |
| | | private static string _value_OP7001 = string.Empty; |
| | | private static string _value_OP7002 = string.Empty; |
| | | private static string _value_OP7003 = string.Empty; |
| | | private static string _value_OP7004 = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// OP70å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP7001 |
| | | { |
| | | get { return _value_OP7001; } |
| | | set |
| | | { |
| | | lock (lockOP7001Value) |
| | | { |
| | | _value_OP7001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP70å·¥åºæµé宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP7002 |
| | | { |
| | | get { return _value_OP7002; } |
| | | set |
| | | { |
| | | lock (lockOP7002Value) |
| | | { |
| | | _value_OP7002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP70å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP7003 |
| | | { |
| | | get { return _value_OP7003; } |
| | | set |
| | | { |
| | | lock (lockOP7003Value) |
| | | { |
| | | _value_OP7003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP70å·¥åºè¯»ç ï¼å°±æ¯OP70å·¥åºæµé宿å伿å°ä¸ä¸ªæ°äºç»´ç ï¼ç»å®å工件å·ï¼ |
| | | /// </summary> |
| | | public static string value_OP7004 |
| | | { |
| | | get { return _value_OP7004; } |
| | | set |
| | | { |
| | | lock (lockOP7004Value) |
| | | { |
| | | _value_OP7004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP7005Runing = new object(); |
| | | private static bool _isAllowRuning_OP7005 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7005 |
| | | { |
| | | get { return _isAllowRuning_OP7005; } |
| | | set |
| | | { |
| | | lock (lockOP7005Runing) |
| | | { |
| | | _isAllowRuning_OP7005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP7005Alert = new object(); |
| | | private static string _lbl_Alert_OP7005 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7005 |
| | | { |
| | | get { return _lbl_Alert_OP7005; } |
| | | set |
| | | { |
| | | lock (lockOP7005Alert) |
| | | { |
| | | _lbl_Alert_OP7005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP7005 = string.Empty; |
| | | private static object lockOP7005Value = new object(); |
| | | /// <summary> |
| | | /// OP70å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP7005 |
| | | { |
| | | get { return _value_OP7005; } |
| | | set |
| | | { |
| | | lock (lockOP7005Value) |
| | | { |
| | | _value_OP7005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private static object lockOP7006Runing = new object(); |
| | | private static bool _isAllowRuning_OP7006 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7006 |
| | | { |
| | | get { return _isAllowRuning_OP7006; } |
| | | set |
| | | { |
| | | lock (lockOP7006Runing) |
| | | { |
| | | _isAllowRuning_OP7006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP7006Alert = new object(); |
| | | private static string _lbl_Alert_OP7006 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7006 |
| | | { |
| | | get { return _lbl_Alert_OP7006; } |
| | | set |
| | | { |
| | | lock (lockOP7006Alert) |
| | | { |
| | | _lbl_Alert_OP7006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP7006 = string.Empty; |
| | | private static object lockOP7006Value = new object(); |
| | | /// <summary> |
| | | /// OP70å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP7006 |
| | | { |
| | | get { return _value_OP7006; } |
| | | set |
| | | { |
| | | lock (lockOP7006Value) |
| | | { |
| | | _value_OP7006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP7007Runing = new object(); |
| | | private static bool _isAllowRuning_OP7007 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP70å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP7007 |
| | | { |
| | | get { return _isAllowRuning_OP7007; } |
| | | set |
| | | { |
| | | lock (lockOP7007Runing) |
| | | { |
| | | _isAllowRuning_OP7007 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP7007Alert = new object(); |
| | | private static string _lbl_Alert_OP7007 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP70å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP7007 |
| | | { |
| | | get { return _lbl_Alert_OP7007; } |
| | | set |
| | | { |
| | | lock (lockOP7007Alert) |
| | | { |
| | | _lbl_Alert_OP7007 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP7007 = string.Empty; |
| | | private static object lockOP7007Value = new object(); |
| | | /// <summary> |
| | | /// OP70å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP7007 |
| | | { |
| | | get { return _value_OP7007; } |
| | | set |
| | | { |
| | | lock (lockOP7007Value) |
| | | { |
| | | _value_OP7007 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | #region OP80å·¥åº |
| | | |
| | | private static object lockOP8001Runing = new object(); |
| | | private static object lockOP8002Runing = new object(); |
| | | private static object lockOP8003Runing = new object(); |
| | | private static object lockOP8004Runing = new object(); |
| | | private static bool _isAllowRuning_OP8001 = false; |
| | | private static bool _isAllowRuning_OP8002 = false; |
| | | private static bool _isAllowRuning_OP8003 = false; |
| | | private static bool _isAllowRuning_OP8004 = false; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºè¯»ç 宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8001 |
| | | { |
| | | get { return _isAllowRuning_OP8001; } |
| | | set |
| | | { |
| | | lock (lockOP8001Runing) |
| | | { |
| | | _isAllowRuning_OP8001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºæµé宿æ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8002 |
| | | { |
| | | get { return _isAllowRuning_OP8002; } |
| | | set |
| | | { |
| | | lock (lockOP8002Runing) |
| | | { |
| | | _isAllowRuning_OP8002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8003 |
| | | { |
| | | get { return _isAllowRuning_OP8003; } |
| | | set |
| | | { |
| | | lock (lockOP8003Runing) |
| | | { |
| | | _isAllowRuning_OP8003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8004 |
| | | { |
| | | get { return _isAllowRuning_OP8004; } |
| | | set |
| | | { |
| | | lock (lockOP8004Runing) |
| | | { |
| | | _isAllowRuning_OP8004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP8001Alert = new object(); |
| | | private static object lockOP8002Alert = new object(); |
| | | private static object lockOP8003Alert = new object(); |
| | | private static object lockOP8004Alert = new object(); |
| | | private static string _lbl_Alert_OP8001 = string.Empty; |
| | | private static string _lbl_Alert_OP8002 = string.Empty; |
| | | private static string _lbl_Alert_OP8003 = string.Empty; |
| | | private static string _lbl_Alert_OP8004 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºè¯»ç 宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8001 |
| | | { |
| | | get { return _lbl_Alert_OP8001; } |
| | | set |
| | | { |
| | | lock (lockOP8001Alert) |
| | | { |
| | | _lbl_Alert_OP8001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºæµé宿æ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8002 |
| | | { |
| | | get { return _lbl_Alert_OP8002; } |
| | | set |
| | | { |
| | | lock (lockOP8002Alert) |
| | | { |
| | | _lbl_Alert_OP8002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8003 |
| | | { |
| | | get { return _lbl_Alert_OP8003; } |
| | | set |
| | | { |
| | | lock (lockOP8003Alert) |
| | | { |
| | | _lbl_Alert_OP8003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8004 |
| | | { |
| | | get { return _lbl_Alert_OP8004; } |
| | | set |
| | | { |
| | | lock (lockOP8004Alert) |
| | | { |
| | | _lbl_Alert_OP8004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private static object lockOP8001Value = new object(); |
| | | private static object lockOP8002Value = new object(); |
| | | private static object lockOP8003Value = new object(); |
| | | private static object lockOP8004Value = new object(); |
| | | private static string _value_OP8001 = string.Empty; |
| | | private static string _value_OP8002 = string.Empty; |
| | | private static string _value_OP8003 = string.Empty; |
| | | private static string _value_OP8004 = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// OP80å·¥åºè¯»ç 宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP8001 |
| | | { |
| | | get { return _value_OP8001; } |
| | | set |
| | | { |
| | | lock (lockOP8001Value) |
| | | { |
| | | _value_OP8001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP80å·¥åºæµé宿æ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP8002 |
| | | { |
| | | get { return _value_OP8002; } |
| | | set |
| | | { |
| | | lock (lockOP8002Value) |
| | | { |
| | | _value_OP8002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP80å·¥åºæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP8003 |
| | | { |
| | | get { return _value_OP8003; } |
| | | set |
| | | { |
| | | lock (lockOP8003Value) |
| | | { |
| | | _value_OP8003 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// OP80å·¥åºè¯»ç ï¼å°±æ¯OP80å·¥åºæµé宿å伿å°ä¸ä¸ªæ°äºç»´ç ï¼ç»å®å工件å·ï¼ |
| | | /// </summary> |
| | | public static string value_OP8004 |
| | | { |
| | | get { return _value_OP8004; } |
| | | set |
| | | { |
| | | lock (lockOP8004Value) |
| | | { |
| | | _value_OP8004 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP8005Runing = new object(); |
| | | private static bool _isAllowRuning_OP8005 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8005 |
| | | { |
| | | get { return _isAllowRuning_OP8005; } |
| | | set |
| | | { |
| | | lock (lockOP8005Runing) |
| | | { |
| | | _isAllowRuning_OP8005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP8005Alert = new object(); |
| | | private static string _lbl_Alert_OP8005 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8005 |
| | | { |
| | | get { return _lbl_Alert_OP8005; } |
| | | set |
| | | { |
| | | lock (lockOP8005Alert) |
| | | { |
| | | _lbl_Alert_OP8005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP8005 = string.Empty; |
| | | private static object lockOP8005Value = new object(); |
| | | /// <summary> |
| | | /// OP80å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP8005 |
| | | { |
| | | get { return _value_OP8005; } |
| | | set |
| | | { |
| | | lock (lockOP8005Value) |
| | | { |
| | | _value_OP8005 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private static object lockOP8006Runing = new object(); |
| | | private static bool _isAllowRuning_OP8006 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8006 |
| | | { |
| | | get { return _isAllowRuning_OP8006; } |
| | | set |
| | | { |
| | | lock (lockOP8006Runing) |
| | | { |
| | | _isAllowRuning_OP8006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP8006Alert = new object(); |
| | | private static string _lbl_Alert_OP8006 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8006 |
| | | { |
| | | get { return _lbl_Alert_OP8006; } |
| | | set |
| | | { |
| | | lock (lockOP8006Alert) |
| | | { |
| | | _lbl_Alert_OP8006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP8006 = string.Empty; |
| | | private static object lockOP8006Value = new object(); |
| | | /// <summary> |
| | | /// OP80å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP8006 |
| | | { |
| | | get { return _value_OP8006; } |
| | | set |
| | | { |
| | | lock (lockOP8006Value) |
| | | { |
| | | _value_OP8006 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private static object lockOP8007Runing = new object(); |
| | | private static bool _isAllowRuning_OP8007 = false; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§OP80å·¥åºSPCæ¨åºæ è®°çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_OP8007 |
| | | { |
| | | get { return _isAllowRuning_OP8007; } |
| | | set |
| | | { |
| | | lock (lockOP8007Runing) |
| | | { |
| | | _isAllowRuning_OP8007 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockOP8007Alert = new object(); |
| | | private static string _lbl_Alert_OP8007 = string.Empty; |
| | | /// <summary> |
| | | /// çæ§OP80å·¥åºSPCæ¨åºæ è®°çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_OP8007 |
| | | { |
| | | get { return _lbl_Alert_OP8007; } |
| | | set |
| | | { |
| | | lock (lockOP8007Alert) |
| | | { |
| | | _lbl_Alert_OP8007 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static string _value_OP8007 = string.Empty; |
| | | private static object lockOP8007Value = new object(); |
| | | /// <summary> |
| | | /// OP80å·¥åºSPCæ¨åºæ è®°å¼ |
| | | /// </summary> |
| | | public static string value_OP8007 |
| | | { |
| | | get { return _value_OP8007; } |
| | | set |
| | | { |
| | | lock (lockOP8007Value) |
| | | { |
| | | _value_OP8007 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region HMI |
| | | |
| | | private static object lockHMIBeartBeatMonitorRuning = new object(); |
| | | private static bool _isAllowRuning_HMIBeartBeatMonitor = false; |
| | | private static object lockHMIBeartBeatMonitorAlert = new object(); |
| | | private static string _lbl_Alert_HMIBeartBeatMonitor = string.Empty; |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIå¿è·³ä¿¡æ¯ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIBeartBeatMonitor |
| | | { |
| | | get { return _isAllowRuning_HMIBeartBeatMonitor; } |
| | | set |
| | | { |
| | | lock (lockHMIBeartBeatMonitorRuning) |
| | | { |
| | | _isAllowRuning_HMIBeartBeatMonitor = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// çæ§HMIå¿è·³ä¿¡æ¯çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIBeartBeatMonitor |
| | | { |
| | | get { return _lbl_Alert_HMIBeartBeatMonitor; } |
| | | set |
| | | { |
| | | lock (lockHMIBeartBeatMonitorAlert) |
| | | { |
| | | _lbl_Alert_HMIBeartBeatMonitor = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static object lockHMIOP104001Runing = new object(); |
| | | private static object lockHMIOP2001Runing = new object(); |
| | | private static object lockHMIOP303501Runing = new object(); |
| | | private static object lockHMIOP5001Runing = new object(); |
| | | private static object lockHMIOP6001Runing = new object(); |
| | | private static object lockHMIOP104002Runing = new object(); |
| | | private static object lockHMIOP2002Runing = new object(); |
| | | private static object lockHMIOP303502Runing = new object(); |
| | | private static object lockHMIOP5002Runing = new object(); |
| | | private static object lockHMIOP6002Runing = new object(); |
| | | private static bool _isAllowRuning_HMIOP104001 = false; |
| | | private static bool _isAllowRuning_HMIOP2001 = false; |
| | | private static bool _isAllowRuning_HMIOP303501 = false; |
| | | private static bool _isAllowRuning_HMIOP5001 = false; |
| | | private static bool _isAllowRuning_HMIOP6001 = false; |
| | | private static bool _isAllowRuning_HMIOP104002 = false; |
| | | private static bool _isAllowRuning_HMIOP2002 = false; |
| | | private static bool _isAllowRuning_HMIOP303502 = false; |
| | | private static bool _isAllowRuning_HMIOP5002 = false; |
| | | private static bool _isAllowRuning_HMIOP6002 = false; |
| | | private static object lockHMIOP104001Alert = new object(); |
| | | private static object lockHMIOP2001Alert = new object(); |
| | | private static object lockHMIOP303501Alert = new object(); |
| | | private static object lockHMIOP5001Alert = new object(); |
| | | private static object lockHMIOP6001Alert = new object(); |
| | | private static object lockHMIOP104002Alert = new object(); |
| | | private static object lockHMIOP2002Alert = new object(); |
| | | private static object lockHMIOP303502Alert = new object(); |
| | | private static object lockHMIOP5002Alert = new object(); |
| | | private static object lockHMIOP6002Alert = new object(); |
| | | private static string _lbl_Alert_HMIOP104001 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP2001 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP303501 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP5001 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP6001 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP104002 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP2002 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP303502 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP5002 = string.Empty; |
| | | private static string _lbl_Alert_HMIOP6002 = string.Empty; |
| | | |
| | | #region çæ§è¯»åçº¿ç¨ |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP104001读åäºç»´ç çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP104001 |
| | | { |
| | | get { return _isAllowRuning_HMIOP104001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP104001Runing) |
| | | { |
| | | _isAllowRuning_HMIOP104001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP2001读åäºç»´ç çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP2001 |
| | | { |
| | | get { return _isAllowRuning_HMIOP2001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP2001Runing) |
| | | { |
| | | _isAllowRuning_HMIOP2001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP303501读åäºç»´ç çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP303501 |
| | | { |
| | | get { return _isAllowRuning_HMIOP303501; } |
| | | set |
| | | { |
| | | lock (lockHMIOP303501Runing) |
| | | { |
| | | _isAllowRuning_HMIOP303501 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP5001读åäºç»´ç çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP5001 |
| | | { |
| | | get { return _isAllowRuning_HMIOP5001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP5001Runing) |
| | | { |
| | | _isAllowRuning_HMIOP5001 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP6001读åäºç»´ç çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP6001 |
| | | { |
| | | get { return _isAllowRuning_HMIOP6001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP6001Runing) |
| | | { |
| | | _isAllowRuning_HMIOP6001 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region çæ§åå
¥çº¿ç¨ |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP104002åå
¥è´¨éæ°æ®çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP104002 |
| | | { |
| | | get { return _isAllowRuning_HMIOP104002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP104002Runing) |
| | | { |
| | | _isAllowRuning_HMIOP104002 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP2002åå
¥è´¨éæ°æ®çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP2002 |
| | | { |
| | | get { return _isAllowRuning_HMIOP2002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP2002Runing) |
| | | { |
| | | _isAllowRuning_HMIOP2002 = value; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP303502åå
¥è´¨éæ°æ®çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP303502 |
| | | { |
| | | get { return _isAllowRuning_HMIOP303502; } |
| | | set |
| | | { |
| | | lock (lockHMIOP303502Runing) |
| | | { |
| | | _isAllowRuning_HMIOP303502 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP5002åå
¥è´¨éæ°æ®çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP5002 |
| | | { |
| | | get { return _isAllowRuning_HMIOP5002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP5002Runing) |
| | | { |
| | | _isAllowRuning_HMIOP5002 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ§è¡çæ§HMIOP6002æ´æ°è´¨éæ°æ®çº¿ç¨ |
| | | /// </summary> |
| | | public static bool isAllowRuning_HMIOP6002 |
| | | { |
| | | get { return _isAllowRuning_HMIOP6002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP6002Runing) |
| | | { |
| | | _isAllowRuning_HMIOP6002 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region çæ§è¯»å线ç¨äºç»´ç çè¦åä¿¡æ¯ |
| | | /// <summary> |
| | | /// çæ§HMIOP104001读åäºç»´ç çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP104001 |
| | | { |
| | | get { return _lbl_Alert_HMIOP104001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP104001Alert) |
| | | { |
| | | _lbl_Alert_HMIOP104001 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP2001读åäºç»´ç çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP2001 |
| | | { |
| | | get { return _lbl_Alert_HMIOP2001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP2001Alert) |
| | | { |
| | | _lbl_Alert_HMIOP2001 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP303501读åäºç»´ç çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP303501 |
| | | { |
| | | get { return _lbl_Alert_HMIOP303501; } |
| | | set |
| | | { |
| | | lock (lockHMIOP303501Alert) |
| | | { |
| | | _lbl_Alert_HMIOP303501 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP5001读åäºç»´ç çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP5001 |
| | | { |
| | | get { return _lbl_Alert_HMIOP5001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP5001Alert) |
| | | { |
| | | _lbl_Alert_HMIOP5001 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP6001读åäºç»´ç çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP6001 |
| | | { |
| | | get { return _lbl_Alert_HMIOP6001; } |
| | | set |
| | | { |
| | | lock (lockHMIOP6001Alert) |
| | | { |
| | | _lbl_Alert_HMIOP6001 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region çæ§åå
¥çº¿ç¨äºç»´ç çè¦åä¿¡æ¯ |
| | | /// <summary> |
| | | /// çæ§HMIOP104002åå
¥è´¨éæ°æ®çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP104002 |
| | | { |
| | | get { return _lbl_Alert_HMIOP104002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP104002Alert) |
| | | { |
| | | _lbl_Alert_HMIOP104002 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP2002åå
¥è´¨éæ°æ®çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP2002 |
| | | { |
| | | get { return _lbl_Alert_HMIOP2002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP2002Alert) |
| | | { |
| | | _lbl_Alert_HMIOP2002 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP303502åå
¥è´¨éæ°æ®çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP303502 |
| | | { |
| | | get { return _lbl_Alert_HMIOP303502; } |
| | | set |
| | | { |
| | | lock (lockHMIOP303502Alert) |
| | | { |
| | | _lbl_Alert_HMIOP303502 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP5002æ´æ°è´¨éæ°æ®çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP5002 |
| | | { |
| | | get { return _lbl_Alert_HMIOP5002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP5002Alert) |
| | | { |
| | | _lbl_Alert_HMIOP5002 = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ§HMIOP6002æ´æ°è´¨éæ°æ®çè¦åæ¶æ¯ |
| | | /// </summary> |
| | | public static string lbl_Alert_HMIOP6002 |
| | | { |
| | | get { return _lbl_Alert_HMIOP6002; } |
| | | set |
| | | { |
| | | lock (lockHMIOP6002Alert) |
| | | { |
| | | _lbl_Alert_HMIOP6002 = value; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using iWare_SCADA_Model.TableModel; |
| | | using log4net; |
| | | using System; |
| | | using System.Collections.Concurrent; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Diagnostics; |
| | | //using System.Data.Entity.Infrastructure; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | using System.Windows.Forms; |
| | | using static System.Windows.Forms.AxHost; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.BLL |
| | | { |
| | | public class WorkPieceInfoManager |
| | | { |
| | | public static WorkPieceInfo GetWorkPieceInfo(string WorkPieceID) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | //æ¥è¯¢ææ |
| | | var query = db.WorkPieceInfo.Where(o => o.WorkPieceID == WorkPieceID).FirstOrDefault(); |
| | | return query; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static long InsertWorkPieceInfo(WorkPieceInfo workPiece) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | db.WorkPieceInfo.Add(workPiece); |
| | | db.SaveChanges(); |
| | | return workPiece.Id; |
| | | } |
| | | } |
| | | |
| | | public static WorkPieceLogMiddle GetAddWorkPieceLog(WorkPieceLogMiddle loginfo) |
| | | { |
| | | loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | return loginfo; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç»WorkPieceLog主é®çå
Œ
±çç屿§èµå¼ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <returns></returns> |
| | | public static WorkPieceLog GetAddWorkPieceLog(WorkPieceLog loginfo) |
| | | { |
| | | loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | return loginfo; |
| | | } |
| | | public static WorkPieceLog GetAddWorkPieceLog1(WorkPieceLogMiddle loginfo) |
| | | { |
| | | loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | return loginfo; |
| | | } |
| | | /// <summary> |
| | | /// éè¿WorkPieceInfo ç»WorkPieceInfoLog 屿§èµå¼ |
| | | /// </summary> |
| | | /// <param name="wpinfo"></param> |
| | | /// <returns></returns> |
| | | public static WorkPieceInfoLog GetAddWorkPieceInfoLog(WorkPieceInfo wpinfo) |
| | | { |
| | | WorkPieceInfoLog infolog = EntityPropHelper.Mapper<WorkPieceInfoLog, WorkPieceInfo>(wpinfo); |
| | | infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | infolog.WorkPieceInfoID = wpinfo.Id; |
| | | infolog.LogAddTime = DateTime.Now; |
| | | return infolog; |
| | | } |
| | | /// <summary> |
| | | /// ç»QualityDataInfo主é®çå
Œ
±çç屿§èµå¼ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <returns></returns> |
| | | public static QualityDataInfo GetAddQualityDataInfo(QualityDataInfo qdinfo) |
| | | { |
| | | qdinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | return qdinfo; |
| | | } |
| | | /// <summary> |
| | | /// éè¿QualityDataInfo ç»QualityDataInfoLog 屿§èµå¼ |
| | | /// </summary> |
| | | /// <param name="wpinfo"></param> |
| | | /// <returns></returns> |
| | | public static QualityDataInfoLog GetAddQualityDataInfoLog(QualityDataInfo qdinfo) |
| | | { |
| | | QualityDataInfoLog infolog = EntityPropHelper.Mapper<QualityDataInfoLog, QualityDataInfo>(qdinfo); |
| | | infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | return infolog; |
| | | } |
| | | public static void test() |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | //WorkPieceLogMiddle a = new WorkPieceLogMiddle(); |
| | | //a.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | //a.WorkPieceID="test01"+ new Random().Next(4).ToString(); |
| | | //a.QualityType = QualityType.SPC.ToString(); |
| | | |
| | | //if(a.QualityType.Equals(QualityType.SPC.ToString())) |
| | | //{ |
| | | // a.Remarks = "SPC"; |
| | | //} |
| | | //else |
| | | //{ |
| | | // a.Remarks = "AUTO"; |
| | | //} |
| | | |
| | | //WorkPieceLog b = new WorkPieceLog(); |
| | | //b.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | //b.WorkPieceID = "testxxx" + new Random().Next(0,1000).ToString(); |
| | | //b.QualityType = QualityType.SPC.ToString(); |
| | | //b.Remarks = "SPC insert into"; |
| | | //b.QualityState = 2; |
| | | //b.QualityStateUpdateMode = "heheh"; |
| | | //db.WorkPieceLog.Add(b); |
| | | |
| | | |
| | | //db.SaveChanges(); |
| | | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤idæ´æ°åå
·å¯¿å½ä¿¡æ¯ï¼ç®åè®¾å®æ¯ç产ä¸ä¸ªå·¥ä»¶ï¼ææåå
·å¯¿å½é½ä¼å1ï¼ |
| | | /// </summary> |
| | | /// <param name="db"></param> |
| | | /// <param name="loginfo"></param> |
| | | public static void UpdateKnifeToolLift(DbModel db, WorkPieceLog loginfo) |
| | | { |
| | | try |
| | | { |
| | | var info = db.KnifeToolEquipmentInfo.Where(o => o.EquipmentID.Equals(loginfo.EquipmentID)).ToList(); |
| | | foreach(var item in info) |
| | | { |
| | | item.CurrentLife++; |
| | | item.UpdatedTime= DateTime.Now; |
| | | } |
| | | |
| | | }catch(Exception ex) |
| | | { |
| | | loginfo.Remarks = (loginfo.Remarks ?? "") + $"{loginfo.WorkPieceID ?? "空"}åå
·å¯¿å½æ´æ°æ°æ®å¼å¸¸{ex.Message}"; |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读åäºç»´ç æ¶é»è¾ |
| | | /// æ ¡éªå·¥ä»¶æ¯å¦è·³åºï¼è´¨éæ¯å¦åæ ¼ |
| | | /// </summary> |
| | | public static void ReadQRcode(WorkPieceLog loginfo, LogType type,PLCService plcService, int? IsFeedback) |
| | | {//æ¤å¤åæ¶æå
¥äºWorkPieceLogï¼WorkPieceInfoLog表ï¼å¹¶æ°å¢æä¿®æ¹WorkPieceInfo表 |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | try |
| | | { |
| | | bool isAddWorkPieceInfo = false; |
| | | if (loginfo.WorkPieceID.Length == 22) |
| | | { |
| | | WorkPieceInfo info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (info == null || info.WorkPieceID.Length < 1) |
| | | {//æå
¥WorkPieceInfo表 |
| | | loginfo = CommonManager.Instance.GetWorkPieceID(loginfo, type); |
| | | info = EntityPropHelper.Mapper<WorkPieceInfo, WorkPieceLog>(loginfo); |
| | | //EntityPropHelper<WorkPieceLog, WorkPieceInfo>.CopyProp(loginfo, info, loginfo.GetWorkPieceInfoDict()); |
| | | if (!loginfo.WorkingProcedure.Equals("OP05")) |
| | | {//å½å·¥ä»¶äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åºä¸æ¯OP05ï¼å设置为å¯çç¶æ |
| | | info.QualityState = (int)QualityState.Suspected; |
| | | info.QualityErrorInfo = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ
åµå¹¶åç¸åºå¤çï¼"; |
| | | info.Remarks = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.WorkingProcedure}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ
åµå¹¶åç¸åºå¤çï¼"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityState = (int)QualityState.OK;//æ¤å¤éè¦æ³¨æï¼å¤æææå·¥åºè´¨éï¼ç¶ååèµå¼ |
| | | info.Remarks = "OP05æ°å¢å·¥ä»¶ä¿¡æ¯"; |
| | | } |
| | | info.WorkPieceinitOnlineTime = DateTimeHelper.GetDateTime(); |
| | | info.WorkingProcedurePlan = ConfigHelper.GetConfigString("WorkingProcedureAllStr") ?? "OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80"; |
| | | info.CreatedUserName = loginfo.MonitoringPoint; |
| | | info.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | info = ParseQRCode(info); |
| | | isAddWorkPieceInfo = true; |
| | | } |
| | | else |
| | | { |
| | | if(info.WorkingProcedureCurrent.Equals("OP05")) |
| | | { |
| | | loginfo.Remarks = (loginfo.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"} OP05å·¥åºéå¤è¯»åäº"; |
| | | return; |
| | | } |
| | | } |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime();// |
| | | info.WorkingProcedureEndTime = null; |
| | | info.WorkPieceState = (int)WorkPieceState.WIP; |
| | | info.EquipmentID = loginfo.EquipmentID; |
| | | info.QualityStateUpdateUser = loginfo.UpdatedUserName; |
| | | info.QualityStateUpdateTime = loginfo.UpdatedTime.Value.LocalDateTime; |
| | | info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | info.WorkPieceCurrentPosition = loginfo.WorkingProcedure; |
| | | info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; |
| | | info.WorkingProcedureCurrent = loginfo.WorkingProcedure; |
| | | info.Remarks = info.Remarks??""+$"{info.WorkingProcedureCurrent}工件ä¸çº¿"; |
| | | |
| | | var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID &&!o.OperationType.Equals("SPC")&& (o.EndTime==null|| o.EndTime<=DateTime.MinValue)).OrderByDescending(o => o.StartTime).FirstOrDefault(); |
| | | if (pro != null && pro.WorkPieceID.Length > 1) |
| | | { |
| | | pro.EndTime = DateTimeHelper.GetDateTime(); |
| | | pro.UpdatedUserName = loginfo.MonitoringPoint; |
| | | pro.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | pro.Remarks = (pro.Remarks ?? "") + "å䏿¬¡ä¸çº¿ï¼æ´æ°ç»ææ¶é´"; |
| | | } |
| | | //æ¯æ¬¡æ«æä¸çº¿é½æå
¥è¿½æº¯è¡¨ |
| | | WorkPieceProcess process = new WorkPieceProcess(); |
| | | process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); |
| | | process.StartTime = DateTimeHelper.GetDateTime(); |
| | | process.QualityState = info.QualityState.HasValue ? info.QualityState.Value : (int)QualityState.OK; |
| | | process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | process.CreatedUserName = loginfo.MonitoringPoint; |
| | | process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.UpdatedUserName = loginfo.MonitoringPoint; |
| | | process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.OperationType = OperationType.ç产.ToString(); |
| | | process.Remarks = ""; |
| | | if (loginfo.WorkingProcedure.Equals("OP05")) |
| | | { |
| | | process.EndTime = process.StartTime; |
| | | } |
| | | db.WorkPieceProcess.Add(process); |
| | | |
| | | //db.Database.AutoTransactionsEnabled = false;// åä¸ä¸ªSaveChangesé»è®¤äºå¡ï¼ å
³éé»è®¤äºå¡ï¼... 好åä¸è½ç¨åï¼åé¢åç ç©¶å§ |
| | | if (isAddWorkPieceInfo) |
| | | { |
| | | db.WorkPieceInfo.Add(info); |
| | | } |
| | | else |
| | | {//ä¸ç¡®å®infoæ¯ç´æ¥ä¼ä¿®æ¹è¿æ¯éè¦å次æ¥è¯¢ï¼å¾
æµè¯ |
| | | //info.Remarks = "ä¿®æ¹ï¼å
·ä½ä¿®æ¹é»è¾å¾
å®"; |
| | | } |
| | | |
| | | #region 夿æ¯å¦è·³åº,æè´¨éä¸ç¬¦å ç¶ååé¦PLC |
| | | if (IsFeedback.HasValue && IsFeedback.Value == (int)FeedbackMode.FeedbackPLC) |
| | | { |
| | | bool checkQualityInfoCompleteFlag = false; |
| | | bool plcFlag = true;//åé¦ç»PLCçæ è®° |
| | | string message = ""; |
| | | checkQualityInfoCompleteFlag = WorkPieceInfoManager.CheckQualityInfoComplete(info, loginfo, type); |
| | | |
| | | if (!checkQualityInfoCompleteFlag || info.QualityState != (int)QualityState.OK) |
| | | { |
| | | plcFlag = false; |
| | | message = !checkQualityInfoCompleteFlag ? "è·³åºï¼" : ""; |
| | | message += info.QualityState != (int)QualityState.OK ? "è´¨éä¸ç¬¦å" : ""; |
| | | } |
| | | ////åé¦ç»PLCï¼ï¼åå
¥ç¹å¾
å®ï¼ |
| | | //MessageModel fr = null; |
| | | //fr = plcService.WriteValuePoint("", "", plcFlag, PLCManger.GetTypeForString("bool")); |
| | | //if (fr.result) |
| | | //{ |
| | | // Log4NetHelper.WriteInfoLog(type, $" 工件{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åºåé¦ç»PLC æåï¼ åºç° {message}"); |
| | | //} |
| | | //else |
| | | //{ |
| | | // Log4NetHelper.WriteErrorLog(type, $" 工件{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åºåé¦ç»PLC å¤±è´¥ï¼ åºç° {message} ï¼å¤±è´¥åå ï¼{fr.resMsg}"); |
| | | //} |
| | | |
| | | //#region åé¦PLC |
| | | |
| | | //bool checkQualityInfoCompleteFlag = false; |
| | | //bool plcFlag = true;//åé¦ç»PLCçæ è®° |
| | | //string message = ""; |
| | | //checkQualityInfoCompleteFlag = WorkPieceInfoManager.CheckQualityInfoComplete(info, wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | //if (!checkQualityInfoCompleteFlag || info.QualityState != (int)QualityState.OK) |
| | | //{ |
| | | // plcFlag = false; |
| | | // message = !checkQualityInfoCompleteFlag ? "è·³åºï¼" : ""; |
| | | //message += info.QualityState != (int)QualityState.OK ? "è´¨éä¸ç¬¦å" : ""; |
| | | //} |
| | | ////åé¦ç»PLCï¼ï¼åå
¥ç¹å¾
å®ï¼ |
| | | //MessageModel fr = null; |
| | | //fr = plcService.WriteValuePoint("", "", plcFlag, PLCManger.GetTypeForString("bool")); |
| | | //if (fr.result) |
| | | //{ |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC æåï¼ åºç° {message}"); |
| | | //} |
| | | //else |
| | | //{ |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC å¤±è´¥ï¼ åºç° {message} ï¼å¤±è´¥åå ï¼{fr.resMsg}"); |
| | | //} |
| | | //#endregion |
| | | } |
| | | else |
| | | {//读ç 宿è¥å·¥ä»¶è´¨éä¸ç¬¦åæåçè·³åºï¼ä¸ç¨ç®¡è®¾å¤æ¯å¦æå·¥ä»¶æ¾è¿å»ï¼æ°éç³»ç»é½ä¸åæ´å½åå·¥åºï¼åé¦è®¾å¤PLC工件ä¸ç¬¦åï¼ |
| | | //è¥å·¥åºåç»æ¶éç¹æ¶å°ç¸å
³å·¥ä»¶ä¿¡æ¯ååæ´å½åå·¥åºï¼ ä½è´¨éä¿¡æ¯ä¸å |
| | | |
| | | info.WorkingProcedureCurrent = loginfo.WorkingProcedure; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ´æ°è®¾å¤å®æ¶è¡¨ |
| | | |
| | | bool isAddEquipmentCurrentMonitor = false; |
| | | EquipmentCurrentMonitor equinfo = new EquipmentCurrentMonitor(); |
| | | equinfo = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == loginfo.EquipmentID).FirstOrDefault(); |
| | | if (equinfo == null || equinfo.Id < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.WorkingProcedure} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); |
| | | equinfo = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLog>(loginfo); |
| | | equinfo.OnlineTime=DateTime.Now; |
| | | isAddEquipmentCurrentMonitor = true; |
| | | } |
| | | else |
| | | {//æ´æ°å·¥ä»¶ |
| | | equinfo.WorkPieceID = loginfo.WorkPieceID; |
| | | equinfo.UpdatedUserName = loginfo.MonitoringPoint; |
| | | equinfo.UpdatedTime = DateTime.Now; |
| | | equinfo.OnlineTime = DateTime.Now; |
| | | } |
| | | if (isAddEquipmentCurrentMonitor) |
| | | { |
| | | equinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | db.EquipmentCurrentMonitor.Add(equinfo); |
| | | } |
| | | #endregion |
| | | //db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo)); |
| | | db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); |
| | | //UpdateKnifeToolLift(db, loginfo);//æ´æ°åå
·å¯¿å½ä¿¡æ¯ |
| | | } |
| | | else |
| | | { |
| | | loginfo.Remarks = (loginfo.Remarks ?? "") + $"ä¸çº¿å®æè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; |
| | | Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}ä¸çº¿çæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); |
| | | |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | loginfo.Remarks = (loginfo.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; |
| | | } |
| | | finally |
| | | { |
| | | loginfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | db.WorkPieceLog.Add(loginfo); |
| | | db.SaveChanges(); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | public static WorkPieceLogMiddle QualityDataHand(WorkPieceLogMiddle loginfo, List<EquipmentQualityConfig> qcofig) |
| | | { |
| | | try |
| | | { |
| | | switch (loginfo.WorkingProcedure) |
| | | { |
| | | case "OP10": |
| | | var cof = qcofig.Where(o => o.ParamColName.Equals("QualityOP10To1")).FirstOrDefault(); |
| | | if (cof != null && cof.Id > 0) |
| | | { |
| | | double oldvalue = 0; |
| | | double StandardValue = 0; |
| | | var flag1 = double.TryParse(loginfo.QualityOP10To1, out oldvalue); |
| | | var flag2 = double.TryParse(cof.StandardValue, out StandardValue); |
| | | if (!flag1 || !flag2) |
| | | { |
| | | return loginfo; |
| | | } |
| | | loginfo.QualityOP10To1 = ((StandardValue + oldvalue * 1.0 / cof.DecimalPlaces).ToString()); |
| | | //+(string.IsNullOrEmpty(cof.Unit) ? "" : cof.Unit) |
| | | } |
| | | break; |
| | | case "OP40": |
| | | var cofOP40 = qcofig.Where(o => o.ParamColName.Equals("QualityOP40To1")).FirstOrDefault(); |
| | | if (cofOP40 != null && cofOP40.Id > 0) |
| | | { |
| | | double oldvalue = 0; |
| | | double StandardValue = 0; |
| | | var flag1 = double.TryParse(loginfo.QualityOP40To1, out oldvalue); |
| | | var flag2 = double.TryParse(cofOP40.StandardValue, out StandardValue); |
| | | if (!flag1 || !flag2) |
| | | { |
| | | return loginfo; |
| | | } |
| | | loginfo.QualityOP40To1 = ((StandardValue + oldvalue*1.0/ cofOP40.DecimalPlaces).ToString()); |
| | | //+(string.IsNullOrEmpty(cofOP40.Unit) ? "" : cofOP40.Unit) |
| | | } |
| | | break; |
| | | case "OP20": |
| | | var cofOP20 = qcofig.Where(o => o.ParamColName.Equals("QualityOP20To1")).FirstOrDefault(); |
| | | if (cofOP20 != null && cofOP20.Id > 0) |
| | | { |
| | | double oldvalue = 0; |
| | | double StandardValue = 0; |
| | | var flag1 = double.TryParse(loginfo.QualityOP20To1, out oldvalue); |
| | | var flag2 = double.TryParse(cofOP20.StandardValue, out StandardValue); |
| | | if (!flag1 || !flag2) |
| | | { |
| | | return loginfo; |
| | | } |
| | | loginfo.QualityOP20To1 = ((StandardValue + oldvalue * 1.0 / cofOP20.DecimalPlaces).ToString()); |
| | | } |
| | | break; |
| | | case "OP60": |
| | | var cofOP60to1 = qcofig.Where(o => o.ParamColName.Equals("QualityOP60To1")).FirstOrDefault(); |
| | | if (cofOP60to1 != null && cofOP60to1.Id > 0) |
| | | { |
| | | double oldvalue = 0; |
| | | double StandardValue = 0; |
| | | var flag1 = double.TryParse(loginfo.QualityOP60To1, out oldvalue); |
| | | var flag2 = double.TryParse(cofOP60to1.StandardValue, out StandardValue); |
| | | if (!flag1 || !flag2) |
| | | { |
| | | return loginfo; |
| | | } |
| | | loginfo.QualityOP60To1 = ((StandardValue + oldvalue * 1.0 / cofOP60to1.DecimalPlaces).ToString()); |
| | | } |
| | | var cofOP60to2 = qcofig.Where(o => o.ParamColName.Equals("QualityOP60To2")).FirstOrDefault(); |
| | | if (cofOP60to2 != null && cofOP60to2.Id > 0) |
| | | { |
| | | double oldvalue = 0; |
| | | double StandardValue = 0; |
| | | var flag1 = double.TryParse(loginfo.QualityOP60To2, out oldvalue); |
| | | var flag2 = double.TryParse(cofOP60to2.StandardValue, out StandardValue); |
| | | if (!flag1 || !flag2) |
| | | { |
| | | return loginfo; |
| | | } |
| | | loginfo.QualityOP60To2 = ((StandardValue + oldvalue * 1.0 / (10 * cofOP60to2.DecimalPlaces)).ToString() + (string.IsNullOrEmpty(cofOP60to2.Unit) ? "" : cofOP60to2.Unit)); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | |
| | | } |
| | | return loginfo; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è´¨éæ£æµå®æ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void QualityInfoComplete(WorkPieceLogMiddle loginfo, LogType type) |
| | | { |
| | | //æ¤å¤åæ¶æå
¥äºWorkPieceLogï¼WorkPieceInfoLog表ï¼å¹¶æ°å¢æä¿®æ¹WorkPieceInfo表 |
| | | //æå
¥è´¨éç¸å
³è¡¨QualityDataInfo |
| | | |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | |
| | | bool isAddWorkPieceInfo = false; |
| | | WorkPieceLog loginfo2 = new WorkPieceLog(); |
| | | loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); |
| | | try |
| | | { |
| | | |
| | | if (loginfo.WorkPieceID.Length == 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | WorkPieceInfo info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (info == null || info.WorkPieceID.Length < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | if (loginfo.MonitoringPoint.Equals("OP1002") || loginfo.MonitoringPoint.Equals("OP1003")|| loginfo.MonitoringPoint.Contains("OP2002")) |
| | | {//OP10 没æä¸çº¿æ«ç æªï¼çº¦å®ç¨æµéå®æä¿¡å·å½ä¸çº¿æ è®° |
| | | info = EntityPropHelper.Mapper<WorkPieceInfo, WorkPieceLogMiddle>(loginfo); |
| | | //EntityPropHelper<WorkPieceLog, WorkPieceInfo>.CopyProp(loginfo, info, loginfo.GetWorkPieceInfoDict()); |
| | | if (!loginfo.WorkingProcedure.Equals("OP05")) |
| | | {//å½å·¥ä»¶äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åºä¸æ¯OP05ï¼å设置为å¯çç¶æ |
| | | info.QualityState = (int)QualityState.Suspected; |
| | | info.QualityErrorInfo = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ
åµå¹¶åç¸åºå¤çï¼"; |
| | | info.Remarks = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.WorkingProcedure}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ
åµå¹¶åç¸åºå¤çï¼"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityState = (int)QualityState.OK;//æ¤å¤éè¦æ³¨æï¼å¤æææå·¥åºè´¨éï¼ç¶ååèµå¼ |
| | | info.Remarks = "OP05æ°å¢å·¥ä»¶ä¿¡æ¯"; |
| | | } |
| | | info.WorkPieceinitOnlineTime = DateTimeHelper.GetDateTime(); |
| | | info.WorkingProcedurePlan = ConfigHelper.GetConfigString("WorkingProcedureAllStr") ?? "OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80"; |
| | | info.CreatedUserName = loginfo.MonitoringPoint; |
| | | info.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime();// |
| | | info.WorkingProcedureEndTime = null; |
| | | info = ParseQRCode(info); |
| | | isAddWorkPieceInfo = true; |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | loginfo2.Remarks = loginfo2.Remarks??""+$"|工件{loginfo.WorkPieceID} è´¨éæ£æµå®æå·¥åº{loginfo.MonitoringPoint} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"; |
| | | Log4NetHelper.WriteErrorLog(type, $"工件{loginfo.WorkPieceID} è´¨éæ£æµå®æå·¥åº{loginfo.MonitoringPoint} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); |
| | | return; |
| | | } |
| | | } |
| | | if (loginfo.MonitoringPoint.Equals("OP1002") || loginfo.MonitoringPoint.Equals("OP1003") || loginfo.MonitoringPoint.Contains("OP2002")) |
| | | {// OP10 没æä¸çº¿æ«ç æªï¼çº¦å®ç¨æµéå®æä¿¡å·å½ä¸çº¿æ è®°ï¼æä»¥ä¸çº¿éè¦ä¿®æ¹çåæ®µæ¾è¿é |
| | | |
| | | if (loginfo.WorkingProcedure.Equals("OP10")) |
| | | { |
| | | var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); |
| | | loginfo2.WorkingProcedure = WorkingProcedure;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | loginfo.WorkingProcedure = WorkingProcedure;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | } |
| | | info.WorkPieceCurrentPosition = loginfo.WorkingProcedure; |
| | | info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; |
| | | info.WorkingProcedureCurrent = loginfo.WorkingProcedure; |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); |
| | | |
| | | #region æ´æ°è®¾å¤å®æ¶è¡¨ |
| | | |
| | | bool isAddEquipmentCurrentMonitor = false; |
| | | EquipmentCurrentMonitor equinfo = new EquipmentCurrentMonitor(); |
| | | equinfo = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == loginfo.EquipmentID).FirstOrDefault(); |
| | | if (equinfo == null || equinfo.Id < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.WorkingProcedure} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); |
| | | equinfo = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLog>(loginfo); |
| | | equinfo.OnlineTime = DateTime.Now; |
| | | isAddEquipmentCurrentMonitor = true; |
| | | } |
| | | else |
| | | {//æ´æ°å·¥ä»¶ |
| | | equinfo.WorkPieceID = loginfo.WorkPieceID; |
| | | equinfo.UpdatedUserName = loginfo.MonitoringPoint; |
| | | equinfo.UpdatedTime = DateTime.Now; |
| | | equinfo.OnlineTime = DateTime.Now; |
| | | } |
| | | if (isAddEquipmentCurrentMonitor) |
| | | { |
| | | equinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | db.EquipmentCurrentMonitor.Add(equinfo); |
| | | } |
| | | #endregion |
| | | //UpdateKnifeToolLift(db, loginfo);//æ´æ°åå
·å¯¿å½ä¿¡æ¯ |
| | | } |
| | | info.WorkPieceState = (int)WorkPieceState.WIP;//æ¨åºååSPCæ½æ£å è´¨éå½å
¥æ¶ç¶æä¿®æ¹åå¨å¶å |
| | | info.EquipmentID = loginfo.EquipmentID; |
| | | info.QualityStateUpdateUser = loginfo.UpdatedUserName; |
| | | info.QualityStateUpdateTime = loginfo.UpdatedTime.Value.LocalDateTime; |
| | | info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | info.Remarks = info.Remarks??"" + $"{loginfo.WorkingProcedure}è´¨éæ£æµå®æä¿®æ¹"; |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) |
| | | {//å·¥åºå¼å§æ¶é´æ²¡æåèµå¼ |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | info.QualityState = (int)((loginfo.QualityStateStr.Equals("OK") || loginfo.QualityStateStr.Equals("0K")) ? QualityState.OK : QualityState.NG); |
| | | |
| | | if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) |
| | | { |
| | | info.QualityErrorInfo = $"{loginfo.WorkingProcedure}å·¥åºè´¨éééæ°æ®ä¸åæ ¼{info.QualityState}"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityErrorInfo = ""; |
| | | } |
| | | loginfo.QualityState = info.QualityState; |
| | | if (isAddWorkPieceInfo) |
| | | { |
| | | db.WorkPieceInfo.Add(info); |
| | | } |
| | | |
| | | #region æ ¹æ®æ å弿´æ°ææ°è´¨éæ°æ®ï¼OP10/OP40/OP20/OP60ï¼ |
| | | var qcofig = db.EquipmentQualityConfig.Where(o => o.WorkingProcedure.Equals(loginfo.WorkingProcedure) && o.ParamType!=1 && o.IsDeleted == false).ToList(); |
| | | if(qcofig.Count > 0) |
| | | { |
| | | QualityDataHand(loginfo, qcofig); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (qualityData == null || qualityData.WorkPieceID.Length < 1 || qualityData.WorkingProcedure.Length < 1) |
| | | {//æå
¥QualityDataInfo表 |
| | | qualityData = EntityPropHelper.Mapper<QualityDataInfo, WorkPieceLog>(loginfo); |
| | | db.QualityDataInfo.Add(GetAddQualityDataInfo(qualityData)); |
| | | } |
| | | //ä¿®æ¹QualityDataInfo表 //é夿¶å°è´¨éä¿¡æ¯ï¼ä¼è¦çä¹åç |
| | | EntityPropHelper<WorkPieceLogMiddle, QualityDataInfo>.CopyProp(loginfo, qualityData, GetQualityDataInfoUpdate(loginfo.WorkingProcedure,loginfo.MonitoringPoint));//æå®ä¿®æ¹å段 |
| | | |
| | | qualityData.QualityStateUpdateUser = info.UpdatedUserName; |
| | | qualityData.QualityReceiveTime = info.UpdatedTime.Value.LocalDateTime; |
| | | qualityData.QualityStateUpdateMode = info.QualityStateUpdateMode; |
| | | if (loginfo.WorkingProcedure.Equals("OP10")) |
| | | { |
| | | qualityData.OP10QualityState = loginfo.QualityState.HasValue? loginfo.QualityState.Value.ToString():"3"; |
| | | qualityData.OP10QualityReceiveTime= DateTimeHelper.GetDateTime(); |
| | | } |
| | | else if (loginfo.WorkingProcedure.Equals("OP20")) |
| | | { |
| | | //Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}è´¨éä¿¡æ¯ã{loginfo.QualityStateStr ?? "空"}ã" + |
| | | // $"ã{(loginfo.QualityState.HasValue? loginfo.QualityState.Value:999)}ãã{(info.QualityState.HasValue ? info.QualityState.Value : 888)}ã 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]"); |
| | | qualityData.OP20QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP20QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | qualityData.OP20QualityFilePath = loginfo.OP20QualityFilePath; |
| | | } |
| | | else if (loginfo.WorkingProcedure.Equals("OP30")) |
| | | { |
| | | switch (loginfo.MonitoringPoint) |
| | | { |
| | | case "OP3002CH3": |
| | | qualityData.OP30QualityFilePathCH3 = loginfo.OP30QualityFilePathCH3; |
| | | qualityData.OP30QualityStateCH3 = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP30QualityReceiveTimeCH3= DateTimeHelper.GetDateTime(); |
| | | break; |
| | | case "OP3002CH4": |
| | | qualityData.OP30QualityFilePathCH4 = loginfo.OP30QualityFilePathCH4; |
| | | qualityData.OP30QualityStateCH4 = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP30QualityReceiveTimeCH4 = DateTimeHelper.GetDateTime(); |
| | | break; |
| | | case "OP3002CH5": |
| | | qualityData.OP30QualityFilePathCH5 = loginfo.OP30QualityFilePathCH5; |
| | | qualityData.OP30QualityStateCH5 = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP30QualityReceiveTimeCH5 = DateTimeHelper.GetDateTime(); |
| | | break; |
| | | case "OP3002CH6": |
| | | qualityData.OP30QualityFilePathCH6 = loginfo.OP30QualityFilePathCH6; |
| | | qualityData.OP30QualityStateCH6 = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP30QualityReceiveTimeCH6 = DateTimeHelper.GetDateTime(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | //qualityData.OP30QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | //qualityData.OP30QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | else if (loginfo.WorkingProcedure.Equals("OP35")) |
| | | { |
| | | qualityData.OP35QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP35QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | else if (loginfo.WorkingProcedure.Equals("OP40")) |
| | | { |
| | | qualityData.OP40QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP40QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | else if (loginfo.WorkingProcedure.Equals("OP60")) |
| | | { |
| | | qualityData.OP60QualityFilePath = loginfo.OP60QualityFilePath; |
| | | qualityData.OP60QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP60QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | else if (loginfo.WorkingProcedure.Equals("OP80")) |
| | | { |
| | | qualityData.OP80QualityFilePath = loginfo.OP80QualityFilePath; |
| | | qualityData.OP80QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP80QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | |
| | | var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == info.WorkingProcedureCurrent && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o => o.StartTime).FirstOrDefault(); |
| | | if (pro == null || pro.WorkPieceID.Length < 1||loginfo.MonitoringPoint.Equals("OP1002") || loginfo.MonitoringPoint.Equals("OP1003") || loginfo.MonitoringPoint.Contains("OP2002")) |
| | | {// OP10 没æä¸çº¿æ«ç æªï¼çº¦å®ç¨æµéå®æä¿¡å·å½ä¸çº¿æ è®°ï¼æä»¥ä¸çº¿éè¦ä¿®æ¹çåæ®µæ¾è¿é |
| | | //ä¸çº¿æ¯æ¯æ¬¡é½æå
¥ |
| | | |
| | | WorkPieceProcess process = new WorkPieceProcess(); |
| | | process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); |
| | | process.StartTime = DateTimeHelper.GetDateTime(); |
| | | process.QualityState = info.QualityState.HasValue ? info.QualityState.Value : (int)QualityState.OK; |
| | | process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | process.CreatedUserName = loginfo.MonitoringPoint; |
| | | process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.UpdatedUserName = loginfo.MonitoringPoint; |
| | | process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.OperationType = OperationType.ç产.ToString(); |
| | | process.QualityDataInfoID = qualityData.Id; |
| | | process.Remarks = ""; |
| | | db.WorkPieceProcess.Add(process); |
| | | } |
| | | else |
| | | {//å
¶ä»çé½åªæ¯ä¿®æ¹ |
| | | pro.QualityDataInfoID = qualityData.Id; |
| | | pro.UpdatedUserName = loginfo.MonitoringPoint; |
| | | pro.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | pro.QualityState = info.QualityState.HasValue ? info.QualityState.Value : 9; |
| | | } |
| | | |
| | | if (loginfo.QualityType!=null&& loginfo.QualityType.Equals(QualityType.SPC.ToString())) |
| | | {//SPCåé¦ï¼ |
| | | if (loginfo.QualityState != (int)QualityState.OK) |
| | | { |
| | | //彿å°å·¥åºæ£æµå°ä¸åæ ¼å·¥ä»¶æ¶ï¼ä»è¯¥å·¥ä»¶å 工宿æ¶å»åæå®æ¶é´èµ·è³æ¥æ£ä¸åæ ¼æ¶é´æ¢ï¼ç³»ç»å°è¯¥å·¥ä»¶çæåå 工工åºå¨è¯¥æ¶é´æ®µå
å å·¥çææå·¥ä»¶ãæ£å¨å å·¥ç工件ã该工åºå
¥å£å¤ç第ä¸ä¸ªå·¥ä»¶å
¨é¨æ 记为çä¼¼ç¶æï¼ç±äººå·¥å¤æ£å·¥ä»¶å¹¶ä¿®æ¹ç¶æï¼å¹¶æ¯ææ¹éåæ´ã |
| | | //çå¤ï¼å¨çº¿æµéä¸éè¦èµ°è¿ä¸ªæµç¨ï¼åªæSPCæ½æ£æéè¦ï¼éè¦æè¿æ¶é´æ®µç工件å
¨é¨ç½®ä¸ºçä¼¼ï¼åªææ¯å·²å®æå·¥ä»¶ |
| | | //æ¶é´æ®µèµ·å§æ¶é´ï¼æ½æ£å·¥ä»¶ç产æ¶é´åä¸SPCæ½æ£æ¶é´ |
| | | //æ¶é´æ®µç»ææ¶é´ï¼æ½æ£å·¥ä»¶è´¨éç»æåºç°åçæ¶é´ |
| | | //æ½æ£å·¥ä»¶å·¥åºæ«ææªå¤å
¥å£å¤ç第ä¸ä¸ªå·¥ä»¶ ä¹æè´¨éç¶æç½®ä¸ºçä¼¼ |
| | | //ï¼æ¯ä¸å·¥åºSPCæ½æ£æ¯è®¾ç½®çåºå®çï¼æ¯å¦200æ½4ï¼ç¶æç½®ä¸ºçä¼¼æ¶è¥å·¥ä»¶è¿å¨è®¾å¤å
ï¼ä¼ç»§ç»çäº§å®æ¯åæåºï¼ |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); |
| | | db.QualityDataInfoLog.Add(GetAddQualityDataInfoLog(qualityData));//æå
¥æ¥å¿ |
| | | } |
| | | else |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éæ£æµå®æè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; |
| | | Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); |
| | | |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éæ£æµå®æ{loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{ex.Message}++{ex.StackTrace}"; |
| | | Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); |
| | | } |
| | | finally |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éï¼{loginfo.QualityStateStr ?? "空"}"; |
| | | db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå
¥å·¥ä»¶é鿥å¿è¡¨ |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 工件æ¨åºNOOK |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void WorkPiecePushOff(WorkPieceLogMiddle loginfo, LogType type) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | WorkPieceLog loginfo2 = new WorkPieceLog(); |
| | | loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); |
| | | try |
| | | { |
| | | if (loginfo.WorkPieceID != null && loginfo.WorkPieceID.Trim('\0').Length == 22) |
| | | { |
| | | WorkPieceInfo info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (info == null || info.WorkPieceID.Length < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | Log4NetHelper.WriteErrorLog(type, $"工件{loginfo.WorkPieceID} 工件æ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); |
| | | return; |
| | | } |
| | | else |
| | | {//æ´æ°è¡¨WorkPieceInfo |
| | | if (loginfo.WorkingProcedure.Equals("OP10")) |
| | | { |
| | | info.WorkPieceCurrentPosition = info.WorkingProcedureCurrent + "NOOK"; |
| | | //var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); |
| | | loginfo2.WorkingProcedure = info.WorkingProcedureCurrent;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | loginfo.WorkingProcedure = info.WorkingProcedureCurrent; //è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | } |
| | | else |
| | | { |
| | | info.WorkingProcedureCurrent = loginfo.WorkingProcedure; |
| | | info.WorkPieceCurrentPosition = loginfo.WorkingProcedure + "NOOK"; |
| | | } |
| | | info.WorkPieceState = (int)WorkPieceState.NOOKPush; |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.Now; |
| | | info.Remarks = "工件NOOKæ¨åº"; |
| | | if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) |
| | | { |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | info.WorkingProcedureEndTime = DateTimeHelper.GetDateTime(); |
| | | info.WorkingProcedureCompleted = info.WorkingProcedureCompleted + loginfo.WorkingProcedure;//å·²å®æå·¥åº |
| | | info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; |
| | | } |
| | | if(loginfo.WorkingProcedure.Equals("OP35")) |
| | | {//为äºè§£å³OP35çééå°çè´¨éä¿¡æ¯æ¯OKè¿NOOKçæ
åµï¼OP35 NOOKæ¶æ´æ°è´¨éä¿¡æ¯ |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"OP35NOOKåè´¨éä¿¡æ¯{(info.QualityState.HasValue? info.QualityState.Value.ToString():"空")}"; |
| | | info.QualityState = (int)QualityState.NG; |
| | | if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) |
| | | { |
| | | info.QualityErrorInfo = $"{loginfo.WorkingProcedure}å·¥åºè´¨éNOOKééæ°æ®ä¸åæ ¼{info.QualityState}"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityErrorInfo = ""; |
| | | } |
| | | loginfo.QualityState = info.QualityState; |
| | | |
| | | var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (qualityData != null) |
| | | { |
| | | qualityData.OP35QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP35QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | db.QualityDataInfoLog.Add(GetAddQualityDataInfoLog(qualityData)); |
| | | } |
| | | } |
| | | //æ´æ°ä¸ä¸å·¥åºçç»ææ¶é´ |
| | | var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == loginfo.WorkingProcedure && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o => o.StartTime).FirstOrDefault(); |
| | | if (pro != null && pro.WorkPieceID.Length > 0) |
| | | { |
| | | pro.EndTime = DateTimeHelper.GetDateTime(); |
| | | pro.Remarks = (pro.Remarks ?? "") + "NOOKç»æ"; |
| | | pro.UpdatedUserName = loginfo.MonitoringPoint; |
| | | pro.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | |
| | | db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); |
| | | |
| | | } |
| | | else |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"工件NOOKæ¨åºè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; |
| | | Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}工件NOOKæ¨åºè¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; |
| | | } |
| | | |
| | | |
| | | db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå
¥å·¥ä»¶é鿥å¿è¡¨ |
| | | db.SaveChanges(); |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 工件SPCæ½æ£æ¨åº |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void WorkPieceSPCPushOff(WorkPieceLogMiddle loginfo, LogType type) |
| | | { |
| | | |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | WorkPieceLog loginfo2 = new WorkPieceLog(); |
| | | loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); |
| | | try { |
| | | if ((loginfo.WorkPieceID != null && loginfo.WorkPieceID.Trim('\0').Length == 22) |
| | | //|| !((loginfo.WorkingProcedure.Equals("OP10") || loginfo.WorkingProcedure.Equals("OP40")) && loginfo.Remarks.Length > 0) |
| | | ) |
| | | { |
| | | WorkPieceInfo info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (info == null || info.WorkPieceID.Length < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | loginfo2.Remarks = $"工件{loginfo.WorkPieceID} 工件SPCæ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"; |
| | | Log4NetHelper.WriteErrorLog(type, $"工件{loginfo.WorkPieceID} 工件SPCæ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); |
| | | return; |
| | | } |
| | | else |
| | | {//æ´æ°è¡¨WorkPieceInfo |
| | | if(loginfo.WorkingProcedure.Equals("OP10")) |
| | | { |
| | | info.WorkPieceCurrentPosition = info.WorkingProcedureCurrent + "SPC"; |
| | | //var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); |
| | | loginfo2.WorkingProcedure = info.WorkingProcedureCurrent;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | loginfo.WorkingProcedure = info.WorkingProcedureCurrent; //è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | } |
| | | else |
| | | { |
| | | info.WorkingProcedureCurrent = loginfo.WorkingProcedure; |
| | | info.WorkPieceCurrentPosition = loginfo.WorkingProcedure + "SPC"; |
| | | } |
| | | info.WorkPieceState = (int)WorkPieceState.SPCPush; |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.Now; |
| | | info.WorkingProcedureEndTime = DateTimeHelper.GetDateTime(); |
| | | if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) |
| | | { |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | |
| | | |
| | | info.WorkingProcedureCompleted = info.WorkingProcedureCompleted + loginfo.WorkingProcedure;//å·²å®æå·¥åº |
| | | info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; |
| | | } |
| | | info.Remarks = "工件SPCæ½æ£æ¨åº"; |
| | | |
| | | //æ´æ°ä¸ä¸å·¥åºçç»ææ¶é´ |
| | | var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == loginfo.WorkingProcedure && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o=>o.StartTime).FirstOrDefault(); |
| | | if (pro != null && pro.WorkPieceID.Length >0) |
| | | { |
| | | pro.EndTime = DateTimeHelper.GetDateTime(); |
| | | pro.Remarks = (pro.Remarks ?? "") + "SPCæ½æ£ç»æ"; |
| | | pro.UpdatedUserName = loginfo.MonitoringPoint; |
| | | pro.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | //æ¯æ¬¡SPC 齿å
¥è¿½æº¯è¡¨ |
| | | WorkPieceProcess process = new WorkPieceProcess(); |
| | | process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); |
| | | process.StartTime = DateTimeHelper.GetDateTime(); |
| | | process.OperationType = OperationType.SPC.ToString(); |
| | | process.QualityState = (int)QualityState.Suspected; |
| | | process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | process.CreatedUserName = loginfo.MonitoringPoint; |
| | | process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.UpdatedUserName = loginfo.MonitoringPoint; |
| | | process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.Remarks = "工件SPCæ½æ£æ¨åº"; |
| | | db.WorkPieceProcess.Add(process); |
| | | |
| | | |
| | | db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); |
| | | } |
| | | else |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"工件SPCæ½æ£æ¨åºè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; |
| | | Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}工件SPCæ½æ£æ¨åºè¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; |
| | | } |
| | | finally |
| | | { |
| | | db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå
¥å·¥ä»¶é鿥å¿è¡¨ |
| | | db.SaveChanges(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// å·¥åºå®æ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void WorkingProcedureComplete(WorkPieceLogMiddle loginfo, LogType type) |
| | | { |
| | | |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | WorkPieceLog loginfo2 = new WorkPieceLog(); |
| | | loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); |
| | | |
| | | try |
| | | { |
| | | if (loginfo.WorkPieceID != null && loginfo.WorkPieceID.Trim('\0').Length == 22) |
| | | { |
| | | bool isAddWorkPieceInfo = false; |
| | | WorkPieceInfo info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (info == null || info.WorkPieceID.Length < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° ï¼ä¸ºäºæµè¯å
å
æ°å¢ï¼ |
| | | Log4NetHelper.WriteErrorLog(type, $"工件{loginfo.WorkPieceID} 工件æ¨åºå·¥åº{loginfo.WorkingProcedure} 没æè·åå°å·¥ä»¶ä¿¡æ¯ä¸åæ´æ°"); |
| | | //db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo));//æå
¥å·¥ä»¶é鿥å¿è¡¨ |
| | | //db.SaveChanges(); |
| | | |
| | | loginfo2 = CommonManager.Instance.GetWorkPieceID(loginfo, type); |
| | | info = EntityPropHelper.Mapper<WorkPieceInfo, WorkPieceLog>(loginfo); |
| | | //EntityPropHelper<WorkPieceLog, WorkPieceInfo>.CopyProp(loginfo, info, loginfo.GetWorkPieceInfoDict()); |
| | | if (!loginfo.WorkingProcedure.Equals("OP05")) |
| | | {//å½å·¥ä»¶äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åºä¸æ¯OP05ï¼å设置为å¯çç¶æ |
| | | info.QualityState = (int)QualityState.Suspected; |
| | | info.QualityErrorInfo = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ
åµå¹¶åç¸åºå¤çï¼"; |
| | | info.Remarks = $"工件äºç»´ç ç¬¬ä¸æ¬¡åºç°çå·¥åº{loginfo.MonitoringPoint}䏿¯OP05,æ°æ®ç¼ºå¤±,请确认æ
åµå¹¶åç¸åºå¤çï¼"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityState = (int)QualityState.OK;//æ¤å¤éè¦æ³¨æï¼å¤æææå·¥åºè´¨éï¼ç¶ååèµå¼ |
| | | info.Remarks = "OP05æ°å¢å·¥ä»¶ä¿¡æ¯"; |
| | | } |
| | | info.WorkPieceinitOnlineTime = DateTimeHelper.GetDateTime();//WorkPieceInitOnlineTime |
| | | info.WorkingProcedurePlan = ConfigHelper.GetConfigString("WorkingProcedureAllStr") ?? "OP05OP10OP20OP30OP35OP40OP50OP60OP70OP80"; |
| | | info.CreatedUserName = loginfo.MonitoringPoint; |
| | | info.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | info.WorkingProcedureCurrent = loginfo.WorkingProcedure; |
| | | info.WorkingProcedureEndTime = null; |
| | | info = ParseQRCode(info); |
| | | isAddWorkPieceInfo = true; |
| | | } |
| | | if (loginfo.WorkingProcedure.Equals("OP10")) |
| | | { |
| | | //var WorkingProcedure = (loginfo.MonitoringPoint.Equals("OP1002") ? "OP10" : "OP40"); |
| | | loginfo2.WorkingProcedure = info.WorkingProcedureCurrent;//è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | loginfo.WorkingProcedure = info.WorkingProcedureCurrent; //è§£å³OP10ï¼OP40åä¸ä¸ªçé®é¢ |
| | | } |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | info.WorkingProcedureCompleted = info.WorkingProcedureCompleted + loginfo.WorkingProcedure;//å·²å®æå·¥åº |
| | | if (!(info.WorkingProcedureStartTime.HasValue && info.WorkingProcedureStartTime > DateTime.Parse("1900/01/01"))) |
| | | {//è¥ä¸ç´æ²¡æå·¥åºå¼å§æ¶é´ï¼åèµå¼å½åæ¶é´ |
| | | info.WorkingProcedureStartTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | info.WorkingProcedureEndTime= DateTimeHelper.GetDateTime(); |
| | | info.WorkPieceCurrentPositionOrder = info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) / 2; |
| | | info.Remarks = $"{loginfo.WorkingProcedure}å·¥åºå®æ"; |
| | | long op80id = 0; |
| | | if (loginfo.WorkingProcedure.Equals("OP80")) |
| | | { |
| | | info.WorkPieceState = (int)WorkPieceState.FinishedProducts; |
| | | info.WorkPieceLastOfflineTime = DateTimeHelper.GetDateTime(); |
| | | info.WorkPieceCurrentPosition = "OP80"; |
| | | info.CompleteTime = DateTimeHelper.GetDateTime(); |
| | | info.OP80NewCode = loginfo.OP80NewCode; |
| | | |
| | | info.QualityState = (int)((loginfo.QualityStateStr.Equals("OK") || loginfo.QualityStateStr.Equals("0K")) ? QualityState.OK : QualityState.NG); |
| | | loginfo.QualityState = info.QualityState; |
| | | info.QualityStateUpdateUser = loginfo.UpdatedUserName; |
| | | info.QualityStateUpdateTime = loginfo.UpdatedTime.Value.LocalDateTime; |
| | | info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | |
| | | var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (qualityData == null || qualityData.WorkPieceID.Length < 1 || qualityData.WorkingProcedure.Length < 1) |
| | | {//æå
¥QualityDataInfo表 |
| | | qualityData = EntityPropHelper.Mapper<QualityDataInfo, WorkPieceLog>(loginfo); |
| | | db.QualityDataInfo.Add(GetAddQualityDataInfo(qualityData)); |
| | | } |
| | | //ä¿®æ¹QualityDataInfo表 //é夿¶å°è´¨éä¿¡æ¯ï¼ä¼è¦çä¹åç |
| | | EntityPropHelper<WorkPieceLogMiddle, QualityDataInfo>.CopyProp(loginfo, qualityData, GetQualityDataInfoUpdate(loginfo.WorkingProcedure, loginfo.MonitoringPoint));//æå®ä¿®æ¹å段 |
| | | |
| | | qualityData.QualityStateUpdateUser = info.UpdatedUserName; |
| | | qualityData.QualityReceiveTime = info.UpdatedTime.Value.LocalDateTime; |
| | | qualityData.QualityStateUpdateMode = info.QualityStateUpdateMode; |
| | | qualityData.OP80QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP80QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | qualityData.OP80QualityFilePath = loginfo.OP80QualityFilePath; |
| | | op80id = qualityData.Id; |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éï¼{loginfo.QualityStateStr ?? "空"}"; |
| | | if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) |
| | | { |
| | | info.QualityErrorInfo = $"{loginfo.WorkingProcedure}å·¥åºè´¨éééæ°æ®ä¸åæ ¼"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityErrorInfo = ""; |
| | | } |
| | | } |
| | | else if(loginfo.WorkingProcedure.Equals("OP30")) |
| | | { |
| | | |
| | | info.QualityState = (int)((loginfo.QualityStateStr.Equals("OK") || loginfo.QualityStateStr.Equals("0K")) ? QualityState.OK : QualityState.NG); |
| | | loginfo.QualityState = info.QualityState; |
| | | info.QualityStateUpdateUser = loginfo.UpdatedUserName; |
| | | info.QualityStateUpdateTime = loginfo.UpdatedTime.Value.LocalDateTime; |
| | | info.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | |
| | | var qualityData = db.QualityDataInfo.Where(o => o.WorkPieceID == loginfo.WorkPieceID).FirstOrDefault(); |
| | | if (qualityData == null || qualityData.WorkPieceID.Length < 1 || qualityData.WorkingProcedure.Length < 1) |
| | | {//æå
¥QualityDataInfo表 |
| | | qualityData = EntityPropHelper.Mapper<QualityDataInfo, WorkPieceLog>(loginfo); |
| | | db.QualityDataInfo.Add(GetAddQualityDataInfo(qualityData)); |
| | | } |
| | | qualityData.QualityStateUpdateUser = info.UpdatedUserName; |
| | | qualityData.QualityReceiveTime = info.UpdatedTime.Value.LocalDateTime; |
| | | qualityData.QualityStateUpdateMode = info.QualityStateUpdateMode; |
| | | qualityData.OP30QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value.ToString() : "3"; |
| | | qualityData.OP30QualityReceiveTime = DateTimeHelper.GetDateTime(); |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"è´¨éï¼{loginfo.QualityStateStr ?? "空"}"; |
| | | if (!info.QualityState.Equals(((int)QualityState.OK).ToString())) |
| | | { |
| | | info.QualityErrorInfo = $"{loginfo.WorkingProcedure}å·¥åºè´¨éééæ°æ®ä¸åæ ¼"; |
| | | } |
| | | else |
| | | { |
| | | info.QualityErrorInfo = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | info.WorkPieceState = (int)WorkPieceState.WIP; |
| | | if (info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure) + 4 <= info.WorkingProcedurePlan.Length) |
| | | { |
| | | info.WorkPieceCurrentPosition = info.WorkingProcedurePlan.Substring(info.WorkingProcedurePlan.IndexOf(loginfo.WorkingProcedure), 8); |
| | | } |
| | | } |
| | | |
| | | var pro = db.WorkPieceProcess.Where(o => o.WorkPieceID == loginfo.WorkPieceID && o.WorkingProcedureCurrent == info.WorkingProcedureCurrent && o.OperationType == OperationType.ç产.ToString()).OrderByDescending(o=>o.StartTime).FirstOrDefault(); |
| | | if (pro == null || pro.WorkPieceID.Length < 1) |
| | | { |
| | | WorkPieceProcess process = new WorkPieceProcess(); |
| | | process = EntityPropHelper.Mapper<WorkPieceProcess, WorkPieceInfo>(info); |
| | | process.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | process.StartTime = DateTimeHelper.GetDateTime(); |
| | | process.EndTime = DateTimeHelper.GetDateTime(); |
| | | process.QualityState = loginfo.QualityState.HasValue ? loginfo.QualityState.Value : (int)QualityState.OK; |
| | | process.CreatedUserName = loginfo.MonitoringPoint; |
| | | process.CreatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.UpdatedUserName = loginfo.MonitoringPoint; |
| | | process.UpdatedTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | process.OperationType = OperationType.ç产.ToString(); |
| | | process.Remarks = ""; |
| | | if(op80id>0) |
| | | { |
| | | process.QualityDataInfoID = op80id; |
| | | } |
| | | db.WorkPieceProcess.Add(process); |
| | | } |
| | | else |
| | | { |
| | | if (op80id > 0) |
| | | { |
| | | pro.QualityDataInfoID = op80id; |
| | | } |
| | | pro.EndTime = DateTimeHelper.GetDateTime(); |
| | | pro.UpdatedUserName = loginfo.MonitoringPoint; |
| | | pro.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | |
| | | |
| | | if (isAddWorkPieceInfo) |
| | | { |
| | | db.WorkPieceInfo.Add(info); |
| | | } |
| | | db.WorkPieceInfoLog.Add(GetAddWorkPieceInfoLog(info)); |
| | | } |
| | | else |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"ä¸çº¿å®æè¯»åäºç»´ç {loginfo.WorkPieceID ?? "空"}å¼å¸¸"; |
| | | Log4NetHelper.WriteErrorLog(type, $" {loginfo.WorkingProcedure}å·¥åºä¸çº¿ 读åå·¥ä»¶ç æ°æ®[{loginfo.WorkPieceID ?? "空"}]æ¶å¼å¸¸ï¼"); |
| | | |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"读åäºç»´ç {loginfo.WorkPieceID ?? "空"}æ´æ°æ°æ®å¼å¸¸{e.Message}"; |
| | | } |
| | | db.WorkPieceLog.Add(GetAddWorkPieceLog(loginfo2));//æå
¥å·¥ä»¶é鿥å¿è¡¨ |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | public static void AlertMonitor(WorkPieceLog loginfo, LogType type) |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 设å¤åè¦çæ§ï¼æ¸
æ´æ¶²ï¼ååæ¶²ï¼åå
·åè¦çï¼ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void AlertMonitor(LogType type) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | bool isAddAlert = false; |
| | | try { |
| | | |
| | | var equipmentlist = db.EquipmentBaseInfo.Where(o=>o.IsDeleted==false).ToList(); |
| | | var alertlist = db.v_get_equipment_alert.Where(o => o.IsDeleted == false).ToList(); |
| | | var knifetoolbase = db.KnifeToolBaseInfo.Where(o => o.IsDeleted == false).ToList(); |
| | | var knifetoolinfo= db.KnifeToolEquipmentInfo.Where(o => o.IsDeleted == false).ToList(); |
| | | //var knifelist = db.KnifeToolEquipmentInfo.GroupJoin(db.KnifeToolBaseInfo.Where(o => o.IsDeleted == false).ToList(), a => a.EquipmentID, b => b.EquipmentID, (a, b) => new { a,b}) |
| | | //.SelectMany(ab => ab.b.DefaultIfEmpty(), (ab, b) => new { ab.a, b.KnifeToolChangeAlertThreshold,b.KnifeToolLife }) |
| | | //.Where(o => o.a.IsDeleted == false) |
| | | //.ToList(); |
| | | foreach (var item in equipmentlist) |
| | | { |
| | | try |
| | | { |
| | | var alert = alertlist.Where(o => o.EquipmentId.Equals(item.EquipmentId)).FirstOrDefault(); |
| | | if (alert==null||alert.Id<1) |
| | | { |
| | | alert = EntityPropHelper.Mapper<v_get_equipment_alert, EquipmentBaseInfo>(item); |
| | | isAddAlert=true; |
| | | } |
| | | //if(item.WorkingProcedure.Equals("OP70")) |
| | | { |
| | | if (item.Detergentchangetime.HasValue) |
| | | { |
| | | if (item.Detergentchangetime.Value.AddDays(item.DetergentChangeAlertThreshold).Date <= DateTime.Now.Date) |
| | | {//op70æ¸
æ´æ¶²åè¦ |
| | | alert.IsAlertDetergent = true; |
| | | alert.Detergentchangetime = item.Detergentchangetime; |
| | | alert.DetergentChangeAlertThreshold = item.DetergentChangeAlertThreshold; |
| | | alert.DetergentChangeCycle = item.DetergentChangeCycle; |
| | | alert.DetergentDesc = $"设å¤ã{item.EquipmentName}ãæ¸
æ´æ¶²ææ°æ´æ¢æ¶é´ä¸ºã{item.Detergentchangetime.Value}ãï¼å·²è¾¾å°åè¦éå¼ï¼è¯·æ³¨æï¼"; |
| | | } |
| | | else |
| | | { |
| | | alert.IsAlertDetergent = false; |
| | | alert.DetergentDesc = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | alert.IsAlertDetergent = false; |
| | | alert.DetergentDesc = ""; |
| | | } |
| | | } |
| | | //if (!item.WorkingProcedure.Equals("OP05")&& !item.WorkingProcedure.Equals("OP30") && !item.WorkingProcedure.Equals("OP70") && !item.WorkingProcedure.Equals("OP80")) |
| | | { |
| | | if(item.CuttingFluidChangeTime.HasValue) |
| | | { |
| | | if (item.CuttingFluidChangeTime.Value.AddDays(item.CuttingFluidChangeAlertThreshold).Date <= DateTime.Now.Date) |
| | | {//ååæ¶²åè¦ |
| | | alert.IsAlertCuttingFluid = true; |
| | | alert.CuttingFluidChangeTime = item.CuttingFluidChangeTime; |
| | | alert.CuttingFluidChangeAlertThreshold = item.CuttingFluidChangeAlertThreshold; |
| | | alert.CuttingFluidDesc = $"设å¤ã{item.EquipmentName}ãååæ¶²ææ°æ´æ¢æ¶é´ä¸ºã{item.CuttingFluidChangeTime.Value}ãï¼å·²è¾¾å°åè¦éå¼ï¼è¯·æ³¨æï¼"; |
| | | } |
| | | else |
| | | { |
| | | alert.IsAlertCuttingFluid = false; |
| | | alert.CuttingFluidDesc = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | alert.IsAlertCuttingFluid = false; |
| | | alert.CuttingFluidDesc = ""; |
| | | } |
| | | } |
| | | bool flag = false; |
| | | string desc = $"设å¤ã{item.EquipmentName}ã"; |
| | | foreach (var knife in knifetoolinfo.Where(o=>o.EquipmentID.Equals(item.EquipmentId))) |
| | | { |
| | | var list = knifetoolbase.Where(o => o.KnifeToolID.Equals(knife.KnifeToolID)).FirstOrDefault(); |
| | | if(list!=null) |
| | | { |
| | | if ((knife.CurrentLife + list.KnifeToolChangeAlertThreshold) >= list.KnifeToolLife) |
| | | {//åå
·åè¦ |
| | | flag = true; |
| | | alert.IsAlertKnifeTool = true; |
| | | alert.KnifeToolChangeAlertThreshold = list.KnifeToolChangeAlertThreshold; |
| | | desc += $"\r\nå·¥ä½ã{knife.Station}ãä¸åå
·ã{knife.KnifeToolID}ã计å寿å½ã{list.KnifeToolLife}ãæ¬¡ï¼å½å已使ç¨å¯¿å½ã{knife.CurrentLife}ãæ¬¡ï¼å·²è¾¾å°åè¦éå¼ï¼è¯·æ³¨æï¼"; |
| | | } |
| | | } |
| | | } |
| | | if(!flag) |
| | | {//没æåå
·åè¦ |
| | | alert.IsAlertKnifeTool = false; |
| | | alert.KnifeToolDesc = ""; |
| | | } |
| | | else |
| | | { |
| | | alert.IsAlertKnifeTool = true; |
| | | alert.KnifeToolDesc = desc; |
| | | } |
| | | |
| | | EquipmentCurrentMonitor info = new EquipmentCurrentMonitor(); |
| | | info = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == item.EquipmentId).FirstOrDefault(); |
| | | if (info == null || info.Id < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | Log4NetHelper.WriteErrorLog(type, $"设å¤{item.EquipmentId} 计ç®åè¦{item.WorkingProcedure} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼"); |
| | | } |
| | | else |
| | | { |
| | | if(string.IsNullOrEmpty(info.Alertmsg)) |
| | | { |
| | | alert.IsAlert = false; |
| | | alert.AlertDesc = ""; |
| | | } |
| | | else |
| | | { |
| | | alert.IsAlert = true; |
| | | alert.AlertDesc = info.Alertmsg; |
| | | } |
| | | } |
| | | if (isAddAlert) |
| | | { |
| | | db.v_get_equipment_alert.Add(alert); |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | | |
| | | Log4NetHelper.WriteErrorLog(type, $" {item.EquipmentName}设å¤è®¡ç®åè¦æ¶å¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $" 设å¤åè¦çæ§ï¼æ¸
æ´æ¶²ï¼ååæ¶²ï¼åå
·åè¦çï¼ è®¡ç®æ¶å¼å¸¸ï¼{e.Message} {e.StackTrace}"); |
| | | } |
| | | |
| | | |
| | | |
| | | //db.WorkPieceLog.Add(loginfo2);//æå
¥è®¾å¤é鿥å¿è¡¨ |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设å¤çæ§ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void EquipmentMonitor(WorkPieceLogMiddle loginfo, LogType type) |
| | | { |
| | | |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | var loginfo2 = EntityPropHelper.Mapper<WorkPieceLog, WorkPieceLogMiddle>(loginfo); |
| | | try |
| | | { |
| | | bool isAddEquipmentCurrentMonitor = false; |
| | | EquipmentCurrentMonitor info = new EquipmentCurrentMonitor(); |
| | | info = db.EquipmentCurrentMonitor.Where(o => o.EquipmentID == loginfo.EquipmentID).FirstOrDefault(); |
| | | if (info == null || info.Id < 1) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.MonitoringPoint} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); |
| | | info = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLogMiddle>(loginfo); |
| | | isAddEquipmentCurrentMonitor = true; |
| | | } |
| | | //ææ°è®¾å¤ç¶æ |
| | | string State = ""; |
| | | //OP20,OP30,OP35,OP50,OP60ççé½ä¸åºååè¦åmessageï¼ä½codeé½ä¸ä¼éå¤ï¼æä»¥æ¬å¤å°±ä¸éè¦å¤æåè¦ç±»åäº |
| | | var codelist = db.EquipmentFailureCode.Where(o => o.WorkingProcedure.Equals(loginfo.WorkingProcedure)).ToList(); |
| | | |
| | | #region æ
é代ç å¤ç |
| | | List<long> Failueslist = new List<long>(); |
| | | Failueslist.Add(loginfo.FailureType1); |
| | | Failueslist.Add(loginfo.FailureType2); |
| | | Failueslist.Add(loginfo.FailureType3); |
| | | Failueslist.Add(loginfo.FailureType4); |
| | | Failueslist.Add(loginfo.FailureType5); |
| | | Failueslist.Add(loginfo.FailureType6); |
| | | Failueslist.Add(loginfo.FailureType7); |
| | | Failueslist.Add(loginfo.FailureType8); |
| | | Failueslist.Add(loginfo.FailureType9); |
| | | Failueslist.Add(loginfo.FailureType10); |
| | | Failueslist.Add(loginfo.FailureType11); |
| | | Failueslist.Add(loginfo.FailureType12); |
| | | Failueslist.Add(loginfo.FailureType13); |
| | | Failueslist.Add(loginfo.FailureType14); |
| | | Failueslist.Add(loginfo.FailureType15); |
| | | Failueslist.Add(loginfo.FailureType16); |
| | | Failueslist.Add(loginfo.FailureType17); |
| | | Failueslist.Add(loginfo.FailureType18); |
| | | Failueslist.Add(loginfo.FailureType19); |
| | | Failueslist.Add(loginfo.FailureType20); |
| | | Failueslist.RemoveAll(o => o == 0); |
| | | string faultall = ""; |
| | | string faultmsg = ""; |
| | | int i = 1; |
| | | foreach (var failues in Failueslist) |
| | | { |
| | | faultall += (failues + "\r\n"); |
| | | EquipmentFailureCode codeinfo = codelist.Where(o => o.Code == failues.ToString()).FirstOrDefault(); |
| | | if (codeinfo != null && codeinfo.Code.Length > 0) |
| | | { |
| | | faultmsg += (i.ToString() + "." + (codeinfo.CodeDesc ?? codeinfo.Code) + "\r\n"); |
| | | } |
| | | else |
| | | { |
| | | faultmsg += (i.ToString() + "." + failues.ToString() + "\r\n"); |
| | | } |
| | | i++; |
| | | } |
| | | //var faultall = string.Join("\r\n", Failueslist.OrderBy(o=>o)); |
| | | #endregion |
| | | #region åè¦ä»£ç å¤ç |
| | | |
| | | List<long> Alertlist = new List<long>(); |
| | | Alertlist.Add(loginfo.FailureMessage1); |
| | | Alertlist.Add(loginfo.FailureMessage2); |
| | | Alertlist.Add(loginfo.FailureMessage3); |
| | | Alertlist.Add(loginfo.FailureMessage4); |
| | | Alertlist.Add(loginfo.FailureMessage5); |
| | | Alertlist.Add(loginfo.FailureMessage6); |
| | | Alertlist.Add(loginfo.FailureMessage7); |
| | | Alertlist.Add(loginfo.FailureMessage8); |
| | | Alertlist.Add(loginfo.FailureMessage9); |
| | | Alertlist.Add(loginfo.FailureMessage10); |
| | | Alertlist.Add(loginfo.FailureMessage11); |
| | | Alertlist.Add(loginfo.FailureMessage12); |
| | | Alertlist.Add(loginfo.FailureMessage13); |
| | | Alertlist.Add(loginfo.FailureMessage14); |
| | | Alertlist.Add(loginfo.FailureMessage15); |
| | | Alertlist.Add(loginfo.FailureMessage16); |
| | | Alertlist.Add(loginfo.FailureMessage17); |
| | | Alertlist.Add(loginfo.FailureMessage18); |
| | | Alertlist.Add(loginfo.FailureMessage19); |
| | | Alertlist.Add(loginfo.FailureMessage20); |
| | | Alertlist.RemoveAll(o => o == 0); |
| | | string alertall = ""; |
| | | string warnmsg = ""; |
| | | i = 1; |
| | | foreach(var alert in Alertlist) |
| | | { |
| | | alertall+=(alert+"\r\n"); |
| | | var codeinfo=codelist.Where(o => o.Code == alert.ToString()).FirstOrDefault(); |
| | | if(codeinfo!=null&&codeinfo.Code.Length>0) |
| | | { |
| | | warnmsg += (i.ToString()+"."+(codeinfo.CodeDesc ?? codeinfo.Code) + "\r\n"); |
| | | } |
| | | else |
| | | { |
| | | warnmsg += (i.ToString() + "." + alert.ToString() + "\r\n"); |
| | | } |
| | | i++; |
| | | } |
| | | #endregion |
| | | //var alertall = string.Join("\r\n", Alertlist.OrderBy(o=>o)); |
| | | |
| | | |
| | | EquipmentWorkingLog infolog = new EquipmentWorkingLog(); |
| | | infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | infolog.LogAddTime = DateTimeHelper.GetDateTime(); |
| | | infolog.WorkPieceLogID = loginfo2.Id; |
| | | infolog.EquipmentID = info.EquipmentID; |
| | | bool isAddEquipmentWorkingLog = false; |
| | | |
| | | bool isStatechange = false; |
| | | |
| | | #region 设å¤ç¶æå¤ç |
| | | |
| | | //æ
éãè¦åãå
¶ä» |
| | | if (loginfo.IsCloseAlert) |
| | | {//æ
é |
| | | info.AlertTime = info.AlertTime ?? DateTime.Now; |
| | | info.FailureType = ""; |
| | | info.WarnType = ""; |
| | | info.Alertmsg = faultmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | info.FailureType = faultall; |
| | | State = ((int)EnumEquipmentCurrentStateDisplay.æ
é).ToString(); |
| | | |
| | | |
| | | //infolog.FailureStartTime = DateTimeHelper.GetDateTime(); |
| | | //infolog.FailureType = faultall; |
| | | //infolog.FailureMsg = faultmsg; |
| | | if (loginfo.IsMessage) |
| | | { |
| | | info.WarnTime = info.WarnTime ?? DateTime.Now; |
| | | info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | info.WarnType = alertall; |
| | | } |
| | | } |
| | | //else if (loginfo.IsMessage) |
| | | //{//è¦å |
| | | // info.AlertTime = null; |
| | | // info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.FailureType = ""; |
| | | |
| | | // info.WarnTime = info.WarnTime ?? DateTime.Now; |
| | | // info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.WarnType = alertall; |
| | | |
| | | // //infolog.WarnStartTime = DateTimeHelper.GetDateTime(); |
| | | // //infolog.WarnType = alertall; |
| | | // //infolog.Warnmsg = warnmsg; |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.è¦å).ToString(); |
| | | //} |
| | | else |
| | | {//åè¦ç»æï¼è·åæåè¦çæ°æ®ï¼ç¶åå
³éä» |
| | | info.AlertTime = null; |
| | | info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | info.FailureType = ""; |
| | | info.WarnType = ""; |
| | | info.WarnTime = null; |
| | | info.Warnmsg = ""; |
| | | if (loginfo.IsMessage) |
| | | {//è¦åä¼è¦çä¸é¢çç¶æï¼å
ä¸ç¨è¦åäº |
| | | info.WarnTime = info.WarnTime ?? DateTime.Now; |
| | | info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | info.WarnType = alertall; |
| | | } |
| | | if (info.EquipmentCurrentState==null||(!info.EquipmentCurrentState.Equals(((int)EnumEquipmentCurrentStateDisplay.离线).ToString()))) |
| | | {//å¦æè®¾å¤ç¶æä¸ºç¦»çº¿ï¼åæ¤å¤ä¸éè¦å¤æä»»ä½ä¿¡æ¯ |
| | | if (loginfo.IsNormalProduction && !loginfo.LackMaterial && !loginfo.FullMaterial) |
| | | {//èªå¨è¿è¡ç¶æ+ä¸ç¼ºæ+ä¸å µæ |
| | | State = ((int)EnumEquipmentCurrentStateDisplay.ç产).ToString(); |
| | | } |
| | | else if (loginfo.IsNormalProduction && loginfo.FullMaterial) |
| | | {//èªå¨è¿è¡ç¶æ+䏿鿻¡æ = 宿 ï¼å°±æ¯æçäº§åºæ¥ä½æ²¡æåºè®¾å¤ï¼ |
| | | State = ((int)EnumEquipmentCurrentStateDisplay.宿).ToString(); |
| | | } |
| | | //else if (loginfo.IsNormalProduction && loginfo.LackMaterial) |
| | | //{//å
¶ä»ç¶æå
¨ç®å¾
æº |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.å¾
æº).ToString(); |
| | | //} |
| | | else |
| | | {//å
¶ä»ç¶æå
¨ç®å¾
æº |
| | | State = ((int)EnumEquipmentCurrentStateDisplay.å¾
æº).ToString(); |
| | | } |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(State) && State != info.EquipmentCurrentState) |
| | | {//åªæç¶æåºç°ååæåæ´,ç¶æåæ´ï¼è¯å®ææ°ç䏿¡æ°æ® |
| | | |
| | | //ç¶æåæ´ï¼è·åæ§ç¶æçä¿¡æ¯ï¼è¥æåæ´æ°(åç¡®ç说ï¼åªè¦æ²¡æç»ææ¶é´ç设å¤ç¶æé½éè¦æ´æ°ç»ææ¶é´ï¼ä»¥ä¾¿äºæå
¥æ°çæ°æ®) |
| | | var equlogState = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue && (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) |
| | | //&& o.EquipmentState== info.EquipmentCurrentState |
| | | ) |
| | | .OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); |
| | | |
| | | if (equlogState != null) |
| | | { |
| | | equlogState.MonitoringPoint = loginfo.MonitoringPoint; |
| | | equlogState.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.Now; |
| | | info.EquipmentCurrentState = State; |
| | | |
| | | //ç¶æåæ´ï¼éè¦æ´æ°åæ¥çï¼è¯å®ä¼æå
¥æ°ç |
| | | infolog.EquipmentState = State; |
| | | infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); |
| | | infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´3"; |
| | | infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(State)).ToString()}\r\n"; |
| | | isAddEquipmentWorkingLog = true; |
| | | isStatechange=true; |
| | | } |
| | | #endregion |
| | | |
| | | //1.ææ
é忝æ
éç¶æï¼ ææ
éä¿¡æ¯+åè¦ä¿¡æ¯ |
| | | //2.没ææ
éæåè¦åæ¯åè¦ç¶æï¼æåè¦ä¿¡æ¯ |
| | | //3.峿²¡æ
éï¼ä¹æ²¡åè¦ï¼åæ¯å
¶ä»ç¶æ |
| | | |
| | | //æ¥æ¾æ¯å¦ææªç»æçæ
é |
| | | var equlogFailure = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | && o.FailureStartTime != null && o.FailureStartTime != DateTime.MinValue && (o.FailureEndTime == null || o.FailureEndTime == DateTime.MinValue)) |
| | | .OrderByDescending(o => o.FailureStartTime).FirstOrDefault(); |
| | | if (loginfo.IsCloseAlert) |
| | | {//ææ
éæ å¿ä½ï¼è®¾å¤ç¶æè¥æåæ´åè¯å®ææ°å¢ï¼æ¤å¤ç´æ¥æ´æ°å³å¯ |
| | | //ææ
éæ å¿ä½ï¼è®¾å¤ç¶æè¥æ²¡ææ´æ°ï¼ææ
éï¼ä¹ä¸ä¼æå
¥æ°çï¼ææ
é设å¤ç¶æåæ´è¯å®æ¯åææ
éï¼ |
| | | infolog.FailureStartTime = DateTimeHelper.GetDateTime(); |
| | | infolog.FailureType = faultall; |
| | | infolog.FailureMsg = faultmsg; |
| | | infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | infolog.Remarks = "æ
éä¿¡æ¯åºç°åæ´1"; |
| | | infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + "æ
éä¿¡æ¯åæ´\r\n"; |
| | | } |
| | | else |
| | | { |
| | | if (equlogFailure != null) |
| | | {//æ
éå
³éç |
| | | equlogFailure.MonitoringPoint = loginfo.MonitoringPoint; |
| | | equlogFailure.FailureEndTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | } |
| | | |
| | | //æ¥æ¾æ¯å¦ææªç»æçåè¦ |
| | | var equlogalert = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | && o.WarnStartTime != null && o.WarnStartTime != DateTime.MinValue && (o.WarnEndTime == null|| o.WarnEndTime == DateTime.MinValue)) |
| | | .OrderByDescending(o => o.WarnStartTime).FirstOrDefault(); |
| | | if (loginfo.IsMessage) |
| | | {//è¥æåè¦ï¼å¦ææè®¾å¤ç¶æåæ´ï¼è¯å®æå
¥ï¼æ¤å¤åªä¿®æ¹å³å¯ |
| | | //è¥æåè¦ï¼å¦æè®¾å¤ç¶ææ²¡æåæ´ï¼æåè¦ï¼ä¹ä¸æå
¥æ°çï¼é®é¢ï¼å½ç¶ææ²¡ææ´æ¹ï¼å¦ä¸ç´æ¯æ
éï¼ä½åè¦ä¿¡æ¯æååï¼æä¹å psï¼æ¤å¤å
ä¸ç®¡ï¼ |
| | | infolog.WarnStartTime = DateTimeHelper.GetDateTime(); |
| | | infolog.WarnType = alertall; |
| | | infolog.Warnmsg = warnmsg; |
| | | infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´2"; |
| | | infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + "åè¦ä¿¡æ¯åæ´\r\n"; |
| | | } |
| | | else |
| | | { |
| | | if (equlogalert != null) |
| | | {//æ
éå
³éç |
| | | equlogalert.MonitoringPoint = loginfo.MonitoringPoint; |
| | | equlogalert.WarnEndTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | } |
| | | #region 忥ç代ç ï¼ä»¥åå æ |
| | | |
| | | //EquipmentWorkingLog infolog =new EquipmentWorkingLog(); |
| | | //infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | //infolog.LogAddTime = DateTimeHelper.GetDateTime(); |
| | | //infolog.WorkPieceLogID = loginfo2.Id; |
| | | //infolog.EquipmentID = info.EquipmentID; |
| | | //bool isAddEquipmentWorkingLog = false; |
| | | //if (loginfo.ischeckAlertStatus) |
| | | //{//åè¦ç¶æåçåæ´ |
| | | // //è¯´ææ¯ä¸ä¸ªæ°åè¦ï¼éè¦æ´æ°è®¾å¤çæ§è¡¨ |
| | | // //æ¥æ¾æªç»æçåè¦ |
| | | // var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | // && o.FailureStartTime != null && o.FailureStartTime != DateTime.MinValue) |
| | | // .OrderByDescending(o=>o.FailureStartTime).FirstOrDefault(); |
| | | // if (loginfo.IsCloseAlert) |
| | | // { |
| | | // if (equlog == null|| (equlog.FailureEndTime!=null&& equlog.FailureEndTime > DateTime.MinValue)) |
| | | // { |
| | | // info.AlertTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | // infolog.FailureStartTime = DateTimeHelper.GetDateTime(); |
| | | // infolog.FailureType = faultall; |
| | | // infolog.FailureMsg = faultmsg; |
| | | // infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | // infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | // infolog.Remarks = "æ
éä¿¡æ¯åºç°åæ´1"; |
| | | // infolog.UpdateDesc = (infolog.UpdateDesc??"")+"æ
éä¿¡æ¯åæ´\r\n"; |
| | | // isAddEquipmentWorkingLog =true; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // if (equlog != null && (equlog.FailureEndTime == null || equlog.FailureEndTime <= DateTime.MinValue)) |
| | | // {//åè¦å
³éçï¼è¥æ²¡æåè¦ä¿¡æ¯ï¼ä¸ç¨ç®¡ |
| | | // equlog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | // equlog.FailureEndTime = DateTimeHelper.GetDateTime(); |
| | | // } |
| | | |
| | | // } |
| | | //} |
| | | //if (loginfo.ischeckMessageStatus) |
| | | //{//åè¦ç¶æåçåæ´ |
| | | // //è¯´ææ¯ä¸ä¸ªæ°åè¦ï¼éè¦æ´æ°è®¾å¤çæ§è¡¨ |
| | | // //æ¥æ¾æªç»æçåè¦ |
| | | // var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | // && o.WarnStartTime != null && o.WarnStartTime != DateTime.MinValue).OrderByDescending(o => o.WarnStartTime).FirstOrDefault(); |
| | | // if (loginfo.IsMessage) |
| | | // { |
| | | // if (equlog == null || (equlog.WarnEndTime != null && equlog.WarnEndTime > DateTime.MinValue)) |
| | | // { |
| | | // info.WarnTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local); |
| | | // infolog.WarnStartTime = DateTimeHelper.GetDateTime(); |
| | | // infolog.WarnType = alertall; |
| | | // infolog.Warnmsg = warnmsg; |
| | | // infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | // infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | // infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´2"; |
| | | // infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + "åè¦ä¿¡æ¯åæ´\r\n"; |
| | | // isAddEquipmentWorkingLog = true; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // if (equlog != null && (equlog.WarnEndTime == null || equlog.WarnEndTime <= DateTime.MinValue)) |
| | | // {//åè¦å
³éçï¼è¥æ²¡æåè¦ä¿¡æ¯ï¼ä¸ç¨ç®¡ |
| | | // equlog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | // equlog.WarnEndTime = DateTimeHelper.GetDateTime(); |
| | | // } |
| | | |
| | | // } |
| | | //} |
| | | ////æ
éãè¦åãå
¶ä» |
| | | //if (loginfo.IsCloseAlert) |
| | | //{//æ
é |
| | | // info.AlertTime = info.AlertTime??DateTime.Now; |
| | | // info.FailureType = ""; |
| | | // info.WarnType = ""; |
| | | // info.Alertmsg = faultmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.FailureType = faultall; |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.æ
é).ToString(); |
| | | |
| | | |
| | | // infolog.FailureStartTime = DateTimeHelper.GetDateTime(); |
| | | // infolog.FailureType = faultall; |
| | | // infolog.FailureMsg = faultmsg; |
| | | // if (loginfo.IsMessage) |
| | | // { |
| | | // info.WarnTime = info.WarnTime ?? DateTime.Now; |
| | | // info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.WarnType = alertall; |
| | | // } |
| | | //} |
| | | //else if(loginfo.IsMessage) |
| | | //{//è¦å |
| | | // info.AlertTime = null; |
| | | // info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.FailureType = ""; |
| | | |
| | | // info.WarnTime = info.WarnTime ?? DateTime.Now; |
| | | // info.Warnmsg = warnmsg;//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.WarnType = alertall; |
| | | |
| | | // infolog.WarnStartTime = DateTimeHelper.GetDateTime(); |
| | | // infolog.WarnType = alertall; |
| | | // infolog.Warnmsg = warnmsg; |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.è¦å).ToString(); |
| | | //} |
| | | //else |
| | | //{//åè¦ç»æï¼è·åæåè¦çæ°æ®ï¼ç¶åå
³éä» |
| | | // info.AlertTime = null; |
| | | // info.Alertmsg = "";//è¿ä¸ªéè¦ä»£ç 对åºåå
¸ç»´æ¤ä¿¡æ¯æç¥é |
| | | // info.FailureType = ""; |
| | | // info.WarnType = ""; |
| | | // info.WarnTime = null; |
| | | // info.Warnmsg = ""; |
| | | // if (loginfo.IsNormalProduction&& loginfo.LackMaterial) |
| | | // { |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.å¾
æº).ToString(); |
| | | // } |
| | | // else if(loginfo.IsNormalProduction && !loginfo.LackMaterial) |
| | | // { |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.ç产).ToString(); |
| | | // } |
| | | // else if(loginfo.IsNormalProduction && loginfo.FullMaterial) |
| | | // {//æ£å¸¸ç产+䏿鿻¡æ = 宿 ï¼å°±æ¯æçäº§åºæ¥ä½æ²¡æåºè®¾å¤ï¼ |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.宿).ToString(); |
| | | // } |
| | | // else |
| | | // {//ç论ä¸ä¸å¯è½èµ°å°è¿ï¼åªæ¯é¿å
ç©ºå¼ |
| | | // State = ((int)EnumEquipmentCurrentStateDisplay.å¾
æº).ToString(); |
| | | // } |
| | | //} |
| | | //if (!string.IsNullOrEmpty(State) && State != info.EquipmentCurrentState) |
| | | //{//åªæç¶æåºç°ååæåæ´ |
| | | // info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | // info.UpdatedTime = DateTime.Now; |
| | | // info.EquipmentCurrentState = State; |
| | | |
| | | // var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | // && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); |
| | | |
| | | // if (equlog != null && (equlog.EquipmentStateEndTime == null || equlog.EquipmentStateEndTime <= DateTime.MinValue)) |
| | | // { |
| | | // equlog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | // equlog.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); |
| | | |
| | | // } |
| | | // //ç¶æåæ´ï¼éè¦æ´æ°åæ¥çï¼å¹¶æå
¥æ°ç |
| | | // infolog.EquipmentState = State; |
| | | // infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); |
| | | // infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | // infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | // infolog.Remarks = "åè¦ä¿¡æ¯åºç°åæ´3"; |
| | | // infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(State)).ToString()}\r\n"; |
| | | // isAddEquipmentWorkingLog = true; |
| | | //} |
| | | ////info.Remarks = $"{loginfo.WorkingProcedure}å·¥åºåè¦"; |
| | | #endregion |
| | | if (isAddEquipmentCurrentMonitor) |
| | | { |
| | | info.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | db.EquipmentCurrentMonitor.Add(info); |
| | | } |
| | | if(isAddEquipmentWorkingLog) |
| | | { |
| | | db.EquipmentWorkingLog.Add(infolog); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | loginfo2.Remarks = (loginfo2.Remarks ?? "") + $"{loginfo2.MonitoringPoint}设å¤çæ§æ´æ°æ°æ®å¼å¸¸{e.Message}.{e.StackTrace}"; |
| | | Log4NetHelper.WriteErrorLog(type, $"{loginfo2.MonitoringPoint}设å¤çæ§æ´æ°æ°æ®å¼å¸¸{e.Message}.{e.StackTrace}"); |
| | | } |
| | | |
| | | //db.WorkPieceLog.Add(loginfo2);//æå
¥è®¾å¤é鿥å¿è¡¨ |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¿è·³çæ§ |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static void EquipmentBeartBeatMonitor(WorkPieceLogMiddle loginfo, LogType type) |
| | | { |
| | | |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | bool isAddEquipmentCurrentMonitor = false; |
| | | EquipmentCurrentMonitor info = new EquipmentCurrentMonitor(); |
| | | info = db.EquipmentCurrentMonitor.Where(o => o.WorkingProcedure == loginfo.WorkingProcedure).FirstOrDefault(); |
| | | if (info == null) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | Log4NetHelper.WriteErrorLog(type, $"设å¤{loginfo.EquipmentID} åè¦çæ§{loginfo.MonitoringPoint} 没æè·åå°è®¾å¤çæ§ä¿¡æ¯ï¼ç°æ°å¢"); |
| | | info = EntityPropHelper.Mapper<EquipmentCurrentMonitor, WorkPieceLogMiddle>(loginfo); |
| | | isAddEquipmentCurrentMonitor = true; |
| | | info.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.å¾
æº).ToString(); |
| | | info.IsDeleted = false; |
| | | } |
| | | string state = ""; |
| | | |
| | | |
| | | EquipmentWorkingLog infolog = new EquipmentWorkingLog(); |
| | | infolog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | infolog.LogAddTime = DateTimeHelper.GetDateTime(); |
| | | infolog.WorkPieceLogID = loginfo.Id; |
| | | infolog.EquipmentID = info.EquipmentID; |
| | | bool isAddEquipmentWorkingLog = false; |
| | | |
| | | if (!loginfo.IsConnect) |
| | | {//ææ°ç¶æä¸ºç¦»çº¿ |
| | | state = ((int)EnumEquipmentCurrentStateDisplay.离线).ToString(); |
| | | info.EquipmentCurrentState = state; |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.Now; |
| | | info.Alertmsg = "设å¤ç¦»çº¿"; |
| | | info.AlertTime= DateTimeHelper.GetDateTime(); |
| | | info.FailureType = ""; |
| | | |
| | | //è¥æ²¡æç¦»çº¿çä¿¡æ¯ï¼åæ°å¢ä¸æ¡ |
| | | var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue &&(o.EquipmentStateEndTime==null||o.EquipmentStateEndTime==DateTime.MinValue) |
| | | &&o.EquipmentState.Equals(state) |
| | | ).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); |
| | | |
| | | if (equlog == null) |
| | | { |
| | | infolog.EquipmentState = state; |
| | | infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); |
| | | infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | infolog.Remarks = "离线"; |
| | | infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(state)).ToString()}\r\n"; |
| | | isAddEquipmentWorkingLog = true; |
| | | } |
| | | //è¥æé离线çç¶ææ°æ®ï¼åæ´æ° |
| | | var equlog2 = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue && (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) |
| | | && !o.EquipmentState.Equals(state) |
| | | ).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); |
| | | if (equlog2 != null) |
| | | { |
| | | equlog2.MonitoringPoint = loginfo.MonitoringPoint; |
| | | equlog2.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); |
| | | } |
| | | |
| | | } |
| | | else |
| | | {//ææ°ç¶æä¸ºå¼æº |
| | | if(((int)EnumEquipmentCurrentStateDisplay.离线).ToString() == info.EquipmentCurrentState) |
| | | {//åªæç¦»çº¿ç¶æï¼æè½åæå¼æº |
| | | state = ((int)EnumEquipmentCurrentStateDisplay.å¾
æº).ToString(); |
| | | info.EquipmentCurrentState = state; |
| | | info.UpdatedUserName = loginfo.MonitoringPoint; |
| | | info.UpdatedTime = DateTime.Now; |
| | | info.Alertmsg = ""; |
| | | info.AlertTime = null; |
| | | |
| | | //æç¦»çº¿çæ°æ®ï¼åæ´æ° |
| | | var equlog = db.EquipmentWorkingLog.Where(o => o.EquipmentID == loginfo.EquipmentID |
| | | && o.EquipmentStateStartTime != null && o.EquipmentStateStartTime != DateTime.MinValue&& (o.EquipmentStateEndTime == null || o.EquipmentStateEndTime == DateTime.MinValue) |
| | | && o.EquipmentState.Equals(((int)EnumEquipmentCurrentStateDisplay.离线).ToString()) |
| | | ).OrderByDescending(o => o.EquipmentStateStartTime).FirstOrDefault(); |
| | | if (equlog != null) |
| | | { |
| | | equlog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | equlog.EquipmentStateEndTime = DateTimeHelper.GetDateTime(); |
| | | |
| | | } |
| | | //离线å弿ºï¼è¯å®ä¼æå
¥ä¸æ¡ |
| | | infolog.EquipmentState = state; |
| | | infolog.EquipmentStateStartTime = DateTimeHelper.GetDateTime(); |
| | | infolog.WorkingProcedure = loginfo.WorkingProcedure; |
| | | infolog.MonitoringPoint = loginfo.MonitoringPoint; |
| | | infolog.Remarks = "弿º"; |
| | | infolog.UpdateDesc = (infolog.UpdateDesc ?? "") + $"设å¤ç¶æåæ´ä¸º{((EnumEquipmentCurrentStateDisplay)int.Parse(state)).ToString()}\r\n"; |
| | | isAddEquipmentWorkingLog = true; |
| | | } |
| | | } |
| | | if (isAddEquipmentWorkingLog) |
| | | { |
| | | db.EquipmentWorkingLog.Add(infolog); |
| | | } |
| | | if (isAddEquipmentCurrentMonitor) |
| | | { |
| | | info.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | db.EquipmentCurrentMonitor.Add(info); |
| | | } |
| | | |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | |
| | | public static void ThreadMonitor(ThreadStatusMonitorMiddle threadinfo) |
| | | { |
| | | ThreadMonitor(EntityPropHelper.Mapper<ThreadStatusMonitor, ThreadStatusMonitorMiddle>(threadinfo)); |
| | | try |
| | | { |
| | | SystemValue.UpdateMainList(threadinfo); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | public static void ThreadMonitor(ThreadStatusMonitor threadinfo) |
| | | { |
| | | try |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | var info = db.ThreadStatusMonitor.Where(o => o.Threadcode == threadinfo.Threadcode).FirstOrDefault(); |
| | | if (info == null || info.Id==0) |
| | | {//没æå·¥ä»¶ä¿¡æ¯ï¼ä¸åæ´æ° |
| | | threadinfo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | threadinfo.CreatedTime= DateTimeHelper.GetDateTime(); |
| | | threadinfo.CreatedUserName = threadinfo.Threadcode; |
| | | db.ThreadStatusMonitor.Add(threadinfo); |
| | | |
| | | } |
| | | else |
| | | {//æ´æ°è¡¨WorkPieceInfo |
| | | info.Remarks = threadinfo.Remarks; |
| | | info.ErrorMsg = threadinfo.ErrorMsg; |
| | | info.Threadendtime = DateTimeHelper.GetDateTime();//æ¯æ¬¡é½æ´æ° |
| | | info.ThreadId = threadinfo.ThreadId; |
| | | info.ThreadFrequency = threadinfo.ThreadFrequency; |
| | | info.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | info.UpdatedUserName = threadinfo.Threadcode; |
| | | info.Threadlastmodifytime = threadinfo.Threadlastmodifytime > DateTime.MinValue ? threadinfo.Threadlastmodifytime : info.Threadlastmodifytime;//妿æä¼ ååæ´æ° |
| | | //if (info.Threadstatue==1) |
| | | //{ |
| | | // info.Threadlastmodifytime = DateTimeHelper.GetDateTime();//ææ°è·å°æ°æ® |
| | | //} |
| | | } |
| | | db.SaveChanges(); |
| | | } |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | #region ä¸å¡æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// dictä¸åé¢ä¸ä¸ªæ¯å对象ï¼åé¢ä¸ä¸ªæ¯ç®æ 对象 |
| | | /// </summary> |
| | | /// <param name="WorkingProcedure"></param> |
| | | /// <returns></returns> |
| | | public static Dictionary<string, string> GetQualityDataInfoUpdate(string WorkingProcedure="",string MonitoringPoint="") |
| | | { |
| | | Dictionary<string, string> dict = new Dictionary<string, string>(); |
| | | |
| | | dict.Add("QualityState", "QualityState"); |
| | | dict.Add("EquipmentID", "EquipmentID"); |
| | | dict.Add("WorkingProcedure", "WorkingProcedure"); |
| | | dict.Add("QualityStateUpdateMode", "QualityStateUpdateMode"); |
| | | dict.Add("QualityStateUpdateUser", "QualityStateUpdateUser"); |
| | | dict.Add("OfflineTime", "OfflineTime"); |
| | | |
| | | switch (WorkingProcedure) |
| | | { |
| | | case "OP10": |
| | | dict.Add("QualityOP10To1", "QualityOP10To1"); |
| | | break; |
| | | case "OP20": |
| | | dict.Add("QualityOP20To1", "QualityOP20To1"); |
| | | break; |
| | | case "OP30": |
| | | switch (MonitoringPoint) |
| | | { |
| | | case "OP3002CH3": |
| | | dict.Add("QualityOP30To1", "QualityOP30To1"); |
| | | break; |
| | | case "OP3002CH4": |
| | | dict.Add("QualityOP30To2", "QualityOP30To2"); |
| | | dict.Add("QualityOP30To8", "QualityOP30To8"); |
| | | break; |
| | | case "OP3002CH5": |
| | | dict.Add("QualityOP30To3", "QualityOP30To3"); |
| | | dict.Add("QualityOP30To4", "QualityOP30To4"); |
| | | dict.Add("QualityOP30To5", "QualityOP30To5"); |
| | | dict.Add("QualityOP30To9", "QualityOP30To9"); |
| | | dict.Add("QualityOP30To10", "QualityOP30To10"); |
| | | dict.Add("QualityOP30To11", "QualityOP30To11"); |
| | | break; |
| | | case "OP3002CH6": |
| | | dict.Add("QualityOP30To6", "QualityOP30To6"); |
| | | dict.Add("QualityOP30To7", "QualityOP30To7"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | break; |
| | | case "OP35": |
| | | dict.Add("QualityOP35To1", "QualityOP35To1"); |
| | | dict.Add("QualityOP35To2", "QualityOP35To2"); |
| | | break; |
| | | case "OP40": |
| | | dict.Add("QualityOP40To1", "QualityOP40To1"); |
| | | break; |
| | | case "OP60": |
| | | dict.Add("QualityOP60To1", "QualityOP60To1"); |
| | | dict.Add("QualityOP60To2", "QualityOP60To2"); |
| | | break; |
| | | case "OP70": |
| | | dict.Add("QualityOP70To1", "QualityOP70To1"); |
| | | dict.Add("QualityOP70To2", "QualityOP70To2"); |
| | | dict.Add("QualityOP70To3", "QualityOP70To3"); |
| | | break; |
| | | case "OP80": |
| | | //dict.Add("OP80NewCode", "OP80NewCode"); |
| | | dict.Add("QualityOP80To1", "QualityOP80To1"); |
| | | dict.Add("QualityOP80To2", "QualityOP80To2"); |
| | | dict.Add("QualityOP80To3", "QualityOP80To3"); |
| | | dict.Add("QualityOP80To4", "QualityOP80To4"); |
| | | dict.Add("QualityOP80To5", "QualityOP80To5"); |
| | | dict.Add("QualityOP80To6", "QualityOP80To6"); |
| | | dict.Add("QualityOP80To7", "QualityOP80To7"); |
| | | dict.Add("QualityOP80To8", "QualityOP80To8"); |
| | | dict.Add("QualityOP80To9", "QualityOP80To9"); |
| | | dict.Add("QualityOP80To10", "QualityOP80To10"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return dict; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿æ¯å¦è·³åº |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <param name="type"></param> |
| | | public static bool CheckQualityInfoComplete(WorkPieceInfo info, WorkPieceLog loginfo, LogType type) |
| | | { |
| | | //夿æ¯å¦è·³åº |
| | | if (info == null || info.WorkPieceID.Length < 1) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶ä¿¡æ¯{loginfo.WorkPieceID}å·¥åºæ¯å¦è·³åºæ¶ï¼ä¼ å
¥å·¥ä»¶ä¿¡æ¯å¼å¸¸"); |
| | | return true;//没åå°å·¥ä»¶ä¿¡æ¯ï¼ä¸å夿æ¯å¦è·³åº |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | string wproStr = info.WorkingProcedureCurrent + loginfo.WorkingProcedure; |
| | | if (wproStr.Length != 8) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åº æ¯å¦è·³åºæ¶ï¼å·¥åºæ¼æ¥æé®é¢é¿åº¦ä¸ä¸º8ä½:{wproStr}"); |
| | | return true;//å·¥åºæ¼æ¥æé®é¢ |
| | | } |
| | | if (!ConfigHelper.GetConfigString("WorkingProcedureAllStr").Contains(wproStr)) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åº åºç°è·³åºï¼è¯·è®¾å¤æ³¨æ:{wproStr}"); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(type, $"æ ¡éªå·¥ä»¶{info.WorkPieceID} {loginfo.WorkingProcedure}å·¥åº æ¯å¦è·³åºæ¶åºç°å¼å¸¸", ex); |
| | | } |
| | | } |
| | | return true; |
| | | |
| | | //using (var trans = db.Database.BeginTransaction()) |
| | | //{ } |
| | | |
| | | //var conStr = @"server=localhost;Database=EFDBO1;User ID=sa;Password=123456;"; |
| | | //using (var connection = new SqlConnection(conStr)) |
| | | //{ |
| | | // connection.Open(); |
| | | // using (var scope = new Transactionscope()) |
| | | // { |
| | | |
| | | // //AD0.Net |
| | | // var command = connection.CreateCommand(); |
| | | // command.CommandText = "DELETE FROM T_RoleInfor"; |
| | | // command.ExecuteNonQuery(); |
| | | // //综åæäº¤ |
| | | // scope.complete(); |
| | | // } |
| | | //} |
| | | } |
| | | /// <summary> |
| | | /// è§£æäºç»´ç |
| | | |
| | | /// </summary> |
| | | /// <param name="loginfo"></param> |
| | | /// <returns></returns> |
| | | public static WorkPieceInfo ParseQRCode(WorkPieceInfo loginfo) |
| | | { |
| | | if(string.IsNullOrEmpty(loginfo.WorkPieceID)|| loginfo.WorkPieceID.Length!=22) |
| | | { |
| | | return loginfo; |
| | | } |
| | | loginfo.WorkPieceIDTo1 = loginfo.WorkPieceID.Substring(0, 2); |
| | | loginfo.WorkPieceIDTo2 = loginfo.WorkPieceID.Substring(2, 4); |
| | | loginfo.WorkPieceIDTo3 = loginfo.WorkPieceID.Substring(6, 6); |
| | | loginfo.WorkPieceIDTo4 = loginfo.WorkPieceID.Substring(12, 2); |
| | | loginfo.WorkPieceIDTo5 = loginfo.WorkPieceID.Substring(14, 4); |
| | | loginfo.WorkPieceIDTo6 = loginfo.WorkPieceID.Substring(18, 2); |
| | | loginfo.WorkPieceIDTo7 = loginfo.WorkPieceID.Substring(20, 2); |
| | | return loginfo; |
| | | } |
| | | #endregion |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.DLA.Dao; |
| | | using iWare_SCADA_Model; |
| | | using log4net; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.BLL |
| | | { |
| | | public class WorkPieceLogManager//: CommonService<WorkPieceLog, WorkPieceLog,DbModel> |
| | | { |
| | | public static List<WorkPieceLog> GetWorkPieceLog(string WorkPieceID) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | //æ¥è¯¢ææ |
| | | var query = db.WorkPieceLog.Where(o=>o.WorkPieceID== WorkPieceID).ToList(); |
| | | return query; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static long InsertWorkPieceLog(WorkPieceLog workPiece) |
| | | { |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | db.WorkPieceLog.Add(workPiece); |
| | | db.SaveChanges(); |
| | | return workPiece.Id; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using System.Collections.Generic; |
| | | using System.Data.SqlClient; |
| | | |
| | | using System.Data.Entity; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.DLA.Dao |
| | | { |
| | | /// <summary> |
| | | /// å
¬ç¨æ¹æ³çæ½è±¡ç±» |
| | | /// å¼ å± |
| | | /// </summary> |
| | | /// <typeparam name="T">èªå®ä¹çå®ä½ç±»</typeparam> |
| | | /// <typeparam name="S">ORMä¸çå®ä½ç±»</typeparam> |
| | | public abstract class CommonDao<T, S> where T : class, ICommonEntity<S> where S : class |
| | | { |
| | | |
| | | #region éè¦å¨åç±»ä¸å®ç°çæ½è±¡æ¹æ³ |
| | | /// <summary> |
| | | /// è¯¥æ¹æ³è·åå¨èªå®ä¹å®ä½åORMèªå¨çæå®ä½ä¹é´å段ç对åºå
³ç³» |
| | | /// </summary> |
| | | protected abstract string GetColumnName(string name); |
| | | |
| | | /// <summary> |
| | | /// è·åTä¸å±æ§åå表 |
| | | /// </summary> |
| | | /// <returns>Tä¸å±æ§åå表</returns> |
| | | protected abstract List<string> GetColumnNames(); |
| | | |
| | | /// <summary> |
| | | /// è¯¥æ¹æ³å°OrmçS对象转æ¢ä¸ºèªå®ä¹ç±»åTç对象 |
| | | /// </summary> |
| | | /// <param name="s">Ormä¸çSå®ä½çå®ä¾</param> |
| | | /// <returns>èªå®ä¹çTç±»åå®ä¾</returns> |
| | | protected abstract T ToEntity(S s); |
| | | |
| | | /// <summary> |
| | | /// è¯¥æ¹æ³å°å®ä¹ç±»åTçS对象转æ¢ä¸ºèªOrmç对象 |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹Tç±»åç对象</param> |
| | | /// <returns>Ormä¸Sç对象</returns> |
| | | protected abstract S ToOrm(T t); |
| | | |
| | | /// <summary> |
| | | /// è¯¥æ¹æ³è·åå¨èªå®ä¹å®ä½åORMèªå¨çæå®ä½ä¹é´å段ç对åºå
³ç³» |
| | | /// </summary> |
| | | protected abstract string GetTableName(); |
| | | #endregion |
| | | |
| | | #region æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶æ¥è¯¢èªå®ä¹å®ä½Tçå表 |
| | | /// </summary> |
| | | /// <param name="param">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="msg">é误信æ¯</param> |
| | | /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> |
| | | public virtual List<T> QueryByParam(QueryParam param, DbContext dbModel) |
| | | { |
| | | var res = new List<T>(); |
| | | var filter = param.Filter == null || param.Filter.Count <= 0 ? new Dictionary<string, object>() : param.Filter; |
| | | var notfilter = param.NotFilter == null || param.NotFilter.Count <= 0 ? new Dictionary<string, object>() : param.NotFilter; |
| | | var search = param.Search == null || param.Search.Count <= 0 ? new Dictionary<string, object>() : param.Search; |
| | | |
| | | var leqd = param.Leqd == null || param.Leqd.Count <= 0 ? new Dictionary<string, object>() : param.Leqd; |
| | | var geqd = param.Geqd == null || param.Geqd.Count <= 0 ? new Dictionary<string, object>() : param.Geqd; |
| | | var ltd = param.Ltd == null || param.Ltd.Count <= 0 ? new Dictionary<string, object>() : param.Ltd; |
| | | var gtd = param.Gtd == null || param.Gtd.Count <= 0 ? new Dictionary<string, object>() : param.Gtd; |
| | | var leq = param.Leq == null || param.Leq.Count <= 0 ? new Dictionary<string, object>() : param.Leq; |
| | | var geq = param.Geq == null || param.Geq.Count <= 0 ? new Dictionary<string, object>() : param.Geq; |
| | | var lt = param.Lt == null || param.Lt.Count <= 0 ? new Dictionary<string, object>() : param.Lt; |
| | | var gt = param.Gt == null || param.Gt.Count <= 0 ? new Dictionary<string, object>() : param.Gt; |
| | | var neq = param.Neq == null || param.Neq.Count <= 0 ? new Dictionary<string, object>() : param.Neq; |
| | | var order = param.Order == null || param.Order.Count <= 0 ? new Dictionary<string, object>() { { "Id", "DESC" } } : param.Order; |
| | | |
| | | var sql = string.Format("SELECT * FROM {0} WHERE 1=1", GetTableName()); |
| | | |
| | | var sqlParams = new List<SqlParameter>(); |
| | | |
| | | foreach (var key in filter.Keys) |
| | | { |
| | | if (filter[key] != null && !string.IsNullOrEmpty(filter[key] + "")) |
| | | { |
| | | |
| | | sqlParams.Add(new SqlParameter(("@F_" + key), filter[key])); |
| | | sql += string.Format(" AND {0} = {1}", GetColumnName(key), "@F_" + key); |
| | | } |
| | | } |
| | | foreach (var key in notfilter.Keys) |
| | | { |
| | | if (notfilter[key] != null && !string.IsNullOrEmpty(notfilter[key] + "")) |
| | | { |
| | | |
| | | sqlParams.Add(new SqlParameter(("@F_" + key), notfilter[key])); |
| | | sql += string.Format(" AND {0} != {1}", GetColumnName(key), "@F_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in search.Keys) |
| | | { |
| | | if (search[key] != null && !string.IsNullOrEmpty(search[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@S_" + key, "%" + search[key] + "%")); |
| | | sql += string.Format(" AND {0} LIKE {1}", GetColumnName(key), "@S_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in leqd.Keys) |
| | | { |
| | | if (leqd[key] != null && !string.IsNullOrEmpty(leqd[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@LEQD_" + key, leqd[key])); |
| | | sql += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQD_" + key); |
| | | } |
| | | } |
| | | |
| | | |
| | | foreach (var key in geqd.Keys) |
| | | { |
| | | if (geqd[key] != null && !string.IsNullOrEmpty(geqd[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@GEQD_" + key, geqd[key])); |
| | | sql += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in ltd.Keys) |
| | | { |
| | | if (ltd[key] != null && !string.IsNullOrEmpty(ltd[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@LTD_" + key, ltd[key])); |
| | | sql += string.Format(" AND {0} < {1}", GetColumnName(key), "@LTD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in gtd.Keys) |
| | | { |
| | | if (gtd[key] != null && !string.IsNullOrEmpty(gtd[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@GTD_" + key, gtd[key])); |
| | | sql += string.Format(" AND {0} > {1}", GetColumnName(key), "@GTD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in leq.Keys) |
| | | { |
| | | if (leq[key] != null && !string.IsNullOrEmpty(leq[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@LEQ_" + key, leq[key])); |
| | | sql += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQ_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in geq.Keys) |
| | | { |
| | | if (geq[key] != null && !string.IsNullOrEmpty(geq[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@GEQ_" + key, geq[key])); |
| | | sql += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQ_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in lt.Keys) |
| | | { |
| | | if (lt[key] != null && !string.IsNullOrEmpty(lt[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@LT_" + key, lt[key])); |
| | | sql += string.Format(" AND {0} < {1}", GetColumnName(key), "@LT_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in gt.Keys) |
| | | { |
| | | if (gt[key] != null && !string.IsNullOrEmpty(gt[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@GT_" + key, gt[key])); |
| | | sql += string.Format(" AND {0} > {1}", GetColumnName(key), "@GT_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in neq.Keys) |
| | | { |
| | | if (neq[key] != null && !string.IsNullOrEmpty(neq[key] + "")) |
| | | { |
| | | sqlParams.Add(new SqlParameter("@NEQ_" + key, neq[key])); |
| | | sql += string.Format(" AND {0} <> {1}", GetColumnName(key), "@NEQ_" + key); |
| | | } |
| | | } |
| | | |
| | | sql += " ORDER BY "; |
| | | |
| | | foreach (var key in order.Keys) |
| | | { |
| | | |
| | | var value = string.IsNullOrEmpty(order[key].ToString()) ? "DESC" : order[key].ToString().ToUpper(); |
| | | |
| | | sqlParams.Add(new SqlParameter("@O_" + key, order[key])); |
| | | sql += string.Format("{0} {1},", GetColumnName(key), value); |
| | | |
| | | } |
| | | |
| | | if (sql.EndsWith(",")) |
| | | { |
| | | sql = sql.Substring(0, sql.Length - 1); |
| | | } |
| | | var datas = dbModel.Database.SqlQuery<S>(sql, sqlParams.ToArray()).ToList(); |
| | | datas.ForEach(x => res.Add(ToEntity(x))); |
| | | |
| | | |
| | | return res; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region æ ¹æ®æ¡ä»¶å页æ¥è¯¢ |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶å页æ¥è¯¢èªå®ä¹å®ä½Tçå表ï¼åæ¶è¿åè®°å½çæ»æ¡æ°åå½åæå¨çé¡µæ° |
| | | /// </summary> |
| | | /// <param name="param">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <param name="totalNum">è®°å½çæ»æ¡æ°</param> |
| | | /// <param name="currentPage">å½å页颿°</param> |
| | | /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> |
| | | public virtual List<T> QueryByParam(QueryParam param, DbContext dbModel, out int totalNum, out int currentPage) |
| | | { |
| | | |
| | | totalNum = 0; |
| | | currentPage = 1; |
| | | |
| | | var res = new List<T>(); |
| | | |
| | | var filter = param.Filter == null || param.Filter.Count <= 0 ? new Dictionary<string, object>() : param.Filter; |
| | | var search = param.Search == null || param.Search.Count <= 0 ? new Dictionary<string, object>() : param.Search; |
| | | |
| | | var leqd = param.Leqd == null || param.Leqd.Count <= 0 ? new Dictionary<string, object>() : param.Leqd; |
| | | var geqd = param.Geqd == null || param.Geqd.Count <= 0 ? new Dictionary<string, object>() : param.Geqd; |
| | | var ltd = param.Ltd == null || param.Ltd.Count <= 0 ? new Dictionary<string, object>() : param.Ltd; |
| | | var gtd = param.Gtd == null || param.Gtd.Count <= 0 ? new Dictionary<string, object>() : param.Gtd; |
| | | var leq = param.Leq == null || param.Leq.Count <= 0 ? new Dictionary<string, object>() : param.Leq; |
| | | var geq = param.Geq == null || param.Geq.Count <= 0 ? new Dictionary<string, object>() : param.Geq; |
| | | var lt = param.Lt == null || param.Lt.Count <= 0 ? new Dictionary<string, object>() : param.Lt; |
| | | var gt = param.Gt == null || param.Gt.Count <= 0 ? new Dictionary<string, object>() : param.Gt; |
| | | var neq = param.Neq == null || param.Neq.Count <= 0 ? new Dictionary<string, object>() : param.Neq; |
| | | var pageIndex = param.PageIndex < 1 ? 1 : param.PageIndex; |
| | | var pageSize = param.PageSize < 1 ? 5 : param.PageSize; |
| | | var order = param.Order == null || param.Order.Count <= 0 ? new Dictionary<string, object>() { { "Id", "DESC" } } : param.Order; |
| | | |
| | | //æ¥è¯¢æ°éçsqlè¯å¥ |
| | | var sqlCount = string.Format("SELECT COUNT(*) FROM {0} WHERE 1=1", GetTableName()); |
| | | |
| | | //æ¥è¯¢æ°é使ç¨çsqlåæ°å表 |
| | | var sqlParamsCount = new List<SqlParameter>(); |
| | | |
| | | var orderStr = ""; |
| | | |
| | | |
| | | foreach (var key in order.Keys) |
| | | { |
| | | var value = string.IsNullOrEmpty(order[key].ToString()) ? "DESC" : order[key].ToString().ToUpper(); |
| | | sqlParamsCount.Add(new SqlParameter("@O_" + key, order[key])); |
| | | orderStr += string.Format("{0} {1},", GetColumnName(key), value); |
| | | } |
| | | |
| | | if (orderStr.EndsWith(",")) |
| | | { |
| | | orderStr = orderStr.Substring(0, orderStr.Length - 1); |
| | | } |
| | | |
| | | //æ¥è¯¢è®°å½å表çsqlè¯å¥ |
| | | var sqlData = string.Format("SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY {0} ) AS ROWNUM from {1} where 1=1", orderStr, GetTableName()); |
| | | |
| | | //æ¥è¯¢è®°å½å表使ç¨çsqlåæ°å表 |
| | | var sqlParamsData = new List<SqlParameter>(); |
| | | |
| | | foreach (var key in filter.Keys) |
| | | { |
| | | if (filter[key] != null && !string.IsNullOrEmpty(filter[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@F_" + key, filter[key])); |
| | | sqlParamsData.Add(new SqlParameter("@F_" + key, filter[key])); |
| | | sqlCount += string.Format(" AND {0} = {1}", GetColumnName(key), "@F_" + key); |
| | | sqlData += string.Format(" AND {0} = {1}", GetColumnName(key), "@F_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in search.Keys) |
| | | { |
| | | if (search[key] != null && !string.IsNullOrEmpty(search[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@S_" + key, "%" + search[key] + "%")); |
| | | sqlParamsData.Add(new SqlParameter("@S_" + key, "%" + search[key] + "%")); |
| | | sqlCount += string.Format(" AND {0} LIKE {1}", GetColumnName(key), "@S_" + key); |
| | | sqlData += string.Format(" AND {0} LIKE {1}", GetColumnName(key), "@S_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in leqd.Keys) |
| | | { |
| | | if (leqd[key] != null && !string.IsNullOrEmpty(leqd[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@LEQD_" + key, leqd[key])); |
| | | sqlParamsData.Add(new SqlParameter("@LEQD_" + key, leqd[key])); |
| | | sqlCount += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQD_" + key); |
| | | sqlData += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in geqd.Keys) |
| | | { |
| | | if (geqd[key] != null && !string.IsNullOrEmpty(geqd[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@GEQD_" + key, geqd[key])); |
| | | sqlParamsData.Add(new SqlParameter("@GEQD_" + key, geqd[key])); |
| | | sqlCount += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQD_" + key); |
| | | sqlData += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in ltd.Keys) |
| | | { |
| | | if (ltd[key] != null && !string.IsNullOrEmpty(ltd[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@LTD_" + key, ltd[key])); |
| | | sqlParamsData.Add(new SqlParameter("@LTD_" + key, ltd[key])); |
| | | sqlCount += string.Format(" AND {0} < {1}", GetColumnName(key), "@LTD_" + key); |
| | | sqlData += string.Format(" AND {0} < {1}", GetColumnName(key), "@LTD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in gtd.Keys) |
| | | { |
| | | if (gtd[key] != null && !string.IsNullOrEmpty(gtd[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@GTD_" + key, gtd[key])); |
| | | sqlParamsData.Add(new SqlParameter("@GTD_" + key, gtd[key])); |
| | | sqlCount += string.Format(" AND {0} > {1}", GetColumnName(key), "@GTD_" + key); |
| | | sqlData += string.Format(" AND {0} > {1}", GetColumnName(key), "@GTD_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in leq.Keys) |
| | | { |
| | | if (leq[key] != null && !string.IsNullOrEmpty(leq[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@LEQ_" + key, leq[key])); |
| | | sqlParamsData.Add(new SqlParameter("@LEQ_" + key, leq[key])); |
| | | sqlCount += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQ_" + key); |
| | | sqlData += string.Format(" AND {0} <= {1}", GetColumnName(key), "@LEQ_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in geq.Keys) |
| | | { |
| | | if (geq[key] != null && !string.IsNullOrEmpty(geq[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@GEQ_" + key, geq[key])); |
| | | sqlParamsData.Add(new SqlParameter("@GEQ_" + key, geq[key])); |
| | | sqlCount += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQ_" + key); |
| | | sqlData += string.Format(" AND {0} >= {1}", GetColumnName(key), "@GEQ_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in lt.Keys) |
| | | { |
| | | if (lt[key] != null && !string.IsNullOrEmpty(lt[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@LT_" + key, lt[key])); |
| | | sqlParamsData.Add(new SqlParameter("@LT_" + key, lt[key])); |
| | | sqlCount += string.Format(" AND {0} < {1}", GetColumnName(key), "@LT_" + key); |
| | | sqlData += string.Format(" AND {0} < {1}", GetColumnName(key), "@LT_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in gt.Keys) |
| | | { |
| | | if (gt[key] != null && !string.IsNullOrEmpty(gt[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@GT_" + key, gt[key])); |
| | | sqlParamsData.Add(new SqlParameter("@GT_" + key, gt[key])); |
| | | sqlCount += string.Format(" AND {0} > {1}", GetColumnName(key), "@GT_" + key); |
| | | sqlData += string.Format(" AND {0} > {1}", GetColumnName(key), "@GT_" + key); |
| | | } |
| | | } |
| | | |
| | | foreach (var key in neq.Keys) |
| | | { |
| | | if (neq[key] != null && !string.IsNullOrEmpty(neq[key] + "")) |
| | | { |
| | | sqlParamsCount.Add(new SqlParameter("@NEQ_" + key, neq[key])); |
| | | sqlParamsData.Add(new SqlParameter("@NEQ_" + key, neq[key])); |
| | | sqlCount += string.Format(" AND {0} <> {1}", GetColumnName(key), "@NEQ_" + key); |
| | | sqlData += string.Format(" AND {0} <> {1}", GetColumnName(key), "@NEQ_" + key); |
| | | } |
| | | } |
| | | |
| | | totalNum = dbModel.Database.SqlQuery<int>(sqlCount, sqlParamsCount.ToArray()).ToList()[0]; |
| | | |
| | | int totalPage = Convert.ToInt32(totalNum / pageSize); |
| | | |
| | | if ((totalNum % pageSize) > 0) |
| | | { |
| | | totalPage += 1; |
| | | } |
| | | |
| | | currentPage = pageIndex > totalPage ? totalPage : pageIndex; |
| | | currentPage = Math.Max(currentPage,1); |
| | | sqlParamsData.Add(new SqlParameter("@PI_Start", (currentPage - 1) * pageSize + 1)); |
| | | sqlParamsData.Add(new SqlParameter("@PI_End", currentPage * pageSize)); |
| | | sqlData += string.Format(") t Where t.ROWNUM between {0} and {1} ", "@PI_Start", "@PI_End"); |
| | | |
| | | var datas = dbModel.Database.SqlQuery<S>(sqlData, sqlParamsData.ToArray()).ToList(); |
| | | |
| | | |
| | | |
| | | datas.ForEach(x => res.Add(ToEntity(x))); |
| | | return res; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region æå
¥æ°ç对象 |
| | | |
| | | /// <summary> |
| | | /// å°èªå®ä¹çå®ä½Tçå®ä¾å表æ¹éä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="ts">èªå®ä¹ç±»åTçå®ä¾å表</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>ä¿åçæ°é</returns> |
| | | public virtual int Save(List<T> ts, DbContext dbModel) |
| | | { |
| | | if (ts == null) |
| | | { |
| | | return 0; |
| | | } |
| | | ts.ForEach(x => dbModel.Set<S>().Add(ToOrm(x))); |
| | | dbModel.SaveChanges(); |
| | | return ts.Count; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å°èªå®ä¹çå®ä½Tçå®ä¾ä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>æ°æ·»å T对象çid</returns> |
| | | public virtual int Save(T t, DbContext dbModel) |
| | | { |
| | | var s = ToOrm(t); |
| | | dbModel.Set<S>().Add(s); |
| | | dbModel.SaveChanges(); |
| | | return ToEntity(s).Id; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹å¯¹è±¡ |
| | | /// <summary> |
| | | /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>éæ¹å®ä½çid</returns> |
| | | public virtual int Update(T t, DbContext dbModel) |
| | | { |
| | | var entry = dbModel.Entry<S>(ToOrm(t)); |
| | | entry.State = System.Data.Entity.EntityState.Unchanged; |
| | | var propStrs = GetColumnNames(); |
| | | propStrs.ForEach(x => entry.Property(GetColumnName(x)).IsModified = true); |
| | | dbModel.SaveChanges(); |
| | | return t.Id; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>éæ¹å®ä½çid</returns> |
| | | /// |
| | | public virtual int Update(List<T> ts, DbContext dbModel) |
| | | { |
| | | foreach (var t in ts) |
| | | { |
| | | var entry = dbModel.Entry<S>(ToOrm(t)); |
| | | entry.State = System.Data.Entity.EntityState.Unchanged; |
| | | var propStrs = GetColumnNames(); |
| | | propStrs.ForEach(x => entry.Property(GetColumnName(x)).IsModified = true); |
| | | } |
| | | dbModel.SaveChanges(); |
| | | return ts.Count; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å é¤å¯¹è±¡ |
| | | |
| | | /// <summary> |
| | | /// 仿°æ®åºä¸å é¤ä¸»é®ä¸ºidçè®°å½ |
| | | /// </summary> |
| | | /// <param name="id">éè¦å é¤å¯¹è±¡çid</param> |
| | | /// <param name="msg">å¼å¸¸é误信æ¯</param> |
| | | /// <returns>被å é¤å¯¹è±¡ç主é®</returns> |
| | | public virtual int Delete(int id, DbContext dbModel) |
| | | { |
| | | var count = Delete(new List<int> { id }, dbModel); |
| | | return id; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 仿°æ®åºä¸æ¹éå é¤ä¸»é®å表为idsçè®°å½ |
| | | /// </summary> |
| | | /// <param name="id">éè¦å é¤å¯¹è±¡çidå表</param> |
| | | /// <param name="msg">å¼å¸¸é误信æ¯</param> |
| | | /// <returns>被å é¤å¯¹è±¡çæ°é</returns> |
| | | public virtual int Delete(List<int> ids, DbContext dbModel) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | var t = Activator.CreateInstance(typeof(T)); |
| | | ((T)t).Id = id; |
| | | var s = ToOrm((T)t); |
| | | dbModel.Set<S>().Attach(s); |
| | | dbModel.Set<S>().Remove(s); |
| | | } |
| | | |
| | | |
| | | dbModel.SaveChanges(); |
| | | return ids.Count; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region æ¼è£
åå
¸ |
| | | /// <summary> |
| | | /// å°æ»¡è¶³æ¡ä»¶çTç±»åæ¼è£
æä»¥id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå
¸ |
| | | /// </summary> |
| | | /// <param name="param">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>以id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå
¸</returns> |
| | | public virtual Dictionary<int, T> ToDictionary(QueryParam param, DbContext dbModel) |
| | | { |
| | | var res = new Dictionary<int, T>(); |
| | | var datas = QueryByParam(param, dbModel); |
| | | datas.ForEach(x => res.Add(x.Id,x)); |
| | | return res; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.Properties; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Entity; |
| | | using System.Data.Entity.Validation; |
| | | using System.Linq; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.DLA.Dao |
| | | { |
| | | /// <summary> |
| | | /// å
¬ç¨æ¹æ³çæ½è±¡ç±» |
| | | /// å¼ å± |
| | | /// </summary> |
| | | /// <typeparam name="T">èªå®ä¹çå®ä½ç±»</typeparam> |
| | | /// <typeparam name="S">ORMä¸çå®ä½ç±»</typeparam> |
| | | public abstract class CommonService<T, S, D>:IService<T> where T : class, ICommonEntity<S> where S : class where D: DbContext,IDisposable |
| | | { |
| | | |
| | | |
| | | #region éè¦å¨åç±»ä¸å®ç°çæ½è±¡æ¹æ³ |
| | | |
| | | |
| | | private CommonDao<T, S> CommonDao; |
| | | |
| | | public CommonService(CommonDao<T, S> commonDao) |
| | | { |
| | | this.CommonDao = commonDao; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶æ¥è¯¢èªå®ä¹å®ä½Tçå表 |
| | | /// </summary> |
| | | /// <param name="param">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="msg">é误信æ¯</param> |
| | | /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> |
| | | public virtual List<T> QueryByParam(QueryParam param, out string msg) |
| | | { |
| | | msg = ""; |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.QueryByParam(param, dbModel); |
| | | } |
| | | |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", msg); |
| | | return new List<T>(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", ex.Message); |
| | | return new List<T>(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region æ ¹æ®æ¡ä»¶å页æ¥è¯¢ |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶å页æ¥è¯¢èªå®ä¹å®ä½Tçå表ï¼åæ¶è¿åè®°å½çæ»æ¡æ°åå½åæå¨çé¡µæ° |
| | | /// </summary> |
| | | /// <param name="param">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <param name="totalNum">è®°å½çæ»æ¡æ°</param> |
| | | /// <param name="currentPage">å½å页颿°</param> |
| | | /// <returns>èªå®ä¹å®ä½Tçè®°å½å表</returns> |
| | | public virtual List<T> QueryByParam(QueryParam param, out string msg, out int totalNum, out int currentPage) |
| | | { |
| | | msg = ""; |
| | | totalNum = 0; |
| | | currentPage = 1; |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.QueryByParam(param, dbModel, out totalNum, out currentPage); |
| | | } |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", msg); |
| | | return new List<T>(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.Message; |
| | | totalNum = 0; |
| | | currentPage = 1; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "QueryByParam", ex.Message); |
| | | return new List<T>(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region æå
¥æ°ç对象 |
| | | |
| | | /// <summary> |
| | | /// å°èªå®ä¹çå®ä½Tçå®ä¾å表æ¹éä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="ts">èªå®ä¹ç±»åTçå®ä¾å表</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>ä¿åçæ°é</returns> |
| | | public virtual int Save(List<T> ts, out string msg) |
| | | { |
| | | msg = ""; |
| | | |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.Save(ts, dbModel); |
| | | } |
| | | |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); |
| | | return 0; |
| | | } |
| | | catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", ex.Message); |
| | | return 0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å°èªå®ä¹çå®ä½Tçå®ä¾ä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>æ°æ·»å T对象çid</returns> |
| | | public virtual int Save(T t, out string msg) |
| | | { |
| | | msg = ""; |
| | | |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.Save(t, dbModel); |
| | | } |
| | | |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); |
| | | return -1; |
| | | } |
| | | catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", ex.Message); |
| | | return -1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Save", msg); |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹å¯¹è±¡ |
| | | /// <summary> |
| | | /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>éæ¹å®ä½çid</returns> |
| | | public virtual int Update(T t, out string msg) |
| | | { |
| | | msg = ""; |
| | | |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.Update(t, dbModel); |
| | | } |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); |
| | | return -1; |
| | | } |
| | | catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "SaveUpdate", ex.Message); |
| | | return -1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); |
| | | return -1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹èªå®ä¹ç±»åTçå®ä½å¹¶ä¿åå°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="t">èªå®ä¹ç±»åTçå®ä¾</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>éæ¹å®ä½çid</returns> |
| | | public virtual int Update(List<T> ts, out string msg) |
| | | { |
| | | msg = ""; |
| | | |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | CommonDao.Update(ts, dbModel); |
| | | return ts.Count; |
| | | } |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); |
| | | return -1; |
| | | } |
| | | catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "SaveUpdate", ex.Message); |
| | | return -1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.HResult == (int)EDbError.è®°å½å·²åå¨ ? EDbError.è®°å½å·²åå¨.ToString() : ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Update", msg); |
| | | return -1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å é¤å¯¹è±¡ |
| | | |
| | | /// <summary> |
| | | /// 仿°æ®åºä¸å é¤ä¸»é®ä¸ºidçè®°å½ |
| | | /// </summary> |
| | | /// <param name="id">éè¦å é¤å¯¹è±¡çid</param> |
| | | /// <param name="msg">å¼å¸¸é误信æ¯</param> |
| | | /// <returns>被å é¤å¯¹è±¡ç主é®</returns> |
| | | public virtual int Delete(int id, out string msg) |
| | | { |
| | | msg = ""; |
| | | |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.Delete(id, dbModel); |
| | | } |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", msg); |
| | | return -1; |
| | | } |
| | | catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | catch (Exception ex) |
| | | { |
| | | msg = "è®°å½å·²è¢«å
¶ä»å¯¹è±¡å¼ç¨ï¼ä¸è½å é¤"; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); |
| | | return -1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 仿°æ®åºä¸æ¹éå é¤ä¸»é®å表为idsçè®°å½ |
| | | /// </summary> |
| | | /// <param name="id">éè¦å é¤å¯¹è±¡çidå表</param> |
| | | /// <param name="msg">å¼å¸¸é误信æ¯</param> |
| | | /// <returns>被å é¤å¯¹è±¡çæ°é</returns> |
| | | public virtual int Delete(List<int> ids, out string msg) |
| | | { |
| | | msg = ""; |
| | | |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.Delete(ids, dbModel); |
| | | } |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", msg); |
| | | return 0; |
| | | } |
| | | |
| | | catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); |
| | | return 0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = "è®°å½å·²è¢«å
¶ä»å¯¹è±¡å¼ç¨ï¼ä¸è½å é¤"; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Delete", ex.Message); |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region æ¼è£
åå
¸ |
| | | /// <summary> |
| | | /// å°æ»¡è¶³æ¡ä»¶çTç±»åæ¼è£
æä»¥id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå
¸ |
| | | /// </summary> |
| | | /// <param name="param">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="msg">å¼å¸¸éè¯¯æ¶æ¯</param> |
| | | /// <returns>以id为é®ï¼ç±»åæ¬èº«ä¸ºå¼çåå
¸</returns> |
| | | public virtual Dictionary<int, T> ToDictionary(QueryParam param,out string msg) |
| | | { |
| | | msg = ""; |
| | | var type = typeof(D); |
| | | using (var dbModel = type.Assembly.CreateInstance(type.FullName) as DbContext) |
| | | { |
| | | try |
| | | { |
| | | return CommonDao.ToDictionary(param, dbModel); |
| | | } |
| | | catch (DbEntityValidationException ex) |
| | | { |
| | | var errs = ex.EntityValidationErrors.SelectMany(validationResult => validationResult.ValidationErrors).Select(m => m.ErrorMessage); |
| | | msg = string.Join(", ", errs); |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "ToDictionary", msg); |
| | | return new Dictionary<int, T>(); |
| | | } |
| | | |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.Message; |
| | | LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "ToDictionary", ex.Message); |
| | | return new Dictionary<int, T>(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Entity; |
| | | using System.Data.SqlClient; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.DLA |
| | | { |
| | | internal class EFHelp |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// å
¬ç¨çå®ä½ç±»æ¥å£ |
| | | /// å¼ å± |
| | | /// </summary> |
| | | /// <typeparam name="T">èªå®ä¹çå®ä½ç±»å</typeparam> |
| | | /// <typeparam name="S">ORMä¸çå®ä½ç±»å</typeparam> |
| | | public interface ICommonEntity<S> |
| | | { |
| | | int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å°Tç±»åçå®ä½è½¬æ¢æOrmä¸ç对象 |
| | | /// </summary> |
| | | /// <returns>Ormä¸ç对象</returns> |
| | | S ToOrm(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using System.Collections.Generic; |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | public interface IService<T> |
| | | { |
| | | List<T> QueryByParam(QueryParam param, out string msg); |
| | | |
| | | int Save(T t, out string msg); |
| | | |
| | | int Update(T t, out string msg); |
| | | |
| | | int Delete(int id, out string msg); |
| | | |
| | | int Delete(List<int> ids, out string msg); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations.Schema; |
| | | using System.Globalization; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢çåæ° |
| | | /// </summary> |
| | | public class QueryParam |
| | | { |
| | | /// <summary> |
| | | /// ç¨äºç²¾ç¡®æ¥è¯¢çåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Filter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºç²¾ç¡®æ¥è¯¢ä¸çå¾çåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> NotFilter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¨¡ç³æ¥è¯¢çåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Search { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæåºæ¥è¯¢çåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Order { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢æ¶é´å°äºçäºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Leqd { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢æ¶é´å¤§äºçäºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Geqd { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢æ¶é´å°äºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Ltd { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢æ¶é´å¤§äºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Gtd { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢å°äºçäºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Leq { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢å¤§äºçäºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Geq { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢å°äºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Lt { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢å¤§äºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Gt { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºæ¥è¯¢å¤§äºçåæ®µ |
| | | /// </summary> |
| | | public Dictionary<string, object> Neq { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºå页ï¼ç¬¬å 页 |
| | | /// </summary> |
| | | public int PageIndex { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨äºåé¡µï¼æ¯ä¸ªé¡µé¢çæ°æ®æ°é |
| | | /// </summary> |
| | | public int PageSize { get; set; } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public class OP60Info |
| | | { |
| | | public string datetime { get; set; } |
| | | public string col2 { get; set; } |
| | | public string value { get; set; } |
| | | |
| | | public DateTime? datetimeHandle{get;set;} |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_Model.TableModelSC; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | public class AlarmLogManager |
| | | { |
| | | public static List<AlarmLog> GetAlarmLogs() |
| | | { |
| | | using (SCModel db = new SCModel()) |
| | | { |
| | | //æ¥è¯¢ææ |
| | | var query = db.AlarmLog.ToList();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ |
| | | return query; |
| | | } |
| | | } |
| | | |
| | | public static void UpdateAlarmLogs(AlarmLog log) |
| | | { |
| | | using (SCModel db = new SCModel()) |
| | | { |
| | | //æ¥è¯¢ææ |
| | | var query = db.AlarmLog.Where(o => o.id == 1).FirstOrDefault();//è¿ä¸ªä¸æ¯å»¶è¿æ¥è¯¢ |
| | | query.alarmMsg = $"æµè¯åï¼{DateTime.Now.ToString()}"; |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// æ°æ®æ¶éåºç±» |
| | | /// </summary> |
| | | public abstract class DataCaptureHandler |
| | | { |
| | | public static string WorkPieceID { get; set; } |
| | | public DataCaptureConfig _dataCaptureConfig = new DataCaptureConfig(); |
| | | //public List<DataCaptureColumnConfig> _columnList = new List<DataCaptureColumnConfig>(); |
| | | /// <summary> |
| | | /// æ¯å¦æ¶éæ°æ®ï¼é»è®¤æ¶é |
| | | /// </summary> |
| | | public bool IsCaptureflag = true; |
| | | /// <summary> |
| | | /// å·¥åºå· |
| | | /// </summary> |
| | | public abstract string WorkingProcedure { get;} |
| | | |
| | | /// <summary> |
| | | /// æ°æ®æ¶éç¹ä»£ç |
| | | /// </summary> |
| | | public abstract string DataCapturePointCode { get;} |
| | | |
| | | /// <summary> |
| | | /// æ¶éæ¶éç¹æè¿° |
| | | /// </summary> |
| | | public abstract string DataCapturePointCname { get;} |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ°çé
置信æ¯ï¼å·æ°åèªçæ°æ® |
| | | /// </summary> |
| | | /// <param name="dataCaptureConfig"></param> |
| | | public abstract void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig); |
| | | /// <summary> |
| | | /// æ°æ®æ¶éå¼å§ |
| | | /// </summary> |
| | | /// <param name="dataCaptureColumnDict">æ°æ®æ¶éé
置信æ¯</param> |
| | | /// <returns></returns> |
| | | public abstract void DataCaptureStart(); |
| | | /// <summary> |
| | | /// é
ç½®çåçæ§ç¹éè·åçæ°æ® |
| | | /// </summary> |
| | | public static List<DataCaptureColumnConfig> colConfig; |
| | | /// <summary> |
| | | /// å¿è·³åè¦é´é |
| | | /// </summary> |
| | | public static int heartBeatAlertInterval = 3; |
| | | /// <summary> |
| | | /// å·æ°å
Œ
±ç±»éè¦çæ°æ® |
| | | /// </summary> |
| | | public static void RefreshDataCommonStatic() |
| | | { |
| | | try |
| | | { |
| | | //è·åé
ç½®çæ°æ®è·åæ¹å¼ |
| | | colConfig= DataCaptureConfigManager.GetDataCaptureColumnConfig(); |
| | | var heartBeat =ConfigHelper.GetConfigString("HeartBeatAlertInterval"); |
| | | if(string.IsNullOrEmpty(heartBeat)) |
| | | { |
| | | heartBeatAlertInterval = 3; |
| | | }else |
| | | { |
| | | if(!int.TryParse(heartBeat, out heartBeatAlertInterval)) |
| | | { |
| | | heartBeatAlertInterval = 3; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP05å·¥åºçæ§æç æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP05 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP05 Instance = new DataCaptureHandler_OP05(); |
| | | |
| | | public List<DataCaptureConfig> _dataCaptureConfig = new List<DataCaptureConfig>(); |
| | | public DataCaptureHandler_OP05() { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.FirstOrDefault().WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.FirstOrDefault().DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.FirstOrDefault().DataCapturePointCname; } |
| | | } |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP0501": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | public override void DataCaptureStart() |
| | | { |
| | | if(IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig.FirstOrDefault()); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°PLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.FirstOrDefault().WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //ä¸å¡ä»£ç |
| | | plcService.ReadValuePoint("", "", PLCManger.GetTypeForString(_dataCaptureConfig.FirstOrDefault().DataCaptureColumnType)); |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP0501 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Globalization; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP05 ææ å®ææ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0501 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0501 Instance = new DataCaptureHandler_OP0501(); |
| | | |
| | | public DataCaptureHandler_OP0501() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | private string CheackPath(string path,int type,int time) |
| | | { |
| | | var directory = Path.GetDirectoryName(path); |
| | | if (!Directory.Exists(directory)) |
| | | { |
| | | Directory.CreateDirectory(directory); |
| | | } |
| | | if (!File.Exists(path)) |
| | | { |
| | | File.Create(path).Close(); |
| | | } |
| | | |
| | | string content = ""; |
| | | // åæ¥æ¥æºæ°æ® |
| | | using (StreamReader reader = new StreamReader(path)) |
| | | { |
| | | content = reader.ReadToEnd(); |
| | | |
| | | Console.WriteLine("读åçå
容æ¯ï¼" + content); |
| | | if (content == null || content == "") |
| | | { |
| | | switch (type) |
| | | { |
| | | case 1: content = DateTimeHelper.GetDateTime().AddYears(time).ToString();break; |
| | | case 2: content = DateTimeHelper.GetDateTime().AddMonths(time).ToString();break; |
| | | case 3: content = DateTimeHelper.GetDateTime().AddDays(time).ToString();break; |
| | | case 4: content = DateTimeHelper.GetDateTime().AddHours(time).ToString();break; |
| | | case 5: content = DateTimeHelper.GetDateTime().AddMinutes(time).ToString();break; |
| | | case 6: content = DateTimeHelper.GetDateTime().AddSeconds(time).ToString();break; |
| | | default: |
| | | content = DateTimeHelper.GetDateTime().ToString(); break; |
| | | } |
| | | //content = DateTimeHelper.GetDateTime().AddMinutes(-10).ToString(); |
| | | } |
| | | |
| | | } |
| | | return content; |
| | | } |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | //// plcè¿æ¥ |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | //if (plcService == null) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | // return; |
| | | //} |
| | | //if (plcService != null && !plcService.IsConnected) |
| | | //{ |
| | | // plcService.Close(); |
| | | // plcService.OpenService(); |
| | | //} |
| | | |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | ////_dataCaptureConfig |
| | | //if (plcService == null || !plcService.IsConnected) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // plcService.Close(); |
| | | // plcService.OpenService(); |
| | | // Thread.Sleep(100); |
| | | // continue; |
| | | //} |
| | | //else |
| | | { |
| | | //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //if (SystemValue.value_OP0501.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | //读ç å®ææ²¡å¥ä¸å¡æä½ï¼è·åäºç»´ç ï¼ç¶åæ¾å°éåä¸ |
| | | #region ä»å·¥æ§æºè·åç¸å
³äºç»´ç |
| | | var path = ConfigHelper.GetConfigString("WorkPeiceIDPath");//æç æºæç äºç»´ç è·¯å¾ |
| | | //æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ |
| | | //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å10ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | var dataTime = CheackPath(Environment.CurrentDirectory + "\\OP05-LastScapTime.txt",4,-10); |
| | | var scapEndTime = DateTimeHelper.GetDateTime(); |
| | | var newFiles = FileHelper.DetectNewFilesCSV(path, 60, Convert.ToDateTime(dataTime), scapEndTime); |
| | | |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯å¼å§:{dataTime}"); |
| | | |
| | | foreach (System.IO.FileInfo file in newFiles) |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,æä»¶å:{file.FullName}"); |
| | | DataTable dt = null; |
| | | dt = CSVHelper.ReadCSV(file.FullName); |
| | | if (dt == null) |
| | | { |
| | | continue; |
| | | } |
| | | lock (SystemValue.lock5QRcodeList) |
| | | { |
| | | #region æ¸
è¿æç¼å |
| | | try |
| | | { |
| | | //æ¸
è¿æç¼å |
| | | var lstRemoveKey = SystemValue.QRcodeList |
| | | .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) |
| | | .Select(p => p.Key).ToList(); |
| | | if (lstRemoveKey.Count > 0) |
| | | { |
| | | foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸
é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸
é¤åè¦æ¥æIDç¼åé误ï¼", ex); |
| | | } |
| | | #endregion |
| | | |
| | | ////çééè¦å¤ççäºç»´ç ä¿¡æ¯ |
| | | //DataRow[] drArr = dt.Select(" æ«ç ç»æ='æå'"); //æ¥è¯¢ |
| | | //DataTable dtNew = dt.Clone(); |
| | | //for (int i = 0; i < drArr.Length; i++) |
| | | //{ |
| | | // var now = DateTime.Now; |
| | | // var list = drArr[i]["æ¶é´"].ToString().Split(':'); |
| | | // var d = new DateTime(now.Year, now.Month, now.Day, Convert.ToInt32(list[0]), Convert.ToInt32(list[1]), Convert.ToInt32(list[2]), DateTimeKind.Local); |
| | | // //and æ¶é´> '19:19:34:547' |
| | | // if (Convert.ToDateTime(DateTime.Now.ToShortDateString() + " " +drArr[i]["æ¶é´"]).TimeOfDay> Convert.ToDateTime(DateTime.Now.ToShortDateString() + " 19:19:34:547").TimeOfDay) |
| | | // dtNew.ImportRow(drArr[i]); |
| | | // //è·åå°ç工件å·å¼å¸¸ |
| | | // SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | // $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | //} |
| | | DataTable newDt = new DataTable(); |
| | | var dates = file.Name.Split('-', '.'); |
| | | var date = string.Format("{0:D4}-{1:D2}-{2:D2}", int.Parse(dates[0]), int.Parse(dates[1]), int.Parse(dates[2])); |
| | | if (DateTimeHelper.GetDateTime().Date != Convert.ToDateTime(date) && DateTimeHelper.GetDateTime().AddDays(-1).Date != Convert.ToDateTime(date)) |
| | | { |
| | | continue; |
| | | } |
| | | DataRow[] filteredRows = new DataRow[dt.Rows.Count]; |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | int j = 0; |
| | | var cache = DataCache.GetCache("OP501-LastTime"); |
| | | DateTime? lasttime = null; |
| | | if (cache != null) |
| | | { |
| | | lasttime = Convert.ToDateTime(cache); |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,å·¥ä»¶ææ°æ¶é´:{(cache==null?"æ ç¼å":cache.ToString())}"); |
| | | for (int i = dt.Rows.Count - 1; i >= 0; i--) |
| | | { |
| | | try |
| | | { |
| | | string timeValue = dt.Rows[i]["æ¶é´"].ToString(); |
| | | string[] timeComponents = timeValue.Split(':'); |
| | | string correctedTime = string.Format("{0:D2}:{1:D2}:{2:D2}", int.Parse(timeComponents[0]), int.Parse(timeComponents[1]), int.Parse(timeComponents[2])); |
| | | var newTime = date + " " + correctedTime; |
| | | dt.Rows[i]["æ¶é´"] = newTime; |
| | | |
| | | var currrentTime = Convert.ToDateTime(dt.Rows[i]["æ¶é´"]); |
| | | if (cache == null) |
| | | { |
| | | if (j == 0) |
| | | { |
| | | lasttime = currrentTime; |
| | | } |
| | | var oldTime = DateTime.Now.AddMinutes(-10); |
| | | if (currrentTime <= oldTime) |
| | | { |
| | | break; |
| | | } |
| | | filteredRows[j] = dt.Rows[i]; |
| | | } |
| | | else |
| | | { |
| | | var cacheTime = Convert.ToDateTime(cache); |
| | | if (currrentTime <= cacheTime) |
| | | { |
| | | break; |
| | | } |
| | | filteredRows[j] = dt.Rows[i]; |
| | | } |
| | | if (lasttime != null && lasttime < currrentTime) |
| | | { |
| | | lasttime = currrentTime; |
| | | } |
| | | j++; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $" {_dataCaptureConfig.WorkingProcedure}æä»¶ææ æ¶é´å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}æä»¶ææ æ¶é´,åºç°å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | |
| | | filteredRows = filteredRows.Where(item=>item!=null).ToArray(); |
| | | // 设置ç¼åå¼ |
| | | DateTime absoluteExpiration = DateTime.Now.AddDays(30); |
| | | TimeSpan slidingExpiration = TimeSpan.FromMinutes(20); |
| | | if (slidingExpiration == TimeSpan.Zero) |
| | | { |
| | | absoluteExpiration = DateTime.Now.AddDays(30); |
| | | } |
| | | else |
| | | { |
| | | absoluteExpiration = DateTime.MaxValue; |
| | | } |
| | | DataCache.SetCache("OP501-LastTime", lasttime, absoluteExpiration, slidingExpiration); |
| | | if (filteredRows.Count() <= 0) |
| | | { |
| | | return; |
| | | } |
| | | if (file.LastAccessTime < Convert.ToDateTime(dataTime)) continue; |
| | | using (StreamWriter writer = new StreamWriter(Environment.CurrentDirectory + "\\OP05-LastScapTime.txt", false)) |
| | | { |
| | | dataTime = file.LastAccessTime.ToString(); |
| | | writer.Write(dataTime); |
| | | } |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"读åå°{filteredRows.Count()}è¡æ°æ®ï¼æ¶é´èå´æ¯{filteredRows[j-1]["æ¶é´"]}-{filteredRows[0]["æ¶é´"]}"); |
| | | } |
| | | |
| | | //// 工件å·ï¼äºç»´ç å¼ï¼ |
| | | //string WorkPieceID = dt.Rows[0][""].ToString(); |
| | | //if (WorkPieceID.Length != 22) |
| | | //{ |
| | | // //è·åå°ç工件å·å¼å¸¸ |
| | | // SystemValue.lbl_Alert_HMI01 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | // $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | //} |
| | | |
| | | |
| | | //SystemValue.QRcodeList.Add("", DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = "OP05"; |
| | | //wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = "cs"; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = CultureInfo.CurrentUICulture.Name; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = "æµè¯"; |
| | | wplog.IsDeleted = false; |
| | | wplog.EquipmentID = "123"; |
| | | |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | wplog.QualityState = 1; |
| | | wplog.ProcessingDuration = 1; |
| | | wplog.MachineToolState = 1; |
| | | wplog.AlertType = 1; |
| | | wplog.WorkPieceNumber = 1; |
| | | wplog.WorkPieceOnlineTime = Convert.ToDateTime(dataTime); |
| | | wplog.WorkPieceOfflineTime = Convert.ToDateTime(dataTime).AddHours(1); |
| | | wplog.WorkPieceStartMachiningTime = Convert.ToDateTime(dataTime); |
| | | wplog.WorkPieceEndMachiningTime = DateTime.Now.AddDays(7); |
| | | wplog.KnifeEdgeNumber = 10; |
| | | wplog.KnifeToolLife = 10; |
| | | wplog.KnifeToolEarlyWarningLife = 3; |
| | | wplog.KnifeToolSurplusLife = 10; |
| | | |
| | | foreach (var item in filteredRows) |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,读å工件äºç»´ç :{item["ææ å
容"].ToString()}"); |
| | | |
| | | if (item == null) break; |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkPieceID = item["ææ å
容"].ToString(); |
| | | wplog.OfflineTime = Convert.ToDateTime(dataTime); |
| | | wplog.Remarks = item["æ¶é´"].ToString() + "|" + item["ææ å
容"].ToString() + "|" + item["ææ å
容"].ToString() + "|" + item["æ«ç ç级"].ToString() + "|" + item["æ«ç ç»æ"].ToString(); |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), null, _dataCaptureConfig.IsFeedback); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | var fileCount = newFiles.Cast<string>().ToList(); |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ«æå®æï¼å
±æ«æå°ï¼ï¼{fileCount.Count()}ï¼ä¸ªæä»¶"); |
| | | } |
| | | //SystemValue.value_OP0501 = value.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | //线ç¨å¤ä¹
æ§è¡ä¸æ¬¡ï¼ä¸å
å«ä¸å¡å¤çæ¶é´ï¼ |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(3000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
ç½®å¼å¸¸"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //if (SystemValue.isStartedModel) |
| | | //{ |
| | | // #region ä»å·¥æ§æºè·åç¸å
³äºç»´ç |
| | | |
| | | |
| | | // //æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å |
| | | // var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime()); |
| | | // foreach (System.IO.FileInfo file in newFiles) |
| | | // { |
| | | // var datatable = CSVHelper.ReadCSV(file.FullName); |
| | | // } |
| | | // lock (SystemValue.lock5QRcodeList) |
| | | // { |
| | | // try |
| | | // { |
| | | // var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | // //æ¸
è¿æç¼å |
| | | // var lstRemoveKey = SystemValue.QRcodeList |
| | | // .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) |
| | | // .Select(p => p.Key).ToList(); |
| | | // if (lstRemoveKey.Count > 0) |
| | | // { |
| | | // foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); |
| | | // Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸
é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); |
| | | // } |
| | | // WorkPieceLog wplog = new WorkPieceLog(); |
| | | // wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | // wplog.WorkingProcedure = WorkingProcedure; |
| | | // //wplog.EquipmentID = WorkingProcedure; |
| | | // wplog.Remarks = WorkingProcedure; |
| | | // wplog.MonitoringPoint = DataCapturePointCode; |
| | | // wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | // wplog.CreatedUserName = DataCapturePointCode; |
| | | // wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | // wplog.UpdatedUserName = DataCapturePointCode; |
| | | // wplog.IsDeleted = false; |
| | | // wplog.EquipmentID= _dataCaptureConfig.EquipmentID; |
| | | // wplog.QualityState = (int)QualityState.OK; |
| | | // wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | // wplog.WorkPieceID = WorkPieceID; |
| | | // if (wplog.WorkPieceID.Length != 22) |
| | | // {//è·åå°ç工件å·å¼å¸¸ |
| | | // } |
| | | // else |
| | | // {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | // //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | // //{ |
| | | // // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | // //} |
| | | // } |
| | | // //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | // var info = WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸
é¤åè¦æ¥æIDç¼åé误ï¼", ex); |
| | | // } |
| | | |
| | | // if (SystemValue.QRcodeList.ContainsKey(WorkPieceID)) |
| | | // { |
| | | // SystemValue.QRcodeList[WorkPieceID] = DateTimeHelper.GetDateTime(); |
| | | // } |
| | | // else |
| | | // { |
| | | // SystemValue.QRcodeList.Add(WorkPieceID, DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // #endregion |
| | | //} |
| | | //else |
| | | //{ |
| | | |
| | | |
| | | //} |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// 读ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0502 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0502 Instance = new DataCaptureHandler_OP0502(); |
| | | |
| | | public DataCaptureHandler_OP0502() |
| | | { |
| | | } |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | // plcè¿æ¥ |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP0502 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP0502.Equals("0") && value.ToString().Equals("1")) |
| | | { |
| | | #region ä»å·¥æ§æºè·åç¸å
³äºç»´ç |
| | | //æç æºæç äºç»´ç è·¯å¾ |
| | | var path = ConfigHelper.GetConfigString("WorkPeiceIDPath"); |
| | | |
| | | //æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ |
| | | var newFiles = FileHelper.DetectNewFilesCSV(path, 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); |
| | | foreach (System.IO.FileInfo file in newFiles) |
| | | { |
| | | DataTable dt = null; |
| | | dt = CSVHelper.ReadCSV(file.FullName); |
| | | if (dt == null) |
| | | { |
| | | continue; |
| | | } |
| | | lock (SystemValue.lock5QRcodeList) |
| | | { |
| | | #region æ¸
è¿æç¼å |
| | | try |
| | | { |
| | | //æ¸
è¿æç¼å |
| | | var lstRemoveKey = SystemValue.QRcodeList |
| | | .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) |
| | | .Select(p => p.Key).ToList(); |
| | | if (lstRemoveKey.Count > 0) |
| | | { |
| | | foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸
é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸
é¤åè¦æ¥æIDç¼åé误ï¼", ex); |
| | | } |
| | | #endregion |
| | | // 工件å·ï¼äºç»´ç å¼ï¼ |
| | | string WorkPieceID = dt.Rows[0][""].ToString(); |
| | | if (WorkPieceID.Length != 22) |
| | | { |
| | | //è·åå°ç工件å·å¼å¸¸ |
| | | SystemValue.lbl_Alert_OP0502 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | } |
| | | |
| | | if (SystemValue.QRcodeList.ContainsKey(WorkPieceID)) |
| | | { |
| | | // å卿¸
çç¼å |
| | | SystemValue.QRcodeList.Remove(WorkPieceID); |
| | | } |
| | | else |
| | | { |
| | | // ä¸åå¨åé¦PLC |
| | | var col = colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode).ToList(); |
| | | if (col.Count == 0) |
| | | { |
| | | SystemValue.lbl_Alert_OP0502 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ä¸åå¨,请å
é
ç½®æ°æ®æ¶éç¹å¯¹äºå段表信æ¯ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ä¸åå¨,请å
é
ç½®æ°æ®æ¶éç¹å¯¹äºå段表信æ¯ï¼"); |
| | | } |
| | | plcService.WriteValuePoint(col[0].DbNumber, col[0].Offset, col[0].DataCaptureColumnTabelName); |
| | | |
| | | } |
| | | |
| | | |
| | | SystemValue.QRcodeList.Add("", DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ |
| | | |
| | | //WorkPieceLog wplog = new WorkPieceLog(); |
| | | //wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | //wplog.WorkingProcedure = WorkingProcedure; |
| | | ////wplog.EquipmentID = WorkingProcedure; |
| | | //wplog.Remarks = WorkingProcedure; |
| | | //wplog.MonitoringPoint = DataCapturePointCode; |
| | | //wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | //wplog.CreatedUserName = DataCapturePointCode; |
| | | //wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | //wplog.UpdatedUserName = DataCapturePointCode; |
| | | //wplog.IsDeleted = false; |
| | | //wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | |
| | | //wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | //wplog.WorkPieceID = dt.Rows[0][""].ToString(); |
| | | |
| | | // 读åäºç»´ç åæ´æ°æ°æ®åº |
| | | // var info = WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | SystemValue.value_OP0502 = value.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0502 = $" {_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | //线ç¨å¤ä¹
æ§è¡ä¸æ¬¡ï¼ä¸å
å«ä¸å¡å¤çæ¶é´ï¼ |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0502 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»ç 宿æ è®°ï¼è¯»åå·¥æ§æºä¸è¯»åäºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using iWare_SCADA_Model; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using System.Threading; |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// 工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºï¼ä¸åæ ¼ï¼ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0503 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0503 Instance = new DataCaptureHandler_OP0503(); |
| | | |
| | | public DataCaptureHandler_OP0503() |
| | | { |
| | | } |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP0503 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP0503 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | |
| | | if (SystemValue.value_OP0503.Equals("0") && value.ToString().Equals("1")) |
| | | { |
| | | string WorkPieceID = ""; |
| | | string HowToExit = ""; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "WorkPieceID": |
| | | WorkPieceID = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)).ToString(); |
| | | break; |
| | | case "HowToExit": |
| | | HowToExit = plcService.WriteValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)).ToString(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (WorkPieceID.Length != 22) |
| | | { |
| | | SystemValue.lbl_Alert_OP0503 = $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | } |
| | | else |
| | | { |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | if ("NOOK".Equals(HowToExit)) |
| | | { |
| | | // NOOKéåº |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | else if("SPC".Equals(HowToExit)) |
| | | { |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | SystemValue.value_OP0503 = value.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0503 = $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | //线ç¨å¤ä¹
æ§è¡ä¸æ¬¡ï¼ä¸å
å«ä¸å¡å¤çæ¶é´ï¼ |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0503 = $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºå·¥ä»¶æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶æ¯å¦è¢«æ¨åºçæ§ï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// 䏿æ è®°ï¼ç¡®è®¤å·¥ä»¶OP05å·¥åºå·²å®æ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0504 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0504 Instance = new DataCaptureHandler_OP0504(); |
| | | |
| | | public DataCaptureHandler_OP0504() |
| | | { |
| | | } |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP0504 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP0504 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | |
| | | if (SystemValue.value_OP0504.Equals("0") && value.ToString().Equals("1")) |
| | | { |
| | | string WorkPieceID = ""; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "WorkPieceID": |
| | | WorkPieceID = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)).ToString(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (WorkPieceID.Length != 22) |
| | | { |
| | | SystemValue.lbl_Alert_OP0504 = $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"工件æ¨åºæ è®°ï¼ç¡®è®¤å·¥ä»¶å·ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | } |
| | | else |
| | | { |
| | | // OP05å·¥åºå®æ |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | } |
| | | |
| | | SystemValue.value_OP0503 = value.ToString(); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0504 = $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0504 = $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å{WorkingProcedure}å·¥åºä¸ææ 记确认工件工åºå·²å®æçæ§ï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP05 设å¤ä¿¡æ¯éé |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0506: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0506 Instance = new DataCaptureHandler_OP0506(); |
| | | |
| | | public DataCaptureHandler_OP0506() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP0506 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP0506 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | WorkPieceInfoManager.EquipmentMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP0506 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0506 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0506 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0506 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP05 åè¦çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0507: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0507 Instance = new DataCaptureHandler_OP0507(); |
| | | |
| | | public DataCaptureHandler_OP0507() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | |
| | | wplog.AlertTime = DateTime.Now; |
| | | Random ran = new Random(); |
| | | //wplog.FailureType = "1101"+ ran.Next(0,100); |
| | | wplog.AlertMsg = "æµè¯åè¦ 1101"; |
| | | |
| | | wplog.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.æ
é).ToString(); |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP0507 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP0507 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP0507.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºåè¦çæ§ è¯»å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºåè¦çæ§ è¯»å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //if(wplog.FailureType.Length>0) |
| | | { |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP0507 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP0507 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0507 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0507 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0507 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1001: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1001 Instance = new DataCaptureHandler_OP1001(); |
| | | |
| | | public DataCaptureHandler_OP1001() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP1001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.WorkingProcedure = "OP10"; |
| | | wplog.EquipmentID = "OP10"; |
| | | wplog.Remarks = "OP10"; |
| | | wplog.MonitoringPoint = "OP1001"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP10, plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $"读å {DataCapturePointCode}å·¥åºä¸çº¿æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1001 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP10, $"{DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10æµè¯å®ææ è®° ï¼OP10ï¼ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1002: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1002 Instance = new DataCaptureHandler_OP1002(); |
| | | |
| | | public DataCaptureHandler_OP1002() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1002.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = "èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //#region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ |
| | | |
| | | |
| | | ////æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å |
| | | //var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); |
| | | //foreach (System.IO.FileInfo file in newFiles) |
| | | //{ |
| | | // var datatable = CSVHelper.ReadCSV(file.FullName); |
| | | //} |
| | | |
| | | //#endregion |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1002 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1002 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}è´¨éä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}è´¨éä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10æµè¯å®ææ è®° ï¼OP40ï¼ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1003 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1003 Instance = new DataCaptureHandler_OP1003(); |
| | | |
| | | public DataCaptureHandler_OP1003() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1003.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = "èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®æ¶å¼å¸¸ï¼"); |
| | | continue; |
| | | } |
| | | |
| | | //#region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ |
| | | |
| | | |
| | | ////æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å |
| | | //var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); |
| | | //foreach (System.IO.FileInfo file in newFiles) |
| | | //{ |
| | | // var datatable = CSVHelper.ReadCSV(file.FullName); |
| | | //} |
| | | |
| | | //#endregion |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | SystemValue.value_OP1003 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1003 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}è´¨éä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}è´¨éä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10/OP40æ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1004: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1004 Instance = new DataCaptureHandler_OP1004(); |
| | | |
| | | public DataCaptureHandler_OP1004() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1004.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç 1.åæ¨åºæ è®°ï¼2忍åºåå ï¼1ï¼nokï¼2å3ï¼spcï¼4ï¼ç¶æä¸æ ï¼ï¼3 忍åºäºç»´ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = "èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | if (wplog.OP10Flag != 1 && wplog.OP10Flag != 2 && wplog.OP10Flag != 3) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®{wplog.WorkPieceID}æ¨åºåå [{wplog.OP10Flag}]å¼å¸¸"); |
| | | wplog.Remarks = $"æ¨åºåå [{wplog.OP10Flag}]å¼å¸¸"; |
| | | } |
| | | if (wplog.OP10Flag == 1) |
| | | { |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, LogType.PLCOP10); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | //else if (wplog.OP10Flag == 2 || wplog.OP10Flag == 3) |
| | | else |
| | | { |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, LogType.PLCOP10); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1004 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1004 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}æ¨åºä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æ¨åºä¿¡æ¯ æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}æ¨åºä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æ¨åºä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10å·¥åºå®ææ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1005: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1005 Instance = new DataCaptureHandler_OP1005(); |
| | | |
| | | public DataCaptureHandler_OP1005() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1005 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1005 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1005.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§å®ææ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§å®ææ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1005 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1005 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºå®ææ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}å·¥åºå®ææ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºå®ææ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}å·¥åºå®ææ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10设å¤ä¿¡æ¯éé |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1006: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1006 Instance = new DataCaptureHandler_OP1006(); |
| | | |
| | | public DataCaptureHandler_OP1006() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1006 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1006 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //if (SystemValue.value_OP1006.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.EquipmentMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP1006 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1006 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $"{DataCapturePointCode}å·¥åºè®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1006 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºè®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{DataCapturePointCode}å·¥åºè®¾å¤ééæ°æ® ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10 åè¦çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1007: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1007 Instance = new DataCaptureHandler_OP1007(); |
| | | |
| | | public DataCaptureHandler_OP1007() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | |
| | | wplog.AlertTime = DateTime.Now; |
| | | Random ran = new Random(); |
| | | //wplog.FailureType = "1101"+ ran.Next(0,100); |
| | | wplog.AlertMsg = "æµè¯åè¦ 1101"; |
| | | |
| | | wplog.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.æ
é).ToString(); |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1007 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP1007 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1007.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1007 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1007 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1007 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP20读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP2001: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP2001 Instance = new DataCaptureHandler_OP2001(); |
| | | |
| | | public DataCaptureHandler_OP2001() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP2001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP2001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.WorkingProcedure = "OP20"; |
| | | wplog.EquipmentID = "OP20"; |
| | | wplog.Remarks = "OP20"; |
| | | wplog.MonitoringPoint = "OP2001"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP20, plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP2001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue._lbl_Alert_OP2001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP20å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP20, "读OP20å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP20æµè¯å®ææ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP2002: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP2002 Instance = new DataCaptureHandler_OP2002(); |
| | | |
| | | public DataCaptureHandler_OP2002() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP2001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP2001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.WorkingProcedure = "OP20"; |
| | | wplog.EquipmentID = "OP20"; |
| | | wplog.Remarks = "OP20"; |
| | | wplog.MonitoringPoint = "OP2002"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case ""://读åäºç»´ç |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | #region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ |
| | | |
| | | |
| | | //æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å |
| | | var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); |
| | | foreach (System.IO.FileInfo file in newFiles) |
| | | { |
| | | var datatable = CSVHelper.ReadCSV(file.FullName); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, LogType.PLCOP20); |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP2001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue._lbl_Alert_OP2001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP20æ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP2003: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP2003 Instance = new DataCaptureHandler_OP2003(); |
| | | |
| | | public DataCaptureHandler_OP2003() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP2001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP2001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.WorkingProcedure = "OP20"; |
| | | wplog.EquipmentID = "OP20"; |
| | | wplog.Remarks = "OP20"; |
| | | wplog.MonitoringPoint = "OP2003"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP20, plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP2001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue._lbl_Alert_OP2001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP20SPCæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP2004: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP2004 Instance = new DataCaptureHandler_OP2004(); |
| | | |
| | | public DataCaptureHandler_OP2004() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP2001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP2001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.WorkingProcedure = "OP20"; |
| | | wplog.EquipmentID = "OP20"; |
| | | wplog.Remarks = "OP20"; |
| | | wplog.MonitoringPoint = "OP2004"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP20, plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP2001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue._lbl_Alert_OP2001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP20å·¥åºå®ææ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP2005: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP2005 Instance = new DataCaptureHandler_OP2005(); |
| | | |
| | | public DataCaptureHandler_OP2005() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP2001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP2001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.WorkingProcedure = "OP20"; |
| | | wplog.EquipmentID = "OP20"; |
| | | wplog.Remarks = "OP20"; |
| | | wplog.MonitoringPoint = "OP2005"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP20, plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP2001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue._lbl_Alert_OP2001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP20åè¦æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP2006: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP2006 Instance = new DataCaptureHandler_OP2006(); |
| | | |
| | | public DataCaptureHandler_OP2006() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP2001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "å·æ° OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP2001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.WorkingProcedure = "OP20"; |
| | | wplog.EquipmentID = "OP20"; |
| | | wplog.Remarks = "OP20"; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.ReadQRcode(wplog, LogType.PLCOP20, plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP2001 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue._lbl_Alert_OP2001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读åOP05å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "读å OP05å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue._lbl_Alert_OP2001 = $" {RandomHelper.GenerateRandomCode(4)} OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, "读OP05å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3001: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3001 Instance = new DataCaptureHandler_OP3001(); |
| | | |
| | | public DataCaptureHandler_OP3001() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP3001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP3001 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig, plcService); |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | return; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | //{ |
| | | // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | //} |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig,plcService); |
| | | if(wplog.WorkPieceID.Length!=22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | continue; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | foreach (var col in colConfig.Where(o=>o.DataCapturePointCode== DataCapturePointCode)) |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset,col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | } |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure),plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | //#region åé¦PLC |
| | | |
| | | //bool checkQualityInfoCompleteFlag = false; |
| | | //bool plcFlag = true;//åé¦ç»PLCçæ è®° |
| | | //string message = ""; |
| | | //checkQualityInfoCompleteFlag = WorkPieceInfoManager.CheckQualityInfoComplete(info, wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | //if (!checkQualityInfoCompleteFlag || info.QualityState != (int)QualityState.OK) |
| | | //{ |
| | | // plcFlag = false; |
| | | // message = !checkQualityInfoCompleteFlag ? "è·³åºï¼" : ""; |
| | | //message += info.QualityState != (int)QualityState.OK ? "è´¨éä¸ç¬¦å" : ""; |
| | | //} |
| | | ////åé¦ç»PLCï¼ï¼åå
¥ç¹å¾
å®ï¼ |
| | | //MessageModel fr = null; |
| | | //fr = plcService.WriteValuePoint("", "", plcFlag, PLCManger.GetTypeForString("bool")); |
| | | //if (fr.result) |
| | | //{ |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC æåï¼ åºç° {message}"); |
| | | //} |
| | | //else |
| | | //{ |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC å¤±è´¥ï¼ åºç° {message} ï¼å¤±è´¥åå ï¼{fr.resMsg}"); |
| | | //} |
| | | //#endregion |
| | | |
| | | } |
| | | SystemValue.value_OP3001 = value.ToString(); |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | //catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP3001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30æµé宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3002: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3002 Instance = new DataCaptureHandler_OP3002(); |
| | | |
| | | public DataCaptureHandler_OP3002() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP3002": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.QualityState = (int)QualityState.NG; |
| | | wplog.QualityStateUpdateUser = WorkingProcedure; |
| | | wplog.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | |
| | | wplog.QualityOP30To1 = "QualityOP30To1"; |
| | | wplog.QualityOP30To2 = "QualityOP30To2"; |
| | | wplog.QualityOP30To3 = "QualityOP30To3"; |
| | | wplog.QualityOP30To4 = "QualityOP30To4"; |
| | | wplog.QualityOP30To5 = "QualityOP30To5"; |
| | | wplog.QualityOP30To6 = "QualityOP30To6"; |
| | | wplog.QualityOP30To7 = "QualityOP30To7"; |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3002 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3002.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | //foreach (var col in colConfig) |
| | | //{ |
| | | // switch(col.DbNumber+ col.Offset) |
| | | // { |
| | | // case "": |
| | | var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | // break; |
| | | // } |
| | | //} |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3002 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3002 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3002 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30 NOOKæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3003: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3003 Instance = new DataCaptureHandler_OP3003(); |
| | | |
| | | public DataCaptureHandler_OP3003() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP3003": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP3003 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3003 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3003 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //if (SystemValue.value_OP3003.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //foreach (var col in colConfig) |
| | | //{ |
| | | // switch(col.DbNumber+ col.Offset) |
| | | // { |
| | | // case "": |
| | | var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | // break; |
| | | // } |
| | | //} |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP3003 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3003 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3003 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30 SPCæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3004: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3004 Instance = new DataCaptureHandler_OP3004(); |
| | | |
| | | public DataCaptureHandler_OP3004() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP3004": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP3004 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3004 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3004 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3004.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP3004 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3004 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3004 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3004 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3004 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30 å·¥åºå®æ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3005: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3005 Instance = new DataCaptureHandler_OP3005(); |
| | | |
| | | public DataCaptureHandler_OP3005() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP3005": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP3005 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3005 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | SystemValue.lbl_Alert_OP3501 = $"{RandomHelper.GenerateRandomCode(4)} å¼å§éé{_dataCaptureConfig.WorkingProcedure}çPLC设å¤{DataCapturePointCode}"; |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3005 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3005.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {_dataCaptureConfig.WorkingProcedure}å·¥åºè·åå°{DataCapturePointCode}æ å¿ä½"); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch(col.DataCaptureColumnTabelName) |
| | | { |
| | | case "WorkPieceID": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3005 = value.ToString().ToUpper(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3005 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3005 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30 å¿è·³çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3006: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3006 Instance = new DataCaptureHandler_OP3006(); |
| | | |
| | | public DataCaptureHandler_OP3006() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3006 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | DateTime PLCHeartBeatMonitorTime = DateTime.Now; |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3006 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (!SystemValue.value_OP3006.Equals(value.ToString())) |
| | | {//å¿è·³çæ§ |
| | | PLCHeartBeatMonitorTime = DateTime.Now; |
| | | } |
| | | if((DateTime.Now- PLCHeartBeatMonitorTime).TotalSeconds> heartBeatAlertInterval) |
| | | { |
| | | SystemValue.lbl_Alert_OP3006 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å¿è·³å¼å¸¸!"; |
| | | } |
| | | SystemValue.value_OP3006 = value.ToString(); |
| | | |
| | | //åå
¥å¿è·³ |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3006 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3006 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP30 åè¦çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3007: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3007 Instance = new DataCaptureHandler_OP3007(); |
| | | |
| | | public DataCaptureHandler_OP3007() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP3007": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP3007 = $" {RandomHelper.GenerateRandomCode(4)} OP30å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP30å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | |
| | | wplog.AlertTime = DateTime.Now; |
| | | Random ran = new Random(); |
| | | //wplog.FailureType = "1101"+ ran.Next(0,100); |
| | | wplog.AlertMsg = "æµè¯åè¦ 1101"; |
| | | |
| | | wplog.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.æ
é).ToString(); |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3007 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3007 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3007.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP3007 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3007 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3007 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.TableModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3501 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3501 Instance = new DataCaptureHandler_OP3501(); |
| | | |
| | | public DataCaptureHandler_OP3501() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig, plcService); |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | return; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | //{ |
| | | // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | //} |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.Remarks= $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.lbl_Alert_OP3501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3501.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿å®ææ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿å®ææ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | } |
| | | SystemValue.value_OP3501 = value.ToString(); |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3501 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3501 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3501 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35æµé宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3502: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3502 Instance = new DataCaptureHandler_OP3502(); |
| | | |
| | | public DataCaptureHandler_OP3502() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.QualityState = (int)QualityState.NG; |
| | | wplog.QualityStateUpdateUser = WorkingProcedure; |
| | | wplog.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | |
| | | wplog.QualityOP35To1 = "QualityOP35To1"; |
| | | wplog.QualityOP35To2 = "QualityOP35To2"; |
| | | //wplog.QualityOP35To3 = "QualityOP35To3"; |
| | | //wplog.QualityOP35To4 = "QualityOP35To4"; |
| | | //wplog.QualityOP35To5 = "QualityOP35To5"; |
| | | //wplog.QualityOP35To6 = "QualityOP35To6"; |
| | | //wplog.QualityOP35To7 = "QualityOP35To7"; |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3502 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3502 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3502.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§æµé宿æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§æµé宿æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3502 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3502 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3502 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§æµéæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§æµéæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3502 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§æµéæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§æµéæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35 NOOKæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3503: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3503 Instance = new DataCaptureHandler_OP3503(); |
| | | |
| | | public DataCaptureHandler_OP3503() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3503 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3503 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3503.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§NOOKæ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§NOOKæ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3503 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3503 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3503 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§NOOKæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§NOOKæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3503 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§NOOKæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§NOOKæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3503 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§NOOKæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§NOOKæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35 SPCæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3504: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3504 Instance = new DataCaptureHandler_OP3504(); |
| | | |
| | | public DataCaptureHandler_OP3504() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3504 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3504 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3504.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§spcæ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§spcæ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3504 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3504 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3504 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§spcæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§spcæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3504 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§spcæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§spcæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3504 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§spcæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§spcæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35 å·¥åºå®æ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3505: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3505 Instance = new DataCaptureHandler_OP3505(); |
| | | |
| | | public DataCaptureHandler_OP3505() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3505 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{DataCapturePointCode}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | SystemValue.lbl_Alert_OP3501 = $"{RandomHelper.GenerateRandomCode(4)} å¼å§éé{DataCapturePointCode}çPLC设å¤"; |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3505 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3005.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºè·åå°ä¸çº¿æ å¿ä½"); |
| | | |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{_dataCaptureConfig.WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch(Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{_dataCaptureConfig.WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id},èµå¼åå[{col.DataCaptureColumnTabelName ?? "空å符串"}]", setex); |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3505 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3505 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3505 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3505 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3505 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35 设å¤ä¿¡æ¯éé |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3506 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3506 Instance = new DataCaptureHandler_OP3506(); |
| | | |
| | | public DataCaptureHandler_OP3506() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3506 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3506 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | WorkPieceInfoManager.EquipmentMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | SystemValue.lbl_Alert_OP3506 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3506 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3506 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3506 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP35 åè¦çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3507 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3507 Instance = new DataCaptureHandler_OP3507(); |
| | | |
| | | public DataCaptureHandler_OP3507() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP3507 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP3507 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP3507.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //if (wplog.FailureType.Length > 0) |
| | | //{ |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | //} |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP3507 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP3507 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3507 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP3507 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP3507 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP70读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP7001: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP7001 Instance = new DataCaptureHandler_OP7001(); |
| | | |
| | | public DataCaptureHandler_OP7001() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig, plcService); |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | return; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | //{ |
| | | // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | //} |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP7001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP7001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP7001.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿å®ææ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿å®ææ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure),plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | } |
| | | SystemValue.value_OP7001 = value.ToString(); |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP7001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP7001 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP70 å·¥åºå®æ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP7005 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP7005 Instance = new DataCaptureHandler_OP7005(); |
| | | |
| | | public DataCaptureHandler_OP7005() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP7005 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{DataCapturePointCode}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | SystemValue.lbl_Alert_OP7005 = $"{RandomHelper.GenerateRandomCode(4)} å¼å§éé{DataCapturePointCode}çPLC设å¤"; |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP7005 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | |
| | | if (SystemValue.value_OP7005.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºè·åå°ä¸çº¿æ å¿ä½"); |
| | | |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{_dataCaptureConfig.WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° 读å工件ç 卿èµå¼ã{_dataCaptureConfig.WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id},èµå¼åå[{col.DataCaptureColumnTabelName ?? "空å符串"}]", setex); |
| | | } |
| | | } |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° 读åå·¥ä»¶ç æ°æ®æ¶å¼å¸¸ï¼"); |
| | | continue; |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP7005 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP7005 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP7005 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP70 设å¤ä¿¡æ¯éé |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP7006: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP7006 Instance = new DataCaptureHandler_OP7006(); |
| | | |
| | | public DataCaptureHandler_OP7006() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP7006 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP7006 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | WorkPieceInfoManager.EquipmentMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | SystemValue.lbl_Alert_OP7006 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP7006 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP70 åè¦çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP7007: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP7007 Instance = new DataCaptureHandler_OP7007(); |
| | | |
| | | public DataCaptureHandler_OP7007() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | |
| | | wplog.AlertTime = DateTime.Now; |
| | | Random ran = new Random(); |
| | | //wplog.FailureType = "1101"+ ran.Next(0,100); |
| | | wplog.AlertMsg = "æµè¯åè¦ 1101"; |
| | | |
| | | wplog.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.æ
é).ToString(); |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP7007 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP7007 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP7007.Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //if(wplog.FailureType.Length>0) |
| | | { |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP7007 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP7007 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP7007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP7007 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8001: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8001 Instance = new DataCaptureHandler_OP8001(); |
| | | |
| | | public DataCaptureHandler_OP8001() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP8001": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP8001 = $" {RandomHelper.GenerateRandomCode(4)} OP80å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP80å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig, plcService); |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | return; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | //{ |
| | | // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | //} |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP8001.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig,plcService); |
| | | if(wplog.WorkPieceID.Length!=22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | continue; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | foreach (var col in colConfig.Where(o=>o.DataCapturePointCode== DataCapturePointCode)) |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset,col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | } |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure),plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | //#region åé¦PLC |
| | | |
| | | //bool checkQualityInfoCompleteFlag = false; |
| | | //bool plcFlag = true;//åé¦ç»PLCçæ è®° |
| | | //string message = ""; |
| | | //checkQualityInfoCompleteFlag = WorkPieceInfoManager.CheckQualityInfoComplete(info, wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | //if (!checkQualityInfoCompleteFlag || info.QualityState != (int)QualityState.OK) |
| | | //{ |
| | | // plcFlag = false; |
| | | // message = !checkQualityInfoCompleteFlag ? "è·³åºï¼" : ""; |
| | | //message += info.QualityState != (int)QualityState.OK ? "è´¨éä¸ç¬¦å" : ""; |
| | | //} |
| | | ////åé¦ç»PLCï¼ï¼åå
¥ç¹å¾
å®ï¼ |
| | | //MessageModel fr = null; |
| | | //fr = plcService.WriteValuePoint("", "", plcFlag, PLCManger.GetTypeForString("bool")); |
| | | //if (fr.result) |
| | | //{ |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC æåï¼ åºç° {message}"); |
| | | //} |
| | | //else |
| | | //{ |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" 工件{wplog.WorkPieceID} {WorkingProcedure}å·¥åºåé¦ç»PLC å¤±è´¥ï¼ åºç° {message} ï¼å¤±è´¥åå ï¼{fr.resMsg}"); |
| | | //} |
| | | //#endregion |
| | | |
| | | } |
| | | SystemValue.value_OP8001 = value.ToString(); |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8001 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | //catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP8001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80æµé宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8002: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8002 Instance = new DataCaptureHandler_OP8002(); |
| | | |
| | | public DataCaptureHandler_OP8002() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP8002": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP8002 = $" {RandomHelper.GenerateRandomCode(4)} OP80å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP80å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.QualityState = (int)QualityState.NG; |
| | | wplog.QualityStateUpdateUser = WorkingProcedure; |
| | | wplog.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | |
| | | wplog.QualityOP80To1 = "QualityOP80To1"; |
| | | wplog.QualityOP80To2 = "QualityOP80To2"; |
| | | wplog.QualityOP80To3 = "QualityOP80To3"; |
| | | wplog.QualityOP80To4 = "QualityOP80To4"; |
| | | wplog.QualityOP80To5 = "QualityOP80To5"; |
| | | wplog.QualityOP80To6 = "QualityOP80To6"; |
| | | wplog.QualityOP80To7 = "QualityOP80To7"; |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8002 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8002 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP8002.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | //foreach (var col in colConfig) |
| | | //{ |
| | | // switch(col.DbNumber+ col.Offset) |
| | | // { |
| | | // case "": |
| | | var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | // break; |
| | | // } |
| | | //} |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP8002 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8002 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8002 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8002 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80 NOOKæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8003: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8003 Instance = new DataCaptureHandler_OP8003(); |
| | | |
| | | public DataCaptureHandler_OP8003() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP8003": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP8003 = $" {RandomHelper.GenerateRandomCode(4)} OP80å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP80å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8003 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8003 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //if (SystemValue.value_OP8003.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //foreach (var col in colConfig) |
| | | //{ |
| | | // switch(col.DbNumber+ col.Offset) |
| | | // { |
| | | // case "": |
| | | var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | // break; |
| | | // } |
| | | //} |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP8003 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8003 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8003 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80 æµé宿å读ç 宿 |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8004: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8004 Instance = new DataCaptureHandler_OP8004(); |
| | | |
| | | public DataCaptureHandler_OP8004() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP8004": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP8004 = $" {RandomHelper.GenerateRandomCode(4)} OP80å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP80å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8004 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8004 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP8004.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP8004 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8004 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8004 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8004 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8004 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80 å·¥åºå®æ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8005: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8005 Instance = new DataCaptureHandler_OP8005(); |
| | | |
| | | public DataCaptureHandler_OP8005() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP8005": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP8005 = $" {RandomHelper.GenerateRandomCode(4)} OP80å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP80å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8005 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8005 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP8005.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP8005 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8005 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8005 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8005 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80 å¿è·³çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8006: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8006 Instance = new DataCaptureHandler_OP8006(); |
| | | |
| | | public DataCaptureHandler_OP8006() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8006 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | DateTime PLCHeartBeatMonitorTime = DateTime.Now; |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8006 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (!SystemValue.value_OP8006.Equals(value.ToString())) |
| | | {//å¿è·³çæ§ |
| | | PLCHeartBeatMonitorTime = DateTime.Now; |
| | | } |
| | | if((DateTime.Now- PLCHeartBeatMonitorTime).TotalSeconds> heartBeatAlertInterval) |
| | | { |
| | | SystemValue.lbl_Alert_OP8006 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å¿è·³å¼å¸¸!"; |
| | | } |
| | | SystemValue.value_OP8006 = value.ToString(); |
| | | |
| | | //åå
¥å¿è·³ |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8006 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8006 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8006 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP80 åè¦çæ§ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP8007: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP8007 Instance = new DataCaptureHandler_OP8007(); |
| | | |
| | | public DataCaptureHandler_OP8007() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | //try |
| | | //{ |
| | | // foreach (var dataCaptureColumnDict in dataCaptureConfig) |
| | | // { |
| | | // switch (dataCaptureColumnDict.DataCapturePointCode) |
| | | // { |
| | | // case "OP8007": |
| | | // //_dataCaptureConfig = dataCaptureColumnDict; |
| | | // IsCaptureflag = true; |
| | | // return; |
| | | |
| | | // } |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // SystemValue._lbl_Alert_OP8007 = $" {RandomHelper.GenerateRandomCode(4)} OP80å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "å·æ° OP80å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | //} |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | |
| | | wplog.AlertTime = DateTime.Now; |
| | | Random ran = new Random(); |
| | | //wplog.FailureType = "1101"+ ran.Next(0,100); |
| | | wplog.AlertMsg = "æµè¯åè¦ 1101"; |
| | | |
| | | wplog.EquipmentCurrentState = ((int)EnumEquipmentCurrentStateDisplay.ç产).ToString(); |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP8007 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_OP8007 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP8007.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig) |
| | | { |
| | | switch(col.DbNumber+ col.Offset) |
| | | { |
| | | case "": |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | wplog.WorkPieceID = valuecol.ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | //SystemValue.value_OP8007 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP8007 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP8007 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºçæ§æç æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读å {WorkingProcedure}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP8007 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), "读{WorkingProcedure}å·¥åºçæ§æç æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Entity.Core.Common.CommandTrees; |
| | | using System.Data.Entity.Validation; |
| | | using System.Data.SqlTypes; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// HMIå¿è·³çæ§ |
| | | /// </summary> |
| | | public class HMIBeartBeatMonitor: DataCaptureHandler |
| | | { |
| | | public static readonly HMIBeartBeatMonitor Instance = new HMIBeartBeatMonitor(); |
| | | |
| | | public HMIBeartBeatMonitor() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_HMIBeartBeatMonitor = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | Dictionary<bool, DateTime> beartBeatDic = new Dictionary<bool, DateTime>(); |
| | | bool BeartBeatMonitorflag = true; |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | if(DataCapturePointCode.Equals("OP1008")) |
| | | { |
| | | |
| | | } |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | try |
| | | {//è·å设å¤plcçå¿è·³ |
| | | |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | |
| | | if (BeartBeatMonitorflag != (bool)value) |
| | | {//PLCå¿è·³åå |
| | | |
| | | if(beartBeatDic.ContainsKey((bool)value)) |
| | | { |
| | | beartBeatDic[(bool)value]=DateTime.Now; |
| | | } |
| | | else |
| | | { |
| | | beartBeatDic.Add((bool)value, DateTime.Now); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.Remarks = "HMI"; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | var max = beartBeatDic.Max(kvp => kvp.Value); |
| | | if(max==null||(DateTime.Now-max).TotalSeconds>10) |
| | | {//å¿è·³10ç§æ²¡ææ´æ°è®¤ä¸ºè®¾å¤æçº¿äº |
| | | wplog.IsConnect = false; |
| | | } |
| | | else |
| | | { |
| | | wplog.IsConnect = true; |
| | | } |
| | | //æ´æ°è®¾å¤å½åè¿æ¥æ
åµ |
| | | WorkPieceInfoManager.EquipmentBeartBeatMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | BeartBeatMonitorflag = (bool)value; |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | catch (DbEntityValidationException ex1) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}å¿è·³è¯»åå¼å¸¸1ï¼", ex1); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}å¿è·³è¯»åå¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | try |
| | | {//ååå¿è·³ |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode && o.IsFeedback == 1)) |
| | | {//è·åé
置详æ
表ä¸éåå
¥å¿è·³ä¿¡æ¯ pc |
| | | bool flag = true; |
| | | var colflag = plcService.ReadValuePoint(col.DbNumber, col.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if ((bool)colflag) |
| | | { |
| | | flag = false; |
| | | } |
| | | else |
| | | { |
| | | flag = true; |
| | | } |
| | | var write= plcService.WriteValuePointNew(col.DbNumber, col.Offset, flag); |
| | | if(!write.result) |
| | | { |
| | | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}æ°éå¿è·³åå
¥å¼å¸¸ï¼{write.resMsg}"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{WorkingProcedure}æ°éå¿è·³åå
¥å¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_HMIBeartBeatMonitor = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºå¿è·³ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºå¿è·³å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_HMIBeartBeatMonitor = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºå¿è·³ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºå¿è·³ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// HML读å |
| | | /// </summary> |
| | | public class HMI_WorkpieceReading : DataCaptureHandler |
| | | { |
| | | public static readonly HMI_WorkpieceReading Instance = new HMI_WorkpieceReading(); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public HMI_WorkpieceReading() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·æ°æ°æ®å表 |
| | | /// </summary> |
| | | /// <param name="dataCaptureConfig"></param> |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°æ®ééå¼å§ |
| | | /// </summary> |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "RHMIOP104001": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "RHMIOP2001": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "RHMIOP303501": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "RHMIOP5001": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "RHMIOP6001": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | |
| | | //switch (_dataCaptureConfig.DataCapturePointCode) |
| | | //{ |
| | | // case "RHMIOP104001": |
| | | // SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // break; |
| | | // case "RHMIOP2001": |
| | | // SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // break; |
| | | // case "RHMIOP303501": |
| | | // SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // break; |
| | | // case "RHMIOP5001": |
| | | // SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // break; |
| | | // case "RHMIOP6001": |
| | | // SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // break; |
| | | // default: |
| | | // break; |
| | | //} |
| | | |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)}"; |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)}"; |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)}"; |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)}"; |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | object value1 = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, "88", 2, PLCManger.GetTypeForString("int")); |
| | | |
| | | string value2 = value1 == null ? "" : value1.ToString(); |
| | | if ("21" .Equals(value2)) |
| | | { |
| | | //10ï¼æ°é读å失败 |
| | | //11 :æ°é读åæå |
| | | //21ï¼æ«ç æåæ è®° |
| | | plcService.WriteValuePointNew(_dataCaptureConfig.DbNumber, "88", 11); |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | |
| | | if (value != null) |
| | | { |
| | | string WorkPieceID = value.ToString().Trim(); |
| | | |
| | | if (WorkPieceID.Length == 22) |
| | | { |
| | | // æ ¹æ®å·¥ä»¶å·è·åå·¥ä»¶ä¿¡æ¯ |
| | | WorkPieceInfo info = null; |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == WorkPieceID&&o.IsDeleted==false).FirstOrDefault(); |
| | | } |
| | | |
| | | if (info != null && info.Id > 0) |
| | | { |
| | | // æå¯¹åºç工件信æ¯åå
¥PLC对åºå°å |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "WorkPieceID": |
| | | //plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.WorkPieceID); |
| | | break; |
| | | case "WorkingProcedureCurrent": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.WorkingProcedureCurrent); |
| | | break; |
| | | case "WorkPieceState": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.WorkPieceState); |
| | | break; |
| | | case "QualityState": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, info.QualityState); |
| | | break; |
| | | case "ReaderEndState": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, 11); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "ReaderEndState": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, 10); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "RHMIOP104001": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; |
| | | break; |
| | | case "RHMIOP2001": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; |
| | | break; |
| | | case "RHMIOP303501": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; |
| | | break; |
| | | case "RHMIOP5001": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; |
| | | break; |
| | | case "RHMIOP6001": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ã卿°æ®åºä¸ä¸åå¨"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "ReaderEndState": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, 10); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "RHMIOP104001": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | break; |
| | | case "RHMIOP2001": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | break; |
| | | case "RHMIOP303501": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | break; |
| | | case "RHMIOP5001": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | break; |
| | | case "RHMIOP6001": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"HMI读åçæ§ äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "ReaderEndState": |
| | | plcService.WriteValuePointNew(col.DbNumber, col.Offset, 10); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(1000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "RHMIOP104001": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "RHMIOP2001": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "RHMIOP303501": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "RHMIOP5001": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "RHMIOP6001": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "RHMIOP104001": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "RHMIOP2001": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "RHMIOP303501": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "RHMIOP5001": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "RHMIOP6001": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Entity.Migrations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// HMIåå
¥ |
| | | /// </summary> |
| | | public class HMI_WorkpieceWrite : DataCaptureHandler |
| | | { |
| | | public static readonly HMI_WorkpieceWrite Instance = new HMI_WorkpieceWrite(); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public HMI_WorkpieceWrite() |
| | | { |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·æ°æ°æ®å表 |
| | | /// </summary> |
| | | /// <param name="dataCaptureConfig"></param> |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°æ®ééå¼å§ |
| | | /// </summary> |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "WHMIOP104002": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "WHMIOP2002": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "WHMIOP303502": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "WHMIOP5002": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | case "WHMIOP6002": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | if (plcService == null && !plcService.IsConnected) |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "WHMIOP104002": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | break; |
| | | case "WHMIOP2002": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | break; |
| | | case "WHMIOP303502": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | break; |
| | | case "WHMIOP5002": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | break; |
| | | case "WHMIOP6002": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | plcService.Close(); |
| | | plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | Object WorkPieceID = null; |
| | | Object QualityState = null; |
| | | Object CheckUpdate = null; |
| | | Object QualityErrorInfo = null; |
| | | |
| | | int UpdateIsOK = 0; |
| | | |
| | | // æå¯¹åºç工件信æ¯åå
¥PLC对åºå°å |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "WorkPieceID": |
| | | WorkPieceID = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | break; |
| | | case "QualityState": |
| | | QualityState = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | break; |
| | | case "CheckUpdate": |
| | | CheckUpdate = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //plcService.WriteValuePoint(col.DbNumber, col.Offset, 0, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | break; |
| | | case "QualityErrorInfo": |
| | | QualityErrorInfo = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | break; |
| | | case "UpdateIsOK": |
| | | UpdateIsOK = col.IsFeedback; |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if ((bool)CheckUpdate) |
| | | { |
| | | // 读åå
å®¹æ£æ¥ |
| | | StringBuilder builder = new StringBuilder(); |
| | | if (WorkPieceID != null) |
| | | { |
| | | if (WorkPieceID.ToString().Length != 22) |
| | | { |
| | | builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½!"); |
| | | } |
| | | |
| | | if (QualityState == null) |
| | | { |
| | | builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãè´¨éç¶æä¸è½ä¸ºç©º"); |
| | | } |
| | | else |
| | | { |
| | | if ((int)QualityState != 1 && (int)QualityState != 2 && (int)QualityState != 3) |
| | | { |
| | | builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãè´¨éç¶æã" + QualityState + "ãé误ï¼åªè½ä¸º1ï¼åæ ¼ 2ï¼ä¸åæ ¼ 3ï¼çä¼¼"); |
| | | } |
| | | else if ((int)QualityState == 2 || (int)QualityState == 3) |
| | | { |
| | | if (QualityErrorInfo == null|| string.IsNullOrEmpty(QualityErrorInfo.ToString())) |
| | | { |
| | | builder.AppendLine("工件äºç»´ç å¼ï¼ã" + WorkPieceID + "ãè´¨éä¸åæ ¼åå ä¸è½ä¸ºç©º"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(builder.ToString())) |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "WHMIOP104002": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $"{WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); |
| | | break; |
| | | case "WHMIOP2002": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $"{WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); |
| | | break; |
| | | case "WHMIOP303502": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $"{WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); |
| | | break; |
| | | case "WHMIOP5002": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $"{WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); |
| | | break; |
| | | case "WHMIOP6002": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $"{WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // æå¯¹åºç工件信æ¯åå
¥PLC对åºå°å |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "UpdateIsOK": |
| | | var aa = plcService.WriteValuePointNew(col.DbNumber, col.Offset, false); |
| | | break; |
| | | |
| | | default: |
| | | //plcService.WriteValuePoint(col.DbNumber, col.Offset, "", PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString()); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // å·¥ä»¶ä¿¡æ¯ |
| | | WorkPieceInfo info = null; |
| | | // å·¥ä»¶æ¥æ¶ä¿¡æ¯å±¥å |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | info = new WorkPieceInfo(); |
| | | info = db.WorkPieceInfo.Where(o => o.WorkPieceID == WorkPieceID.ToString()&&o.IsDeleted==false).FirstOrDefault(); |
| | | |
| | | if (info == null) |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "WHMIOP104002": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå
¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; |
| | | break; |
| | | case "WHMIOP2002": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå
¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; |
| | | break; |
| | | case "WHMIOP303502": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå
¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; |
| | | break; |
| | | case "WHMIOP5002": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå
¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; |
| | | break; |
| | | case "WHMIOP6002": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $"工件{WorkPieceID}ï¼{WorkingProcedure}å·¥åºHMLåå
¥çæ§æ¶ï¼å·¥ä»¶ä¿¡æ¯è¡¨ä¸ä¸åå¨"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"å·¥åºHMLåå
¥çæ§ï¼æ°æ®è¿åæ ¼å¼å¼å¸¸ï¼" + builder.ToString()); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | info.QualityState = Convert.ToInt32(QualityState); |
| | | info.QualityStateUpdateUser = "HMI"; |
| | | info.QualityStateUpdateTime = DateTime.Now; |
| | | info.QualityStateUpdateMode = "èªå¨"; |
| | | info.QualityErrorInfo = QualityErrorInfo.ToString(); |
| | | |
| | | |
| | | // åå
¥å·¥ä»¶æ¥æ¶ä¿¡æ¯å±¥å |
| | | //wplog = CommonManager.Instance.GetWorkPieceID(wplog, LogType.PLCHMI04); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkPieceID = info.WorkPieceID; |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.QualityState = Convert.ToInt32(QualityState); |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | db.WorkPieceLog.Add(wplog); |
| | | db.SaveChanges(); |
| | | } |
| | | |
| | | |
| | | |
| | | if (UpdateIsOK == 1) |
| | | { |
| | | // æå¯¹åºç工件信æ¯åå
¥PLC对åºå°å |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "UpdateIsOK": |
| | | var aa = plcService.WriteValuePointNew(col.DbNumber, col.Offset, true); |
| | | break; |
| | | //case "WorkPieceID": |
| | | // plcService.WriteValuePointNew(col.DbNumber, col.Offset, ""); |
| | | // break; |
| | | |
| | | default: |
| | | //plcService.WriteValuePoint(col.DbNumber, col.Offset, "", PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | switch (col.DataCaptureColumnTabelName) |
| | | { |
| | | case "UpdateIsOK": |
| | | var aa = plcService.WriteValuePointNew(col.DbNumber, col.Offset, true); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "WHMIOP104002": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "WHMIOP2002": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "WHMIOP303502": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "WHMIOP5002": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | case "WHMIOP6002": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}å·¥åºHMI读åäºç»´ç çæ§ï¼åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (_dataCaptureConfig.DataCapturePointCode) |
| | | { |
| | | case "WHMIOP104002": |
| | | SystemValue.lbl_Alert_HMIOP104001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "WHMIOP2002": |
| | | SystemValue.lbl_Alert_HMIOP2001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "WHMIOP303502": |
| | | SystemValue.lbl_Alert_HMIOP303501 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "WHMIOP5002": |
| | | SystemValue.lbl_Alert_HMIOP5001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | case "WHMIOP6002": |
| | | SystemValue.lbl_Alert_HMIOP6001 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure}å·¥åºHML读åäºç»´ç çæ§ ä¸åæ°æ®ééï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{WorkingProcedure}å·¥åºHMLåå
¥çæ§ï¼ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using iWare_SCADA_Model; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | public class PLCFactory |
| | | { |
| | | public static PLCService GetOPCService(PLCServiceTypeEnum _OPCServiceTypeEnum, HslCommunicationParam hslcpParam) |
| | | { |
| | | PLCService plcService = null; |
| | | switch (_OPCServiceTypeEnum) |
| | | { |
| | | case PLCServiceTypeEnum.Siemens_HslCommunicationService: |
| | | plcService = new Siemens_HslCommunicationService(hslcpParam); |
| | | break; |
| | | } |
| | | return plcService; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using HslCommunication.Profinet.Siemens; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using log4net; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | public class PLCManger |
| | | { |
| | | /// <summary> |
| | | /// å®ä¾åå个PLCService |
| | | /// </summary> |
| | | /// <param name="_ip"></param> |
| | | /// <param name="device"></param> |
| | | /// <returns></returns> |
| | | public static PLCService GetSinglePLCService(DataCaptureConfig dataCaptureConfig) |
| | | { |
| | | HslCommunicationParam hslCommunicationParam = new HslCommunicationParam() |
| | | { |
| | | cpu = (SiemensPLCS)dataCaptureConfig.DataCapturePLCType, |
| | | ip = dataCaptureConfig.PLCIP, |
| | | //rack = WareSdaStruct.Srm_Rack, |
| | | //slot = WareSdaStruct.Srm_Slot, |
| | | port = dataCaptureConfig.PLCPort.Value |
| | | }; |
| | | PLCService PLCService = PLCFactory.GetOPCService(PLCServiceTypeEnum.Siemens_HslCommunicationService, hslCommunicationParam); |
| | | return PLCService; |
| | | } |
| | | public static Type GetTypeForString(string datatype) |
| | | { |
| | | switch (datatype.ToLower()) |
| | | { |
| | | case "int": |
| | | return typeof(Int16); |
| | | case "dint": |
| | | return typeof(Int32); |
| | | case "char": |
| | | return typeof(Char); |
| | | case "real": |
| | | return typeof(double); |
| | | //return typeof(Single); |
| | | case "bool": |
| | | return typeof(bool); |
| | | case "string": |
| | | return typeof(string); |
| | | case "byte": |
| | | return typeof(Byte); |
| | | case "other": |
| | | return typeof(string); |
| | | default: |
| | | return typeof(string); |
| | | } |
| | | } |
| | | |
| | | public static object GetVauleForObjectType(object vaule,TypeCode type) |
| | | { |
| | | |
| | | switch (type) |
| | | { |
| | | case TypeCode.Int16: |
| | | return Convert.ToInt16(vaule); |
| | | case TypeCode.Int32: |
| | | return Convert.ToInt32(vaule); |
| | | case TypeCode.Char: |
| | | return Convert.ToChar(vaule); |
| | | case TypeCode.Single: |
| | | return Convert.ToSingle(vaule); |
| | | case TypeCode.Boolean: |
| | | return Convert.ToBoolean(vaule); |
| | | case TypeCode.String: |
| | | return Convert.ToString(vaule); |
| | | case TypeCode.Byte: |
| | | return Convert.ToByte(vaule); |
| | | |
| | | default: |
| | | return Convert.ToString(vaule); |
| | | } |
| | | } |
| | | |
| | | public static LogType GetLogTypeForWorkingProcedure(string wp) |
| | | { |
| | | switch(wp) |
| | | { |
| | | |
| | | case "OP05": |
| | | return LogType.PLCOP05; |
| | | case "OP10": |
| | | return LogType.PLCOP10; |
| | | case "OP20": |
| | | return LogType.PLCOP20; |
| | | case "OP30": |
| | | return LogType.PLCOP30; |
| | | case "OP35": |
| | | return LogType.PLCOP35; |
| | | case "OP40": |
| | | return LogType.PLCOP40; |
| | | case "OP50": |
| | | return LogType.PLCOP50; |
| | | case "OP60": |
| | | return LogType.PLCOP60; |
| | | case "OP70": |
| | | return LogType.PLCOP70; |
| | | case "OP80": |
| | | return LogType.PLCOP80; |
| | | case "HMI": |
| | | return LogType.PLCHMI; |
| | | default: |
| | | return LogType.PLCService; |
| | | } |
| | | } |
| | | |
| | | public static string GetWorkPieceIDForPLC(DataCaptureConfig _dataCaptureConfig,PLCService plcService) |
| | | { |
| | | try |
| | | { |
| | | var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | return valueid.ToString().Trim(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {_dataCaptureConfig.WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | public class PLCService |
| | | { |
| | | public LogType _LogType; |
| | | public bool IsConnected { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå¼æå¡ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public virtual MessageModel OpenService() |
| | | { |
| | | this.IsConnected = false; |
| | | return new MessageModel() |
| | | { |
| | | result = true |
| | | }; |
| | | } |
| | | ///// <summary> |
| | | ///// åå
¥ |
| | | ///// </summary> |
| | | ///// <param name="address">å°å</param> |
| | | ///// <param name="value">å¼</param> |
| | | ///// <returns></returns> |
| | | //public virtual MessageModel WriteValuePoint(string dbNumber, string offset, object value) |
| | | //{ |
| | | // return new MessageModel() |
| | | // { |
| | | // result = true |
| | | // }; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// åå
¥ |
| | | /// </summary> |
| | | /// <param name="fullAddress">å°å</param> |
| | | /// <param name="value">å¼</param> |
| | | /// <param name="proObj">屿§å¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | public virtual MessageModel WriteValuePointNew(string dbNumber, string offset, object value) |
| | | { |
| | | return new MessageModel() |
| | | { |
| | | result = true |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// åå
¥ |
| | | /// </summary> |
| | | /// <param name="address">å°å</param> |
| | | /// <param name="value">å¼</param> |
| | | /// <param name="proObj">屿§å¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | public virtual MessageModel WriteValuePoint(string dbNumber, string offset, object value, Object proObj) |
| | | { |
| | | return new MessageModel() |
| | | { |
| | | result = true |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå
¥ |
| | | /// </summary> |
| | | /// <param name="fullAddress">å°å</param> |
| | | /// <param name="value">å¼</param> |
| | | /// <param name="proObj">屿§å¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | public virtual MessageModel WriteValuePoint(string fullAddress, object value, Object proObj) |
| | | { |
| | | return new MessageModel() |
| | | { |
| | | result = true |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读å |
| | | /// </summary> |
| | | /// <param name="dbNumber">DBåå</param> |
| | | /// <param name="offset">åç§»é</param> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public virtual object ReadValuePoint(string dbNumber, string offset,int stringlen, Type type = default(Type)) |
| | | { |
| | | return null; |
| | | } |
| | | /// <summary> |
| | | /// 读å |
| | | /// </summary> |
| | | /// <param name="dbNumber">DBåå</param> |
| | | /// <param name="offset">åç§»é</param> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public virtual object ReadValuePoint(string dbNumber, string offset, Type type = default(Type)) |
| | | { |
| | | return null; |
| | | } |
| | | public virtual object ReadValuePointV2(string fullAddress, Type type = default(Type), int stringlen = 0) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读å |
| | | /// </summary> |
| | | /// <param name="fullAddress">å°å</param> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public virtual object ReadValuePoint(string fullAddress, Type type = default(Type)) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæç»çDBåå°å |
| | | /// </summary> |
| | | /// <param name="dbNumber"></param> |
| | | /// <param name="offset"></param> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public virtual string GetAddress(string dbNumber, string offset, Type type = default(Type)) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
³éè¿æ¥ |
| | | /// </summary> |
| | | public virtual void Close() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Net; |
| | | using System.Security.Cryptography; |
| | | using HslCommunication; |
| | | using HslCommunication.Profinet.Siemens; |
| | | using iTextSharp.text.pdf; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// 西ä¹åPLC |
| | | /// </summary> |
| | | public class Siemens_HslCommunicationService : PLCService |
| | | { |
| | | private SiemensS7Net siemensTcpNet = null; |
| | | private readonly SiemensPLCS _cpu; |
| | | private readonly string _ip; |
| | | private readonly int _port; |
| | | public Siemens_HslCommunicationService(HslCommunicationParam hslcpParam) |
| | | { |
| | | _cpu = hslcpParam.cpu; |
| | | _ip = hslcpParam.ip; |
| | | _port = hslcpParam.port; |
| | | |
| | | _LogType = LogType.HslCommunicationService; |
| | | } |
| | | /// <summary> |
| | | /// æå¼è¿æ¥ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public override MessageModel OpenService() |
| | | { |
| | | MessageModel fre = new MessageModel(); |
| | | try |
| | | { |
| | | //åå»ºè¿æ¥å¯¹è±¡ |
| | | siemensTcpNet = new SiemensS7Net(_cpu, _ip); |
| | | siemensTcpNet.IpAddress = _ip; |
| | | siemensTcpNet.Port = Convert.ToInt16(_port); |
| | | //siemensTcpNet.Rack = Convert.ToInt16(tb_Rack.Text); |
| | | //siemensTcpNet |
| | | //ä¸è®°å½æ¥å¿ï¼ï¼ï¼ï¼å¦åæä»¶å¤ªå¤§å¯¼è´é®é¢ï¼ |
| | | //siemensTcpNet.LogNet = new HslCommunication.LogNet.LogNetSingle("Siemens_HslCommunicationService_logs.txt"); |
| | | |
| | | OperateResult operateResult = siemensTcpNet.ConnectServer(); |
| | | if (operateResult.IsSuccess) |
| | | { |
| | | base.IsConnected = true; |
| | | fre.result = true; |
| | | return fre; |
| | | } |
| | | base.IsConnected = false; |
| | | fre.result = false; |
| | | fre.resMsg = "æå¼å¤±è´¥," + operateResult.Message; |
| | | return fre; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | base.IsConnected = false; |
| | | Log4NetHelper.WriteErrorLog(_LogType, "åå§å西é¨åPLCåºç°å¼å¸¸", ex); |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | public override MessageModel WriteValuePointNew(string dbNumber, string offset, object value) |
| | | {//æ¤æ¹æ³ä¸å使ç¨è¥¿é¨åPLC |
| | | if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) |
| | | { |
| | | throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); |
| | | } |
| | | MessageModel fre = new MessageModel(); |
| | | OperateResult operateResult = null; |
| | | //Type proObjType = proObj.GetType(); |
| | | var address = GetAddress(dbNumber, offset, value.GetType()); |
| | | try |
| | | { |
| | | if (value is bool) |
| | | { |
| | | bool myData = Convert.ToBoolean(value); |
| | | operateResult = siemensTcpNet.Write(address, myData); |
| | | } |
| | | else if (value is int) |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, Int16.Parse(value.ToString())); |
| | | } |
| | | else if (value is short) |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, (short)value); |
| | | } |
| | | else if (value is string) |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, (string)value); |
| | | } |
| | | else if (value is char) |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, (char)value); |
| | | } |
| | | else if (value is double|| value is float) |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, (double)value); |
| | | } |
| | | else |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, value.ToString()); |
| | | } |
| | | if (!operateResult.IsSuccess) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå
¥åºç°å¼å¸¸:" + operateResult.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), null); |
| | | fre.result = false; |
| | | fre.resMsg = "åå
¥å¤±è´¥:" + operateResult.Message; |
| | | } |
| | | else |
| | | { |
| | | fre.result = true; |
| | | //Log4NetHelper.WriteInfoLog(_LogType, String.Format("åå
¥æåï¼åå
¥å°å:{0},å¼:{1}", address, value.ToString())); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå
¥åºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), ex); |
| | | fre.result = false; |
| | | fre.resMsg = "åå
¥å¤±è´¥:" + ex.Message; |
| | | } |
| | | return fre; |
| | | } |
| | | /// <summary> |
| | | /// åå
¥ |
| | | /// </summary> |
| | | /// <param name="address">å°å</param> |
| | | /// <param name="value">å¼</param> |
| | | /// <returns></returns> |
| | | public override MessageModel WriteValuePoint(string dbNumber, string offset, object value, Object proObj) |
| | | {//æ¤æ¹æ³ä¸å使ç¨è¥¿é¨åPLC |
| | | if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) |
| | | { |
| | | throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); |
| | | } |
| | | MessageModel fre = new MessageModel(); |
| | | OperateResult operateResult = null; |
| | | Type proObjType = proObj.GetType(); |
| | | var address = GetAddress(dbNumber, offset, value.GetType()); |
| | | try |
| | | { |
| | | if (proObjType == typeof(Boolean)) |
| | | {//å¸å°ç±»å |
| | | bool myData = Convert.ToBoolean(value); |
| | | operateResult = siemensTcpNet.Write(address, myData); |
| | | } |
| | | //æµ®ç¹ |
| | | else if (proObjType == typeof(double) || proObjType == typeof(float)) |
| | | { |
| | | double MyData = Convert.ToDouble(value); |
| | | operateResult = siemensTcpNet.Write(address, MyData); |
| | | |
| | | } |
| | | //æ´æ° |
| | | else if (proObjType == typeof(Int16) || proObjType == typeof(short)) |
| | | { |
| | | short MyData = Convert.ToInt16(value); |
| | | operateResult = siemensTcpNet.Write(address, MyData);//æ¤å¤éè¦æ³¨æï¼çæ´åçæ¤å¤ä¸ç¡®å®æ¯å¦ä¼æ¥éï¼éè¦æµè¯ |
| | | //operateResult = siemensTcpNet.Write(address, MyData.ConvertToUshort()); |
| | | } |
| | | //åæ´æ° |
| | | else if (proObjType == typeof(Int32)) |
| | | { |
| | | int myData = Convert.ToInt32(value); |
| | | operateResult = siemensTcpNet.Write(address, myData); |
| | | } |
| | | //Char |
| | | else if (proObjType == typeof(Char)) |
| | | {//charè¦è½¬æ¢æintç±»åï¼åç»PLC |
| | | int myData = Convert.ToInt32(value); |
| | | byte b = (byte)myData; |
| | | operateResult = siemensTcpNet.Write(address, b); |
| | | } |
| | | //String |
| | | else if (proObjType == typeof(String)) |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, value.ToString()); |
| | | } |
| | | else |
| | | { |
| | | operateResult = siemensTcpNet.Write(address, value.ToString()); |
| | | } |
| | | if (!operateResult.IsSuccess) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå
¥åºç°å¼å¸¸:" + operateResult.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), null); |
| | | fre.result = false; |
| | | fre.resMsg = "åå
¥å¤±è´¥:" + operateResult.Message; |
| | | } |
| | | else |
| | | { |
| | | fre.result = true; |
| | | //Log4NetHelper.WriteInfoLog(_LogType, String.Format("åå
¥æåï¼åå
¥å°å:{0},å¼:{1}", address, value.ToString())); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("åå
¥åºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0},å¼:{1}", address, value.ToString()), ex); |
| | | fre.result = false; |
| | | fre.resMsg = "åå
¥å¤±è´¥:" + ex.Message; |
| | | } |
| | | return fre; |
| | | } |
| | | |
| | | public override MessageModel WriteValuePoint(string fullAddress, object value, object proObj) |
| | | { |
| | | var arr = fullAddress.Split(SystemValue.PLCDBADDRESS_SEPARATE); |
| | | string dbNumber = arr[0]; |
| | | string offset = arr[1]; |
| | | return WriteValuePoint(dbNumber, offset, value, proObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读å |
| | | /// </summary> |
| | | /// <param name="dbNumber">DBåå</param> |
| | | /// <param name="offset">åç§»é</param> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public override object ReadValuePoint(string dbNumber, string offset, int stringlen, Type type = default(Type)) |
| | | { |
| | | if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) |
| | | { |
| | | throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); |
| | | } |
| | | var address = GetAddress(dbNumber, offset, type); |
| | | try |
| | | { |
| | | if (type == typeof(bool)) |
| | | {//å¸å°è¦è½¬æ¢æ1å0åå
¥ |
| | | bool MyPlcData = siemensTcpNet.ReadBool(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //æµ®ç¹ |
| | | else if (type == typeof(double) || type == typeof(float)) |
| | | { |
| | | var MyPlcData = siemensTcpNet.ReadFloat(address).Content; |
| | | return MyPlcData; |
| | | |
| | | } |
| | | //æ´æ° |
| | | else if (type == typeof(short)) |
| | | { |
| | | int MyPlcData = siemensTcpNet.ReadInt16(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //åæ´æ° |
| | | else if (type == typeof(Int32)) |
| | | { |
| | | long MyPlcData = siemensTcpNet.ReadInt32(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //Char |
| | | else if (type == typeof(Char)) |
| | | {//charè¦è½¬æ¢æintç±»åï¼åç»PLC |
| | | char MyPlcData = (char)(siemensTcpNet.ReadByte(address).Content); |
| | | return MyPlcData.ToString(); |
| | | } |
| | | //String |
| | | else if (type == typeof(String)) |
| | | { |
| | | var data = siemensTcpNet.ReadString(address, (ushort)stringlen); |
| | | var MyPlcData = siemensTcpNet.ReadString(address, (ushort)stringlen).Content; |
| | | //write.Message = siemensTcpNet.ReadString(write.Name).Message; |
| | | |
| | | //string MyPlcData = siemensTcpNet.ReadString(address).Content; |
| | | return MyPlcData == null ? "" : MyPlcData.ToString(); |
| | | } |
| | | else |
| | | { |
| | | var MyPlcData = siemensTcpNet.ReadString(address).Content; |
| | | return MyPlcData == null ? "" : MyPlcData.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("读ååºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0}", address), ex); |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 读å |
| | | /// </summary> |
| | | /// <param name="dbNumber">DBåå</param> |
| | | /// <param name="offset">åç§»é</param> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public override object ReadValuePoint(string dbNumber, string offset, Type type = default(Type)) |
| | | { |
| | | if (dbNumber.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) |
| | | { |
| | | throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); |
| | | } |
| | | var address = GetAddress(dbNumber, offset, type); |
| | | try |
| | | { |
| | | if (type == typeof(bool)) |
| | | {//å¸å°è¦è½¬æ¢æ1å0åå
¥ |
| | | var MyPlcData11 = siemensTcpNet.ReadBool(address); |
| | | bool MyPlcData = siemensTcpNet.ReadBool(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //æµ®ç¹ |
| | | else if (type == typeof(double) || type == typeof(float)) |
| | | { |
| | | var MyPlcData = siemensTcpNet.ReadFloat(address).Content; |
| | | return MyPlcData; |
| | | |
| | | } |
| | | //æ´æ° |
| | | else if (type == typeof(short)) |
| | | { |
| | | int MyPlcData = siemensTcpNet.ReadInt16(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //åæ´æ° |
| | | else if (type == typeof(Int32)) |
| | | { |
| | | long MyPlcData = siemensTcpNet.ReadInt32(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //Char |
| | | else if (type == typeof(Char)) |
| | | {//charè¦è½¬æ¢æintç±»åï¼åç»PLC |
| | | char MyPlcData = (char)(siemensTcpNet.ReadByte(address).Content); |
| | | return MyPlcData.ToString(); |
| | | } |
| | | //String |
| | | else if (type == typeof(String)) |
| | | { |
| | | string MyPlcData = siemensTcpNet.ReadString(address).Content; |
| | | return MyPlcData == null ? "" : MyPlcData.ToString(); |
| | | } |
| | | else |
| | | { |
| | | var MyPlcData = siemensTcpNet.ReadString(address).Content; |
| | | return MyPlcData == null ? "" : MyPlcData.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("读ååºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0}", address), ex); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | public override object ReadValuePointV2(string fullAddress, Type type = default(Type), int stringlen=0) |
| | | { |
| | | if (fullAddress.IndexOf(SystemValue.PLCDBADDRESS_SEPARATE.ToString()) > -1) |
| | | { |
| | | throw new Exception("忰䏿£ç¡®ï¼ä¸åºè¯¥å¸¦" + SystemValue.PLCDBADDRESS_SEPARATE.ToString()); |
| | | } |
| | | var address = fullAddress; |
| | | |
| | | try |
| | | { |
| | | if (type == typeof(bool)) |
| | | {//å¸å°è¦è½¬æ¢æ1å0åå
¥ |
| | | bool MyPlcData = siemensTcpNet.ReadBool(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //æµ®ç¹ |
| | | else if (type == typeof(double) || type == typeof(float)) |
| | | { |
| | | var MyPlcData = siemensTcpNet.ReadFloat(address).Content; |
| | | return MyPlcData; |
| | | |
| | | } |
| | | //æ´æ° |
| | | else if (type == typeof(short)) |
| | | { |
| | | int MyPlcData = siemensTcpNet.ReadInt16(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //åæ´æ° |
| | | else if (type == typeof(Int32)) |
| | | { |
| | | long MyPlcData = siemensTcpNet.ReadInt32(address).Content; |
| | | return MyPlcData; |
| | | } |
| | | //Char |
| | | else if (type == typeof(Char)) |
| | | {//charè¦è½¬æ¢æintç±»åï¼åç»PLC |
| | | char MyPlcData = (char)(siemensTcpNet.ReadByte(address).Content); |
| | | return MyPlcData.ToString(); |
| | | } |
| | | //String |
| | | else if (type == typeof(String)) |
| | | { |
| | | var data = siemensTcpNet.ReadString(address, (ushort)stringlen); |
| | | var MyPlcData = siemensTcpNet.ReadString(address, (ushort)stringlen).Content; |
| | | //write.Message = siemensTcpNet.ReadString(write.Name).Message; |
| | | |
| | | //string MyPlcData = siemensTcpNet.ReadString(address).Content; |
| | | return MyPlcData == null ? "" : MyPlcData.ToString(); |
| | | } |
| | | else |
| | | { |
| | | var MyPlcData = siemensTcpNet.ReadString(address).Content; |
| | | return MyPlcData == null ? "" : MyPlcData.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(_LogType, String.Format("读ååºç°å¼å¸¸:" + ex.Message + "ï¼å°å:{0}", address), ex); |
| | | throw; |
| | | } |
| | | } |
| | | public override object ReadValuePoint(string fullAddress, Type type = default(Type)) |
| | | { |
| | | var arr = fullAddress.Split(SystemValue.PLCDBADDRESS_SEPARATE); |
| | | string dbNumber = arr[0]; |
| | | string offset = arr[1]; |
| | | return ReadValuePoint(dbNumber, offset, type); |
| | | } |
| | | |
| | | |
| | | public override string GetAddress(string dbNumber, string offset, Type type = default(Type)) |
| | | { |
| | | return "DB" + dbNumber + "." + offset; |
| | | } |
| | | |
| | | public override void Close() |
| | | { |
| | | if (siemensTcpNet != null) |
| | | siemensTcpNet.ConnectClose(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Entity.Core.Common.CommandTrees; |
| | | using System.Data.Entity.Validation; |
| | | using System.Data.SqlTypes; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// åè¦çæ§ |
| | | /// </summary> |
| | | public class AlertMonitor: DataCaptureHandler |
| | | { |
| | | public static readonly AlertMonitor Instance = new AlertMonitor(); |
| | | |
| | | public AlertMonitor() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | while (true) |
| | | { |
| | | |
| | | try |
| | | { |
| | | |
| | | WorkPieceInfoManager.AlertMonitor(LogType.FormMain); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, $"计ç®åè¦å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using iWare_SCADA_Model.TableModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// 读ç 宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_01 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_01 Instance = new DataCaptureHandler_01(); |
| | | |
| | | public DataCaptureHandler_01() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | //var valuecol = plcService.ReadValuePoint("2050", "28", 25, typeof(string)); |
| | | |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | //var valueid = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, _dataCaptureConfig.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //wplog.WorkPieceID = PLCManger.GetWorkPieceIDForPLC(_dataCaptureConfig, plcService); |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | return; |
| | | } |
| | | else |
| | | {//è·åå
¶ä»é
ç½®çå¾
éé项 |
| | | |
| | | //foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | //{ |
| | | // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | |
| | | //} |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | |
| | | return; |
| | | } |
| | | |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_01 = ""; |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg= $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //System.Net.IPHostEntry myEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); |
| | | //string ipAddress = myEntry.AddressList[0].ToString(); |
| | | //string hostname = Environment.MachineName; |
| | | |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (value_01.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨"+ Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿å®ææ è®° 读å工件ç 卿ç±äºå段å{col.DataCaptureColumnTabelName}没æ¾å°å¤±è´¥{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§ä¸çº¿å®ææ è®° åæ®µ{col.DataCaptureColumnTabelName}卿èµå¼å¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //读åäºç»´ç åæ´æ°æ°æ®åº |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | } |
| | | value_01 = value.ToString(); |
| | | |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iTextSharp.text.pdf; |
| | | using iTextSharp.text; |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | using iTextSharp.text.pdf.parser.clipper; |
| | | using iTextSharp.text.pdf.parser; |
| | | using iWare_SCADA_Model.TableModelSC; |
| | | using static System.Net.WebRequestMethods; |
| | | using File = System.IO.File; |
| | | using Spire.Additions.Xps.Schema; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// æµé宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_02: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_02 Instance = new DataCaptureHandler_02(); |
| | | |
| | | public DataCaptureHandler_02() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | wplog.QualityState = (int)QualityState.NG; |
| | | wplog.QualityStateUpdateUser = WorkingProcedure; |
| | | wplog.QualityStateUpdateMode = QualityStateUpdateMode.Auto.ToString(); |
| | | |
| | | //wplog.QualityTo1 = "QualityTo1"; |
| | | //wplog.QualityTo2 = "QualityTo2"; |
| | | //wplog.QualityTo3 = "QualityTo3"; |
| | | //wplog.QualityTo4 = "QualityTo4"; |
| | | //wplog.QualityTo5 = "QualityTo5"; |
| | | //wplog.QualityTo6 = "QualityTo6"; |
| | | //wplog.QualityTo7 = "QualityTo7"; |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | |
| | | return; |
| | | } |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //_dataCaptureConfig.DataCapturePLCType = 5; |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_02 = ""; |
| | | |
| | | string path36 = ConfigHelper.GetConfigString("OP30QualityDataFor36Station");//op30 3å·¥ä½ï¼6å·¥ä½å°å |
| | | string path45 = ConfigHelper.GetConfigString("OP30QualityDataFor45Station");//op30 4å·¥ä½ï¼5å·¥ä½å°å |
| | | string pathOP20 = ConfigHelper.GetConfigString("OP20QualityData"); |
| | | string pathOP60 = ConfigHelper.GetConfigString("OP60QualityData"); |
| | | if (string.IsNullOrEmpty(path36)) |
| | | { |
| | | path36 = @"Z:\"; |
| | | } |
| | | if (string.IsNullOrEmpty(path45)) |
| | | { |
| | | path45 = @"U:\"; |
| | | } |
| | | if (string.IsNullOrEmpty(pathOP20)) |
| | | { |
| | | pathOP20 = @"W:\"; |
| | | } |
| | | if (string.IsNullOrEmpty(pathOP60)) |
| | | { |
| | | pathOP60 = @"V:\"; |
| | | } |
| | | |
| | | if (DataCapturePointCode.Contains("CH3")) |
| | | {//å·¥ä½3 涨æåç© |
| | | path36 = path36 + "kistler_crack"; |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH4")) |
| | | {//å·¥ä½4 颿§ç´§åç© SEQ_04 |
| | | |
| | | path45 = path45 + "NutrunnerData\\FO\\SEQ_04"; |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH5")) |
| | | {//å·¥ä½5 æ§ç´§åç© SEQ_24 |
| | | |
| | | path45 = path45 + "NutrunnerData\\FO\\SEQ_24"; |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH6")) |
| | | {//å·¥ä½6 衬å¥åè£
åç© |
| | | |
| | | path36 = path36 + "kistler_bush"; |
| | | } |
| | | DateTime? fileFindTime = null; |
| | | DateTime? op60QualityTime = null; |
| | | // è´¨éä¿¡æ¯ï¼æ¶¨æåç©... 颿§ç´§åç© é¢æ§ç´§è§åº¦ ç»æ§ç´§åç© ç»æ§ç´§è§åº¦ |
| | | //kistler_crack 涨æåç© å·¥ä½3 涨æåç©ï¼Y - Maximumï¼ è´¨éç»æï¼Resultï¼ |
| | | //kistler_bush åè£
åç© å·¥ä½6 衬å¥åè£
åç©ï¼Y - Maximumï¼ è¡¬å¥åè£
ä½ç§»ï¼Block Xï¼ è´¨éç»æï¼Resultï¼ |
| | | //Bosch_Rexroth /ï¼Ch_0_1.csv / Ch_0_2.csv 两éé åæ¶åææ°çï¼æè
id对åºï¼ï¼ï¼ 颿§ç´§åç©å·¥ä½4 颿§ç´§è§åº¦ 颿§ç´§åç©ï¼T + Nmï¼ è´¨éç»æï¼ç»æï¼ ç®åæä»¶ä¸è½èªå¨çæ åä¸ å士乿§ç´§ç³»ç» |
| | | //Bosch_Rexroth /ï¼Ch_0_3.csv / Ch_0_4.csv 两éé åæ¶åææ°çï¼æè
id对åºï¼ï¼ï¼ ç»æ§ç´§å·¥ä½5 ç»æ§ç´§è§åº¦ æ§ç´§åç©ï¼T + Nmï¼ ç»æ§ç´§è§åº¦ |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æµé宿ã{value_02}ãã{value.ToString()}ãã{_dataCaptureConfig.PLCIP}ãã{_dataCaptureConfig.DbNumber}ãã{_dataCaptureConfig.Offset}ã[{_dataCaptureConfig.DataCapturePLCType}][{plcService.IsConnected.ToString()}]"); |
| | | if (value_02.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è¿å
¥æµé宿ã{value_02}ãã{value.ToString()}ã"); |
| | | |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§æµé宿æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | if(set.PropertyType.FullName.Equals("System.String")) |
| | | { |
| | | set.SetValue(wplog, valuecol.ToString());//ç»å¨æå段èµå¼ |
| | | } |
| | | else |
| | | { |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§æµé宿æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (WorkingProcedure.Equals("OP30")) |
| | | { |
| | | var time = DateTimeHelper.GetDateTime(); |
| | | if (fileFindTime==null) |
| | | { |
| | | fileFindTime = time.AddMinutes(-10); |
| | | } |
| | | |
| | | //è·åæä»¶å¤¹åç§° |
| | | List<string> directorylist = new List<string>(); |
| | | string directory = time.ToString("yyyy-MM-dd_HH"); |
| | | string directoryOther = time.AddSeconds(-30).ToString("yyyy-MM-dd_HH"); |
| | | directorylist.Add(directory); |
| | | if (!directory.Equals(directoryOther)) |
| | | {//妿30ç§åæ¯å¦ä¸ä¸ªæä»¶å¤¹ |
| | | directorylist.Add(directoryOther); |
| | | } |
| | | |
| | | List<FileInfo> files = new List<FileInfo>(); |
| | | foreach (var dir in directorylist) |
| | | { |
| | | try |
| | | { |
| | | if (DataCapturePointCode.Contains("CH3")|| DataCapturePointCode.Contains("CH6")) |
| | | {//å·¥ä½3 涨æåç© |
| | | //æ«æå½åæ¶é´ä¸30ç§ååºç°çæä»¶,ä¸è¬èæå¨15ç§å·¦å³ï¼ä¸¤ä¸ªæå¡å¨æ¶é´ä¸ä¸æ ·ä¼å¯¼è´åä¸å°æä»¶ï¼ |
| | | var newFiles = FileHelper.DetectNewFiles(path36 + @"\" + dir, "*.pdf", 10, fileFindTime.Value, time.AddMinutes(120)); |
| | | foreach (var file in newFiles) |
| | | { |
| | | files.Add((FileInfo)file); |
| | | } |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH4")|| DataCapturePointCode.Contains("CH5")) |
| | | {//å·¥ä½4 颿§ç´§åç© SEQ_04 |
| | | |
| | | //æ«æå½åæ¶é´ä¸30ç§ååºç°çæä»¶,ä¸è¬èæå¨15ç§å·¦å³ï¼ä¸¤ä¸ªæå¡å¨æ¶é´ä¸ä¸æ ·ä¼å¯¼è´åä¸å°æä»¶ï¼ |
| | | var newFiles = FileHelper.DetectNewFiles(path45, "*.txt", 10, fileFindTime.Value, time.AddMinutes(120)); |
| | | foreach (var file in newFiles) |
| | | { |
| | | files.Add((FileInfo)file); |
| | | } |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æµéå®æè¯»åæä»¶{dir}æ°æ®æ¶å¼å¸¸,ééæ¶é´{fileFindTime.Value},é¿å
å·¥åºå®æå¼å¸¸1ï¼", ex); |
| | | } |
| | | |
| | | } |
| | | files = files.OrderByDescending(o => o.LastWriteTime).ToList(); |
| | | if(files.Count>0) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"å·¥ä½ã{DataCapturePointCode}ã工件ã{wplog.WorkPieceID??"空å符"}ãæä»¶{files[0].FullName}æµéå®æè¯»åæä»¶æ°æ®å¼å§"); |
| | | switch (DataCapturePointCode) |
| | | { |
| | | case "OP3002CH3": |
| | | wplog.OP30QualityFilePathCH3 = files[0].FullName; |
| | | wplog.QualityStateStr= FileHelper.ReadPdfFileForSpire(files[0].FullName, "Result"); |
| | | wplog.QualityOP30To1 = FileHelper.ReadPdfFileForSpire(files[0].FullName, "Y-Maximum");//涨æåç© |
| | | break; |
| | | case "OP3002CH4": |
| | | wplog = GetCH4Info(files[0].FullName, wplog); |
| | | wplog.OP30QualityFilePathCH4 = files[0].FullName; |
| | | break; |
| | | case "OP3002CH5": |
| | | wplog = GetCH5Info(files[0].FullName, wplog); |
| | | wplog.OP30QualityFilePathCH5 = files[0].FullName; |
| | | break; |
| | | case "OP3002CH6": |
| | | wplog.OP30QualityFilePathCH6 = files[0].FullName; |
| | | wplog.QualityStateStr = FileHelper.ReadPdfFileForSpire(files[0].FullName, "Result"); |
| | | wplog.QualityOP30To6 = FileHelper.ReadPdfFileForSpire(files[0].FullName, "Y-Maximum");//衬å¥åè£
åç© |
| | | wplog.QualityOP30To7 = FileHelper.ReadPdfFileForSpire(files[0].FullName, "Block X");//衬å¥åè£
ä½ç§» |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | fileFindTime = files[0].LastWriteTime; |
| | | } |
| | | } |
| | | else if(WorkingProcedure.Equals("OP35")) |
| | | { |
| | | if(wplog.OP35OK) |
| | | { |
| | | wplog.QualityStateStr = "OK"; |
| | | } |
| | | else |
| | | { |
| | | wplog.QualityStateStr = "NG"; |
| | | } |
| | | } |
| | | else if(WorkingProcedure.Equals("OP60")) |
| | | { |
| | | |
| | | var time = DateTimeHelper.GetDateTime(); |
| | | if (fileFindTime == null) |
| | | { |
| | | fileFindTime = time.AddMinutes(-10); |
| | | } |
| | | //OP60 éè¦æ«ææä»¶è¯»åè´¨éä¿¡æ¯ |
| | | //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å30ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | List<FileInfo> files = new List<FileInfo>(); |
| | | var newFiles = FileHelper.DetectNewFiles(pathOP60, "*.dfq", 300, fileFindTime.Value, time.AddHours(2)); |
| | | foreach (var file in newFiles) |
| | | { |
| | | files.Add((FileInfo)file); |
| | | } |
| | | if(files.Count()>0) |
| | | { |
| | | files = files.OrderByDescending(o => o.LastWriteTime).ToList(); |
| | | List<OP60Info> op60Infos = new List<OP60Info>(); |
| | | foreach (var file in files) |
| | | {//åååºå¹é
çæä»¶å为工件å·çæä»¶ |
| | | if (file.Name.Contains("SP-" + DataCapturePointCode.Substring(DataCapturePointCode.Length - 1, 1))) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}ä¸çº¿å®æè¯»åå°æä»¶{file.Name}ï¼æ¯æå®ç工件"); |
| | | |
| | | var datatable = CSVHelper.ReadCSVList(file.FullName); |
| | | if (datatable.Count < 106) |
| | | {//è´¨éæ°æ®ä»106è¡å¼å§ |
| | | continue; |
| | | } |
| | | datatable.Reverse(); |
| | | System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); |
| | | byte[] byteArray = new byte[] { (byte)15 }; |
| | | string strCharacter = asciiEncoding.GetString(byteArray); |
| | | var list = datatable[0].Split(new String[] { strCharacter }, StringSplitOptions.None); |
| | | byte[] byteArray2 = new byte[] { (byte)20 }; |
| | | string strCharacter2 = asciiEncoding.GetString(byteArray2); |
| | | foreach (var item in list) |
| | | { |
| | | var listitem = item.Split(new String[] { strCharacter2 }, StringSplitOptions.None); |
| | | if (listitem.Count() == 3) |
| | | { |
| | | OP60Info info = new OP60Info(); |
| | | info.datetime = listitem[2]; |
| | | info.col2 = listitem[1]; |
| | | info.value = listitem[0]; |
| | | info.datetimeHandle = CommonManager.GetOP60Time(info.datetime); |
| | | op60Infos.Add(info); |
| | | } |
| | | } |
| | | if(op60Infos.Count()>=2) |
| | | { |
| | | if(op60QualityTime.HasValue) |
| | | { |
| | | if(op60Infos[0].datetimeHandle> op60QualityTime.Value) |
| | | { |
| | | wplog.QualityOP60To1 = op60Infos[0].value; |
| | | wplog.QualityOP60To2 = op60Infos[1].value; |
| | | wplog.OP60QualityFilePath = file.FullName; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wplog.QualityOP60To1 = op60Infos[0].value; |
| | | wplog.QualityOP60To2 = op60Infos[1].value; |
| | | wplog.OP60QualityFilePath = file.FullName; |
| | | } |
| | | op60QualityTime = op60Infos[0].datetimeHandle; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}ä¸çº¿å®æè¯»åæä»¶{file.FullName}䏿¯æå®å·¥ä»¶{wplog.WorkPieceID}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (WorkingProcedure.Equals("OP20")) |
| | | { |
| | | |
| | | var time = DateTimeHelper.GetDateTime(); |
| | | if (fileFindTime == null) |
| | | { |
| | | fileFindTime = time.AddMinutes(-60); |
| | | } |
| | | //OP20 éè¦æ«ææä»¶è¯»åè´¨éä¿¡æ¯ |
| | | //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å30ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | List<FileInfo> files = new List<FileInfo>(); |
| | | var newFiles = FileHelper.DetectNewFiles(pathOP20, "*.dfq", 300, fileFindTime.Value, time.AddHours(2)); |
| | | foreach (var file in newFiles) |
| | | { |
| | | files.Add((FileInfo)file); |
| | | } |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"å·¥ä½ã{DataCapturePointCode}ã工件ã{wplog.WorkPieceID ?? "空å符"}ãè·åå°ã{files.Count()}ã个æä»¶ï¼ã{fileFindTime.Value}ãã{time.AddHours(2)}ã"); |
| | | |
| | | if (files.Count() > 0) |
| | | { |
| | | files = files.OrderByDescending(o => o.LastWriteTime).ToList(); |
| | | List<OP60Info> op60Infos = new List<OP60Info>(); |
| | | foreach (var file in files) |
| | | {//åååºå¹é
çæä»¶å为工件å·çæä»¶ |
| | | if (file.Name.Contains("SP-" + DataCapturePointCode.Substring(DataCapturePointCode.Length - 1, 1))) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}ä¸çº¿å®æè¯»åå°æä»¶{file.Name}ï¼æ¯æå®ç工件"); |
| | | |
| | | var datatable = CSVHelper.ReadCSVList(file.FullName); |
| | | if (datatable.Count < 57) |
| | | {//è´¨éæ°æ®ä»106è¡å¼å§ |
| | | continue; |
| | | } |
| | | datatable.Reverse(); |
| | | System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); |
| | | byte[] byteArray = new byte[] { (byte)15 }; |
| | | string strCharacter = asciiEncoding.GetString(byteArray); |
| | | var list = datatable[0].Split(new String[] { strCharacter }, StringSplitOptions.None); |
| | | byte[] byteArray2 = new byte[] { (byte)20 }; |
| | | string strCharacter2 = asciiEncoding.GetString(byteArray2); |
| | | foreach (var item in list) |
| | | { |
| | | var listitem = item.Split(new String[] { strCharacter2 }, StringSplitOptions.None); |
| | | if (listitem.Count() == 3) |
| | | { |
| | | OP60Info info = new OP60Info(); |
| | | info.datetime = listitem[2]; |
| | | info.col2 = listitem[1]; |
| | | info.value = listitem[0]; |
| | | info.datetimeHandle = CommonManager.GetOP60Time(info.datetime); |
| | | op60Infos.Add(info); |
| | | } |
| | | } |
| | | if (op60Infos.Count() >= 1) |
| | | { |
| | | if (op60QualityTime.HasValue) |
| | | { |
| | | if (op60Infos[0].datetimeHandle > op60QualityTime.Value) |
| | | { |
| | | wplog.QualityOP20To1 = op60Infos[0].value; |
| | | wplog.OP20QualityFilePath = file.FullName; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wplog.QualityOP20To1 = op60Infos[0].value; |
| | | wplog.OP20QualityFilePath = file.FullName; |
| | | } |
| | | op60QualityTime = op60Infos[0].datetimeHandle; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}ä¸çº¿å®æè¯»åæä»¶{file.FullName}䏿¯æå®å·¥ä»¶{wplog.WorkPieceID}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}æµé宿åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æµéå®æè¯»åæä»¶æ°æ®æ¶å¼å¸¸,é¿å
å·¥åºå®æå¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | value_02 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§æµéæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§æµéæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§æµéæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§æµéæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | public WorkPieceLogMiddle GetCH4Info(string FullName, WorkPieceLogMiddle wplog) |
| | | { |
| | | try |
| | | { |
| | | string fileContent = File.ReadAllText(FullName); |
| | | string[] lines2 = fileContent.Split('\n'); |
| | | bool IDCodeIndex = false; |
| | | int Mcount = 0; |
| | | int i = 0; |
| | | int count = 0; |
| | | foreach (string line in lines2) |
| | | { |
| | | count++; |
| | | if (count==4) |
| | | {//è·åè´¨éç»æ |
| | | var list = line.Split(' '); |
| | | if(list.Count()>0) |
| | | { |
| | | var str = list[list.Count() - 1].ToString().Trim(); |
| | | wplog.QualityStateStr= str.Equals("OK")?"OK":"NG"; |
| | | } |
| | | } |
| | | // å¤çæ¯ä¸è¡çé»è¾ |
| | | if (line.Contains("ID-Code"))//两个æ§ç´§ï¼æ¯ä¸ªåé¢é½æID-Code |
| | | { |
| | | i++; |
| | | IDCodeIndex = true; |
| | | Mcount = 0; |
| | | } |
| | | if (IDCodeIndex) |
| | | { |
| | | if (line.Contains(" M "))//第ä¸ä¸ªMè¡æ¯æ§ç´§æ°æ® |
| | | {//颿§ç´§åç© |
| | | Mcount++; |
| | | if (Mcount == 3) |
| | | { |
| | | i++; |
| | | var str = line.Replace("+", "").Replace("-", ""); |
| | | var list = str.Split('M'); |
| | | if (list.Count() == 4) |
| | | { |
| | | if (i <= 2) |
| | | {//CH1 |
| | | wplog.QualityOP30To2 = list[2].ToString().Trim(); |
| | | } |
| | | else |
| | | {//CH2 |
| | | wplog.QualityOP30To8 = list[2].ToString().Trim(); |
| | | } |
| | | } |
| | | IDCodeIndex = false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}CH4å·¥ä½è´¨éæ°æ®å¼å¸¸å·¥ä»¶å·ï¼{(wplog.WorkPieceID == null ? "" : wplog.WorkPieceID)} æä»¶åï¼{FullName}ï¼", ex); |
| | | } |
| | | return wplog; |
| | | |
| | | } |
| | | |
| | | public WorkPieceLogMiddle GetCH5Info(string FullName, WorkPieceLogMiddle wplog) |
| | | { |
| | | try |
| | | { |
| | | string fileContent = File.ReadAllText(FullName); |
| | | string[] lines2 = fileContent.Split('\n'); |
| | | bool IDCodeIndex = false; |
| | | int Mcount = 0; |
| | | int i = 0; |
| | | int count = 0; |
| | | foreach (string line in lines2) |
| | | { |
| | | count++; |
| | | if (count == 4) |
| | | {//è·åè´¨éç»æ |
| | | var list = line.Split(' '); |
| | | if (list.Count() > 0) |
| | | { |
| | | var str = list[list.Count() - 1].ToString().Trim(); |
| | | wplog.QualityStateStr = str.Equals("OK") ? "OK" : "NG"; |
| | | } |
| | | } |
| | | // å¤çæ¯ä¸è¡çé»è¾ |
| | | if (line.Contains("ID-Code"))//两个æ§ç´§ï¼æ¯ä¸ªåé¢é½æID-Code |
| | | { |
| | | i++; |
| | | IDCodeIndex = true; |
| | | Mcount = 0; |
| | | } |
| | | if (IDCodeIndex) |
| | | { |
| | | if (line.Contains(" M "))//第ä¸ä¸ªMè¡æ¯æ§ç´§æ°æ® |
| | | {//æç»åç© |
| | | Mcount++; |
| | | if (Mcount == 3) |
| | | { |
| | | var str = line.Replace("+", "").Replace("-", ""); |
| | | var list = str.Split('M'); |
| | | if (list.Count() == 4) |
| | | { |
| | | if (i == 1) |
| | | {//CH3 |
| | | wplog.QualityOP30To3 = list[2].ToString().Trim(); |
| | | } |
| | | else |
| | | {//CH4 |
| | | wplog.QualityOP30To9 = list[2].ToString().Trim(); |
| | | } |
| | | } |
| | | IDCodeIndex = false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (line.Contains(" MWSP ")) |
| | | {//ç»æ§ç´§åç© ç»æ§ç´§è§åº¦ |
| | | var list = line.Split(new String[] { " MWS " }, StringSplitOptions.None); |
| | | if (list.Count() == 2) |
| | | { |
| | | if (i == 1) |
| | | {//CH3 |
| | | wplog.QualityOP30To4 = list[1].ToString().Trim(); |
| | | } |
| | | else |
| | | {//CH4 |
| | | wplog.QualityOP30To10 = list[1].ToString().Trim(); |
| | | } |
| | | var list2 = list[0].Split(new String[] { " W " }, StringSplitOptions.None); |
| | | if (list2.Count() == 2) |
| | | { |
| | | var str = list2[1].ToString(); |
| | | if (i == 1) |
| | | {//CH3 |
| | | wplog.QualityOP30To5 = str.Substring(0, str.IndexOf("MWSP")).Trim(); |
| | | } |
| | | else |
| | | {//CH4 |
| | | wplog.QualityOP30To11 = str.Substring(0, str.IndexOf("MWSP")).Trim(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}CH5å·¥ä½è´¨éæ°æ®å¼å¸¸å·¥ä»¶å·ï¼{(wplog.WorkPieceID == null ? "" : wplog.WorkPieceID)} æä»¶åï¼{FullName}ï¼", ex); |
| | | } |
| | | return wplog; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// NOOKæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_03: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_03 Instance = new DataCaptureHandler_03(); |
| | | |
| | | public DataCaptureHandler_03() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_03 = ""; |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (value_03.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§NOOKæ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§NOOKæ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | if(_dataCaptureConfig.WorkingProcedure.Equals("OP20") |
| | | //||_dataCaptureConfig.WorkingProcedure.Equals("OP60") |
| | | ) |
| | | {//op20ä¼åæ¶æ¨åºå¤ä»¶ï¼æä»¥ç¹æ®å¤ç |
| | | wplog.WorkPieceID = wplog.WorkPieceIDA; |
| | | wplog.Remarks = "NOOKæ¨åºå·¥ä»¶A"; |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | wplog.WorkPieceID = wplog.WorkPieceIDB; |
| | | wplog.Remarks = "NOOKæ¨åºå·¥ä»¶B"; |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | wplog.WorkPieceID = wplog.WorkPieceIDC; |
| | | wplog.Remarks = "NOOKæ¨åºå·¥ä»¶C"; |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | //wplog.WorkPieceID = wplog.WorkPieceIDD; |
| | | //wplog.Remarks = "NOOKæ¨åºå·¥ä»¶D"; |
| | | //WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | else |
| | | { |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | value_03 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§NOOKæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§NOOKæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§NOOKæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§NOOKæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§NOOKæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§NOOKæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// SPCæ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_04: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_04 Instance = new DataCaptureHandler_04(); |
| | | |
| | | public DataCaptureHandler_04() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_04 = ""; |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (value_04.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§spcæ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§spcæ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | |
| | | if (_dataCaptureConfig.WorkingProcedure.Equals("OP20")|| _dataCaptureConfig.WorkingProcedure.Equals("OP60") |
| | | ) |
| | | {//op20,op50,op60 ä¼åæ¶æ¨åºå¤ä»¶ï¼æä»¥ç¹æ®å¤ç |
| | | wplog.WorkPieceID = wplog.WorkPieceIDA; |
| | | wplog.Remarks = "SPCæ¨åºå·¥ä»¶A"; |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | wplog.WorkPieceID = wplog.WorkPieceIDB; |
| | | wplog.Remarks = "SPCæ¨åºå·¥ä»¶B"; |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | wplog.WorkPieceID = wplog.WorkPieceIDC; |
| | | wplog.Remarks = "SPCæ¨åºå·¥ä»¶C"; |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | if(_dataCaptureConfig.WorkingProcedure.Equals("OP60")) |
| | | { |
| | | wplog.WorkPieceID = wplog.WorkPieceIDD; |
| | | wplog.Remarks = "SPCæ¨åºå·¥ä»¶D"; |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | } |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | //夿æ¯å¦è·³åºï¼ä¸ä¸å·¥åºè´¨éæ¯å¦åæ ¼ |
| | | |
| | | |
| | | |
| | | //åé¦ç»PLCï¼åå
¥ |
| | | |
| | | |
| | | } |
| | | value_04 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§spcæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§spcæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§spcæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§spcæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§spcæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§spcæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | using static System.Net.WebRequestMethods; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// å·¥åºå®æ |
| | | /// </summary> |
| | | public class DataCaptureHandler_05: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_05 Instance = new DataCaptureHandler_05(); |
| | | |
| | | public DataCaptureHandler_05() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "123456"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_05 = ""; |
| | | string path = ConfigHelper.GetConfigString("OP80QualityData");//OP80çå°å |
| | | //string path = "C:\\Users\\SY-PC\\Desktop\\FO";//OP80çå°å |
| | | DateTime? fileFindTime = null; |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºå¼å§è·åæ å¿ä½"); |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (value_05.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºè·åå°ä¸çº¿æ å¿ä½"); |
| | | |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.IsDeleted = false; |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{_dataCaptureConfig.WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch(Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{_dataCaptureConfig.WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id},èµå¼åå[{col.DataCaptureColumnTabelName ?? "空å符串"}]", setex); |
| | | } |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | if (WorkingProcedure.Equals("OP80")) |
| | | { |
| | | var time = DateTimeHelper.GetDateTime(); |
| | | if (fileFindTime == null) |
| | | { |
| | | fileFindTime = time.AddMinutes(-10); |
| | | } |
| | | //OP80 éè¦æ«ææä»¶è¯»åè´¨éä¿¡æ¯ |
| | | //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å30ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | List<FileInfo> files = new List<FileInfo>(); |
| | | var newFiles = FileHelper.DetectNewFilesCSV(path, 300, fileFindTime.Value, time.AddHours(2)); |
| | | foreach (var file in newFiles) |
| | | { |
| | | files.Add((FileInfo)file); |
| | | } |
| | | files = files.OrderByDescending(o => o.LastWriteTime).ToList(); |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åå°æä»¶{files.Count()}个工件{wplog.WorkPieceID} æ¶é´{fileFindTime.Value.ToString()}"); |
| | | |
| | | foreach (var file in files) |
| | | {//åååºå¹é
çæä»¶å为工件å·çæä»¶ |
| | | if (file.Name.Contains(wplog.WorkPieceID)) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åå°æä»¶{file.Name}ï¼æ¯æå®ç工件"); |
| | | |
| | | var datatable = CSVHelper.ReadCSVList(file.FullName); |
| | | List<string> rowFirst = new List<string>(); |
| | | List<string> rowSecond = new List<string>(); |
| | | if (datatable.Count == 2) |
| | | { |
| | | rowFirst = datatable[0].Split(',').ToList(); |
| | | rowSecond = datatable[1].Split(',').ToList(); |
| | | if(rowSecond.Count<11) |
| | | { |
| | | continue; |
| | | } |
| | | //æ¥æåæ¶é´ æ¹å·/æ è¯å· åµå¥å·/ä¸»è½´å· æä½ç¬¦ ææ¬ æµéæº è¿ç¨åæ° æµéç³»ç» è¿ç¨åæ°å¼ åºåå· é¶ä»¶è¯å«å· 1 |
| | | OP80Info oP80Info = new OP80Info(); |
| | | oP80Info.æ¥æåæ¶é´ = rowSecond[0]; |
| | | oP80Info.æ¹å· = rowSecond[1]; |
| | | oP80Info.åµå¥å· = rowSecond[2]; |
| | | oP80Info.æä½ç¬¦ = rowSecond[3]; |
| | | oP80Info.ææ¬ = rowSecond[4]; |
| | | oP80Info.æµéæº = rowSecond[5]; |
| | | oP80Info.è¿ç¨åæ° = rowSecond[6]; |
| | | oP80Info.æµéç³»ç» = rowSecond[7]; |
| | | oP80Info.è¿ç¨åæ°å¼ = rowSecond[8]; |
| | | oP80Info.åºåå· = rowSecond[9]; |
| | | oP80Info.é¶ä»¶è¯å«å· = rowSecond[10]; |
| | | for (int i = 1; i <= (rowSecond.Count - 11) / 10; i++) |
| | | { |
| | | if (rowSecond.Count < (11 + i * 10)) |
| | | { |
| | | break; |
| | | } |
| | | //åç§° ç¸å¯¹å¼ ç¸å¯¹å¼åä½ ç»å¯¹å¼ ç»å¯¹å¼åä½ åä¹å¼ ä¸é ä¸é ç¶æ/ç级 åé符 |
| | | OP80ItemInfo item = new OP80ItemInfo(); |
| | | item.åé符 = rowSecond[1 + i * 10]; |
| | | item.åç§° = rowSecond[2 + i * 10]; |
| | | item.ç¸å¯¹å¼ = rowSecond[3 + i * 10]; |
| | | item.ç¸å¯¹å¼åä½ = rowSecond[4 + i * 10]; |
| | | item.ç»å¯¹å¼ = rowSecond[5 + i * 10]; |
| | | item.ç»å¯¹å¼åä½ = rowSecond[6 + i * 10]; |
| | | item.åä¹å¼ = rowSecond[7 + i * 10]; |
| | | item.ä¸é = rowSecond[8 + i * 10]; |
| | | item.ä¸é = rowSecond[9 + i * 10]; |
| | | item.ç¶æ = rowSecond[10 + i * 10]; |
| | | oP80Info.OP80ItemInfolist.Add(item); |
| | | if(item.åç§°.Equals("Weight Class") || item.åç§°.Equals("Weight Small End") |
| | | || item.åç§°.Equals("Weight Big End") || item.åç§°.Equals("Dime Small_End Class") |
| | | || item.åç§°.Equals("Dime Big_End Class")) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | if(!string.IsNullOrEmpty(item.ç¶æ)) |
| | | { |
| | | oP80Info.OP80ItemStatusInfolist.Add(item); |
| | | } |
| | | } |
| | | } |
| | | if(oP80Info.OP80ItemStatusInfolist.Count>0) |
| | | { |
| | | if(oP80Info.OP80ItemStatusInfolist.Any(o=>!o.ç¶æ.Equals("OK"))) |
| | | { |
| | | wplog.QualityStateStr = "NG"; |
| | | } |
| | | else |
| | | { |
| | | wplog.QualityStateStr = "OK"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wplog.QualityStateStr = "OK"; |
| | | } |
| | | |
| | | |
| | | wplog.OP80QualityFilePath = file.FullName; |
| | | wplog.OP80NewCode = oP80Info.æ¹å·?.Replace("#", ""); |
| | | //大头éé |
| | | wplog.QualityOP80To1 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Weight Big End")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //å°å¤´éé |
| | | wplog.QualityOP80To2 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Weight Small End")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //æ»é |
| | | wplog.QualityOP80To3 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Total Weight")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //å¼¯æ² |
| | | wplog.QualityOP80To4 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Bend to A")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //æåº¦ |
| | | wplog.QualityOP80To5 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Twist to A")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //大头åç´åº¦ |
| | | wplog.QualityOP80To6 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Big_End_C_Squareness")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //å°å¤´åç´åº¦ |
| | | wplog.QualityOP80To10 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Sma_End_C_Squareness")).FirstOrDefault()?.ç»å¯¹å¼; |
| | | //大头ååç»çº§å« |
| | | wplog.QualityOP80To7 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Dime Big_End Class")).FirstOrDefault()?.ç¶æ; |
| | | //å°å¤´ååç»çº§å« |
| | | wplog.QualityOP80To8 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Dime Small_End Class")).FirstOrDefault()?.ç¶æ; |
| | | //ééç»å« |
| | | wplog.QualityOP80To9 = oP80Info.OP80ItemInfolist.Where(o => o.åç§°.Equals("Weight Class")).FirstOrDefault()?.ç¶æ; |
| | | //wplog.Remarks = (wplog.Remarks ?? "") + $"OP80ä¸çº¿å®æè¯»åæä»¶{file.FullName},æ°æ®ã{wplog.OP80NewCode??"空"}ãã{wplog.QualityOP80To1 ?? "空"}ãã{wplog.QualityOP80To2 ?? "空"}ãã{wplog.QualityOP80To3 ?? "空"}ãã{wplog.QualityOP80To4 ?? "空"}ãã{wplog.QualityOP80To5 ?? "空"}ã"; |
| | | } |
| | | else |
| | | { |
| | | wplog.Remarks = (wplog.Remarks ?? "") + $"OP80ä¸çº¿å®æè¯»åæä»¶{file.FullName}å¼å¸¸ï¼è¡æ°ä¸æ¯2è¡"; |
| | | } |
| | | fileFindTime = files[0].LastWriteTime; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åæä»¶{file.FullName}䏿¯æå®å·¥ä»¶{wplog.WorkPieceID}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° å®æè¯»åæä»¶æ°æ®æ¶å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åæä»¶æ°æ®æ¶å¼å¸¸,é¿å
å·¥åºå®æå¼å¸¸ï¼", ex); |
| | | } |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkingProcedureComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | } |
| | | value_05 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}ä¸çº¿æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{WorkingProcedure}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§æç æ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}ä¸çº¿æ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// 设å¤ä¿¡æ¯éé |
| | | /// </summary> |
| | | public class DataCaptureHandler_06 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_06 Instance = new DataCaptureHandler_06(); |
| | | |
| | | public DataCaptureHandler_06() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.IsDeleted = false; |
| | | |
| | | |
| | | wplog.WorkPieceID = WorkPieceID; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = DataCapturePointCode; |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | return; |
| | | } |
| | | Dictionary<bool, DateTime> fullBeatDic = new Dictionary<bool, DateTime>();//FullMaterial å µæ 10ç§falseç®å µæ |
| | | Dictionary<bool, DateTime> lackBeatDic = new Dictionary<bool, DateTime>();//LackMaterial 缺æ 10ç§falseç®ç¼ºæ |
| | | fullBeatDic.Add(false, DateTime.Now); |
| | | lackBeatDic.Add(false, DateTime.Now); |
| | | bool fullBeatMonitorflag = true; |
| | | bool lackBeatMonitorflag = true; |
| | | |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_06 = ""; |
| | | string AlertStatus = "";//æ
éç¶ææ¯å¦åæ´ |
| | | string MessageStatus = "";//åè¦ç¶ææ¯å¦åæ´ |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //ä¸å¡ä»£ç |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID;; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿ç±äºå段å{col.DataCaptureColumnTabelName}没æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | continue; |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºè®¾å¤éé 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //if((AlertStatus.Equals("") && wplog.IsCloseAlert.ToString().ToUpper().Equals("TRUE")) || !(AlertStatus.ToUpper().Equals(wplog.IsCloseAlert.ToString().ToUpper()))) |
| | | //{//说æåè¦ä¿¡æ¯æ°æ®åçåæ´ |
| | | // wplog.ischeckAlertStatus=true; |
| | | //} |
| | | //if ((MessageStatus.Equals("") && wplog.IsMessage.ToString().ToUpper().Equals("TRUE")) || !(MessageStatus.ToUpper().Equals(wplog.IsMessage.ToString().ToUpper()))) |
| | | //{//说æåè¦ä¿¡æ¯æ°æ®åçåæ´ |
| | | // wplog.ischeckMessageStatus = true; |
| | | //} |
| | | if(wplog.WorkingProcedure.Equals("OP05")) |
| | | { |
| | | if (fullBeatMonitorflag != wplog.FullMaterial) |
| | | {//å µæå¿è·³åå |
| | | |
| | | if (fullBeatDic.ContainsKey(wplog.FullMaterial)) |
| | | { |
| | | fullBeatDic[wplog.FullMaterial] = DateTime.Now; |
| | | } |
| | | else |
| | | { |
| | | fullBeatDic.Add((bool)wplog.FullMaterial, DateTime.Now); |
| | | } |
| | | |
| | | } |
| | | fullBeatMonitorflag = wplog.FullMaterial; |
| | | |
| | | var maxfull = fullBeatDic.Max(kvp => kvp.Value); |
| | | if (maxfull == null || (DateTime.Now - maxfull).TotalSeconds > 10) |
| | | {//å¿è·³10ç§æ²¡ææ´æ°è®¤ä¸ºè®¾å¤å µæ |
| | | wplog.FullMaterial = true; |
| | | } |
| | | else |
| | | { |
| | | wplog.FullMaterial = false; |
| | | } |
| | | |
| | | if (lackBeatMonitorflag != wplog.LackMaterial) |
| | | {//缺æå¿è·³åå |
| | | |
| | | if (lackBeatDic.ContainsKey(wplog.LackMaterial)) |
| | | { |
| | | lackBeatDic[wplog.LackMaterial] = DateTime.Now; |
| | | } |
| | | else |
| | | { |
| | | lackBeatDic.Add((bool)wplog.LackMaterial, DateTime.Now); |
| | | } |
| | | |
| | | } |
| | | lackBeatMonitorflag = wplog.LackMaterial; |
| | | |
| | | var maxlack = lackBeatDic.Max(kvp => kvp.Value); |
| | | if (maxlack == null || (DateTime.Now - maxlack).TotalSeconds > 10) |
| | | {//å¿è·³10ç§æ²¡ææ´æ°è®¤ä¸ºè®¾å¤å µæ |
| | | wplog.LackMaterial = true; |
| | | } |
| | | else |
| | | { |
| | | wplog.LackMaterial = false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | AlertStatus = wplog.IsCloseAlert.ToString().ToUpper(); |
| | | AlertStatus = wplog.IsMessage.ToString().ToUpper(); |
| | | WorkPieceInfoManager.EquipmentMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§è®¾å¤ééæ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§è®¾å¤éé ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using log4net; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// åè¦çæ§ï¼PLCçåè¦ç±è®¾å¤çæ§æ¥å®ç°ï¼æ¬å¤ç¨æ¥ä»æºåºåæ°æ®ï¼ |
| | | /// </summary> |
| | | public class DataCaptureHandler_07 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_07 Instance = new DataCaptureHandler_07(); |
| | | |
| | | public DataCaptureHandler_07() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | string value_07 = ""; |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | |
| | | //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //if ((value_07.Equals("") && value.ToString().ToUpper().Equals("TRUE")) || !(value_07.ToUpper().Equals(value.ToString().ToUpper()))) |
| | | //{//å½åè¦æ è®°ä¸ä¸æ¬¡ä¸åæ¶ |
| | | // //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | // //ä¸å¡ä»£ç |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | // WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | // wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | // wplog.WorkingProcedure = WorkingProcedure; |
| | | // wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | // wplog.Remarks = WorkingProcedure; |
| | | // wplog.MonitoringPoint = DataCapturePointCode; |
| | | // wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | // wplog.CreatedUserName = DataCapturePointCode; |
| | | //wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | //wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | // wplog.IsDeleted = false; |
| | | // wplog.IsCloseAlert = (bool)value; |
| | | // foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | // {//è·åæ¯å¦åè¦ï¼åè¦ç±»å(20个) |
| | | // try |
| | | // { |
| | | // var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | // //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | // var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | // if (set == null) |
| | | // { |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | // } |
| | | // set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | // } |
| | | // catch (Exception setex) |
| | | // { |
| | | // Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | // } |
| | | // } |
| | | // //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | // WorkPieceInfoManager.AlertMonitor(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | // threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | //} |
| | | //value_07 = value.ToString(); |
| | | //threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | |
| | | //if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | //{ |
| | | // threadStatusMonitor.ThreadFrequency = 5000; |
| | | // Thread.Sleep(5000); |
| | | //} |
| | | //else |
| | | //{ |
| | | // threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | // Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | //} |
| | | |
| | | } |
| | | catch (System.Data.Entity.Validation.DbEntityValidationException ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºè®¾å¤åè¦ä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Globalization; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP05 ææ å®ææ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP0501 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP0501 Instance = new DataCaptureHandler_OP0501(); |
| | | |
| | | public DataCaptureHandler_OP0501() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | |
| | | } |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | //// plcè¿æ¥ |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | //if (plcService == null) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP0501 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | // return; |
| | | //} |
| | | //if (plcService != null && !plcService.IsConnected) |
| | | //{ |
| | | // plcService.Close(); |
| | | // plcService.OpenService(); |
| | | //} |
| | | |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | ////_dataCaptureConfig |
| | | //if (plcService == null || !plcService.IsConnected) |
| | | //{ |
| | | // SystemValue.lbl_Alert_OP0501 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | // plcService.Close(); |
| | | // plcService.OpenService(); |
| | | // Thread.Sleep(100); |
| | | // continue; |
| | | //} |
| | | //else |
| | | { |
| | | //var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | //if (SystemValue.value_OP0501.Equals("0") && value.ToString().Equals("1")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | //读ç å®ææ²¡å¥ä¸å¡æä½ï¼è·åäºç»´ç ï¼ç¶åæ¾å°éåä¸ |
| | | #region ä»å·¥æ§æºè·åç¸å
³äºç»´ç |
| | | var path = ConfigHelper.GetConfigString("WorkPeiceIDPath");//æç æºæç äºç»´ç è·¯å¾ |
| | | //æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ |
| | | //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å10ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | var dataTime = CommonManager.Instance.CheackPath(Environment.CurrentDirectory + "\\LastModifyTime\\OP05-LastScapTime.txt", 4,-10); |
| | | var scapEndTime = DateTimeHelper.GetDateTime(); |
| | | var newFiles = FileHelper.DetectNewFilesCSV(path, 60, Convert.ToDateTime(dataTime), scapEndTime); |
| | | |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯å¼å§:{dataTime}"); |
| | | |
| | | foreach (System.IO.FileInfo file in newFiles) |
| | | { |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,æä»¶å:{file.FullName}"); |
| | | DataTable dt = null; |
| | | dt = CSVHelper.ReadCSV(file.FullName); |
| | | if (dt == null) |
| | | { |
| | | continue; |
| | | } |
| | | lock (SystemValue.lock5QRcodeList) |
| | | { |
| | | #region æ¸
è¿æç¼å |
| | | try |
| | | { |
| | | //æ¸
è¿æç¼å |
| | | var lstRemoveKey = SystemValue.QRcodeList |
| | | .Where(p => p.Value < DateTimeHelper.GetDateTime().AddMinutes(-600)) |
| | | .Select(p => p.Key).ToList(); |
| | | if (lstRemoveKey.Count > 0) |
| | | { |
| | | foreach (var key in lstRemoveKey) SystemValue.QRcodeList.Remove(key); |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ¸
é¤ç¼åæ°éï¼ï¼{lstRemoveKey.Count}ï¼ å©ä½ç¼åæ°éï¼ï¼{SystemValue.QRcodeList.Count}ï¼"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, "æ¸
é¤åè¦æ¥æIDç¼åé误ï¼", ex); |
| | | } |
| | | #endregion |
| | | |
| | | ////çééè¦å¤ççäºç»´ç ä¿¡æ¯ |
| | | //DataRow[] drArr = dt.Select(" æ«ç ç»æ='æå'"); //æ¥è¯¢ |
| | | //DataTable dtNew = dt.Clone(); |
| | | //for (int i = 0; i < drArr.Length; i++) |
| | | //{ |
| | | // var now = DateTime.Now; |
| | | // var list = drArr[i]["æ¶é´"].ToString().Split(':'); |
| | | // var d = new DateTime(now.Year, now.Month, now.Day, Convert.ToInt32(list[0]), Convert.ToInt32(list[1]), Convert.ToInt32(list[2]), DateTimeKind.Local); |
| | | // //and æ¶é´> '19:19:34:547' |
| | | // if (Convert.ToDateTime(DateTime.Now.ToShortDateString() + " " +drArr[i]["æ¶é´"]).TimeOfDay> Convert.ToDateTime(DateTime.Now.ToShortDateString() + " 19:19:34:547").TimeOfDay) |
| | | // dtNew.ImportRow(drArr[i]); |
| | | // //è·åå°ç工件å·å¼å¸¸ |
| | | // SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | // $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | //} |
| | | DataTable newDt = new DataTable(); |
| | | var dates = file.Name.Split('-', '.'); |
| | | var date = string.Format("{0:D4}-{1:D2}-{2:D2}", int.Parse(dates[0]), int.Parse(dates[1]), int.Parse(dates[2])); |
| | | if (DateTimeHelper.GetDateTime().Date != Convert.ToDateTime(date) && DateTimeHelper.GetDateTime().AddDays(-1).Date != Convert.ToDateTime(date)) |
| | | { |
| | | continue; |
| | | } |
| | | DataRow[] filteredRows = new DataRow[dt.Rows.Count]; |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | int j = 0; |
| | | var cache = DataCache.GetCache("OP501-LastTime"); |
| | | DateTime? lasttime = null; |
| | | if (cache != null) |
| | | { |
| | | lasttime = Convert.ToDateTime(cache); |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,å·¥ä»¶ææ°æ¶é´:{(cache==null?"æ ç¼å":cache.ToString())}"); |
| | | for (int i = dt.Rows.Count - 1; i >= 0; i--) |
| | | { |
| | | string timeValue = " "; |
| | | try |
| | | { |
| | | timeValue = dt.Rows[i]["æ¶é´"].ToString(); |
| | | string[] timeComponents = timeValue.Split(':'); |
| | | string correctedTime = string.Format("{0:D2}:{1:D2}:{2:D2}", int.Parse(timeComponents[0]), int.Parse(timeComponents[1]), int.Parse(timeComponents[2])); |
| | | var newTime = date + " " + correctedTime; |
| | | dt.Rows[i]["æ¶é´"] = newTime; |
| | | |
| | | var currrentTime = Convert.ToDateTime(dt.Rows[i]["æ¶é´"]); |
| | | if (cache == null) |
| | | { |
| | | if (j == 0) |
| | | { |
| | | if(currrentTime>DateTimeHelper.GetDateTime().AddHours(-10)) |
| | | { |
| | | lasttime = currrentTime; |
| | | } |
| | | } |
| | | var oldTime = DateTime.Now.AddMinutes(-10); |
| | | if (currrentTime <= oldTime) |
| | | { |
| | | break; |
| | | } |
| | | filteredRows[j] = dt.Rows[i]; |
| | | } |
| | | else |
| | | { |
| | | var cacheTime = Convert.ToDateTime(cache); |
| | | if (currrentTime <= cacheTime) |
| | | { |
| | | break; |
| | | } |
| | | filteredRows[j] = dt.Rows[i]; |
| | | } |
| | | |
| | | if (currrentTime > DateTimeHelper.GetDateTime().AddHours(-10)) |
| | | { |
| | | if (lasttime != null && lasttime < currrentTime) |
| | | { |
| | | lasttime = currrentTime; |
| | | } |
| | | } |
| | | j++; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $" {_dataCaptureConfig.WorkingProcedure}æä»¶ææ æ¶é´[{timeValue}]å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}æä»¶ææ æ¶é´,åºç°å¼å¸¸ï¼", ex); |
| | | } |
| | | } |
| | | |
| | | filteredRows = filteredRows.Where(item=>item!=null).ToArray(); |
| | | // 设置ç¼åå¼ |
| | | DateTime absoluteExpiration = DateTime.Now.AddDays(30); |
| | | TimeSpan slidingExpiration = TimeSpan.FromMinutes(20); |
| | | if (slidingExpiration == TimeSpan.Zero) |
| | | { |
| | | absoluteExpiration = DateTime.Now.AddDays(30); |
| | | } |
| | | else |
| | | { |
| | | absoluteExpiration = DateTime.MaxValue; |
| | | } |
| | | DataCache.SetCache("OP501-LastTime", lasttime, absoluteExpiration, slidingExpiration); |
| | | if (filteredRows.Count() <= 0) |
| | | { |
| | | continue; |
| | | } |
| | | if (file.LastAccessTime < Convert.ToDateTime(dataTime)) continue; |
| | | using (StreamWriter writer = new StreamWriter(Environment.CurrentDirectory + "\\OP05-LastScapTime.txt", false)) |
| | | { |
| | | dataTime = file.LastAccessTime.ToString(); |
| | | writer.Write(dataTime); |
| | | } |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"读åå°{filteredRows.Count()}è¡æ°æ®ï¼æ¶é´èå´æ¯{filteredRows[j-1]["æ¶é´"]}-{filteredRows[0]["æ¶é´"]}"); |
| | | } |
| | | |
| | | //// 工件å·ï¼äºç»´ç å¼ï¼ |
| | | //string WorkPieceID = dt.Rows[0][""].ToString(); |
| | | //if (WorkPieceID.Length != 22) |
| | | //{ |
| | | // //è·åå°ç工件å·å¼å¸¸ |
| | | // SystemValue.lbl_Alert_HMI01 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"; |
| | | // Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | // $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ã" + WorkPieceID + "ãé¿åº¦å¼å¸¸ï¼é¿åº¦ä¸çäº22ä½"); |
| | | //} |
| | | |
| | | |
| | | //SystemValue.QRcodeList.Add("", DateTimeHelper.GetDateTime());//äºç»´ç æ·»å å°åè¡¨ä¸ |
| | | |
| | | WorkPieceLog wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = _dataCaptureConfig.WorkingProcedure; ; |
| | | //wplog.EquipmentID = WorkingProcedure; |
| | | wplog.Remarks = "cs"; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.IsDeleted = false; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime();//ç»ä¸çº¿æ¶é´ç¨ |
| | | |
| | | wplog.QualityState = 1; |
| | | wplog.ProcessingDuration = 1; |
| | | wplog.MachineToolState = 1; |
| | | wplog.AlertType = 1; |
| | | wplog.WorkPieceNumber = 1; |
| | | wplog.WorkPieceOnlineTime = Convert.ToDateTime(dataTime); |
| | | wplog.WorkPieceOfflineTime = Convert.ToDateTime(dataTime).AddHours(1); |
| | | wplog.WorkPieceStartMachiningTime = Convert.ToDateTime(dataTime); |
| | | wplog.WorkPieceEndMachiningTime = DateTime.Now.AddDays(7); |
| | | wplog.KnifeEdgeNumber = 10; |
| | | wplog.KnifeToolLife = 10; |
| | | wplog.KnifeToolEarlyWarningLife = 3; |
| | | wplog.KnifeToolSurplusLife = 10; |
| | | |
| | | foreach (var item in filteredRows) |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), |
| | | $"{_dataCaptureConfig.WorkingProcedure}å·¥åºè¯»åå·¥æ§æºä¸äºç»´ç ä¿¡æ¯,读å工件äºç»´ç :{item["ææ å
容"].ToString()}"); |
| | | |
| | | if (item == null) break; |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkPieceID = item["ææ å
容"].ToString(); |
| | | wplog.OfflineTime = Convert.ToDateTime(dataTime); |
| | | wplog.Remarks = item["æ¶é´"].ToString() + "|" + item["ææ å
容"].ToString() + "|" + item["ææ å
容"].ToString() + "|" + item["æ«ç ç级"].ToString() + "|" + item["æ«ç ç»æ"].ToString(); |
| | | WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), null, _dataCaptureConfig.IsFeedback); |
| | | |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | //var fileCount = ((iWare_SCADA_BusinessLogical.Utils.FindFiles)newFiles).; |
| | | //Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"æ«æå®æï¼å
±æ«æå°ï¼ï¼{fileCount.Count()}ï¼ä¸ªæä»¶"); |
| | | } |
| | | //SystemValue.value_OP0501 = value.ToString(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | |
| | | SystemValue.lbl_Alert_OP0501 = $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(LogType.PLCOP05, $" {_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯,åºç°å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | //线ç¨å¤ä¹
æ§è¡ä¸æ¬¡ï¼ä¸å
å«ä¸å¡å¤çæ¶é´ï¼ |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(3000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}å·¥åºææ 宿æ è®°ï¼è¯»åå·¥æ§æºä¸æå°äºç»´ç ä¿¡æ¯ï¼ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
ç½®å¼å¸¸"); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using log4net; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10æµè¯å®ææ è®° ï¼OP10ï¼ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1002: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1002 Instance = new DataCaptureHandler_OP1002(); |
| | | |
| | | public DataCaptureHandler_OP1002() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | |
| | | SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now} *****0***"); |
| | | Stopwatch stopwatch = Stopwatch.StartNew(); |
| | | stopwatch.Start(); |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | stopwatch.Stop(); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now}*****01****{stopwatch.ElapsedMilliseconds}"); |
| | | if (SystemValue.value_OP1002.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now}***1****"); |
| | | |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now}***2****{col.DataCaptureColumnTabelName} å¼ {valuecol.ToString()??""}"); |
| | | |
| | | if (col.DataCaptureColumnTabelName.Contains("Quality")) |
| | | {//åæ®µåå
å«Qualityæ¯è®¤ä¸ºæ¯è´¨éæ°æ®ï¼é½æ¯è½¬æ¢æstring |
| | | set.SetValue(wplog, valuecol.ToString());//ç»å¨æå段èµå¼ |
| | | } |
| | | else |
| | | { |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {WorkingProcedure}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | //#region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ |
| | | |
| | | |
| | | ////æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å |
| | | //var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); |
| | | //foreach (System.IO.FileInfo file in newFiles) |
| | | //{ |
| | | // var datatable = CSVHelper.ReadCSV(file.FullName); |
| | | //} |
| | | |
| | | //#endregion |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now}***3****"); |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1002 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1002 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}è´¨éä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}è´¨éä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1002 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10æµè¯å®ææ è®° ï¼OP40ï¼ |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1003 : DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1003 Instance = new DataCaptureHandler_OP1003(); |
| | | |
| | | public DataCaptureHandler_OP1003() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | |
| | | SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} {WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now} *****0***"); |
| | | Stopwatch stopwatch = Stopwatch.StartNew(); |
| | | stopwatch.Start(); |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | stopwatch.Stop(); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºæµæ 记读å{DateTime.Now}*****01****{stopwatch.ElapsedMilliseconds}*****{value.ToString().ToUpper()}**"); |
| | | if(value.ToString().ToUpper().Equals("TRUE")) |
| | | { |
| | | |
| | | } |
| | | if (SystemValue.value_OP1003.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° {col.DataCaptureColumnTabelName}读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | if(col.DataCaptureColumnTabelName.Contains("Quality")) |
| | | {//åæ®µåå
å«Qualityæ¯è®¤ä¸ºæ¯è´¨éæ°æ®ï¼é½æ¯è½¬æ¢æstring |
| | | set.SetValue(wplog, valuecol.ToString());//ç»å¨æå段èµå¼ |
| | | } |
| | | else |
| | | { |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° {col.DataCaptureColumnTabelName}读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | if (wplog.WorkPieceID.Length != 22) |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®æ¶å¼å¸¸ï¼"); |
| | | continue; |
| | | } |
| | | |
| | | //#region å·¥æ§æºè¯»åè´¨éä¿¡æ¯ |
| | | |
| | | |
| | | ////æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å |
| | | //var newFiles = FileHelper.DetectNewFilesCSV("", 10, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime()); |
| | | //foreach (System.IO.FileInfo file in newFiles) |
| | | //{ |
| | | // var datatable = CSVHelper.ReadCSV(file.FullName); |
| | | //} |
| | | |
| | | //#endregion |
| | | |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | SystemValue.value_OP1003 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1003 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}è´¨éä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}è´¨éä¿¡æ¯æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1003 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}è´¨éä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// OP10/OP40æ¨åºæ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP1004: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP1004 Instance = new DataCaptureHandler_OP1004(); |
| | | |
| | | public DataCaptureHandler_OP1004() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | while (true) |
| | | { |
| | | ThreadStatusMonitor threadStatusMonitor = new ThreadStatusMonitor(); |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | |
| | | SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (SystemValue.value_OP1004.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç 1.åæ¨åºæ è®°ï¼2忍åºåå ï¼1ï¼nokï¼2å3ï¼spcï¼4ï¼ç¶æä¸æ 5:äºç»´ç è¯å«å¤±è´¥ ï¼ï¼3 忍åºäºç»´ç |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.OnlineTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | if (wplog.OP10Flag != "1" && wplog.OP10Flag != "2" && wplog.OP10Flag != "3") |
| | | {//è·åå°ç工件å·å¼å¸¸ |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®{wplog.WorkPieceID}æ¨åºåå [{wplog.OP10Flag}]å¼å¸¸"); |
| | | wplog.Remarks = $"æ¨åºåå [{wplog.OP10Flag}]å¼å¸¸"; |
| | | } |
| | | if (wplog.OP10Flag == "1") |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åº1çæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®{wplog.WorkPieceID}æ¨åºåå [{wplog.OP10Flag}]"); |
| | | |
| | | WorkPieceInfoManager.WorkPiecePushOff(wplog, LogType.PLCOP10); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | wplog.Remarks = (wplog.Remarks ?? "") + $"æ¨åºåå [{wplog.OP10Flag}] NOOK"; |
| | | } |
| | | //else if (wplog.OP10Flag == 2 || wplog.OP10Flag == 3) |
| | | else |
| | | { |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åº23çæ§è¯»ç æ è®° 读åå·¥ä»¶ç æ°æ®{wplog.WorkPieceID}æ¨åºåå [{wplog.OP10Flag}]"); |
| | | |
| | | WorkPieceInfoManager.WorkPieceSPCPushOff(wplog, LogType.PLCOP10); |
| | | wplog.Remarks = (wplog.Remarks ?? "") + $"æ¨åºåå [{wplog.OP10Flag}] SPC"; |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | SystemValue.value_OP1004 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | SystemValue.lbl_Alert_OP1004 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}æ¨åºä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æ¨åºä¿¡æ¯ æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SystemValue.lbl_Alert_OP1004 = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}æ¨åºä¿¡æ¯ åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼ï¼"; |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}æ¨åºä¿¡æ¯ ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWare_SCADA_BusinessLogical.BLL; |
| | | using iWare_SCADA_BusinessLogical.Utils; |
| | | using iWare_SCADA_Model; |
| | | using iWare_SCADA_Model.MiddleModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | | /// <summary> |
| | | /// æµé宿æ è®° |
| | | /// </summary> |
| | | public class DataCaptureHandler_OP3002: DataCaptureHandler |
| | | { |
| | | public static readonly DataCaptureHandler_OP3002 Instance = new DataCaptureHandler_OP3002(); |
| | | |
| | | public DataCaptureHandler_OP3002() |
| | | { |
| | | } |
| | | |
| | | public override string WorkingProcedure |
| | | { |
| | | get { return _dataCaptureConfig.WorkingProcedure; } |
| | | } |
| | | |
| | | public override string DataCapturePointCode |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCode; } |
| | | } |
| | | public override string DataCapturePointCname |
| | | { |
| | | get { return _dataCaptureConfig.DataCapturePointCname; } |
| | | } |
| | | |
| | | |
| | | public override void RefreshDataList(List<DataCaptureConfig> dataCaptureConfig) |
| | | { |
| | | } |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | ThreadStatusMonitorMiddle threadStatusMonitor = new ThreadStatusMonitorMiddle(); |
| | | if (IsCaptureflag) |
| | | { |
| | | //var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | var plcService = SystemValue.GetPLCService(_dataCaptureConfig); |
| | | if (plcService == null) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $"{RandomHelper.GenerateRandomCode(4)} æ²¡ææ¾å°{_dataCaptureConfig.WorkingProcedure}çPLC设å¤"; |
| | | return; |
| | | } |
| | | if (plcService != null && !plcService.IsConnected) |
| | | { |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string Station = "03"; |
| | | string value_02 = ""; |
| | | string path = ConfigHelper.GetConfigString("OP30QualityDataForStation");//æç æºæç äºç»´ç è·¯å¾ |
| | | if(string.IsNullOrEmpty(path)) |
| | | { |
| | | path = @"Z:\"; |
| | | } |
| | | if(DataCapturePointCode.Contains("CH3")) |
| | | {//å·¥ä½3 涨æåç© |
| | | path = path + "kistler_crack"; |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH4")) |
| | | {//å·¥ä½4 颿§ç´§åç© |
| | | |
| | | path = path + "Bosch_Rexroth"; |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH5")) |
| | | {//å·¥ä½5 æ§ç´§åç© |
| | | |
| | | path = path + "Bosch_Rexroth"; |
| | | } |
| | | else if (DataCapturePointCode.Contains("CH6")) |
| | | {//å·¥ä½6 衬å¥åè£
åç© |
| | | |
| | | path = path + "kistler_bush"; |
| | | } |
| | | // è´¨éä¿¡æ¯ï¼æ¶¨æåç©... 颿§ç´§åç© é¢æ§ç´§è§åº¦ ç»æ§ç´§åç© ç»æ§ç´§è§åº¦ |
| | | //kistler_crack 涨æåç© å·¥ä½3 涨æåç©ï¼Y - Maximumï¼ è´¨éç»æï¼Resultï¼ |
| | | //kistler_bush åè£
åç© å·¥ä½6 衬å¥åè£
åç©ï¼Y - Maximumï¼ è¡¬å¥åè£
ä½ç§»ï¼Block Xï¼ è´¨éç»æï¼Resultï¼ |
| | | //Bosch_Rexroth /ï¼Ch_0_1.csv / Ch_0_2.csv 两éé åæ¶åææ°çï¼æè
id对åºï¼ï¼ï¼ 颿§ç´§åç©å·¥ä½4 颿§ç´§åç©ï¼T + Nmï¼ è´¨éç»æï¼ç»æï¼ ç®åæä»¶ä¸è½èªå¨çæ åä¸ å士乿§ç´§ç³»ç» |
| | | //Bosch_Rexroth /ï¼Ch_0_3.csv / Ch_0_4.csv 两éé åæ¶åææ°çï¼æè
id对åºï¼ï¼ï¼ ç»æ§ç´§å·¥ä½5 æ§ç´§åç©ï¼T + Nmï¼ ç»æ§ç´§è§åº¦ |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | //threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | try |
| | | { |
| | | //_dataCaptureConfig |
| | | if (plcService == null || !plcService.IsConnected) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} {_dataCaptureConfig.WorkingProcedure} PLCè¿æ¥å·²æå¼ï¼æ£å¨å°è¯æå¼!"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | SystemValue.PLCServiceReconnect(plcService); |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | Thread.Sleep(100); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | if (value_02.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//å½ä¸ä¸æ è®°ä½0ï¼å½åè·åæ 记为1æ¶ï¼ |
| | | //触åæä½, å¹¶ç»éæåéèµå¼ä¸º1 |
| | | //ä¸å¡ä»£ç |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedUserName = Environment.MachineName+"èªå¨" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityType = QualityType.Online.ToString(); |
| | | |
| | | |
| | | ////æ«æå
±äº«ç®å½å¹¶å°æ°çæä»¶æ«æè¿å ä¸è¬èæå¨15ç§å·¦å³ï¼å¯ä»¥ç¡®è®¤ä¸ä¸ï¼ |
| | | ////æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å10ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | //var startTime = CommonManager.Instance.CheackPath(Environment.CurrentDirectory + $"\\LastModifyTime\\OP30Station{Station}-LastScapTime.txt", 6, -10); |
| | | //var endTime = DateTimeHelper.GetDateTime(); |
| | | //var newFiles = FileHelper.DetectNewFilesCSV(path, 10, Convert.ToDateTime(startTime), endTime); |
| | | |
| | | //foreach (System.IO.FileInfo file in newFiles) |
| | | //{ |
| | | |
| | | //} |
| | | |
| | | foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) |
| | | { |
| | | try |
| | | { |
| | | var valuecol = plcService.ReadValuePoint(col.DbNumber, col.Offset, col.DataCaptureColumnLength.Value, PLCManger.GetTypeForString(col.DataCaptureColumnType)); |
| | | //wplog.GetType().GetProperty(col.DataCaptureColumnTabelName).SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | var set = wplog.GetType().GetProperty(col.DataCaptureColumnTabelName); |
| | | if (set == null) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§æµé宿æ è®° 读å工件ç 卿ç±äºåæ®µåæ²¡æ¾å°ï¼èµå¼ã{WorkingProcedure ?? "空å符串"}ã失败{wplog.Id}"); |
| | | } |
| | | set.SetValue(wplog, valuecol);//ç»å¨æå段èµå¼ |
| | | } |
| | | catch (Exception setex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}å·¥åºçæ§æµé宿æ è®° 读å工件ç 卿èµå¼ã{WorkingProcedure ?? "空å符串"}ãå¼å¸¸{wplog.Id}", setex); |
| | | } |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (WorkingProcedure.Equals("OP80")) |
| | | { |
| | | //OP80 éè¦æ«ææä»¶è¯»åè´¨éä¿¡æ¯ |
| | | //æ«æä¿®æ¹æ¶é´å¨ä¸æ¬¡æ«ææ¶é´ä¹å60ç§å°å½åæ¶é´çä¹é´çæä»¶ |
| | | List<FileInfo> files = new List<FileInfo>(); |
| | | var newFiles = FileHelper.DetectNewFilesCSV(path, 60, DateTimeHelper.GetDateTime(), DateTimeHelper.GetDateTime().AddHours(1)); |
| | | foreach (var file in newFiles) |
| | | { |
| | | files.Add((FileInfo)file); |
| | | } |
| | | files = files.OrderByDescending(o => o.LastAccessTime).ToList(); |
| | | foreach (var file in files) |
| | | {//åååºå¹é
çæä»¶å为工件å·çæä»¶ |
| | | if (file.Name.Contains(wplog.WorkPieceID)) |
| | | { |
| | | var datatable = CSVHelper.ReadCSVList(file.FullName); |
| | | List<string> rowFirst = new List<string>(); |
| | | List<string> rowSecond = new List<string>(); |
| | | if (datatable.Count == 2) |
| | | { |
| | | rowFirst = datatable[0].Split(',').ToList(); |
| | | rowSecond = datatable[1].Split(',').ToList(); |
| | | //ç»ç¸åºè´¨éæ°æ®èµå¼ |
| | | wplog.OP80NewCode = rowSecond[1]; |
| | | wplog.QualityOP80To1 = rowFirst[13]; |
| | | } |
| | | else |
| | | { |
| | | wplog.Remarks = (wplog.Remarks ?? "") + $"OP80ä¸çº¿å®æè¯»åæä»¶{file.FullName}å¼å¸¸ï¼è¡æ°ä¸æ¯2è¡"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åæä»¶{file.FullName}䏿¯æå®å·¥ä»¶{wplog.WorkPieceID}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}ä¸çº¿æ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80ä¸çº¿å®æè¯»åæä»¶æ°æ®æ¶å¼å¸¸,é¿å
å·¥åºå®æå¼å¸¸ï¼", ex); |
| | | } |
| | | //æ´æ°WorkPieceInfo表以åæå
¥WorkPieceLog表åWorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | value_02 = value.ToString(); |
| | | |
| | | |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 5000; |
| | | Thread.Sleep(5000); |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = _dataCaptureConfig.DataCaptureFrequency.Value; |
| | | Thread.Sleep(_dataCaptureConfig.DataCaptureFrequency.Value); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 读å{DataCapturePointCode}å·¥åºçæ§æµéæ è®° åºç°å¼å¸¸ï¼è¯·æ¥çæ¥å¿ï¼"; |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读å {DataCapturePointCode}å·¥åºçæ§æµéæ è®°æ°æ®æ¶å¼å¸¸ï¼", ex); |
| | | } |
| | | finally |
| | | { |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | | threadStatusMonitor.Threadcode = DataCapturePointCode; |
| | | threadStatusMonitor.Threadcname = DataCapturePointCname; |
| | | threadStatusMonitor.Threadendtime = DateTime.Now; |
| | | threadStatusMonitor.Threadlastmodifytime = DateTime.Now; |
| | | threadStatusMonitor.Threadstatue = 0; |
| | | threadStatusMonitor.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | threadStatusMonitor.Remarks = $" {RandomHelper.GenerateRandomCode(4)} {DataCapturePointCode}å·¥åºçæ§æµéæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤é
置信æ¯ï¼"; |
| | | WorkPieceInfoManager.ThreadMonitor(threadStatusMonitor); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}å·¥åºçæ§æµéæ è®° ä¸åæ ¡éªï¼è¯·ç¡®è®¤æ¯å¦é
ç½®å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP6002.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/HMIBeartBeatMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/HMI_WorkpieceReading.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/HMI_WorkpieceWrite.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Properties/AssemblyInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Properties/Resources.Designer.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Properties/Resources.resx
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/CSVHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/ComboBoxHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/ConfigHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/DataCache.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/DateTimeHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/EntityPropHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/EnumberHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/FileDirectoryEnumerator.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/FileHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/FileOperationHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/FindFiles.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/FolderHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/Log4Net/C_LogWriter.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/Log4Net/Log4netHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/LogTextHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/RandomHelper.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/RegexExtension.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/iWare_SCADA_BusinessLogical.csproj
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/log4net_iWare.config
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/packages.config
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCapture.sln
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/App.config
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.Designer.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.resx
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormTest.Designer.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormTest.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormTest.resx
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/Program.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/Properties/AssemblyInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/Properties/Resources.Designer.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/Properties/Resources.resx
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/Properties/Settings.Designer.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/Properties/Settings.settings
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/iWare_SCADA_DataCaptureV3.csproj
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/packages.config
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/App.Config
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/EnumberEntity.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/Enums.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/ListItem.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/MessageModel.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/MiddleModel/ThreadStatusMonitorMiddle.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/MiddleModel/WorkPieceLogMiddle.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/PLCDataCapture/BasePlcParam.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/PLCDataCapture/HslCommunicationParam.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/Properties/AssemblyInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/SystemValue.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/DataCaptureColumnConfig.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/DataCaptureConfig.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/DbModel.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/EquipmentBaseInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/EquipmentCurrentMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/EquipmentWorkingLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/KnifeToolBaseInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/KnifeToolDataMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/QualityDataInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/SystemLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/WorkPieceInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/WorkPieceInfoLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel - 副本/WorkPieceLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/DataCaptureColumnConfig.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/DataCaptureConfig.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/DbModel.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/EquipmentBaseInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/EquipmentCurrentMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/EquipmentFailureCode.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/EquipmentWorkingLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/KnifeToolBaseInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/KnifeToolDataMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/KnifeToolEquipmentInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/KnifeToolEquipmentInfoLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/KnifeToolEquipmentMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/KnifeToolEquipmentUpdateLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/Model1.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/QualityDataInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/QualityDataInfoLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/SystemLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/ThreadStatusMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/WorkPieceInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/WorkPieceInfoLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/WorkPieceLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/WorkPieceProcess.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModel/v_get_equipment_alert.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/AlarmLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/CNCStatus.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/Count.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/CumulativeTime.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/CurrentToolNumber.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/FeedAndSpindle.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/Load.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/OEE.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/Postion.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/ProgramBlock.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/ProgramInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/SCModel.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/TableModelSC/TimeData.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/iWare_SCADA_Model.csproj
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/packages.config
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/DataCaptureColumnConfig.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/DataCaptureConfig.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/EquipmentBaseInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/EquipmentCurrentMonitor.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/EquipmentWorkingLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/Model1.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/Model2.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/Model3.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/QualityDataInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/QualityDataInfoLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/WorkPieceInfo.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/WorkPieceInfoLog.cs
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_Model/test/WorkPieceLog.cs
iWara.SCADA.Code/.gitattributes
iWara.SCADA.Code/.gitignore
iWara.SCADA.Code/README.en.md
iWara.SCADA.Code/README.md
iWara.SCADA.Code/iWare.Wms.Application/Entity/LocationView.cs
iWara.SCADA.Code/iWare.Wms.Application/Mapper/CustomMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Mapper/DataHandler.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterface/AccessInterfaceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterface/Dto/AccessWorPieceInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterface/Dto/AccessWorkPieceInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterface/IAccessInterfaceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterface/Map/AccessInterfaceMap.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/AccessInterfaceLogService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/Dto/AddAccessInterfaceLogInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/IAccessInterfaceLogService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureColumnConfig/DataCaptureColumnConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureColumnConfig/Dto/DataCaptureColumnConfigDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureColumnConfig/Dto/DataCaptureColumnConfigInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureColumnConfig/Dto/DataCaptureColumnConfigOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureColumnConfig/IDataCaptureColumnConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureColumnConfig/Map/DataCaptureColumnConfigMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureConfig/DataCaptureConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureConfig/Dto/DataCaptureConfigDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureConfig/Dto/DataCaptureConfigInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureConfig/Dto/DataCaptureConfigOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureConfig/IDataCaptureConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/DataCaptureConfig/Map/DataCaptureConfigMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentBaseInfo/Dto/EquipmentBaseInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentBaseInfo/Dto/EquipmentBaseInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentBaseInfo/Dto/EquipmentBaseInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentBaseInfo/EquipmentBaseInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentBaseInfo/IEquipmentBaseInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentBaseInfo/Map/EquipmentBaseInfoMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentCurrentMonitor/Dto/EquipmentCurrentMonitorDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentCurrentMonitor/Dto/EquipmentCurrentMonitorInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentCurrentMonitor/Dto/EquipmentCurrentMonitorOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentCurrentMonitor/EquipmentCurrentMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentCurrentMonitor/IEquipmentCurrentMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentCurrentMonitor/Map/EquipmentCurrentMonitorMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentStatusAnalyse/Dto/EquipmentStatusAnalyseDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentStatusAnalyse/Dto/EquipmentStatusAnalyseInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentStatusAnalyse/Dto/EquipmentStatusAnalyseOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentStatusAnalyse/EquipmentStatusAnalyseService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentStatusAnalyse/IEquipmentStatusAnalyseService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentStatusAnalyse/Map/EquipmentStatusAnalyseMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentWorkingLog/Dto/EquipmentWorkingLogDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentWorkingLog/Dto/EquipmentWorkingLogInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentWorkingLog/Dto/EquipmentWorkingLogOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentWorkingLog/EquipmentWorkingLogService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/EquipmentWorkingLog/IEquipmentWorkingLogService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolBaseInfo/Dto/KnifeToolBaseInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolBaseInfo/Dto/KnifeToolBaseInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolBaseInfo/Dto/KnifeToolBaseInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolBaseInfo/IKnifeToolBaseInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolBaseInfo/KnifeToolBaseInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolBaseInfo/Map/KnifeToolBaseInfoMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolDataMonitor/Dto/KnifeToolDataMonitorDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolDataMonitor/Dto/KnifeToolDataMonitorInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolDataMonitor/Dto/KnifeToolDataMonitorOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolDataMonitor/IKnifeToolDataMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolDataMonitor/KnifeToolDataMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolDataMonitor/Map/KnifeToolDataMonitorMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentInfo/Dto/KnifeToolEquipmentInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentInfo/Dto/KnifeToolEquipmentInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentInfo/Dto/KnifeToolEquipmentInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentInfo/IKnifeToolEquipmentInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentInfo/KnifeToolEquipmentInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentInfo/Map/KnifeToolEquipmentInfoMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentMonitor/Dto/KnifeToolEquipmentMonitorDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentMonitor/Dto/KnifeToolEquipmentMonitorInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentMonitor/Dto/KnifeToolEquipmentMonitorOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentMonitor/IKnifeToolEquipmentMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentMonitor/KnifeToolEquipmentMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentMonitor/Map/KnifeToolEquipmentMonitorMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentUpdateLog/Dto/KnifeToolEquipmentUpdateLogDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentUpdateLog/Dto/KnifeToolEquipmentUpdateLogInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentUpdateLog/Dto/KnifeToolEquipmentUpdateLogOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentUpdateLog/IKnifeToolEquipmentUpdateLogService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentUpdateLog/KnifeToolEquipmentUpdateLogService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolEquipmentUpdateLog/Map/KnifeToolEquipmentUpdateLogMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolUsageAnalysis/Dto/KnifeToolUsageAnalysisDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolUsageAnalysis/Dto/KnifeToolUsageAnalysisInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolUsageAnalysis/Dto/KnifeToolUsageAnalysisOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolUsageAnalysis/IKnifeToolUsageAnalysisService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolUsageAnalysis/KnifeToolUsageAnalysisService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/KnifeToolUsageAnalysis/Map/KnifeToolUsageAnalysisMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/Dto/WorkPieceByOP80NewCodeInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ProductionPlanInfo/Dto/ProductionPlanInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ProductionPlanInfo/Dto/ProductionPlanInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ProductionPlanInfo/Dto/ProductionPlanInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ProductionPlanInfo/IProductionPlanInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ProductionPlanInfo/Map/ProductionPlanInfoMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ProductionPlanInfo/ProductionPlanInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/QualityDataInfo/Dto/QualityDataInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/QualityDataInfo/Dto/QualityDataInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/QualityDataInfo/Dto/QualityDataInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/QualityDataInfo/IQualityDataInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/QualityDataInfo/QualityDataInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ShiftInfo/Dto/ShiftInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ShiftInfo/Dto/ShiftInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ShiftInfo/Dto/ShiftInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ShiftInfo/IShiftInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ShiftInfo/Map/ShiftInfoMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ShiftInfo/ShiftInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/App/Dto/AppInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/App/Dto/AppOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/App/ISysAppService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/App/SysAppService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Auth/AuthService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Auth/Dto/LoginInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Auth/Dto/LoginOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Auth/Dto/RegistInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Auth/IAuthService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Base/BaseService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Base/Dto/BaseDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Cache/ISysCacheService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Cache/SysCacheService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/ClickWord/ClickWordCaptcha.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/ClickWord/ClickWordCaptchaInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/ClickWord/ClickWordCaptchaResult.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/ClickWord/IClickWordCaptcha.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/General/GeneralCaptcha.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/General/GeneralCaptchaInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Captcha/General/IGeneralCaptcha.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/CodeGenConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/CodeGenService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/CodeGenConfig.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/CodeGenInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/CodeGenModel.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/CodeGenOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/DatabaseOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/TableColumnOuput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/TableOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/Dto/XnCodeGenOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/ICodeGenConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/CodeGen/ICodeGenService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Config/Dto/ConfigInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Config/ISysConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Config/SysConfigService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/Dto/DictDataInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/Dto/DictDataOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/Dto/DictTreeOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/Dto/DictTypeInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/ISysDictDataService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/ISysDictTypeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/SysDictDataService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Dict/SysDictTypeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/Dto/EmpExtOrgPosOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/Dto/EmpOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/Dto/EmpOutput2.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/Dto/EmpPosOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/ISysEmpExtOrgPosService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/ISysEmpPosService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/ISysEmpService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/SysEmpExtOrgPosService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/SysEmpPosService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Emp/SysEmpService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Enum/Dto/EnumDataInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Enum/Dto/EnumDataOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Enum/ISysEnumDataService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Enum/SysEnumDataService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/File/Dto/FileInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/File/Dto/FileOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/File/ISysFileService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/File/SysFileService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/Dto/FormAddDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/Dto/FormDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/Dto/FormEditDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/Dto/FormPageSearch.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/Dto/FormPublishDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/FormService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Forms/IFormService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Hubs/ChatHub.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Hubs/Dto/MessageinputDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Hubs/IChatClient.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/Dto/ContrasOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/Dto/ContrastLowCode.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/Dto/Front_CodeGenerate.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/Dto/GenEntity.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/Dto/LowCodeInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/GenEntityComparer.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/ILowCodeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/LowCode/LowCodeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Menu/Dto/AntDesignTreeNode.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Menu/Dto/MenuInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Menu/Dto/MenuOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Menu/Dto/MenuTreeOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Menu/ISysMenuService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Menu/SysMenuService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Message/ISendMessageService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Message/SendMessageService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Monitor/IMachineService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Monitor/MachineService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/Dto/NoticeBase.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/Dto/NoticeDetailOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/Dto/NoticeInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/Dto/NoticeReceiveOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/ISysNoticeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/ISysNoticeUserService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/SysNoticeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Notice/SysNoticeUserService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/OnlineUser/Dto/OnlineUserOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/OnlineUser/ISysOnlineUserService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/OnlineUser/SysOnlineUserService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Org/Dto/OrgInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Org/Dto/OrgOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Org/Dto/OrgTreeNode.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Org/ISysOrgService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Org/SysOrgService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Pos/Dto/PosInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Pos/ISysPosService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Pos/SysPosService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/Dto/RoleInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/Dto/RoleOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/ISysRoleDataScopeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/ISysRoleMenuService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/ISysRoleService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/SysRoleDataScopeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/SysRoleMenuService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Role/SysRoleService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Timer/Dto/JobInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Timer/Dto/JobOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Timer/ISysTimerService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/Timer/SysTimerService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/CurrentUserInfo.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/Dto/AuthToken.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/Dto/AuthUserInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/Dto/UserInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/Dto/UserOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/ISysUserDataScopeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/ISysUserRoleService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/ISysUserService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/SysUserDataScopeService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/SysUserRoleService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/System/User/SysUserService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ThreadStatusMonitor/Dto/ThreadStatusMonitorDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ThreadStatusMonitor/Dto/ThreadStatusMonitorInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ThreadStatusMonitor/Dto/ThreadStatusMonitorOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ThreadStatusMonitor/IThreadStatusMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ThreadStatusMonitor/Map/ThreadStatusMonitorMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/ThreadStatusMonitor/ThreadStatusMonitorService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsArea/Dto/WmsAreaDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsArea/Dto/WmsAreaInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsArea/Dto/WmsAreaOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsArea/IWmsAreaService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsArea/Map/WmsAreaMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsArea/WmsAreaService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsContainer/Dto/WmsContainerDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsContainer/Dto/WmsContainerInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsContainer/Dto/WmsContainerOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsContainer/IWmsContainerService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsContainer/Map/WmsContainerMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsContainer/WmsContainerService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsMaterial/Dto/WmsMaterialDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsMaterial/Dto/WmsMaterialInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsMaterial/Dto/WmsMaterialOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsMaterial/IWmsMaterialService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsMaterial/Map/WmsMaterialMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsMaterial/WmsMaterialService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsPlace/Dto/WmsPlaceDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsPlace/Dto/WmsPlaceInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsPlace/Dto/WmsPlaceOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsPlace/IWmsPlaceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsPlace/Map/WmsPlaceMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsPlace/WmsPlaceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsBase/WmsSeed/WmsSeed.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsAccessDetails/Dto/View_AccessDetailsDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsAccessDetails/Dto/View_AccessDetailsInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsAccessDetails/Dto/View_AccessDetailsOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsAccessDetails/IView_AccessDetailsService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsAccessDetails/Map/View_AccessDetailsMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsAccessDetails/View_AccessDetailsService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsIndex/Dto/IndexInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsIndex/Dto/IndexOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsIndex/IIndexCountService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsIndex/IndexCountService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsLocationView/Dto/LocationViewInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsLocationView/Dto/LocationViewOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsLocationView/IlocationViewService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsCount/WmsLocationView/locationViewService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/Entrance/Dto/PadBindEntranceInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/Entrance/Dto/PadWmsMaterialContainerDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/Entrance/Dto/PdaBindEntranceDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/Entrance/Dto/PdaBindEntranceOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/Entrance/PdaBindEntranceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/ExWare/Dto/ExWarehouseInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WmsPda/ExWare/ExWarePDAService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsBindEntrance/BindEntranceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsBindEntrance/Dto/BindEntranceDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsBindEntrance/Dto/BindEntranceInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsBindEntrance/Dto/BindEntranceOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsBindEntrance/Dto/WmsMaterialContainerDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsBindEntrance/IBindEntranceService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/Dto/ExWarehouseInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/Dto/WmsMaterialStockDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/Dto/WmsMaterialStockInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/Dto/WmsMaterialStockOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/ExWarehouseService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/IExWarehouseService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsExWarehouse/Map/WmsMaterialStockMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsTask/Dto/WmsTaskDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsTask/Dto/WmsTaskInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsTask/Dto/WmsTaskOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsTask/IWmsTaskService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsTask/Map/WmsTaskMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/Wmsjob/WmsTask/WmsTaskService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceInfo/Dto/WorkPieceInfoDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceInfo/Dto/WorkPieceInfoInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceInfo/Dto/WorkPieceInfoOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceInfo/IWorkPieceInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceInfo/Map/WorkPieceInfoMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceInfo/WorkPieceInfoService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceOutbound/Dto/WorkPieceOutboundDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceOutbound/Dto/WorkPieceOutboundInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceOutbound/Dto/WorkPieceOutboundOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceOutbound/IWorkPieceOutboundService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceOutbound/Map/WorkPieceOutboundMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceOutbound/WorkPieceOutboundService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/Dto/WorkPieceProcessDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/Dto/WorkPieceProcessInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/Dto/WorkPieceProcessOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/IWorkPieceProcessService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/Map/WorkPieceProcessMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/WorkPieceProcess/WorkPieceProcessService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/YieldAnalysis/Dto/YieldAnalysisDto.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/YieldAnalysis/Dto/YieldAnalysisInput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/YieldAnalysis/Dto/YieldAnalysisOutput.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/YieldAnalysis/IYieldAnalysisService.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/YieldAnalysis/Map/YieldAnalysisMapper.cs
iWara.SCADA.Code/iWare.Wms.Application/Service/YieldAnalysis/YieldAnalysisService.cs
iWara.SCADA.Code/iWare.Wms.Application/SpareTimes/SpareTimeDemo.cs
iWara.SCADA.Code/iWare.Wms.Application/Startup.cs
iWara.SCADA.Code/iWare.Wms.Application/applicationsettings.json
iWara.SCADA.Code/iWare.Wms.Application/iWare.Wms.Application.csproj
iWara.SCADA.Code/iWare.Wms.Application/iWare.Wms.Application.xml
iWara.SCADA.Code/iWare.Wms.Core/Const/ClaimConst.cs
iWara.SCADA.Code/iWare.Wms.Core/Const/CommonConst.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/Access/AccessInterfaceLog.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/DEntityBase.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/IDataPermissions.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/DataCaptureColumnConfig.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/DataCaptureConfig.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/EquipmentCurrentMonitor.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/EquipmentStatusAnalyse.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/EquipmentWorkingLog.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/Equipmentbaseinfo.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/InfoAirport.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/KnifeToolBaseInfo.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/KnifeToolDataMonitor.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/KnifeToolEquipmentMonitor.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/KnifeToolUsageAnalysis.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/ProductionPlanInfo.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/QualityDataInfo.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/QualityDataInfoLog.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/ShiftInfo.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/SystemLog.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/TeamsAndGroups.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/ThreadStatusMonitor.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/V_GetEquipmentAlert.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/WorkPieceInfo.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/WorkPieceInfoLog.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/WorkPieceLog.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/WorkPieceOutBound.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/WorkPieceProcess.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/SCADA/YieldAnalysis.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysApp.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysCodeGen.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysCodeGenConfig.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysCodeModular.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysConfig.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysDictData.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysDictType.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysEmp.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysEmpExtOrgPos.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysEmpPos.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysFile.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysForm.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysLogAudit.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysLogEx.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysLogOp.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysLogVis.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysLowCode.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysLowCodeDataBase.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysMenu.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysNotice.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysNoticeUser.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysOnlineUser.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysOrg.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysPos.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysRole.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysRoleDataScope.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysRoleMenu.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysTimer.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysUser.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysUserDataScope.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/System/SysUserRole.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsBase/WmsArea.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsBase/WmsContainer.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsBase/WmsMaterial.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsBase/WmsPlace.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsCount/WmsMaterialStock.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsCount/v_AccessDetails.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsJob/WmsContainerPlace.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsJob/WmsMaterialContainer.cs
iWara.SCADA.Code/iWare.Wms.Core/Entity/WmsJob/WmsTask.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/AdminType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/CommonStatus.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/DataOpType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/DataScopeType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/EnumAuditStatus.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/EnumEquipmentCurrentState.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/EnumQualityErrorInfoType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/EnumQuantityState.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/Enums.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/ErrorCode.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/FileLocation.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/FormDesignType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/Gender.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/HttpMethod.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/HttpStatusCode.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/LoginType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/MenuOpenType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/MenuType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/MenuWeight.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/MessageType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/NoticeStatus.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/NoticeType.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/NoticeUserStatus.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/QueryTypeEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/RequestTypeEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/RoleTypeEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/WmsAreaEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/WmsContainerEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/WmsMaterialEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/WmsTaskEnum.cs
iWara.SCADA.Code/iWare.Wms.Core/Enum/YesOrNot.cs
iWara.SCADA.Code/iWare.Wms.Core/EventSubscriber/LogEventSubscriber.cs
iWara.SCADA.Code/iWare.Wms.Core/Extension/CsRedisExtensions.cs
iWara.SCADA.Code/iWare.Wms.Core/Extension/DictionaryExtensions.cs
iWara.SCADA.Code/iWare.Wms.Core/Extension/FakeDeleteExtensions.cs
iWara.SCADA.Code/iWare.Wms.Core/Extension/LambdaExpressionBuilder.cs
iWara.SCADA.Code/iWare.Wms.Core/Extension/NewtonsoftJsonSerializerProvider .cs
iWara.SCADA.Code/iWare.Wms.Core/Extension/QueryableExstenstions.cs
iWara.SCADA.Code/iWare.Wms.Core/Filter/DisableOpLogAttribute.cs
iWara.SCADA.Code/iWare.Wms.Core/Filter/LogExceptionHandler.cs
iWara.SCADA.Code/iWare.Wms.Core/Filter/RequestActionFilter.cs
iWara.SCADA.Code/iWare.Wms.Core/Options/RefreshTokenSettingOptions.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysAppSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysConfigSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysDictDataSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysDictTypeSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysEmpExtOrgPos.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysEmpPosSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysEmpSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysMenuSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysOrgSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysPosSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysRoleSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysTimerSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysUserDataScopeSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysUserRoleSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/SysUserSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsAreaSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsContainerPlaceSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsContainerSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsMaterialContainerSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsMaterialSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsMaterialStockSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsPlaceSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/SeedData/WmsTaskSeedData.cs
iWara.SCADA.Code/iWare.Wms.Core/Service/BaseId.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/CodeGenUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/DataCompareUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/DataConvertUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/DateTimeOffSetToDateTime.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/DictCacheUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/EntityPropHelper.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/EnumEntity.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/EnumUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/ExcelUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/FileUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/IPUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/JsonUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Dto/Front_FileDto.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Enum/FieldType.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/EssentialFactor.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Factor/DateFactor.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Factor/DecimalFactor.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Factor/Interface/IFactor.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Factor/TextFactor.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Att/FrontTypeAttribute.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Att/FrontTypeBindDatabaseAttribute.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Code/AutoCode_Dynamic.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Code/AutoCode_Front.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Code/AutoCode_FrontModel.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Code/FileUrl_Code.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Alert.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Batch.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Button.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Card.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Cascader.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Checkbox.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Date.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Divider.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Editor.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Grid.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Html.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Input.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Number.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Radio.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Rate.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Select.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_SelectInputList.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Slider.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Switch.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Table.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Tabs.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Text.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Textarea.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_Time.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_TreeSelect.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_UploadFile.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Front_UploadImg.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Interface/IFront.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Interface/IFrontDynamic.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Interface/IFrontDynamicOptions.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Interface/IFrontLayout.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Base.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Config.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Convert.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Dynamic.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Model.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Option.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Rule.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/Front_Tree_Option.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/NotFoundFrontException.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/Front/Model/ViewDynamic.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/LowCode/SysFileServiceEx.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/MachineUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/PageInputOrder.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/PagedUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/ReflectionUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/ShellUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/StringUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/TreeBuildUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/TypeUtil.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/XnInputBase.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/XnPageResult.cs
iWara.SCADA.Code/iWare.Wms.Core/Util/XnRestfulResultProvider.cs
iWara.SCADA.Code/iWare.Wms.Core/applicationconfig.json
iWara.SCADA.Code/iWare.Wms.Core/iWare.Wms.Core.csproj
iWara.SCADA.Code/iWare.Wms.Database.Migrations/Migrations/20240112013535_v1.0.1.Designer.cs
iWara.SCADA.Code/iWare.Wms.Database.Migrations/Migrations/20240112013535_v1.0.1.cs
iWara.SCADA.Code/iWare.Wms.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs
iWara.SCADA.Code/iWare.Wms.Database.Migrations/iWare.Wms.Database.Migrations.csproj
iWara.SCADA.Code/iWare.Wms.Database.Migrations/note/note.txt
iWara.SCADA.Code/iWare.Wms.EntityFramework.Core/DbContexts/DefaultDbContext.cs
iWara.SCADA.Code/iWare.Wms.EntityFramework.Core/DbContexts/MultiTenantDbContext.cs
iWara.SCADA.Code/iWare.Wms.EntityFramework.Core/DbContexts/SCADAGatewayDbContext.cs
iWara.SCADA.Code/iWare.Wms.EntityFramework.Core/Startup.cs
iWara.SCADA.Code/iWare.Wms.EntityFramework.Core/dbsettings.json
iWara.SCADA.Code/iWare.Wms.EntityFramework.Core/iWare.Wms.EntityFramework.Core.csproj
iWara.SCADA.Code/iWare.Wms.Web.Core/Handlers/JwtHandler.cs
iWara.SCADA.Code/iWare.Wms.Web.Core/ServiceExtension/BStyleServiceExtension.cs
iWara.SCADA.Code/iWare.Wms.Web.Core/ServiceExtension/SnowflakeIdServiceExtension.cs
iWara.SCADA.Code/iWare.Wms.Web.Core/Startup.cs
iWara.SCADA.Code/iWare.Wms.Web.Core/iWare.Wms.Web.Core.csproj
iWara.SCADA.Code/iWare.Wms.Web.Entry/.config/dotnet-tools.json
iWara.SCADA.Code/iWare.Wms.Web.Entry/Controllers/HomeController.cs
iWara.SCADA.Code/iWare.Wms.Web.Entry/Program.cs
iWara.SCADA.Code/iWare.Wms.Web.Entry/Properties/launchSettings.json
iWara.SCADA.Code/iWare.Wms.Web.Entry/Views/Home/Index.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/Views/Shared/_Layout.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/Views/_ViewImports.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/Views/_ViewStart.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/appsettings.json
iWara.SCADA.Code/iWare.Wms.Web.Entry/iWare.Wms.Web.Entry.csproj
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Font/font1559.ttf
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/1.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/2.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/3.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/4.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/5.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/6.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/7.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Captcha/Image/8.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Image/logo.png
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template.zip
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Dto.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Dto.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Entity.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Entity.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/IService.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/IService.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Input.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Input.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Manage.js.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Manage.js.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Mapper.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Mapper.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Output.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Output.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Service.cs.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/Service.cs.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/addForm.vue.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/addForm.vue.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/editForm.vue.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/editForm.vue.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/index.vue.cshtml
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Template/index.vue.vm
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/273667564548165.jpeg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290520762908741.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290540885852229.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290541680373829.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290541696553029.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290541720457285.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290543139135557.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290543159849029.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290543276712005.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290543306960965.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290543630598213.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290543643689029.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290544533905477.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/290544557092933.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/351604299395141.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/352893017190469.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/Upload/Default/352918594232389.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/avatar2.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/app.7633af46.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/app.7633af46.css.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/chunk-b7a16696.677134ab.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/chunk-b7a16696.677134ab.css.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/chunk-vendors.4659697d.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/chunk-vendors.4659697d.css.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/fail.8d6df989.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/fail.8d6df989.css.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/site.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/theme-colors-ef7df4e0.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/user.fa7ae686.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/css/user.fa7ae686.css.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/favicon.ico
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/img/bg.110420cf.png
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/img/logo.a0cbaad2.png
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/img/map.3425b845.jpg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/img/map.ae82c867.png
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/img/map2.48889afd.png
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/img/welcome.164ddad4.png
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/index.html
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/app.413ecdbc.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/app.413ecdbc.js.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/chunk-b7a16696.e8717d8b.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/chunk-b7a16696.e8717d8b.js.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/chunk-vendors.c9111d8d.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/chunk-vendors.c9111d8d.js.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/fail.c1daacfd.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/fail.c1daacfd.js.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/site.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/user.6ca40864.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/js/user.6ca40864.js.gz
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/LICENSE
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.min.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.min.css.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.js.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.min.js.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.js.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation/LICENSE.md
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation/dist/additional-methods.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation/dist/additional-methods.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation/dist/jquery.validate.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery/LICENSE.txt
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery/dist/jquery.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery/dist/jquery.min.js
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/lib/jquery/dist/jquery.min.map
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/loading/loading.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/loading/loading.html
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/loading/option2/html_code_segment.html
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/loading/option2/loading.css
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/loading/option2/loading.svg
iWara.SCADA.Code/iWare.Wms.Web.Entry/wwwroot/logo.png
iWara.SCADA.Code/iWare.Wms.sln
iwara-scada-web/.browserslistrc
iwara-scada-web/.editorconfig
iwara-scada-web/.env
iwara-scada-web/.env.development
iwara-scada-web/.env.preview
iwara-scada-web/.eslintrc.js
iwara-scada-web/.gitignore
iwara-scada-web/.prettierrc
iwara-scada-web/.travis.yml
iwara-scada-web/Dockerfile
iwara-scada-web/LICENSE
iwara-scada-web/WMS基准版前端文档.docx
iwara-scada-web/babel.config.js
iwara-scada-web/config/plugin.config.js
iwara-scada-web/docker/docker-compose.yml
iwara-scada-web/docker/nginx/Dockerfile
iwara-scada-web/docker/nginx/nginx.conf
iwara-scada-web/docker/nginx/vhost/default.conf
iwara-scada-web/jest.config.js
iwara-scada-web/jsconfig.json
iwara-scada-web/package-lock.json
iwara-scada-web/package.json
iwara-scada-web/postcss.config.js
iwara-scada-web/public/avatar2.jpg
iwara-scada-web/public/config.js
iwara-scada-web/public/index.html
iwara-scada-web/public/loading/loading.css
iwara-scada-web/public/loading/loading.html
iwara-scada-web/public/loading/option2/html_code_segment.html
iwara-scada-web/public/loading/option2/loading.css
iwara-scada-web/public/loading/option2/loading.svg
iwara-scada-web/public/logo.png
iwara-scada-web/src/App.vue
iwara-scada-web/src/api/modular/gen/codeGenerateManage.js
iwara-scada-web/src/api/modular/gen/lowCodeManage.js
iwara-scada-web/src/api/modular/gen/sysCodeGenerateConfigManage.js
iwara-scada-web/src/api/modular/main/BasicDataMaintenance.js
iwara-scada-web/src/api/modular/main/BindEntranceManage.js
iwara-scada-web/src/api/modular/main/DataCaptureColumnConfigManage.js
iwara-scada-web/src/api/modular/main/DataCaptureConfigManage.js
iwara-scada-web/src/api/modular/main/EquipmentBaseInfoManage.js
iwara-scada-web/src/api/modular/main/EquipmentCurrentMonitorManage.js
iwara-scada-web/src/api/modular/main/EquipmentStatusAnalyseManage.js
iwara-scada-web/src/api/modular/main/EquipmentWorkingLogManage.js
iwara-scada-web/src/api/modular/main/ExWarehouseManage.js
iwara-scada-web/src/api/modular/main/KnifeToolBaseInfoManage.js
iwara-scada-web/src/api/modular/main/KnifeToolDataMonitorManage.js
iwara-scada-web/src/api/modular/main/KnifeToolEquipmentUpdateLog.js
iwara-scada-web/src/api/modular/main/KnifeToolUsageAnalysisManage.js
iwara-scada-web/src/api/modular/main/LocationViewManage.js
iwara-scada-web/src/api/modular/main/QualityDataInfoManage.js
iwara-scada-web/src/api/modular/main/README.md
iwara-scada-web/src/api/modular/main/ShiftManage.js
iwara-scada-web/src/api/modular/main/SysTenantManage.js
iwara-scada-web/src/api/modular/main/ThreadStatusMonitorManage.js
iwara-scada-web/src/api/modular/main/View_AccessDetailsManage.js
iwara-scada-web/src/api/modular/main/WmsAreaManage.js
iwara-scada-web/src/api/modular/main/WmsContainerManage.js
iwara-scada-web/src/api/modular/main/WmsMaterialManage.js
iwara-scada-web/src/api/modular/main/WmsPlaceManage.js
iwara-scada-web/src/api/modular/main/WmsTaskManage.js
iwara-scada-web/src/api/modular/main/WorkPieceInfoManage.js
iwara-scada-web/src/api/modular/main/WorkPieceOutboundManage.js
iwara-scada-web/src/api/modular/main/WorkPieceProcessManage.js
iwara-scada-web/src/api/modular/main/YieldAnalysisManage.js
iwara-scada-web/src/api/modular/main/YieldMaintenanceManage.js
iwara-scada-web/src/api/modular/main/ceManage.js
iwara-scada-web/src/api/modular/main/cesManage.js
iwara-scada-web/src/api/modular/system/README.md
iwara-scada-web/src/api/modular/system/appManage.js
iwara-scada-web/src/api/modular/system/auditorworkflowManage.js
iwara-scada-web/src/api/modular/system/configManage.js
iwara-scada-web/src/api/modular/system/dictDataManage.js
iwara-scada-web/src/api/modular/system/dictManage.js
iwara-scada-web/src/api/modular/system/emailManage.js
iwara-scada-web/src/api/modular/system/enumManage.js
iwara-scada-web/src/api/modular/system/fileManage.js
iwara-scada-web/src/api/modular/system/formDesignmanage.js
iwara-scada-web/src/api/modular/system/homeManage.js
iwara-scada-web/src/api/modular/system/logManage.js
iwara-scada-web/src/api/modular/system/loginManage.js
iwara-scada-web/src/api/modular/system/machineManage.js
iwara-scada-web/src/api/modular/system/menuManage.js
iwara-scada-web/src/api/modular/system/noticeManage.js
iwara-scada-web/src/api/modular/system/noticeReceivedManage.js
iwara-scada-web/src/api/modular/system/onlineUserManage.js
iwara-scada-web/src/api/modular/system/orgManage.js
iwara-scada-web/src/api/modular/system/posManage.js
iwara-scada-web/src/api/modular/system/roleManage.js
iwara-scada-web/src/api/modular/system/smsManage.js
iwara-scada-web/src/api/modular/system/tenantManage.js
iwara-scada-web/src/api/modular/system/timersManage.js
iwara-scada-web/src/api/modular/system/userManage.js
iwara-scada-web/src/api/modular/system/workflowManage.js
iwara-scada-web/src/assets/icons/bx-analyse.svg
iwara-scada-web/src/assets/login_bk.png
iwara-scada-web/src/assets/logo.png
iwara-scada-web/src/assets/logo.svg
iwara-scada-web/src/assets/logo2.jpg
iwara-scada-web/src/assets/notice.png
iwara-scada-web/src/assets/welcome.png
iwara-scada-web/src/assets/welcome/blue.svg
iwara-scada-web/src/assets/welcome/inner.png
iwara-scada-web/src/components/ArticleListContent/ArticleListContent.vue
iwara-scada-web/src/components/ArticleListContent/index.js
iwara-scada-web/src/components/AvatarList/Item.vue
iwara-scada-web/src/components/AvatarList/List.vue
iwara-scada-web/src/components/AvatarList/index.js
iwara-scada-web/src/components/AvatarList/index.less
iwara-scada-web/src/components/AvatarList/index.md
iwara-scada-web/src/components/Charts/Bar.vue
iwara-scada-web/src/components/Charts/ChartCard.vue
iwara-scada-web/src/components/Charts/Liquid.vue
iwara-scada-web/src/components/Charts/MiniArea.vue
iwara-scada-web/src/components/Charts/MiniBar.vue
iwara-scada-web/src/components/Charts/MiniProgress.vue
iwara-scada-web/src/components/Charts/MiniSmoothArea.vue
iwara-scada-web/src/components/Charts/Radar.vue
iwara-scada-web/src/components/Charts/RankList.vue
iwara-scada-web/src/components/Charts/TagCloud.vue
iwara-scada-web/src/components/Charts/TransferBar.vue
iwara-scada-web/src/components/Charts/Trend.vue
iwara-scada-web/src/components/Charts/chart.less
iwara-scada-web/src/components/Charts/smooth.area.less
iwara-scada-web/src/components/ChooseSiteModal.vue
iwara-scada-web/src/components/CountDown/CountDown.vue
iwara-scada-web/src/components/CountDown/index.js
iwara-scada-web/src/components/CountDown/index.md
iwara-scada-web/src/components/DepartmentSelect/DepartmentSelect.vue
iwara-scada-web/src/components/DepartmentSelect/index.js
iwara-scada-web/src/components/DescriptionList/DescriptionList.vue
iwara-scada-web/src/components/DescriptionList/index.js
iwara-scada-web/src/components/Dialog.js
iwara-scada-web/src/components/Editor/QuillEditor.vue
iwara-scada-web/src/components/Editor/WangEditor.vue
iwara-scada-web/src/components/Ellipsis/Ellipsis.vue
iwara-scada-web/src/components/Ellipsis/index.js
iwara-scada-web/src/components/Ellipsis/index.md
iwara-scada-web/src/components/Exception/ExceptionPage.vue
iwara-scada-web/src/components/Exception/index.js
iwara-scada-web/src/components/Exception/type.js
iwara-scada-web/src/components/FooterToolbar/FooterToolBar.vue
iwara-scada-web/src/components/FooterToolbar/index.js
iwara-scada-web/src/components/FooterToolbar/index.less
iwara-scada-web/src/components/FooterToolbar/index.md
iwara-scada-web/src/components/GlobalFooter/GlobalFooter.vue
iwara-scada-web/src/components/GlobalFooter/index.js
iwara-scada-web/src/components/GlobalHeader/GlobalHeader.vue
iwara-scada-web/src/components/GlobalHeader/index.js
iwara-scada-web/src/components/IconSelector/IconSelector.vue
iwara-scada-web/src/components/IconSelector/README.md
iwara-scada-web/src/components/IconSelector/icons.js
iwara-scada-web/src/components/IconSelector/index.js
iwara-scada-web/src/components/Loading.js
iwara-scada-web/src/components/Menu/SideMenu.vue
iwara-scada-web/src/components/Menu/index.js
iwara-scada-web/src/components/Menu/menu.js
iwara-scada-web/src/components/Menu/menu.render.js
iwara-scada-web/src/components/MultiTab/MultiTab.vue
iwara-scada-web/src/components/MultiTab/events.js
iwara-scada-web/src/components/MultiTab/index.js
iwara-scada-web/src/components/MultiTab/index.less
iwara-scada-web/src/components/NProgress/nprogress.less
iwara-scada-web/src/components/NoticeIcon/NoticeIcon.vue
iwara-scada-web/src/components/NoticeIcon/index.js
iwara-scada-web/src/components/NumberInfo/NumberInfo.vue
iwara-scada-web/src/components/NumberInfo/index.js
iwara-scada-web/src/components/NumberInfo/index.less
iwara-scada-web/src/components/NumberInfo/index.md
iwara-scada-web/src/components/PageHeader/PageHeader.vue
iwara-scada-web/src/components/PageHeader/index.js
iwara-scada-web/src/components/PageLoading/index.jsx
iwara-scada-web/src/components/Result/Result.vue
iwara-scada-web/src/components/Result/index.js
iwara-scada-web/src/components/Search/GlobalSearch.jsx
iwara-scada-web/src/components/Search/index.less
iwara-scada-web/src/components/SettingDrawer/SettingDrawer.vue
iwara-scada-web/src/components/SettingDrawer/SettingItem.vue
iwara-scada-web/src/components/SettingDrawer/index.js
iwara-scada-web/src/components/SettingDrawer/settingConfig.js
iwara-scada-web/src/components/SettingDrawer/themeColor.js
iwara-scada-web/src/components/StandardFormRow/StandardFormRow.vue
iwara-scada-web/src/components/StandardFormRow/index.js
iwara-scada-web/src/components/Table/README.md
iwara-scada-web/src/components/Table/columnSetting.vue
iwara-scada-web/src/components/Table/index.js
iwara-scada-web/src/components/Table/index.less
iwara-scada-web/src/components/TagSelect/TagSelectOption.jsx
iwara-scada-web/src/components/TagSelect/index.jsx
iwara-scada-web/src/components/TextArea/index.jsx
iwara-scada-web/src/components/TextArea/style.less
iwara-scada-web/src/components/Tree/Tree.jsx
iwara-scada-web/src/components/Trend/Trend.vue
iwara-scada-web/src/components/Trend/index.js
iwara-scada-web/src/components/Trend/index.less
iwara-scada-web/src/components/Trend/index.md
iwara-scada-web/src/components/UserSelect/UserSelect.vue
iwara-scada-web/src/components/UserSelect/index.js
iwara-scada-web/src/components/_util/util.js
iwara-scada-web/src/components/global.less
iwara-scada-web/src/components/index.js
iwara-scada-web/src/components/index.less
iwara-scada-web/src/components/tools/Breadcrumb.vue
iwara-scada-web/src/components/tools/DetailList.vue
iwara-scada-web/src/components/tools/HeadInfo.vue
iwara-scada-web/src/components/tools/LangSelect.vue
iwara-scada-web/src/components/tools/Logo.vue
iwara-scada-web/src/components/tools/TwoStepCaptcha.vue
iwara-scada-web/src/components/tools/UserMenu.vue
iwara-scada-web/src/components/tools/index.js
iwara-scada-web/src/components/verifition/Verify.vue
iwara-scada-web/src/components/verifition/Verify/VerifyPoints.vue
iwara-scada-web/src/components/verifition/Verify/VerifySlide.vue
iwara-scada-web/src/components/verifition/utils/ase.js
iwara-scada-web/src/components/verifition/utils/axios.js
iwara-scada-web/src/components/verifition/utils/util.js
iwara-scada-web/src/components/xnComponents/XCard.vue
iwara-scada-web/src/config/defaultSettings.js
iwara-scada-web/src/config/router.config.js
iwara-scada-web/src/core/bootstrap.js
iwara-scada-web/src/core/directives/action.js
iwara-scada-web/src/core/icons.js
iwara-scada-web/src/core/lazy_lib/components_use.js
iwara-scada-web/src/core/lazy_use.js
iwara-scada-web/src/core/use.js
iwara-scada-web/src/layouts/BasicLayout.vue
iwara-scada-web/src/layouts/BlankLayout.vue
iwara-scada-web/src/layouts/Iframe.vue
iwara-scada-web/src/layouts/PageView.vue
iwara-scada-web/src/layouts/RouteView.vue
iwara-scada-web/src/layouts/UserLayout.vue
iwara-scada-web/src/layouts/index.js
iwara-scada-web/src/main.js
iwara-scada-web/src/mock/index.js
iwara-scada-web/src/mock/services/article.js
iwara-scada-web/src/mock/services/auth.js
iwara-scada-web/src/mock/services/manage.js
iwara-scada-web/src/mock/services/other.js
iwara-scada-web/src/mock/services/tagCloud.js
iwara-scada-web/src/mock/services/user.js
iwara-scada-web/src/mock/util.js
iwara-scada-web/src/permission.js
iwara-scada-web/src/router/generator-routers.js
iwara-scada-web/src/router/index.js
iwara-scada-web/src/store/getters.js
iwara-scada-web/src/store/index.js
iwara-scada-web/src/store/modules/app.js
iwara-scada-web/src/store/modules/async-router.js
iwara-scada-web/src/store/modules/permission.js
iwara-scada-web/src/store/modules/user.js
iwara-scada-web/src/store/mutation-types.js
iwara-scada-web/src/utils/applocation.js
iwara-scada-web/src/utils/axios.js
iwara-scada-web/src/utils/device.js
iwara-scada-web/src/utils/domUtil.js
iwara-scada-web/src/utils/filter.js
iwara-scada-web/src/utils/helper/permission.js
iwara-scada-web/src/utils/messagesend.js
iwara-scada-web/src/utils/mixin.js
iwara-scada-web/src/utils/permissions.js
iwara-scada-web/src/utils/request.js
iwara-scada-web/src/utils/routeConvert.js
iwara-scada-web/src/utils/socket.js
iwara-scada-web/src/utils/util.js
iwara-scada-web/src/utils/utils.less
iwara-scada-web/src/views/404.vue
iwara-scada-web/src/views/Home.vue
iwara-scada-web/src/views/gen/codeGenerate/addForm.vue
iwara-scada-web/src/views/gen/codeGenerate/assembly.vue
iwara-scada-web/src/views/gen/codeGenerate/editForm.vue
iwara-scada-web/src/views/gen/codeGenerate/fkModal.vue
iwara-scada-web/src/views/gen/codeGenerate/index.vue
iwara-scada-web/src/views/gen/codeGenerate/indexConfig.vue
iwara-scada-web/src/views/gen/lowCode/addForm.vue
iwara-scada-web/src/views/gen/lowCode/editForm.vue
iwara-scada-web/src/views/gen/lowCode/index.vue
iwara-scada-web/src/views/main/BasicDataMaintenance/index.vue
iwara-scada-web/src/views/main/BindEntrance/index.vue
iwara-scada-web/src/views/main/BindEntrance/inputLayout.vue
iwara-scada-web/src/views/main/BindEntrance/searchBox.vue
iwara-scada-web/src/views/main/DataCaptureColumnConfig/addForm.vue
iwara-scada-web/src/views/main/DataCaptureColumnConfig/editForm.vue
iwara-scada-web/src/views/main/DataCaptureColumnConfig/index.vue
iwara-scada-web/src/views/main/DataCaptureConfig/addForm.vue
iwara-scada-web/src/views/main/DataCaptureConfig/editForm.vue
iwara-scada-web/src/views/main/DataCaptureConfig/index.vue
iwara-scada-web/src/views/main/EquipmentBaseInfo/addForm.vue
iwara-scada-web/src/views/main/EquipmentBaseInfo/editForm.vue
iwara-scada-web/src/views/main/EquipmentBaseInfo/index.vue
iwara-scada-web/src/views/main/EquipmentCurrentMonitor/index.vue
iwara-scada-web/src/views/main/EquipmentCurrentMonitor/modules/flexItem.vue
iwara-scada-web/src/views/main/EquipmentCurrentMonitor/modules/tab.vue
iwara-scada-web/src/views/main/EquipmentStatusAnalyse/api/getData.js
iwara-scada-web/src/views/main/EquipmentStatusAnalyse/index.vue
iwara-scada-web/src/views/main/EquipmentStatusAnalyse/modules/Echarts.vue
iwara-scada-web/src/views/main/EquipmentWorkingLog/index.vue
iwara-scada-web/src/views/main/ExWarehouse/index.vue
iwara-scada-web/src/views/main/FaultFreetimeAnalysis/index.vue
iwara-scada-web/src/views/main/FaultFreetimeAnalysis/modules/Echarts.vue
iwara-scada-web/src/views/main/KnifeToolBaseInfo/addForm.vue
iwara-scada-web/src/views/main/KnifeToolBaseInfo/editForm.vue
iwara-scada-web/src/views/main/KnifeToolBaseInfo/index.vue
iwara-scada-web/src/views/main/KnifeToolDataAction/index.vue
iwara-scada-web/src/views/main/KnifeToolDataAction/modules/addEditForm.vue
iwara-scada-web/src/views/main/KnifeToolDataAction/modules/toolDetail.vue
iwara-scada-web/src/views/main/KnifeToolDataAction/modules/toolOff.vue
iwara-scada-web/src/views/main/KnifeToolDataAction/modules/toolOnline.vue
iwara-scada-web/src/views/main/KnifeToolDataMonitor/index.vue
iwara-scada-web/src/views/main/KnifeToolEquipmentUpdateLog/index.vue
iwara-scada-web/src/views/main/KnifeToolUsageAnalysis/api/getData.js
iwara-scada-web/src/views/main/KnifeToolUsageAnalysis/index.vue
iwara-scada-web/src/views/main/KnifeToolUsageAnalysis/modules/Echarts copy.vue
iwara-scada-web/src/views/main/KnifeToolUsageAnalysis/modules/Echarts.vue
iwara-scada-web/src/views/main/LocationView/DetailDrawer.vue
iwara-scada-web/src/views/main/LocationView/SearchForm.vue
iwara-scada-web/src/views/main/LocationView/index.vue
iwara-scada-web/src/views/main/OEEManagement/index.vue
iwara-scada-web/src/views/main/OEEManagement/modules/Echarts.vue
iwara-scada-web/src/views/main/QualityDataInfo/index.vue
iwara-scada-web/src/views/main/QualityDataInfo/modules/Tab.vue
iwara-scada-web/src/views/main/README.md
iwara-scada-web/src/views/main/ShiftManagement/addOrEditForm.vue
iwara-scada-web/src/views/main/ShiftManagement/index.vue
iwara-scada-web/src/views/main/SysTenant/addForm.vue
iwara-scada-web/src/views/main/SysTenant/editForm.vue
iwara-scada-web/src/views/main/SysTenant/index.vue
iwara-scada-web/src/views/main/ThreadStatusMonitor/index.vue
iwara-scada-web/src/views/main/View_AccessDetails/addForm.vue
iwara-scada-web/src/views/main/View_AccessDetails/editForm.vue
iwara-scada-web/src/views/main/View_AccessDetails/index.vue
iwara-scada-web/src/views/main/WmsArea/addForm.vue
iwara-scada-web/src/views/main/WmsArea/editForm.vue
iwara-scada-web/src/views/main/WmsArea/index.vue
iwara-scada-web/src/views/main/WmsBindIn/index.vue
iwara-scada-web/src/views/main/WmsContainer/addForm.vue
iwara-scada-web/src/views/main/WmsContainer/editForm.vue
iwara-scada-web/src/views/main/WmsContainer/index.vue
iwara-scada-web/src/views/main/WmsMaterial/addForm.vue
iwara-scada-web/src/views/main/WmsMaterial/editForm.vue
iwara-scada-web/src/views/main/WmsMaterial/index.vue
iwara-scada-web/src/views/main/WmsPlace/addForm.vue
iwara-scada-web/src/views/main/WmsPlace/editForm.vue
iwara-scada-web/src/views/main/WmsPlace/index.vue
iwara-scada-web/src/views/main/WmsTask/InfoModal.vue
iwara-scada-web/src/views/main/WmsTask/PriorityModal.vue
iwara-scada-web/src/views/main/WmsTask/addForm.vue
iwara-scada-web/src/views/main/WmsTask/editForm.vue
iwara-scada-web/src/views/main/WmsTask/index.vue
iwara-scada-web/src/views/main/WorkPieceInfo/editForm.vue
iwara-scada-web/src/views/main/WorkPieceInfo/index.vue
iwara-scada-web/src/views/main/WorkPieceOutbound/addForm.vue
iwara-scada-web/src/views/main/WorkPieceOutbound/editForm.vue
iwara-scada-web/src/views/main/WorkPieceOutbound/index.vue
iwara-scada-web/src/views/main/WorkPieceProcess copy/index.vue
iwara-scada-web/src/views/main/WorkPieceProcess copy/modules/qualityDetail.vue
iwara-scada-web/src/views/main/WorkPieceProcess/index.vue
iwara-scada-web/src/views/main/WorkPieceProcess/modules/qualityDetail.vue
iwara-scada-web/src/views/main/YieldAnalysis/api/getData.js
iwara-scada-web/src/views/main/YieldAnalysis/index.vue
iwara-scada-web/src/views/main/YieldAnalysis/modules/Echarts.vue
iwara-scada-web/src/views/main/YieldMaintenance/index.vue
iwara-scada-web/src/views/main/YieldMaintenance/modules/addEditForm.vue
iwara-scada-web/src/views/main/YieldMaintenance/modules/yield.vue
iwara-scada-web/src/views/main/screenMonitor/LabelTag.vue
iwara-scada-web/src/views/main/screenMonitor/TopMiddleCmp.vue
iwara-scada-web/src/views/main/screenMonitor/cards.vue
iwara-scada-web/src/views/main/screenMonitor/digitalFlop.vue
iwara-scada-web/src/views/main/screenMonitor/img/bg.png
iwara-scada-web/src/views/main/screenMonitor/img/map.jpg
iwara-scada-web/src/views/main/screenMonitor/img/map.png
iwara-scada-web/src/views/main/screenMonitor/img/map2.png
iwara-scada-web/src/views/main/screenMonitor/img/mapCenterPoint.png
iwara-scada-web/src/views/main/screenMonitor/img/mapPoint.png
iwara-scada-web/src/views/main/screenMonitor/index.vue
iwara-scada-web/src/views/main/screenMonitor/left1.vue
iwara-scada-web/src/views/main/screenMonitor/left12.vue
iwara-scada-web/src/views/main/screenMonitor/left2.vue
iwara-scada-web/src/views/main/screenMonitor/left22.vue
iwara-scada-web/src/views/main/screenMonitor/left23.vue
iwara-scada-web/src/views/main/screenMonitor/middle1.vue
iwara-scada-web/src/views/main/screenMonitor/middle2.vue
iwara-scada-web/src/views/main/screenMonitor/middle3.vue
iwara-scada-web/src/views/main/screenMonitor/rankingBoard.vue
iwara-scada-web/src/views/main/screenMonitor/right1.vue
iwara-scada-web/src/views/main/screenMonitor/right2.vue
iwara-scada-web/src/views/main/screenMonitor/right3.vue
iwara-scada-web/src/views/main/screenMonitor/right4.vue
iwara-scada-web/src/views/main/screenMonitor/scrollBoard.vue
iwara-scada-web/src/views/main/screenMonitor/topHeader.vue
iwara-scada-web/src/views/system/README.md
iwara-scada-web/src/views/system/account/center/Index.vue
iwara-scada-web/src/views/system/account/center/page/App.vue
iwara-scada-web/src/views/system/account/center/page/Article.vue
iwara-scada-web/src/views/system/account/center/page/Project.vue
iwara-scada-web/src/views/system/account/center/page/index.js
iwara-scada-web/src/views/system/account/settings/AvatarModal.vue
iwara-scada-web/src/views/system/account/settings/BaseSetting.vue
iwara-scada-web/src/views/system/account/settings/Binding.vue
iwara-scada-web/src/views/system/account/settings/Custom.vue
iwara-scada-web/src/views/system/account/settings/Index.vue
iwara-scada-web/src/views/system/account/settings/Notification.vue
iwara-scada-web/src/views/system/account/settings/Security.vue
iwara-scada-web/src/views/system/account/settings/securityItem/updPwd.vue
iwara-scada-web/src/views/system/app/addForm.vue
iwara-scada-web/src/views/system/app/editForm.vue
iwara-scada-web/src/views/system/app/index.vue
iwara-scada-web/src/views/system/config/addForm.vue
iwara-scada-web/src/views/system/config/editForm.vue
iwara-scada-web/src/views/system/config/index.vue
iwara-scada-web/src/views/system/dashboard/Analysis.vue
iwara-scada-web/src/views/system/dashboard/Monitor.vue
iwara-scada-web/src/views/system/dashboard/TestWork.vue
iwara-scada-web/src/views/system/dashboard/Workplace.vue
iwara-scada-web/src/views/system/dict/addForm.vue
iwara-scada-web/src/views/system/dict/dictdata/addForm.vue
iwara-scada-web/src/views/system/dict/dictdata/editForm.vue
iwara-scada-web/src/views/system/dict/dictdata/index.vue
iwara-scada-web/src/views/system/dict/editForm.vue
iwara-scada-web/src/views/system/dict/index.vue
iwara-scada-web/src/views/system/email/index.vue
iwara-scada-web/src/views/system/exception/403.vue
iwara-scada-web/src/views/system/exception/404.vue
iwara-scada-web/src/views/system/exception/500.vue
iwara-scada-web/src/views/system/file/detailForm.vue
iwara-scada-web/src/views/system/file/index.vue
iwara-scada-web/src/views/system/file/previewForm.vue
iwara-scada-web/src/views/system/formDesign/edit.vue
iwara-scada-web/src/views/system/formDesign/index.vue
iwara-scada-web/src/views/system/formDesign/list.vue
iwara-scada-web/src/views/system/index/Echarts.vue
iwara-scada-web/src/views/system/index/LineEcharts.vue
iwara-scada-web/src/views/system/index/ModuleA.vue
iwara-scada-web/src/views/system/index/ModuleB.vue
iwara-scada-web/src/views/system/index/ModuleC.vue
iwara-scada-web/src/views/system/index/SmoothLineEcharts.vue
iwara-scada-web/src/views/system/index/modules/EquipmentRunStatus.vue
iwara-scada-web/src/views/system/index/modules/ProdlineHealthy.vue
iwara-scada-web/src/views/system/index/modules/ProductionCompletionTrend.vue
iwara-scada-web/src/views/system/index/modules/ProductionStatistics.vue
iwara-scada-web/src/views/system/index/modules/QualityDataTrends.vue
iwara-scada-web/src/views/system/index/welcome.vue
iwara-scada-web/src/views/system/log/exlog/details.vue
iwara-scada-web/src/views/system/log/exlog/index.vue
iwara-scada-web/src/views/system/log/oplog/details.vue
iwara-scada-web/src/views/system/log/oplog/index.vue
iwara-scada-web/src/views/system/log/vislog/details.vue
iwara-scada-web/src/views/system/log/vislog/index.vue
iwara-scada-web/src/views/system/machine/index.vue
iwara-scada-web/src/views/system/menu/addForm.vue
iwara-scada-web/src/views/system/menu/editForm.vue
iwara-scada-web/src/views/system/menu/index.vue
iwara-scada-web/src/views/system/myworkflow/auditor.vue
iwara-scada-web/src/views/system/myworkflow/components/auditoropera.vue
iwara-scada-web/src/views/system/myworkflow/components/viewworkflow.vue
iwara-scada-web/src/views/system/myworkflow/create.vue
iwara-scada-web/src/views/system/myworkflow/index.vue
iwara-scada-web/src/views/system/myworkflow/unauditor.vue
iwara-scada-web/src/views/system/notice/addForm.vue
iwara-scada-web/src/views/system/notice/detailForm.vue
iwara-scada-web/src/views/system/notice/editForm.vue
iwara-scada-web/src/views/system/notice/index.vue
iwara-scada-web/src/views/system/noticeReceived/detailForm.vue
iwara-scada-web/src/views/system/noticeReceived/index.vue
iwara-scada-web/src/views/system/onlineUser/index.vue
iwara-scada-web/src/views/system/org/addForm.vue
iwara-scada-web/src/views/system/org/editForm.vue
iwara-scada-web/src/views/system/org/index.vue
iwara-scada-web/src/views/system/pos/addForm.vue
iwara-scada-web/src/views/system/pos/editForm.vue
iwara-scada-web/src/views/system/pos/index.vue
iwara-scada-web/src/views/system/role/addForm.vue
iwara-scada-web/src/views/system/role/editForm.vue
iwara-scada-web/src/views/system/role/index.vue
iwara-scada-web/src/views/system/role/roleMenuForm.vue
iwara-scada-web/src/views/system/role/roleOrgForm.vue
iwara-scada-web/src/views/system/sms/index.vue
iwara-scada-web/src/views/system/tenant/addForm.vue
iwara-scada-web/src/views/system/tenant/editForm.vue
iwara-scada-web/src/views/system/tenant/index.vue
iwara-scada-web/src/views/system/tenant/tenantMenuForm.vue
iwara-scada-web/src/views/system/timers/addForm.vue
iwara-scada-web/src/views/system/timers/editForm.vue
iwara-scada-web/src/views/system/timers/index.vue
iwara-scada-web/src/views/system/user/addForm.vue
iwara-scada-web/src/views/system/user/editForm.vue
iwara-scada-web/src/views/system/user/index.vue
iwara-scada-web/src/views/system/user/userOrgForm.vue
iwara-scada-web/src/views/system/user/userRoleForm.vue
iwara-scada-web/src/views/system/workflow/components/builderWorkFlow.vue
iwara-scada-web/src/views/system/workflow/components/nomalWorkFlow.vue
iwara-scada-web/src/views/system/workflow/components/store/conditionflownode.js
iwara-scada-web/src/views/system/workflow/components/store/flowNodeGroup.vue
iwara-scada-web/src/views/system/workflow/components/store/flowentity.js
iwara-scada-web/src/views/system/workflow/components/store/flownodes.js
iwara-scada-web/src/views/system/workflow/components/store/nodeProperty.vue
iwara-scada-web/src/views/system/workflow/components/store/readme.md
iwara-scada-web/src/views/system/workflow/components/store/sourcenodes.js
iwara-scada-web/src/views/system/workflow/create.vue
iwara-scada-web/src/views/system/workflow/edit.vue
iwara-scada-web/src/views/system/workflow/index.vue
iwara-scada-web/src/views/system/workflow/startworkflow.vue
iwara-scada-web/src/views/userLoginReg/Login.vue
iwara-scada-web/src/views/userLoginReg/Register.vue
iwara-scada-web/src/views/userLoginReg/RegisterResult.vue
iwara-scada-web/tests/unit/.eslintrc.js
iwara-scada-web/vue.config.js
iwara-scada-web/webstorm.config.js
yiqi_pda/.gitignore
yiqi_pda/.hbuilderx/launch.json
yiqi_pda/App.vue
yiqi_pda/README.md
yiqi_pda/__json_server_mock__/db.json
yiqi_pda/api/api.js
yiqi_pda/api/common/index.js
yiqi_pda/api/home/index.js
yiqi_pda/api/outBound/index.js
yiqi_pda/api/production/index.js
yiqi_pda/api/retrospect/index.js
yiqi_pda/api/shift/index.js
yiqi_pda/api/unBind/index.js
yiqi_pda/api/unBindAll/index.js
yiqi_pda/components/ActionUserRow.vue
yiqi_pda/components/DefaultHeaderPageLayout.vue
yiqi_pda/components/EasyPicker.vue
yiqi_pda/components/EasySelectFormItem.vue
yiqi_pda/components/FullPageLayout.vue
yiqi_pda/components/HeaderPageLayout.vue
yiqi_pda/components/PageHeader.vue
yiqi_pda/components/ScanInputFormItem.vue
yiqi_pda/components/UViewFormSelectPicker.vue
yiqi_pda/config/index.js
yiqi_pda/config/modules/ajax.js
yiqi_pda/config/modules/pagination.js
yiqi_pda/index.html
yiqi_pda/main.js
yiqi_pda/manifest.json
yiqi_pda/mdImgs/1664329468868.jpg
yiqi_pda/mdImgs/1664329790970.jpg
yiqi_pda/mdImgs/1664330296712.png
yiqi_pda/mdImgs/1665970038354.jpg
yiqi_pda/package.json
yiqi_pda/pages.json
yiqi_pda/pages/baseTask/in.vue
yiqi_pda/pages/baseTask/out.vue
yiqi_pda/pages/home/detail.vue
yiqi_pda/pages/home/index.vue
yiqi_pda/pages/home/modules/warnContent.vue
yiqi_pda/pages/home/modules/warnItem.vue
yiqi_pda/pages/login/index.vue
yiqi_pda/pages/outBound/index.vue
yiqi_pda/pages/outBound/modules/ScanInputFormItem.vue
yiqi_pda/pages/outBound/modules/content.vue
yiqi_pda/pages/outBound/modules/modalPwd.vue
yiqi_pda/pages/print/bluePrint.js
yiqi_pda/pages/print/bluetoothConnection.vue
yiqi_pda/pages/production/addOrEditProd.vue
yiqi_pda/pages/production/index.vue
yiqi_pda/pages/retrospect/index.vue
yiqi_pda/pages/retrospect/modules/barContent.vue
yiqi_pda/pages/retrospect/modules/barStatus.vue
yiqi_pda/pages/setting/host.vue
yiqi_pda/pages/shift/addOrEditShift.vue
yiqi_pda/pages/shift/index.vue
yiqi_pda/pages/start/index.vue
yiqi_pda/pages/unBind/index.vue
yiqi_pda/pages/unBind/modules/barContent.vue
yiqi_pda/pages/unBind/modules/barStatus.vue
yiqi_pda/pages/unBind/modules/modalPwd.vue
yiqi_pda/pages/unBindAll/index.vue
yiqi_pda/pages/unBindAll/modules/Tab.vue
yiqi_pda/pages/unBindAll/modules/barContent.vue
yiqi_pda/pages/unBindAll/modules/barListItem.vue
yiqi_pda/pages/unBindAll/modules/barStatus.vue
yiqi_pda/pages/unBindAll/modules/detailModal.vue
yiqi_pda/pages/unBindAll/modules/statusSelect.vue
yiqi_pda/service/request/index.js
yiqi_pda/service/request/modules/beforeSend.js
yiqi_pda/service/store/index.js
yiqi_pda/service/store/modules/print.js
yiqi_pda/service/store/modules/system.js
yiqi_pda/service/store/modules/user.js
yiqi_pda/static/fonts/iconfont.css
yiqi_pda/static/fonts/iconfont.ttf
yiqi_pda/static/fonts/iconfont.woff
yiqi_pda/static/fonts/iconfont.woff2
yiqi_pda/static/img/icon.png
yiqi_pda/static/img/logo.jpg
yiqi_pda/static/js/print/gbk.js
yiqi_pda/static/js/print/printerjobs.js
yiqi_pda/static/js/utils/filter.js
yiqi_pda/static/js/utils/index.js
yiqi_pda/static/js/utils/modules/color.js
yiqi_pda/static/js/utils/modules/regexValidate.js
yiqi_pda/static/logo.png
yiqi_pda/uni.scss
yiqi_pda/uni_modules/uview-ui/LICENSE
yiqi_pda/uni_modules/uview-ui/README.md
yiqi_pda/uni_modules/uview-ui/changelog.md
yiqi_pda/uni_modules/uview-ui/components/u--form/u--form.vue
yiqi_pda/uni_modules/uview-ui/components/u--image/u--image.vue
yiqi_pda/uni_modules/uview-ui/components/u--input/u--input.vue
yiqi_pda/uni_modules/uview-ui/components/u--text/u--text.vue
yiqi_pda/uni_modules/uview-ui/components/u--textarea/u--textarea.vue
yiqi_pda/uni_modules/uview-ui/components/u-action-sheet/props.js
yiqi_pda/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
yiqi_pda/uni_modules/uview-ui/components/u-album/props.js
yiqi_pda/uni_modules/uview-ui/components/u-album/u-album.vue
yiqi_pda/uni_modules/uview-ui/components/u-alert/props.js
yiqi_pda/uni_modules/uview-ui/components/u-alert/u-alert.vue
yiqi_pda/uni_modules/uview-ui/components/u-avatar-group/props.js
yiqi_pda/uni_modules/uview-ui/components/u-avatar-group/u-avatar-group.vue
yiqi_pda/uni_modules/uview-ui/components/u-avatar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-avatar/u-avatar.vue
yiqi_pda/uni_modules/uview-ui/components/u-back-top/props.js
yiqi_pda/uni_modules/uview-ui/components/u-back-top/u-back-top.vue
yiqi_pda/uni_modules/uview-ui/components/u-badge/props.js
yiqi_pda/uni_modules/uview-ui/components/u-badge/u-badge.vue
yiqi_pda/uni_modules/uview-ui/components/u-button/nvue.scss
yiqi_pda/uni_modules/uview-ui/components/u-button/props.js
yiqi_pda/uni_modules/uview-ui/components/u-button/u-button.vue
yiqi_pda/uni_modules/uview-ui/components/u-button/vue.scss
yiqi_pda/uni_modules/uview-ui/components/u-calendar/header.vue
yiqi_pda/uni_modules/uview-ui/components/u-calendar/month.vue
yiqi_pda/uni_modules/uview-ui/components/u-calendar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-calendar/u-calendar.vue
yiqi_pda/uni_modules/uview-ui/components/u-calendar/util.js
yiqi_pda/uni_modules/uview-ui/components/u-car-keyboard/props.js
yiqi_pda/uni_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue
yiqi_pda/uni_modules/uview-ui/components/u-cell-group/props.js
yiqi_pda/uni_modules/uview-ui/components/u-cell-group/u-cell-group.vue
yiqi_pda/uni_modules/uview-ui/components/u-cell/props.js
yiqi_pda/uni_modules/uview-ui/components/u-cell/u-cell.vue
yiqi_pda/uni_modules/uview-ui/components/u-checkbox-group/props.js
yiqi_pda/uni_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue
yiqi_pda/uni_modules/uview-ui/components/u-checkbox/props.js
yiqi_pda/uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue
yiqi_pda/uni_modules/uview-ui/components/u-circle-progress/props.js
yiqi_pda/uni_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue
yiqi_pda/uni_modules/uview-ui/components/u-code-input/props.js
yiqi_pda/uni_modules/uview-ui/components/u-code-input/u-code-input.vue
yiqi_pda/uni_modules/uview-ui/components/u-code/props.js
yiqi_pda/uni_modules/uview-ui/components/u-code/u-code.vue
yiqi_pda/uni_modules/uview-ui/components/u-col/props.js
yiqi_pda/uni_modules/uview-ui/components/u-col/u-col.vue
yiqi_pda/uni_modules/uview-ui/components/u-collapse-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-collapse/props.js
yiqi_pda/uni_modules/uview-ui/components/u-collapse/u-collapse.vue
yiqi_pda/uni_modules/uview-ui/components/u-column-notice/props.js
yiqi_pda/uni_modules/uview-ui/components/u-column-notice/u-column-notice.vue
yiqi_pda/uni_modules/uview-ui/components/u-count-down/props.js
yiqi_pda/uni_modules/uview-ui/components/u-count-down/u-count-down.vue
yiqi_pda/uni_modules/uview-ui/components/u-count-down/utils.js
yiqi_pda/uni_modules/uview-ui/components/u-count-to/props.js
yiqi_pda/uni_modules/uview-ui/components/u-count-to/u-count-to.vue
yiqi_pda/uni_modules/uview-ui/components/u-datetime-picker/props.js
yiqi_pda/uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue
yiqi_pda/uni_modules/uview-ui/components/u-divider/props.js
yiqi_pda/uni_modules/uview-ui/components/u-divider/u-divider.vue
yiqi_pda/uni_modules/uview-ui/components/u-dropdown-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-dropdown/props.js
yiqi_pda/uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue
yiqi_pda/uni_modules/uview-ui/components/u-empty/props.js
yiqi_pda/uni_modules/uview-ui/components/u-empty/u-empty.vue
yiqi_pda/uni_modules/uview-ui/components/u-form-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-form-item/u-form-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-form/props.js
yiqi_pda/uni_modules/uview-ui/components/u-form/u-form.vue
yiqi_pda/uni_modules/uview-ui/components/u-gap/props.js
yiqi_pda/uni_modules/uview-ui/components/u-gap/u-gap.vue
yiqi_pda/uni_modules/uview-ui/components/u-grid-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-grid-item/u-grid-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-grid/props.js
yiqi_pda/uni_modules/uview-ui/components/u-grid/u-grid.vue
yiqi_pda/uni_modules/uview-ui/components/u-icon/iconfont.ttf
yiqi_pda/uni_modules/uview-ui/components/u-icon/icons.js
yiqi_pda/uni_modules/uview-ui/components/u-icon/props.js
yiqi_pda/uni_modules/uview-ui/components/u-icon/u-icon.vue
yiqi_pda/uni_modules/uview-ui/components/u-image/props.js
yiqi_pda/uni_modules/uview-ui/components/u-image/u-image.vue
yiqi_pda/uni_modules/uview-ui/components/u-index-anchor/props.js
yiqi_pda/uni_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue
yiqi_pda/uni_modules/uview-ui/components/u-index-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-index-item/u-index-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-index-list/props.js
yiqi_pda/uni_modules/uview-ui/components/u-index-list/u-index-list.vue
yiqi_pda/uni_modules/uview-ui/components/u-input/props.js
yiqi_pda/uni_modules/uview-ui/components/u-input/u-input.vue
yiqi_pda/uni_modules/uview-ui/components/u-keyboard/props.js
yiqi_pda/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue
yiqi_pda/uni_modules/uview-ui/components/u-line-progress/props.js
yiqi_pda/uni_modules/uview-ui/components/u-line-progress/u-line-progress.vue
yiqi_pda/uni_modules/uview-ui/components/u-line/props.js
yiqi_pda/uni_modules/uview-ui/components/u-line/u-line.vue
yiqi_pda/uni_modules/uview-ui/components/u-link/props.js
yiqi_pda/uni_modules/uview-ui/components/u-link/u-link.vue
yiqi_pda/uni_modules/uview-ui/components/u-list-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-list-item/u-list-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-list/props.js
yiqi_pda/uni_modules/uview-ui/components/u-list/u-list.vue
yiqi_pda/uni_modules/uview-ui/components/u-loading-icon/props.js
yiqi_pda/uni_modules/uview-ui/components/u-loading-icon/u-loading-icon.vue
yiqi_pda/uni_modules/uview-ui/components/u-loading-page/props.js
yiqi_pda/uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue
yiqi_pda/uni_modules/uview-ui/components/u-loadmore/props.js
yiqi_pda/uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue
yiqi_pda/uni_modules/uview-ui/components/u-modal/props.js
yiqi_pda/uni_modules/uview-ui/components/u-modal/u-modal.vue
yiqi_pda/uni_modules/uview-ui/components/u-navbar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-navbar/u-navbar.vue
yiqi_pda/uni_modules/uview-ui/components/u-no-network/props.js
yiqi_pda/uni_modules/uview-ui/components/u-no-network/u-no-network.vue
yiqi_pda/uni_modules/uview-ui/components/u-notice-bar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-notice-bar/u-notice-bar.vue
yiqi_pda/uni_modules/uview-ui/components/u-notify/props.js
yiqi_pda/uni_modules/uview-ui/components/u-notify/u-notify.vue
yiqi_pda/uni_modules/uview-ui/components/u-number-box/props.js
yiqi_pda/uni_modules/uview-ui/components/u-number-box/u-number-box.vue
yiqi_pda/uni_modules/uview-ui/components/u-number-keyboard/props.js
yiqi_pda/uni_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue
yiqi_pda/uni_modules/uview-ui/components/u-overlay/props.js
yiqi_pda/uni_modules/uview-ui/components/u-overlay/u-overlay.vue
yiqi_pda/uni_modules/uview-ui/components/u-parse/node/node.vue
yiqi_pda/uni_modules/uview-ui/components/u-parse/parser.js
yiqi_pda/uni_modules/uview-ui/components/u-parse/props.js
yiqi_pda/uni_modules/uview-ui/components/u-parse/u-parse.vue
yiqi_pda/uni_modules/uview-ui/components/u-picker-column/props.js
yiqi_pda/uni_modules/uview-ui/components/u-picker-column/u-picker-column.vue
yiqi_pda/uni_modules/uview-ui/components/u-picker/props.js
yiqi_pda/uni_modules/uview-ui/components/u-picker/u-picker.vue
yiqi_pda/uni_modules/uview-ui/components/u-popup/props.js
yiqi_pda/uni_modules/uview-ui/components/u-popup/u-popup.vue
yiqi_pda/uni_modules/uview-ui/components/u-radio-group/props.js
yiqi_pda/uni_modules/uview-ui/components/u-radio-group/u-radio-group.vue
yiqi_pda/uni_modules/uview-ui/components/u-radio/props.js
yiqi_pda/uni_modules/uview-ui/components/u-radio/u-radio.vue
yiqi_pda/uni_modules/uview-ui/components/u-rate/props.js
yiqi_pda/uni_modules/uview-ui/components/u-rate/u-rate.vue
yiqi_pda/uni_modules/uview-ui/components/u-read-more/props.js
yiqi_pda/uni_modules/uview-ui/components/u-read-more/u-read-more.vue
yiqi_pda/uni_modules/uview-ui/components/u-row-notice/props.js
yiqi_pda/uni_modules/uview-ui/components/u-row-notice/u-row-notice.vue
yiqi_pda/uni_modules/uview-ui/components/u-row/props.js
yiqi_pda/uni_modules/uview-ui/components/u-row/u-row.vue
yiqi_pda/uni_modules/uview-ui/components/u-safe-bottom/props.js
yiqi_pda/uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom.vue
yiqi_pda/uni_modules/uview-ui/components/u-scroll-list/nvue.js
yiqi_pda/uni_modules/uview-ui/components/u-scroll-list/other.js
yiqi_pda/uni_modules/uview-ui/components/u-scroll-list/props.js
yiqi_pda/uni_modules/uview-ui/components/u-scroll-list/scrollWxs.wxs
yiqi_pda/uni_modules/uview-ui/components/u-scroll-list/u-scroll-list.vue
yiqi_pda/uni_modules/uview-ui/components/u-search/props.js
yiqi_pda/uni_modules/uview-ui/components/u-search/u-search.vue
yiqi_pda/uni_modules/uview-ui/components/u-skeleton/props.js
yiqi_pda/uni_modules/uview-ui/components/u-skeleton/u-skeleton.vue
yiqi_pda/uni_modules/uview-ui/components/u-slider/mpother.js
yiqi_pda/uni_modules/uview-ui/components/u-slider/mpwxs.js
yiqi_pda/uni_modules/uview-ui/components/u-slider/mpwxs.wxs
yiqi_pda/uni_modules/uview-ui/components/u-slider/nvue - 副本.js
yiqi_pda/uni_modules/uview-ui/components/u-slider/nvue.js
yiqi_pda/uni_modules/uview-ui/components/u-slider/props.js
yiqi_pda/uni_modules/uview-ui/components/u-slider/u-slider.vue
yiqi_pda/uni_modules/uview-ui/components/u-status-bar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-status-bar/u-status-bar.vue
yiqi_pda/uni_modules/uview-ui/components/u-steps-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-steps-item/u-steps-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-steps/props.js
yiqi_pda/uni_modules/uview-ui/components/u-steps/u-steps.vue
yiqi_pda/uni_modules/uview-ui/components/u-sticky/props.js
yiqi_pda/uni_modules/uview-ui/components/u-sticky/u-sticky.vue
yiqi_pda/uni_modules/uview-ui/components/u-subsection/props.js
yiqi_pda/uni_modules/uview-ui/components/u-subsection/u-subsection.vue
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/index - backup.wxs
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/index.wxs
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/nvue - backup.js
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/nvue.js
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/u-swipe-action-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action-item/wxs.js
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action/props.js
yiqi_pda/uni_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue
yiqi_pda/uni_modules/uview-ui/components/u-swiper-indicator/props.js
yiqi_pda/uni_modules/uview-ui/components/u-swiper-indicator/u-swiper-indicator.vue
yiqi_pda/uni_modules/uview-ui/components/u-swiper/props.js
yiqi_pda/uni_modules/uview-ui/components/u-swiper/u-swiper.vue
yiqi_pda/uni_modules/uview-ui/components/u-switch/props.js
yiqi_pda/uni_modules/uview-ui/components/u-switch/u-switch.vue
yiqi_pda/uni_modules/uview-ui/components/u-tabbar-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tabbar-item/u-tabbar-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-tabbar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tabbar/u-tabbar.vue
yiqi_pda/uni_modules/uview-ui/components/u-table/props.js
yiqi_pda/uni_modules/uview-ui/components/u-table/u-table.vue
yiqi_pda/uni_modules/uview-ui/components/u-tabs-item/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tabs-item/u-tabs-item.vue
yiqi_pda/uni_modules/uview-ui/components/u-tabs/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tabs/u-tabs.vue
yiqi_pda/uni_modules/uview-ui/components/u-tag/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tag/u-tag.vue
yiqi_pda/uni_modules/uview-ui/components/u-td/props.js
yiqi_pda/uni_modules/uview-ui/components/u-td/u-td.vue
yiqi_pda/uni_modules/uview-ui/components/u-text/props.js
yiqi_pda/uni_modules/uview-ui/components/u-text/u-text.vue
yiqi_pda/uni_modules/uview-ui/components/u-text/value.js
yiqi_pda/uni_modules/uview-ui/components/u-textarea/props.js
yiqi_pda/uni_modules/uview-ui/components/u-textarea/u-textarea.vue
yiqi_pda/uni_modules/uview-ui/components/u-toast/u-toast.vue
yiqi_pda/uni_modules/uview-ui/components/u-toolbar/props.js
yiqi_pda/uni_modules/uview-ui/components/u-toolbar/u-toolbar.vue
yiqi_pda/uni_modules/uview-ui/components/u-tooltip/clipboard.min.js
yiqi_pda/uni_modules/uview-ui/components/u-tooltip/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tooltip/u-tooltip.vue
yiqi_pda/uni_modules/uview-ui/components/u-tr/props.js
yiqi_pda/uni_modules/uview-ui/components/u-tr/u-tr.vue
yiqi_pda/uni_modules/uview-ui/components/u-transition/nvue.ani-map.js
yiqi_pda/uni_modules/uview-ui/components/u-transition/props.js
yiqi_pda/uni_modules/uview-ui/components/u-transition/transition.js
yiqi_pda/uni_modules/uview-ui/components/u-transition/u-transition.vue
yiqi_pda/uni_modules/uview-ui/components/u-transition/vue.ani-style.scss
yiqi_pda/uni_modules/uview-ui/components/u-upload/mixin.js
yiqi_pda/uni_modules/uview-ui/components/u-upload/props.js
yiqi_pda/uni_modules/uview-ui/components/u-upload/u-upload.vue
yiqi_pda/uni_modules/uview-ui/components/u-upload/utils.js
yiqi_pda/uni_modules/uview-ui/components/uview-ui/uview-ui.vue
yiqi_pda/uni_modules/uview-ui/index.js
yiqi_pda/uni_modules/uview-ui/index.scss
yiqi_pda/uni_modules/uview-ui/libs/config/color.js
yiqi_pda/uni_modules/uview-ui/libs/config/config.js
yiqi_pda/uni_modules/uview-ui/libs/config/props.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/actionSheet.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/album.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/alert.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/avatar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/avatarGroup.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/backtop.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/badge.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/button.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/calendar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/carKeyboard.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/cell.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/cellGroup.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/checkbox.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/checkboxGroup.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/circleProgress.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/code.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/codeInput.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/col.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/collapse.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/collapseItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/columnNotice.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/countDown.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/countTo.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/datetimePicker.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/divider.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/empty.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/form.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/formItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/gap.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/grid.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/gridItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/icon.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/image.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/indexAnchor.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/indexList.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/input.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/keyboard.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/line.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/lineProgress.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/link.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/list.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/listItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/loadingIcon.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/loadingPage.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/loadmore.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/modal.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/navbar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/noNetwork.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/noticeBar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/notify.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/numberBox.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/numberKeyboard.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/overlay.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/parse.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/picker.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/popup.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/radio.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/radioGroup.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/rate.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/readMore.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/row.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/rowNotice.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/scrollList.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/search.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/section.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/skeleton.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/slider.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/statusBar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/steps.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/stepsItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/sticky.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/subsection.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/swipeAction.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/swipeActionItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/swiper.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/swipterIndicator.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/switch.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/tabbar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/tabbarItem.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/tabs.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/tag.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/text.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/textarea.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/toast.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/toolbar.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/tooltip.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/transition.js
yiqi_pda/uni_modules/uview-ui/libs/config/props/upload.js
yiqi_pda/uni_modules/uview-ui/libs/config/zIndex.js
yiqi_pda/uni_modules/uview-ui/libs/css/color.scss
yiqi_pda/uni_modules/uview-ui/libs/css/common.scss
yiqi_pda/uni_modules/uview-ui/libs/css/components.scss
yiqi_pda/uni_modules/uview-ui/libs/css/flex.scss
yiqi_pda/uni_modules/uview-ui/libs/css/h5.scss
yiqi_pda/uni_modules/uview-ui/libs/css/mixin.scss
yiqi_pda/uni_modules/uview-ui/libs/css/mp.scss
yiqi_pda/uni_modules/uview-ui/libs/css/nvue.scss
yiqi_pda/uni_modules/uview-ui/libs/css/vue.scss
yiqi_pda/uni_modules/uview-ui/libs/function/colorGradient.js
yiqi_pda/uni_modules/uview-ui/libs/function/debounce.js
yiqi_pda/uni_modules/uview-ui/libs/function/digit.js
yiqi_pda/uni_modules/uview-ui/libs/function/index.js
yiqi_pda/uni_modules/uview-ui/libs/function/platform.js
yiqi_pda/uni_modules/uview-ui/libs/function/test.js
yiqi_pda/uni_modules/uview-ui/libs/function/throttle.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/adapters/index.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/InterceptorManager.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/Request.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/buildFullPath.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/defaults.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/dispatchRequest.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/mergeConfig.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/core/settle.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/helpers/buildURL.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/helpers/combineURLs.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/helpers/isAbsoluteURL.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/index.d.ts
yiqi_pda/uni_modules/uview-ui/libs/luch-request/index.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/utils.js
yiqi_pda/uni_modules/uview-ui/libs/luch-request/utils/clone.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/button.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/mixin.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/mpMixin.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/mpShare.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/openType.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/style.js
yiqi_pda/uni_modules/uview-ui/libs/mixin/touch.js
yiqi_pda/uni_modules/uview-ui/libs/util/async-validator.js
yiqi_pda/uni_modules/uview-ui/libs/util/calendar.js
yiqi_pda/uni_modules/uview-ui/libs/util/dayjs.js
yiqi_pda/uni_modules/uview-ui/libs/util/emitter.js
yiqi_pda/uni_modules/uview-ui/libs/util/route.js
yiqi_pda/uni_modules/uview-ui/package.json
yiqi_pda/uni_modules/uview-ui/theme.scss
yiqi_pda/unpackage/cache/apk/__UNI__2005783_cm.apk
yiqi_pda/unpackage/cache/apk/__UNI__3710012_cm.apk
yiqi_pda/unpackage/cache/apk/__UNI__9945D9A_cm.apk
yiqi_pda/unpackage/cache/apk/apkurl
yiqi_pda/unpackage/cache/apk/cmManifestCache.json
yiqi_pda/unpackage/cache/certdata
yiqi_pda/unpackage/cache/cloudcertificate/certini
yiqi_pda/unpackage/cache/cloudcertificate/package.keystore
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/.manifest/icon-android-hdpi.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/.manifest/icon-android-xhdpi.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/.manifest/icon-android-xxhdpi.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/.manifest/icon-android-xxxhdpi.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappchooselocation.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniapperror.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappes6.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappopenlocation.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniapppicker.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappquill.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappquillimageresize.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappscan.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappsuccess.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/__uniappview.html
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/app-config-service.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/app-config.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/app-service.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/app-view.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/manifest.json
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/fonts/iconfont.css
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/fonts/iconfont.ttf
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/fonts/iconfont.woff
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/fonts/iconfont.woff2
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/img/icon.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/img/logo.jpg
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/js/print/gbk.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/js/print/printerjobs.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/js/utils/filter.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/js/utils/index.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/js/utils/modules/color.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/js/utils/modules/regexValidate.js
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/static/logo.png
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/uni_modules/uview-ui/components/u-icon/iconfont.ttf
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/view.css
yiqi_pda/unpackage/cache/wgt/__UNI__2005783/view.umd.min.js
yiqi_pda/unpackage/dist/build/.automator/app-plus/.automator.json
yiqi_pda/unpackage/dist/build/app-plus/__uniappchooselocation.js
yiqi_pda/unpackage/dist/build/app-plus/__uniapperror.png
yiqi_pda/unpackage/dist/build/app-plus/__uniappes6.js
yiqi_pda/unpackage/dist/build/app-plus/__uniappopenlocation.js
yiqi_pda/unpackage/dist/build/app-plus/__uniapppicker.js
yiqi_pda/unpackage/dist/build/app-plus/__uniappquill.js
yiqi_pda/unpackage/dist/build/app-plus/__uniappquillimageresize.js
yiqi_pda/unpackage/dist/build/app-plus/__uniappscan.js
yiqi_pda/unpackage/dist/build/app-plus/__uniappsuccess.png
yiqi_pda/unpackage/dist/build/app-plus/__uniappview.html
yiqi_pda/unpackage/dist/build/app-plus/app-config-service.js
yiqi_pda/unpackage/dist/build/app-plus/app-config.js
yiqi_pda/unpackage/dist/build/app-plus/app-service.js
yiqi_pda/unpackage/dist/build/app-plus/app-view.js
yiqi_pda/unpackage/dist/build/app-plus/manifest.json
yiqi_pda/unpackage/dist/build/app-plus/static/fonts/iconfont.css
yiqi_pda/unpackage/dist/build/app-plus/static/fonts/iconfont.ttf
yiqi_pda/unpackage/dist/build/app-plus/static/fonts/iconfont.woff
yiqi_pda/unpackage/dist/build/app-plus/static/fonts/iconfont.woff2
yiqi_pda/unpackage/dist/build/app-plus/static/img/icon.png
yiqi_pda/unpackage/dist/build/app-plus/static/img/logo.jpg
yiqi_pda/unpackage/dist/build/app-plus/static/js/print/gbk.js
yiqi_pda/unpackage/dist/build/app-plus/static/js/print/printerjobs.js
yiqi_pda/unpackage/dist/build/app-plus/static/js/utils/filter.js
yiqi_pda/unpackage/dist/build/app-plus/static/js/utils/index.js
yiqi_pda/unpackage/dist/build/app-plus/static/js/utils/modules/color.js
yiqi_pda/unpackage/dist/build/app-plus/static/js/utils/modules/regexValidate.js
yiqi_pda/unpackage/dist/build/app-plus/static/logo.png
yiqi_pda/unpackage/dist/build/app-plus/uni_modules/uview-ui/components/u-icon/iconfont.ttf
yiqi_pda/unpackage/dist/build/app-plus/view.css
yiqi_pda/unpackage/dist/build/app-plus/view.umd.min.js
yiqi_pda/unpackage/dist/dev/.automator/app-plus/.automator.json
yiqi_pda/unpackage/dist/dev/app-plus/__uniappchooselocation.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniapperror.png
yiqi_pda/unpackage/dist/dev/app-plus/__uniappes6.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniappopenlocation.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniapppicker.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniappquill.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniappquillimageresize.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniappscan.js
yiqi_pda/unpackage/dist/dev/app-plus/__uniappsuccess.png
yiqi_pda/unpackage/dist/dev/app-plus/__uniappview.html
yiqi_pda/unpackage/dist/dev/app-plus/app-config-service.js
yiqi_pda/unpackage/dist/dev/app-plus/app-config.js
yiqi_pda/unpackage/dist/dev/app-plus/app-service.js
yiqi_pda/unpackage/dist/dev/app-plus/app-view.js
yiqi_pda/unpackage/dist/dev/app-plus/manifest.json
yiqi_pda/unpackage/dist/dev/app-plus/static/fonts/iconfont.css
yiqi_pda/unpackage/dist/dev/app-plus/static/fonts/iconfont.ttf
yiqi_pda/unpackage/dist/dev/app-plus/static/fonts/iconfont.woff
yiqi_pda/unpackage/dist/dev/app-plus/static/fonts/iconfont.woff2
yiqi_pda/unpackage/dist/dev/app-plus/static/img/icon.png
yiqi_pda/unpackage/dist/dev/app-plus/static/img/logo.jpg
yiqi_pda/unpackage/dist/dev/app-plus/static/js/print/gbk.js
yiqi_pda/unpackage/dist/dev/app-plus/static/js/print/printerjobs.js
yiqi_pda/unpackage/dist/dev/app-plus/static/js/utils/filter.js
yiqi_pda/unpackage/dist/dev/app-plus/static/js/utils/index.js
yiqi_pda/unpackage/dist/dev/app-plus/static/js/utils/modules/color.js
yiqi_pda/unpackage/dist/dev/app-plus/static/js/utils/modules/regexValidate.js
yiqi_pda/unpackage/dist/dev/app-plus/static/logo.png
yiqi_pda/unpackage/dist/dev/app-plus/uni_modules/uview-ui/components/u-icon/iconfont.ttf
yiqi_pda/unpackage/dist/dev/app-plus/view.css
yiqi_pda/unpackage/dist/dev/app-plus/view.umd.min.js
yiqi_pda/unpackage/res/icons/1024x1024.png
yiqi_pda/unpackage/res/icons/120x120.png
yiqi_pda/unpackage/res/icons/144x144.png
yiqi_pda/unpackage/res/icons/152x152.png
yiqi_pda/unpackage/res/icons/167x167.png
yiqi_pda/unpackage/res/icons/180x180.png
yiqi_pda/unpackage/res/icons/192x192.png
yiqi_pda/unpackage/res/icons/20x20.png
yiqi_pda/unpackage/res/icons/29x29.png
yiqi_pda/unpackage/res/icons/40x40.png
yiqi_pda/unpackage/res/icons/58x58.png
yiqi_pda/unpackage/res/icons/60x60.png
yiqi_pda/unpackage/res/icons/72x72.png
yiqi_pda/unpackage/res/icons/76x76.png
yiqi_pda/unpackage/res/icons/80x80.png
yiqi_pda/unpackage/res/icons/87x87.png
yiqi_pda/unpackage/res/icons/96x96.png
yiqi_screen/.gitignore
yiqi_screen/README.md
yiqi_screen/babel.config.js
yiqi_screen/dist.zip
yiqi_screen/jsconfig.json
yiqi_screen/package-lock.json
yiqi_screen/package.json
yiqi_screen/public/favicon.ico
yiqi_screen/public/index.html
yiqi_screen/src/App.vue
yiqi_screen/src/api/api.js
yiqi_screen/src/api/common.js
yiqi_screen/src/assets/bg1.png
yiqi_screen/src/assets/images/OP35.png
yiqi_screen/src/assets/images/bg.png
yiqi_screen/src/assets/images/blue/OP05.png
yiqi_screen/src/assets/images/blue/OP10.png
yiqi_screen/src/assets/images/blue/OP20.png
yiqi_screen/src/assets/images/blue/OP30.png
yiqi_screen/src/assets/images/blue/OP35.png
yiqi_screen/src/assets/images/blue/OP40.png
yiqi_screen/src/assets/images/blue/OP50.png
yiqi_screen/src/assets/images/blue/OP60.png
yiqi_screen/src/assets/images/blue/OP70.png
yiqi_screen/src/assets/images/blue/OP80.png
yiqi_screen/src/assets/images/blue/unit.png
yiqi_screen/src/assets/images/border_left1.png
yiqi_screen/src/assets/images/border_left2.png
yiqi_screen/src/assets/images/border_middle.png
yiqi_screen/src/assets/images/border_prodline.png
yiqi_screen/src/assets/images/border_right1.png
yiqi_screen/src/assets/images/border_right2.png
yiqi_screen/src/assets/images/edo.jpg
yiqi_screen/src/assets/images/green/OP05.png
yiqi_screen/src/assets/images/green/OP10.png
yiqi_screen/src/assets/images/green/OP20.png
yiqi_screen/src/assets/images/green/OP30.png
yiqi_screen/src/assets/images/green/OP35.png
yiqi_screen/src/assets/images/green/OP35产线 .png
yiqi_screen/src/assets/images/green/OP40.png
yiqi_screen/src/assets/images/green/OP50.png
yiqi_screen/src/assets/images/green/OP60.png
yiqi_screen/src/assets/images/green/OP70.png
yiqi_screen/src/assets/images/green/OP80.png
yiqi_screen/src/assets/images/green/unit.png
yiqi_screen/src/assets/images/green/产线总.png
yiqi_screen/src/assets/images/prodline_all.png
yiqi_screen/src/assets/images/prodline_all1.png
yiqi_screen/src/assets/images/red/OP05.png
yiqi_screen/src/assets/images/red/OP10.png
yiqi_screen/src/assets/images/red/OP20.png
yiqi_screen/src/assets/images/red/OP30.png
yiqi_screen/src/assets/images/red/OP35.png
yiqi_screen/src/assets/images/red/OP40.png
yiqi_screen/src/assets/images/red/OP50.png
yiqi_screen/src/assets/images/red/OP60.png
yiqi_screen/src/assets/images/red/OP70.png
yiqi_screen/src/assets/images/red/OP80.png
yiqi_screen/src/assets/images/red/unit.png
yiqi_screen/src/assets/images/title.png
yiqi_screen/src/assets/images/white/OP05.png
yiqi_screen/src/assets/images/white/OP10.png
yiqi_screen/src/assets/images/white/OP20.png
yiqi_screen/src/assets/images/white/OP30.png
yiqi_screen/src/assets/images/white/OP35.png
yiqi_screen/src/assets/images/white/OP40.png
yiqi_screen/src/assets/images/white/OP50.png
yiqi_screen/src/assets/images/white/OP60.png
yiqi_screen/src/assets/images/white/OP70.png
yiqi_screen/src/assets/images/white/OP80.png
yiqi_screen/src/assets/images/white/unit.png
yiqi_screen/src/assets/images/yellow/OP05.png
yiqi_screen/src/assets/images/yellow/OP10.png
yiqi_screen/src/assets/images/yellow/OP20.png
yiqi_screen/src/assets/images/yellow/OP30.png
yiqi_screen/src/assets/images/yellow/OP35.png
yiqi_screen/src/assets/images/yellow/OP40.png
yiqi_screen/src/assets/images/yellow/OP50.png
yiqi_screen/src/assets/images/yellow/OP60.png
yiqi_screen/src/assets/images/yellow/OP70.png
yiqi_screen/src/assets/images/yellow/OP80.png
yiqi_screen/src/assets/images/yellow/unit.png
yiqi_screen/src/assets/logo.png
yiqi_screen/src/components/Content.vue
yiqi_screen/src/components/EquipmentRunStatus.vue
yiqi_screen/src/components/ProdlineHealthy.vue
yiqi_screen/src/components/ProductionCompletionTrend.vue
yiqi_screen/src/components/ProductionStatistics.vue
yiqi_screen/src/components/QualityDataTrends.vue
yiqi_screen/src/main.js
yiqi_screen/vue.config.js |