Changeset 3470


Ignore:
Timestamp:
Jul 13, 2018 8:39:37 AM (3 years ago)
Author:
vondreele
Message:

add a comeent/question for OnConstDel? (no effect on processing)
replace ReadMarCCDFrame.py with Steven Weigand's version - fix problem with reading header

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r3468 r3470  
    10061006        Id,name = Indx[Obj.GetId()]
    10071007        del data[name][Id]
    1008         allcons = FindAllCons(data)
     1008        allcons = FindAllCons(data)     #should I call CheckChangedConstraint() instead?
    10091009        if not len(allcons): return
    1010         errmsg,warnmsg = CheckConstraints(allcons)
     1010        CheckConstraints(allcons)
    10111011        wx.CallAfter(OnPageChanged,None)
    10121012       
  • trunk/ReadMarCCDFrame.py

    r3143 r3470  
    288288        File.seek(IFD[34710][2][0])
    289289        self.headerType = st.unpack(byteOrd+'I',File.read(4))[0] #/* flag for header type  (can be used as magic number) */
    290         self.headerName = st.unpack(byteOrd+16*'s',File.read(16))[0].replace(b'\x00',b'')
     290        self.headerName = b''.join(st.unpack(byteOrd+16*'s',File.read(16))).replace(b'\x00',b'')
    291291        self.headerMajorVersion = st.unpack(byteOrd+'I',File.read(4))[0] #/* header_major_version (n.) */
    292292        self.headerMinorVersion = st.unpack(byteOrd+'I',File.read(4))[0] #/* header_minor_version (.n) */
     
    361361
    362362        File.seek(IFD[34710][2][0]+256+128)
    363         self.barcode = st.unpack(byteOrd+16*'s',File.read(16))[0].replace(b'\x00',b'')
     363        self.barcode = b''.join(st.unpack(byteOrd+16*'s',File.read(16))).replace(b'\x00',b'')
    364364        self.barcodeAngle = st.unpack(byteOrd+'I',File.read(4))[0]
    365365        self.barcodeStatus = st.unpack(byteOrd+'I',File.read(4))[0]
     
    433433
    434434        File.seek(IFD[34710][2][0]+256+128+256+128+128+128)
    435         self.filetitle = st.unpack(byteOrd+128*'s',File.read(128))[0].replace(b'\x00',b'')
    436         self.filepath = st.unpack(byteOrd+'s'*128,File.read(128))[0].replace(b'\x00',b'') #/* path name for data file*/
    437         self.filename = st.unpack(byteOrd+'s'*64,File.read(64))[0].replace(b'\x00',b'') #/* name of data file*/
    438         self.acquireTimestamp = st.unpack(byteOrd+'s'*32,File.read(32))[0].replace(b'\x00',b'') #/* date and time of acquisition*/
    439         self.headerTimestamp = st.unpack(byteOrd+'s'*32,File.read(32))[0].replace(b'\x00',b'') #/* date and time of header update*/
    440         self.saveTimestamp = st.unpack(byteOrd+'s'*32,File.read(32))[0].replace(b'\x00',b'') #/* date and time file saved */
    441         self.fileComment = st.unpack(byteOrd+'s'*512,File.read(512))[0].replace(b'\x00',b'') #/* comments  - can be used as desired */
    442         self.datasetComment = st.unpack(byteOrd+'s'*512,File.read(512))[0].replace(b'\x00',b'') #/* comments  - can be used as desired */
    443 
    444         self.userData = st.unpack(byteOrd+'s'*512,File.read(512))[0].replace(b'\x00',b'')
     435        self.filetitle = b''.join(st.unpack(byteOrd+128*'s',File.read(128))).replace(b'\x00',b'')
     436        self.filepath = b''.join(st.unpack(byteOrd+'s'*128,File.read(128))).replace(b'\x00',b'') #/* path name for data file*/
     437        self.filename = b''.join(st.unpack(byteOrd+'s'*64,File.read(64))).replace(b'\x00',b'') #/* name of data file*/
     438        self.acquireTimestamp = b''.join(st.unpack(byteOrd+'s'*32,File.read(32))).replace(b'\x00',b'') #/* date and time of acquisition*/
     439        self.headerTimestamp = b''.join(st.unpack(byteOrd+'s'*32,File.read(32))).replace(b'\x00',b'') #/* date and time of header update*/
     440        self.saveTimestamp = b''.join(st.unpack(byteOrd+'s'*32,File.read(32))).replace(b'\x00',b'') #/* date and time file saved */
     441        self.fileComment = b''.join(st.unpack(byteOrd+'s'*512,File.read(512))).replace(b'\x00',b'') #/* comments  - can be used as desired */
     442        self.datasetComment = b''.join(st.unpack(byteOrd+'s'*512,File.read(512))).replace(b'\x00',b'') #/* comments  - can be used as desired */
     443
     444        self.userData = b''.join(st.unpack(byteOrd+'s'*512,File.read(512))).replace(b'\x00',b'')
    445445
    446446        File.seek(4096)
Note: See TracChangeset for help on using the changeset viewer.