Skip to content

Commit

Permalink
Version 1.3
Browse files Browse the repository at this point in the history
Siemens Drive - fixed error when reading serial number for tube assembly
  • Loading branch information
EllenWasbo committed Jun 17, 2020
1 parent a06ed17 commit 2451cf3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
27 changes: 27 additions & 0 deletions PowerBI_query/powerBIquery_getSiemensQC_PEToutput.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
let
Source = Csv.Document(File.Contents("...your results txt file...txt"),[Delimiter="#(tab)", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
useFirstRowAsHeaders = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(useFirstRowAsHeaders,{{"Date", type date}}),
//Add hours to data from same date to visualize all measurementes separately, replace Date column with this DateTime column as first column
AddIndex=Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
GroupRows=Table.Group(AddIndex,{"Date"},{{"Count", each Table.AddIndexColumn((_), "SubIndex", 1,1) }}),
ExpandCount = Table.ExpandTableColumn(GroupRows, "Count",{"Partial","Full", "Time Align", "Calib Factor", "Measured Randoms",
"Scanner Efficiency", "Scatter Ratio", "ECF", "Time Alignment Residual", "Time Alignment fit x", "Time Alignment fit y", "Phantom Pos x",
"Phantom Pos y","SubIndex"}),
AddDuration=Table.AddColumn(ExpandCount, "Time", each #time(0,0,0)+#duration(0,[SubIndex],0,0), type time),
ChangeTypeDate = Table.TransformColumnTypes(AddDuration,{{"Date", type date}}),
AddDateTime=Table.AddColumn(ChangeTypeDate, "DateTime", each [Date]&[Time], type datetime),
ColumnNames=Table.ColumnNames(AddDateTime),
ReorderedList=List.Combine({{"DateTime"},List.RemoveMatchingItems(ColumnNames,{"DateTime"})}),
ReorderColumns=Table.ReorderColumns(AddDateTime, ReorderedList),
RemoveColumns=Table.RemoveColumns(ReorderColumns, {"SubIndex","Date","Time"}),
//PET specific changes
#"Replaced Value" = Table.ReplaceValue(RemoveColumns,"X", "2",Replacer.ReplaceText,{"Partial"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","X","3",Replacer.ReplaceText,{"Full"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","X","1",Replacer.ReplaceText,{"Time Align"}),
#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2",null,0,Replacer.ReplaceValue,{"Partial", "Full", "Time Align"}),
#"Change Type" = Table.TransformColumnTypes(#"Replaced Value3",{{"Partial", type number}, {"Full", type number}, {"Time Align", type number}, {"Calib Factor", type number}, {"Measured Randoms", type number}, {"Scanner Efficiency", type number}, {"Scatter Ratio", type number}, {"ECF", type number}, {"Time Alignment Residual", type number}, {"Time Alignment fit x", type number}, {"Time Alignment fit y", type number}, {"Phantom Pos x", type number}, {"Phantom Pos y", type number}}),
AddDaily=Table.AddColumn(#"Change Type","No extra", each if List.AllTrue({[Partial]=null,[Time Align]=null,[Full]=null}) then 0 else null, type number)

in
AddDaily
2 changes: 1 addition & 1 deletion getSiemensQC.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pro getSiemensQC, GROUP_LEADER=bMain
xoffset=50
yoffset=50

bMain = WIDGET_BASE(TITLE='getSiemensQC v1.2', MBAR=bar, /COLUMN, XSIZE=xsz, YSIZE=900, XOFFSET=xoffset, YOFFSET=yoffset,/TLB_KILL_REQUEST_EVENTS, /TLB_MOVE_EVENTS)
bMain = WIDGET_BASE(TITLE='getSiemensQC v1.3', MBAR=bar, /COLUMN, XSIZE=xsz, YSIZE=900, XOFFSET=xoffset, YOFFSET=yoffset,/TLB_KILL_REQUEST_EVENTS, /TLB_MOVE_EVENTS)

file_menu=WIDGET_BUTTON(bar, VALUE='File', /MENU)
btn_appPET=WIDGET_BUTTON(file_menu, VALUE='Configure automatic append to txt-file PET', UVALUE='addAppendTempPET')
Expand Down
Binary file modified getSiemensQC.sav
Binary file not shown.
9 changes: 7 additions & 2 deletions readctcons.pro
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@ function readCTcons, clipres, config, filename
rowno=WHERE(STRMATCH(clipres, config.CT.(langu)(13)+'*', /FOLD_CASE) EQ 1)
IF N_ELEMENTS(rowno) EQ 2 THEN BEGIN
IF rowno(1) EQ rowno(0)+1 THEN BEGIN;as newer files where table with three columns and both tubes in table even though only one tube
strArrRes(4)=clipres(rowno(0)+13)
strArrRes(5)=clipres(rowno(1)+13)
IF clipres(rowno(0)+2) EQ config.CT.(langu)(12) THEN BEGIN;seen at least for Drive
strArrRes(4)=clipres(rowno(0)+3)
strArrRes(5)=clipres(rowno(0)+4)
ENDIF ELSE BEGIN
strArrRes(4)=clipres(rowno(0)+13)
strArrRes(5)=clipres(rowno(1)+13)
ENDELSE
ENDIF
ENDIF ELSE BEGIN
IF rowno(0) NE -1 AND N_ELEMENTS(rowno) EQ 1 THEN BEGIN
Expand Down

0 comments on commit 2451cf3

Please sign in to comment.