Skip to content

Issues with saving NSC Detector text file #79

@shbhuk

Description

@shbhuk

Hi,
This is following issue #71
I get the following error on trying to use

self.ln.zGetDetectorViewer(displayData=True,settingsFile=settingsFile,txtFile=txtfile,keepFile=True,timeout=600)



C:\Users\shbhu\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\pyzdde\zfileutils.py in readDetectorViewerTextFile(pyz, textFileName, displayData)
    649     >>> info, gridData = zfu.readDetectorViewerTextFile(pyz, textFileName, True)
    650     """
--> 651     line_list = pyz._readLinesFromFile(pyz._openFile(textFileName))
    652     # Meta data
    653     detNumSurfNumPat = r'Detector\s*\d{1,4}\s*,\s*NSCG\sSurface\s*\d{1,4}'
C:\Users\shbhu\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\pyzdde\zdde.py in _openFile(fileName)
  12143     global _global_use_unicode_text
  12144     if _global_use_unicode_text:
> 12145         f = open(fileName, u'rb')
  12146     else:
  12147         f = open(fileName, 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/shbhu/Desktop/test.txt' 

I checked the source code, and this function which GetDetectorViewer() calls -

 ret = self.zGetTextFile(textFileName, 'Dvr', cfgFile, getTextFlag,
                               timeout)

This function runs without error and returns 0. However it is not creating the textFile. Thus the zfileutils are giving an error.

This sends the following DDE command -


            cmd = 'GetTextFile,"{tF}",{aT},"{sF}",{fl:d}'.format(tF=textFileName,
                                    aT=analysisType,sF=settingsFile,fl=flag)
            reply = self._sendDDEcommand(cmd, timeout)

This command runs without error and returns 'OK' when I call it -
cmd = 'GetTextFile,"{tF}",{aT},"{sF}",{fl:d}'.format(tF=loc+'test.txt', aT='Dvr',sF='',fl=0)

However, there is no file generated in the directory specified by 'loc'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions