Source Code for Unit Conversion


The following source files, led by gray banners, contain class functions in Unit Conversion for SansGUI utility program.  The sections highlighted by a yellow background Color are manually entered.  Code sections with white background color are generated by the SansGUI Source Code Framework.  The source file is compiled into a dynamic linked library to be invoked by SansGUI when the user clicks on the Check Data button in a Table Object Properties dialog.

Class Table.Vector is the base class of class Table.Vector.Length and other unit dimensions.  The SG_xEndEdit_Table_Vector() function serves as the common copy function for all the subclasses.  The function in class Table.Vector.Length is listed as an example to show how the base class function is called from all the subclasses.  Other generated place-holder functions have not been modified and are omitted from this code listing.

For more details about the complete package, please read the Unit Conversion for SansGUI Manual on-line.

Implementation in Fortran (CVF)

Functions in Class Table.Vector     [Go to Top]

! Table_Vector.f

! - DLL routines for class <Reference>Table.Vector

! DATE: Saturday, July 28, 2001 TIME: 08:32:30 PM

! The skeleton of this file is generated by SansGUI(tm)

! Attribute indices in class version [1.0.0.0]

! 1: iSize - Table Size

! 2: iSheets - Number of Sheets

! ======================================================================

! SG_xEndEdit - End Edit Check

! ----------------------------------------------------------------------

      integer function SG_xEndEdit_Table_Vector(self,                   &

     &                        simCtrl, chgChild,                        &
     &                        pRefObjs, iRefObjs,                       &
     &                        pAdjObjs, iAdjObjs,                       &
     &                        pLnkObjs, iLnkObjs,                       &
     &                        cMessage, cCommand, pOutFile )
!DEC$ IF DEFINED (_DLL)

!DEC$ ATTRIBUTES DLLEXPORT :: SG_xEndEdit_Table_Vector

!DEC$ END IF

      include "SGdllf.h"

      ! TODO: declare your local variables here

      real*4, dimension(*) :: UserData

      real*4, dimension(*) :: ColumnData

      integer :: i, iSize

      POINTER(PTR_UserData, UserData)

      POINTER(PTR_ColumnData, ColumnData)

      integer, parameter :: SG_NDX_DATA = 3

      if (self%nSGobjSchema .ne. SG_OBJ_SCHEMA) then

          SG_xEndEdit_Table_Vector = SG_R_SCHM

          return

      end if

      ! TODO: put your simulator code here

      if (self%iNumVars .gt. SG_NDX_DATA) then

          PTR_zValues = self%pzValues

          PTR_UserData = zValues(SG_NDX_DATA)%vData

          iSize = zValues(SG_NDX_DATA)%iSize

          ! simply copy data from user data column to all the other columns

          do i = SG_NDX_DATA + 1, self%iNumVars

              PTR_ColumnData = zValues(i)%vData

              call copyDataColumn(UserData, ColumnData, iSize)

          end do

      end if

      SG_xEndEdit_Table_Vector = SG_R_OK

      return

      end

! ======================================================================

! copyDataColumn - copy data from the user data column to another

! ----------------------------------------------------------------------

      subroutine copyDataColumn(fromColumn, toColumn, iLength)

      integer :: iLength

      intent (in) iLength

      real*4, dimension(iLength) :: fromColumn, toColumn

      ! use Fortran array copying feature

      toColumn = fromColumn

      return

      end

! ======================================================================

! SG_xLoadSize - Resize for Load

! ----------------------------------------------------------------------

      integer function SG_xLoadSize_Table_Vector(self,                  &

     &                        simCtrl, chgChild,                        &
     &                        pRefObjs, iRefObjs,                       &
     &                        pAdjObjs, iAdjObjs,                       &
     &                        pLnkObjs, iLnkObjs,                       &
     &                        cMessage, cCommand, pOutFile )
!DEC$ IF DEFINED (_DLL)

!DEC$ ATTRIBUTES DLLEXPORT :: SG_xLoadSize_Table_Vector

!DEC$ END IF

      include "SGdllf.h"

      ! TODO: declare your local variables here

 

      if (self%nSGobjSchema .ne. SG_OBJ_SCHEMA) then

          SG_xLoadSize_Table_Vector = SG_R_SCHM

          return

      end if

 

      ! TODO: put your simulator code here

 

      SG_xLoadSize_Table_Vector = SG_R_OK

      return

      end

! ======================================================================

! SG_xLoad - Load Data

! ----------------------------------------------------------------------

      integer function SG_xLoad_Table_Vector(self,                      &

     &                        simCtrl, chgChild,                        &
     &                        pRefObjs, iRefObjs,                       &
     &                        pAdjObjs, iAdjObjs,                       &
     &                        pLnkObjs, iLnkObjs,                       &
     &                        cMessage, cCommand, pOutFile )
