@@ -76,11 +76,7 @@ protected Tag[] createdTags
7676 #endregion //IBlockDescription
7777
7878 #region PUBLIC
79- #if OPCCLIENT
80- internal abstract class Tag : OPC . OPC_Interface . OPC_Interface_Tag
81- #elif COMMSERVER
8279 internal abstract class Tag : Device . TagInDevice
83- #endif
8480 {
8581
8682 #region PRIVATE
@@ -168,37 +164,15 @@ internal static System.Type GetDataTypeFromConfig(ComunicationNet.TagsRow myDSC)
168164 else
169165 return typeof ( object ) ;
170166 }
171- #if OPCCLIENT
172- internal override bool
173- #elif COMMSERVER
174- public override void
175- #endif
176- UpdateTag ( object Val )
167+ public override void UpdateTag ( object Val )
177168 {
178- #if OPCCLIENT
179- if ( ! base . UpdateTag ( Val ) ) return false ;
180- #elif COMMSERVER
181169 base . UpdateTag ( Val ) ;
182- #endif
183170 CheckTagAlarm ( Val ) ;
184- #if OPCCLIENT
185- return true ;
186- #endif
187171 }
188- #if OPCCLIENT
189- internal
190- #elif COMMSERVER
191- public override
192- #endif
193- bool GetVal ( ref object Val )
172+ public override bool GetVal ( ref object Val )
194173 {
195- #if OPCCLIENT
196- Val = base . Value . Value ;
197- if ( base . Value . Quality . QualityBits != Opc . Da . qualityBits . good ) return false ;
198- #elif COMMSERVER
199174 if ( ! base . GetVal ( ref Val ) )
200175 return false ;
201- #endif
202176 CheckTagAlarm ( Val ) ;
203177 return true ;
204178 }
@@ -207,18 +181,8 @@ bool GetVal(ref object Val)
207181 /// </summary>
208182 /// <param name="myDSC">params from Tags table</param>
209183 /// <param name="myStation">pointer to interface that allow to change priority of the station</param>
210- #if OPCCLIENT
211- internal Tag
212- ( BaseStation . Management . Tag myDSC , IStationState myStation )
213- : base ( myDSC , //myDSC.Name,
214- null , // MPTD raczej empy wariant
215- Opc . Da . qualityBits . badNotConnected ,
216- myDSC . Writeable , null , "" ) //MZTD: - dodac opisy dla tagow i ew. path
217- #elif COMMSERVER
218- internal Tag
219- ( ComunicationNet . TagsRow myDSC , IStationState myStation )
184+ internal Tag ( ComunicationNet . TagsRow myDSC , IStationState myStation )
220185 : base ( myDSC . Name , null , Opc . Da . qualityBits . badNotConnected , ( ItemAccessRights ) myDSC . AccessRights , GetDataTypeFromConfig ( myDSC ) )
221- #endif
222186 {
223187 switch ( ( StateTrigger ) myDSC . StateTrigger )
224188 {
@@ -233,21 +197,20 @@ internal Tag
233197 }
234198 stateMask = ( int ) myDSC . StateMask ;
235199 this . myStation = myStation ;
236- #if COMMSERVER
237200 this . EuType = Opc . Da . euType . noEnum ;
238201 ItemPropertyCollection itemPropertyCollection = new ItemPropertyCollection ( ) ;
239202 foreach ( ComunicationNet . ItemPropertiesTableRow row_property in myDSC . GetItemPropertiesTableRows ( ) )
240203 {
241204 try
242205 {
243- Opc . Da . PropertyDescription prop_dsc =
244- Opc . Da . PropertyDescription . Find (
245- new Opc . Da . PropertyID (
206+ PropertyDescription prop_dsc =
207+ PropertyDescription . Find (
208+ new PropertyID (
246209 new XmlQualifiedName ( row_property . ID_Name_Name , row_property . ID_Name_Namespace )
247210 ) ) ;
248- Opc . Da . ItemProperty itemprop = new Opc . Da . ItemProperty ( ) ;
249- itemprop . ID = prop_dsc . ID ;
250- itemprop . Value = row_property . Value ;
211+ ItemProperty _itemProperty = new ItemProperty ( ) ;
212+ _itemProperty . ID = prop_dsc . ID ;
213+ _itemProperty . Value = row_property . Value ;
251214 if ( prop_dsc . ID != Opc . Da . Property . DATATYPE ) //this property is managed differently
252215 // as GetDataTypeFromConfig( myDSC )
253216 // at the constructor
@@ -264,24 +227,24 @@ internal Tag
264227 // this property contains double value
265228 double prop_value = 0 ;
266229 if ( double . TryParse ( row_property . Value , out prop_value ) )
267- itemprop . Value = prop_value ;
230+ _itemProperty . Value = prop_value ;
268231 }
269232 if ( prop_dsc . ID == Opc . Da . Property . EUTYPE )
270233 {
271- itemprop . Value = Opc . Da . euType . noEnum ;
234+ _itemProperty . Value = Opc . Da . euType . noEnum ;
272235 // this property contains vale from enum: Opc.Da.euType
273236 foreach ( Opc . Da . euType NEWeuType in Enum . GetValues ( typeof ( Opc . Da . euType ) ) )
274237 {
275238 if ( NEWeuType . ToString ( ) == row_property . Value )
276- itemprop . Value = NEWeuType ;
239+ _itemProperty . Value = NEWeuType ;
277240 }
278241 }
279242 if ( prop_dsc . ID == Opc . Da . Property . EUINFO )
280243 {
281- //I assume that this is table of strings splited by ;
282- itemprop . Value = row_property . Value . Split ( ';' ) ;
244+ //I assume that this is table of strings spited by ;
245+ _itemProperty . Value = row_property . Value . Split ( ';' ) ;
283246 }
284- itemPropertyCollection . Add ( itemprop ) ;
247+ itemPropertyCollection . Add ( _itemProperty ) ;
285248 }
286249 }
287250 catch ( Exception ex )
@@ -301,20 +264,11 @@ internal Tag
301264 "Problem with many properties for item : " + myDSC . Name + ": " +
302265 TraceEvent . GetMessageWithExceptionNameFromExceptionIncludingInnerException ( ex ) ) ;
303266 }
304- #endif
305267 }
306268 #endregion PUBLIC
307269
308270 } //Tag
309271
310- #if OPCCLIENT
311- internal virtual bool UpdateAllTags ( ReadValue val )
312- {
313- for ( ushort idx = 0 ; ( idx < mylength ) ; idx ++ )
314- if ( ! tagHendlers [ idx ] . UpdateTag ( val [ idx ] ) ) return false ;
315- return true ;
316- }
317- #elif COMMSERVER
318272 internal virtual void UpdateAllTags ( IReadValue val )
319273 {
320274 for ( ushort idx = 0 ; ( idx < mylength ) ; idx ++ )
@@ -331,7 +285,6 @@ internal virtual void UpdateAllTags(IReadValue val)
331285 }
332286 }
333287 }
334- #endif
335288
336289 /// <summary>
337290 /// Initializes a new instance of the <see cref="DataBlock"/> class.
@@ -358,7 +311,7 @@ internal DataBlock(ComunicationNet.DataBlocksRow myRow, IDataWrite myWriteInt, I
358311 /// </returns>
359312 public override string ToString ( )
360313 {
361- return String . Format ( "{0}: startaddress ={1}; datatype ={2}; length={3};" , base . ToString ( ) ,
314+ return String . Format ( "{0}: start address ={1}; data type ={2}; length={3};" , base . ToString ( ) ,
362315 myStartAddress , myDataType , mylength ) ;
363316 }
364317 #endregion PUBLIC
0 commit comments