개정판 6396f27e
service 수정
Change-Id: I00f870d7e57967552032204dcfff7afad9f2e0b4
ConvertService/ServiceBase/Markus.Service.Station/StationService/ServiceStationWCF.cs | ||
---|---|---|
142 | 142 |
{ |
143 | 143 |
try |
144 | 144 |
{ |
145 |
|
|
146 | 145 |
if (AliveConvertQueue.Count(c => c.UniqueKey == convertItem.UniqueKey) == 0) |
147 | 146 |
{ |
148 | 147 |
if (ServiceStation.AliveConvertQueue.Count() < MultiProcessCount) |
ConvertService/ServiceBase/Markus.Service.StationController/App.xaml.cs | ||
---|---|---|
20 | 20 |
protected override void OnStartup(StartupEventArgs e) |
21 | 21 |
{ |
22 | 22 |
base.OnStartup(e); |
23 |
MainWindow = new MainWindow(); |
|
24 | 23 |
//MainWindow.Closing += MainWindow_Closing; |
25 | 24 |
|
26 | 25 |
//_notifyIcon = new System.Windows.Forms.NotifyIcon(); |
ConvertService/ServiceBase/Markus.Service.StationController/Markus.Service.StationController.csproj | ||
---|---|---|
86 | 86 |
<Generator>MSBuild:Compile</Generator> |
87 | 87 |
<SubType>Designer</SubType> |
88 | 88 |
</ApplicationDefinition> |
89 |
<Compile Include="ViewModel\AliveViewModel.cs" /> |
|
89 | 90 |
<Compile Include="ViewModel\MainViewModel.cs" /> |
90 | 91 |
<Page Include="MainWindow.xaml"> |
91 | 92 |
<Generator>MSBuild:Compile</Generator> |
... | ... | |
189 | 190 |
<Name>Markus.Service.Extensions</Name> |
190 | 191 |
</ProjectReference> |
191 | 192 |
</ItemGroup> |
193 |
<ItemGroup> |
|
194 |
<Folder Include="Views\Monitor\" /> |
|
195 |
</ItemGroup> |
|
192 | 196 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
193 | 197 |
<PropertyGroup> |
194 | 198 |
<PostBuildEvent>mkdir $(TargetDir)Bin |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/AliveViewModel.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace Markus.Service.StationController.ViewModel |
|
8 |
{ |
|
9 |
class AliveViewModel |
|
10 |
{ |
|
11 |
} |
|
12 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/MainViewModel.cs | ||
---|---|---|
113 | 113 |
{ |
114 | 114 |
try |
115 | 115 |
{ |
116 |
if(client != null) |
|
117 |
{ |
|
118 |
client.Abort(); |
|
119 |
client.AliveConvertListCompleted -= Client_AliveConvertListCompleted; |
|
120 |
client = null; |
|
121 |
} |
|
122 | 116 |
|
117 |
ServiceAbort(); |
|
118 |
|
|
123 | 119 |
var configFileName = $"StationController.ini"; |
124 | 120 |
|
125 | 121 |
var config = ConfigHelper.AppConfig(configFileName); |
... | ... | |
137 | 133 |
|
138 | 134 |
} |
139 | 135 |
|
136 |
private void ServiceAbort() |
|
137 |
{ |
|
138 |
if (client != null) |
|
139 |
{ |
|
140 |
client.Abort(); |
|
141 |
client.AliveConvertListCompleted -= Client_AliveConvertListCompleted; |
|
142 |
client = null; |
|
143 |
} |
|
144 |
} |
|
145 |
|
|
140 | 146 |
private void Timer_Tick(object sender, EventArgs e) |
141 | 147 |
{ |
142 | 148 |
try |
143 | 149 |
{ |
144 | 150 |
if (!IsTimer) |
145 | 151 |
{ |
152 |
ServiceAbort(); |
|
146 | 153 |
timer.Stop(); |
147 | 154 |
} |
148 | 155 |
|
149 |
client.AliveConvertListAsync(); |
|
156 |
//if (ServiceCheck()) |
|
157 |
//{ |
|
158 |
client.AliveConvertListAsync(); |
|
159 |
//} |
|
160 |
//else |
|
161 |
//{ |
|
162 |
// ServiceConnection(); |
|
163 |
//} |
|
150 | 164 |
} |
151 | 165 |
catch (Exception ex) |
152 | 166 |
{ |
... | ... | |
154 | 168 |
} |
155 | 169 |
} |
156 | 170 |
|
171 |
private bool ServiceCheck() |
|
172 |
{ |
|
173 |
System.ServiceModel.Description.MetadataExchangeClient mexClient = null; |
|
174 |
bool isServiceUp = true; |
|
175 |
|
|
176 |
try |
|
177 |
{ |
|
178 |
string address = "http://172.20.101.119:9101/StationService?wsdl"; |
|
179 |
mexClient = new System.ServiceModel.Description.MetadataExchangeClient(new Uri(address), |
|
180 |
System.ServiceModel.Description.MetadataExchangeClientMode.MetadataExchange); |
|
181 |
mexClient.OperationTimeout = new TimeSpan(0, 0, 5); |
|
182 |
|
|
183 |
System.ServiceModel.Description.MetadataSet metadata = mexClient.GetMetadata(); |
|
184 |
// if service down I get the exception |
|
185 |
} |
|
186 |
catch (Exception ex) |
|
187 |
{ |
|
188 |
isServiceUp = false; |
|
189 |
} |
|
190 |
|
|
191 |
return isServiceUp; |
|
192 |
} |
|
193 |
|
|
157 | 194 |
private void Client_AliveConvertListCompleted(object sender, AliveConvertListCompletedEventArgs e) |
158 | 195 |
{ |
159 | 196 |
AliveItems = e.Result; |
KCOM/Controls/DecodeImage.cs | ||
---|---|---|
130 | 130 |
|
131 | 131 |
owner.scaleImages.Add(new ScaleImage { Scale = value, source = owner.ViewSource }); |
132 | 132 |
|
133 |
System.Diagnostics.Debug.WriteLine($"TranFormImage Height : {tb.Height} Scale : {value} brightness : {brightness}"); |
|
133 |
//System.Diagnostics.Debug.WriteLine($"TranFormImage Height : {tb.Height} Scale : {value} brightness : {brightness}");
|
|
134 | 134 |
|
135 | 135 |
} |
136 | 136 |
}); |
내보내기 Unified diff