Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
SendDicomFiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alan Farhadi
SendDicomFiles
Commits
9ed82e73
Commit
9ed82e73
authored
May 10, 2020
by
alan.f
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change-inputs-to-model
parent
1c1fd957
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
9 deletions
+36
-9
C-UI.csproj
C-UI/C-UI.csproj
+1
-0
Form1.cs
C-UI/Form1.cs
+6
-2
InputsDto.cs
C-UI/Models/InputsDto.cs
+17
-0
SCU_Store.cs
C-UI/SCU_Store.cs
+12
-7
No files found.
C-UI/C-UI.csproj
View file @
9ed82e73
...
...
@@ -73,6 +73,7 @@
<Reference
Include=
"WindowsBase"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Models\InputsDto.cs"
/>
<Compile
Include=
"SCU_Store.cs"
/>
<Compile
Include=
"Form1.cs"
>
<SubType>
Form
</SubType>
...
...
C-UI/Form1.cs
View file @
9ed82e73
using
System
;
using
C_UI.Models
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
...
...
@@ -25,7 +26,10 @@ namespace C_UI
string
fileExt
=
System
.
IO
.
Path
.
GetExtension
(
ofdUploadFile
.
FileName
);
if
(
result
==
DialogResult
.
OK
&&
fileExt
==
".dcm"
)
{
SCU_Store
.
StoreFile
(
cbxIPs
.
Text
,
int
.
Parse
(
txtPort
.
Text
),
ofdUploadFile
.
FileNames
,
txtServerAET
.
Text
,
txtAet
.
Text
);
InputsDto
inputsDto
=
new
InputsDto
()
{
ServerHost
=
cbxIPs
.
Text
,
Port
=
int
.
Parse
(
txtPort
.
Text
)
,
FileNames
=
ofdUploadFile
.
FileNames
,
ServerAET
=
txtServerAET
.
Text
,
Aet
=
txtAet
.
Text
};
SCU_Store
.
StoreFile
(
inputsDto
);
}
}
...
...
C-UI/Models/InputsDto.cs
0 → 100644
View file @
9ed82e73
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
C_UI.Models
{
public
struct
InputsDto
{
public
string
ServerHost
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
public
string
[]
FileNames
{
get
;
set
;
}
public
string
ServerAET
{
get
;
set
;
}
public
string
Aet
{
get
;
set
;
}
}
}
C-UI/SCU_Store.cs
View file @
9ed82e73
...
...
@@ -12,6 +12,7 @@ using System.Windows.Forms;
using
DicomClient
=
Dicom
.
Network
.
Client
.
DicomClient
;
using
System.Reactive.Threading.Tasks
;
using
System.CodeDom
;
using
C_UI.Models
;
namespace
C_UI
{
...
...
@@ -20,13 +21,12 @@ namespace C_UI
{
static
Logger
logger
=
LogManager
.
GetCurrentClassLogger
();
public
static
async
Task
StoreFile
(
string
_storeServerHost
,
int
_storeServerPort
,
string
[]
dicomFiles
,
string
_aet
,
string
_storeServerAET
)
public
static
async
Task
StoreFile
(
InputsDto
inputsDto
)
{
var
client
=
new
DicomClient
(
_storeServerHost
,
_storeServerPort
,
false
,
_storeServerAET
,
_a
et
);
var
client
=
new
DicomClient
(
inputsDto
.
ServerHost
,
inputsDto
.
Port
,
false
,
inputsDto
.
ServerAET
,
inputsDto
.
A
et
);
client
.
NegotiateAsyncOps
();
dicomFil
es
.
ToObservable
()
inputsDto
.
FileNam
es
.
ToObservable
()
.
Select
(
async
fileName
=>
{
var
request
=
new
DicomCStoreRequest
(
fileName
);
...
...
@@ -37,10 +37,15 @@ namespace C_UI
})
.
Select
(
t
=>
{
t
.
Wait
();
return
t
.
Result
;
})
.
Subscribe
(
filename
=>
logger
.
Warn
(
$"file sent:
{
filename
}
"
),
onError
=>
logger
.
Error
(
onError
.
Message
),
()
=>
{
});
}).
Subscribe
();
//.Subscribe(filename =>
//{
// logger.Warn($"file sent:{filename}");
//},
//onError =>
//{ logger.Error(onError.Message); },
//() => { });
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment