Jump to content

aldebaran

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Migration of properties doesn’t work. What do we have to change, for migrating successful properties? Original Code (one example of many): Property: Public Property Get Duty_lmt(ByVal iIndex As Integer) As Double Duty_lmt = mvarLmt(iIndex) End Property Public Property Let Duty_lmt(ByVal iIndex As Integer, ByVal vData As Double) mvarLmt(iIndex) = vData End Property Setting/Getting Property: For iLoop = 1 To 2 If .Duty_T1 <> NOVALUE And .Duty_T2 <> NOVALUE And .Duty_T3 <> NOVALUE And .Duty_T4 <> NOVALUE Then If iLoop = 1 Then .Duty_lmt(iLoop) = (.Duty_T1 + .Duty_T2) / 2 Else .Duty_lmt(iLoop) = (.Duty_T3 + .Duty_T4) / 2 End If Else If .Duty_T1 = NOVALUE Then .Duty_lmt(1) = .Duty_T2 Else .Duty_lmt(1) = .Duty_T1 End If If .Duty_T3 = NOVALUE Then .Duty_lmt(2) = .Duty_T4 Else .Duty_lmt(2) = .Duty_T3 End If End If .Duty_Dens(iLoop) = Densitet(.Duty_lmt(iLoop)) .Duty_Spech(iLoop) = Kapacitivitet(.Duty_lmt(iLoop)) .Duty_Cond(iLoop) = Ledntal(.Duty_lmt(iLoop)) .Duty_visk(iLoop) = Dynvisk(.Duty_lmt(iLoop)) .Duty_Pran(iLoop) = Prandtl(.Duty_lmt(iLoop)) Migrating this we get following result: Properties: public double GetLmt(int iIndex) { return mvarLmt[iIndex - 1]; } public void SetLmt(int iIndex, double value) { mvarLmt[iIndex - 1] = value; } Properties are renamed, e.g. (All Properties has in migration the same pattern, this is one of many examples): And they are mapped in a file named "ExtendedMappings.xml": <Mapping DotNetTypeName='Calculators.CoilDuty.Set' VB6MemberName='lmt'>set_lmt</Mapping> <Mapping DotNetTypeName='Calculators.CoilDuty.Get' VB6MemberName='lmt'>get_lmt</Mapping> In code both pattern are used: if (mvarDuty.T1 == CalcSupport.NOVALUE) { mvarDuty. set_lmt (1, mvarDuty.T2); } else { mvarDuty.set_lmt(1, mvarDuty.T1); } if (mvarDuty.T3 == CalcSupport.NOVALUE) { mvarDuty.set_lmt(2, mvarDuty.T4); } else { mvarDuty.set_lmt(2, mvarDuty.T3); } } mvarDuty.set_Dens(iLoop, Waterfunctions.Densitet(mvarDuty.GetGLmt(iLoop))); mvarDuty.set_Spech(iLoop, Waterfunctions.Kapacitivitet(mvarDuty.GetGetGetLmt(iLoop))); mvarDuty.set_Cond(iLoop, Waterfunctions.Ledntal(mvarDuty.GetGetGetGetLmt(iLoop))); mvarDuty.set_visk(iLoop, Waterfunctions.Dynvisk(mvarDuty.GetGetGetGetGetLmt(iLoop))); mvarDuty.set_Pran(iLoop, Waterfunctions.Prandtl(mvarDuty.GetGetGetGetGetGetLmt(iLoop))); Questions: CoilDuty (mvarDuty) does not contain a definiton for set_lmt. CoilDuty does contain a definition for SetLmt. Why set_lmt is used? What is the mapping in ExtendedMappings.xml for? Why is "GetLmt" called with growing number of "Get"? mvarDuty.set_Dens(iLoop, Waterfunctions.Densitet(mvarDuty.GetGLmt(iLoop))); mvarDuty.set_Spech(iLoop, Waterfunctions.Kapacitivitet(mvarDuty.GetGetGetLmt(iLoop))); mvarDuty.set_Cond(iLoop, Waterfunctions.Ledntal(mvarDuty.GetGetGetGetLmt(iLoop))); mvarDuty.set_visk(iLoop, Waterfunctions.Dynvisk(mvarDuty.GetGetGetGetGetLmt(iLoop))); mvarDuty.set_Pran(iLoop, Waterfunctions.Prandtl(mvarDuty.GetGetGetGetGetGetLmt(iLoop)));
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use