!DEC$ IF DEFINED (_DLL)

!DEC$ ATTRIBUTES DLLEXPORT :: SG_xLoad_Table_Vector

!DEC$ END IF

      include "SGdllf.h"

      ! TODO: declare your local variables here

 

     if (self%nSGobjSchema .ne. SG_OBJ_SCHEMA) then

          SG_xLoad_Table_Vector = SG_R_SCHM

          return

      end if

 

      ! TODO: put your simulator code here

 

      SG_xLoad_Table_Vector = SG_R_OK

      return

      end

Functions in Class Table.Vector.Length     [Go to Top]

! Table_Vector_Length.f

! - DLL routines for class <Reference>Table.Vector.Length

! DATE: Saturday, July 28, 2001 TIME: 08:32:29 PM

! The skeleton of this file is generated by SansGUI(tm)

! Attribute indices in class version [1.0.0.0]

! 1: iSize - Table Size

! 2: iSheets - Number of Sheets

! 3: Data - User Data

! 4: To_1 - To Unit 1

! 5: To_2 - To Unit 2

! 6: To_3 - To Unit 3

! 7: To_4 - To Unit 4

! 8: To_5 - To Unit 5

! ======================================================================

! SG_xEndEdit - End Edit Check

! ----------------------------------------------------------------------

      integer function SG_xEndEdit_Table_Vector_Length(self,            &

     &                        simCtrl, chgChild,                        &
     &                        pRefObjs, iRefObjs,                       &
     &                        pAdjObjs, iAdjObjs,                       &
     &                        pLnkObjs, iLnkObjs,                       &
     &                        cMessage, cCommand, pOutFile )
!DEC$ IF DEFINED (_DLL)

!DEC$ ATTRIBUTES DLLEXPORT :: SG_xEndEdit_Table_Vector_Length

!DEC$ END IF

      include "SGdllf.h"

      ! TODO: declare your local variables here

      integer SG_xEndEdit_Table_Vector

      if (self%nSGobjSchema .ne. SG_OBJ_SCHEMA) then

          SG_xEndEdit_Table_Vector_Length = SG_R_SCHM

          return

      end if

      ! TODO: put your simulator code here

      SG_xEndEdit_Table_Vector_Length =                                 &

     &SG_xEndEdit_Table_Vector(self, simCtrl, chgChild,                 &

     &          pRefObjs, iRefObjs, pAdjObjs, iAdjObjs,                 &

     &          pLnkObjs, iLnkObjs, cMessage, cCommand,                 &

     &          pOutFile )

      return

      end

! ======================================================================

! SG_xLoadSize - Resize for Load

! ----------------------------------------------------------------------

      integer function SG_xLoadSize_Table_Vector_Length(self,           &

     &                        simCtrl, chgChild,                        &
     &                        pRefObjs, iRefObjs,                       &
     &                        pAdjObjs, iAdjObjs,                       &
     &                        pLnkObjs, iLnkObjs,                       &
     &                        cMessage, cCommand, pOutFile )
!DEC$ IF DEFINED (_DLL)

!DEC$ ATTRIBUTES DLLEXPORT :: SG_xLoadSize_Table_Vector_Length

!DEC$ END IF

      include "SGdllf.h"

      ! TODO: declare your local variables here

 

      if (self%nSGobjSchema .ne. SG_OBJ_SCHEMA) then

          SG_xLoadSize_Table_Vector_Length = SG_R_SCHM

          return

      end if

 

      ! TODO: put your simulator code here

 

      SG_xLoadSize_Table_Vector_Length = SG_R_OK

      return

      end

! ======================================================================

! SG_xLoad - Load Data

! ----------------------------------------------------------------------

      integer function SG_xLoad_Table_Vector_Length(self,               &

     &                        simCtrl, chgChild,                        &
     &                        pRefObjs, iRefObjs,                       &
     &                        pAdjObjs, iAdjObjs,                       &
     &                        pLnkObjs, iLnkObjs,                       &
     &                        cMessage, cCommand, pOutFile )
!DEC$ IF DEFINED (_DLL)

!DEC$ ATTRIBUTES DLLEXPORT :: SG_xLoad_Table_Vector_Length

!DEC$ END IF

      include "SGdllf.h"

      ! TODO: declare your local variables here

 

      if (self%nSGobjSchema .ne. SG_OBJ_SCHEMA) then

          SG_xLoad_Table_Vector_Length = SG_R_SCHM

          return

      end if

 

      ! TODO: put your simulator code here

      SG_xLoad_Table_Vector_Length = SG_R_OK

      return

      end

 


Unit Conversion for SansGUI version 1.1

Copyright 2001-2002 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com