提交 d4331b76 编写于 作者: cdy816's avatar cdy816

Spider 接口 Bug 修改

上级 0a1b7b8f
......@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PackageProjectUrl>https://github.com/cdy816/mars</PackageProjectUrl>
<Authors>Cdy</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
......
......@@ -2,6 +2,9 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Authors>Cdy</Authors>
<PackageProjectUrl>https://github.com/cdy816/mars</PackageProjectUrl>
<Description>Mars</Description>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
......
......@@ -2,6 +2,12 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Authors>Cdy</Authors>
<Product>Mars</Product>
<PackageId>Mars.DBDevelopClientWebApi</PackageId>
<PackageProjectUrl>https://github.com/cdy816/mars</PackageProjectUrl>
<Description>DBDevelop Server WebApi SDK</Description>
<Copyright />
</PropertyGroup>
<ItemGroup>
......
......@@ -1406,7 +1406,7 @@ namespace DBStudio
}
catch (Exception ex)
{
Console.WriteLine("CheckStart " + name + " failed." + ex.Message + " " + ex.StackTrace);
//Console.WriteLine("CheckStart " + name + " failed." + ex.Message + " " + ex.StackTrace);
return false;
}
}
......
......@@ -256,7 +256,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Padding="5,0" Loaded="ComboBox_Loaded" Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding DriverList}" IsEditable="True" Text="{Binding DriverName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Padding="5,0" Loaded="ComboBox_Loaded" Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding DriverList}" IsEditable="False" SelectedItem="{Binding DriverName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -268,7 +268,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Padding="5,0" Loaded="ComboBox_Loaded" Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding RegistorList}" IsEditable="True" Text="{Binding RegistorName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Padding="5,0" Loaded="ComboBox_Loaded" Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding RegistorList}" IsEditable="True" Text="{Binding RegistorName,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......
......@@ -97,7 +97,8 @@ namespace DBInStudio.Desktop.View
{
if((sender as FrameworkElement).IsLoaded)
{
dg.CommitEdit();
if (!(sender as ComboBox).IsEditable)
dg.CommitEdit();
}
}
......
......@@ -125,20 +125,7 @@ namespace SimDriver
{
while (!mIsClosed)
{
//mTickCount++;
DateTime time = DateTime.Now;
//if (mTickCount < 5)
//{
// mIsBusy = false;
// Thread.Sleep(100);
// continue;
//}
//else
//{
// mTickCount = 0;
//}
//LoggerService.Service.Info("Sim Driver", "Sart: " + time,ConsoleColor.DarkMagenta);
if ((mLastProcessTime-time).TotalSeconds>1000)
{
......@@ -163,14 +150,10 @@ namespace SimDriver
double fval = Math.Cos(mNumber / 180.0 * Math.PI);
double sval = Math.Sin(mNumber / 180.0 * Math.PI);
//#if DEBUG
//if(mNumber%10==0)
//Log("Sim:Sin " + fval + " " + "Sim:Cos " + sval + " " + "Sim:step " + mNumber + " " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
#if DEBUG
Stopwatch sw = new Stopwatch();
sw.Start();
//#endif
#endif
System.Threading.Tasks.Parallel.ForEach(mTagIdCach, (vv) =>
......@@ -197,15 +180,17 @@ namespace SimDriver
}
});
mTagService.SubmiteNotifyChanged();
sw.Stop();
int delay = (int)(500 - (DateTime.Now - mLastProcessTime).TotalMilliseconds);
if(delay < 0)
{
delay = 1;
}
if(mNumber%10 == 0)
#if DEBUG
sw.Stop();
if (mNumber%10 == 0)
LoggerService.Service.Info("Sim Driver", "set value elapsed:" + sw.ElapsedMilliseconds);
#endif
Thread.Sleep(delay);
}
}
......
......@@ -590,7 +590,7 @@ namespace SpiderDriver.ClientApi
{
}
return null;
return re;
}
/// <summary>
......
......@@ -7,6 +7,8 @@
<Product>Mars</Product>
<PackageProjectUrl>https://github.com/cdy816/mars</PackageProjectUrl>
<Version>1.0.3</Version>
<AssemblyVersion>1.0.4.0</AssemblyVersion>
<FileVersion>1.0.4.0</FileVersion>
</PropertyGroup>
<ItemGroup>
......
<?xml version="1.0" encoding="utf-8" ?>
<Config>
<Server StartPort="3600" EndPort="3601" />
<Server StartPort="8800" EndPort="8801" />
</Config>
\ No newline at end of file
......@@ -104,6 +104,7 @@ namespace SpiderDriver
ProcessSetRealData(client, data);
break;
case APIConst.SetTagValueAndQualityFun:
ProcessSetRealDataAndQuality(client, data);
break;
case APIConst.RegistorTag:
ProcessValueChangeNotify(client, data);
......
......@@ -26,7 +26,7 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\Output&quot; /y&#xD;&#xA;copy &quot;$(TargetDir)Config\SpiderDrivercfg&quot; &quot;$(SolutionDir)\Output\Config&quot; /y&#xD;&#xA;if exist &quot;$(TargetDir)$(TargetName).XML&quot; copy &quot;$(TargetDir)$(TargetName).XML&quot; &quot;$(SolutionDir)\Output\Xml&quot; /y&#xD;&#xA;if exist &quot;$(TargetDir)$(TargetName).pdb&quot; copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)\Output&quot; /y" />
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\Output&quot; /y&#xD;&#xA;copy &quot;$(TargetDir)Config\SpiderDriver.cfg&quot; &quot;$(SolutionDir)\Output\Config&quot; /y&#xD;&#xA;if exist &quot;$(TargetDir)$(TargetName).XML&quot; copy &quot;$(TargetDir)$(TargetName).XML&quot; &quot;$(SolutionDir)\Output\Xml&quot; /y&#xD;&#xA;if exist &quot;$(TargetDir)$(TargetName).pdb&quot; copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)\Output&quot; /y" />
</Target>
</Project>
......@@ -66,10 +66,12 @@ namespace SpiderDriver
int count = data.ReadInt();
if (count > 0)
{
var re = BufferManager.Manager.Allocate(APIConst.TagInfoRequestFun, count * 4);
var re = BufferManager.Manager.Allocate(APIConst.TagInfoRequestFun, (count+1) * 4);
re.WriteInt(count);
for (int i = 0; i < count; i++)
{
var ival = mm.GetTagIdByName(data.ReadString());
string stag = data.ReadString();
var ival = mm.GetTagIdByName(stag);
if (ival.HasValue)
{
re.WriteInt(ival.Value);
......@@ -135,7 +137,7 @@ namespace SpiderDriver
foreach(var vv in tags)
{
re.WriteInt(vv.Id);
re.WriteString(vv.Name);
re.WriteString(vv.FullName);
re.WriteByte((byte)vv.Type);
}
return re;
......
......@@ -11,7 +11,7 @@
<Label Content="IP:" HorizontalAlignment="Left" Margin="31,33,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="ipt" HorizontalAlignment="Left" Margin="106,38,0,0" Text="127.0.0.1" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
<Label Content="Port:" HorizontalAlignment="Left" Margin="256,33,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="portt" HorizontalAlignment="Left" Margin="317,35,0,0" Text="3600" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
<TextBox x:Name="portt" HorizontalAlignment="Left" Margin="317,35,0,0" Text="8800" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
<Label Content="Count:" HorizontalAlignment="Left" Margin="30,78,0,0" VerticalAlignment="Top"/>
<Label Content="Sin:" HorizontalAlignment="Left" Margin="30,118,0,0" VerticalAlignment="Top"/>
<Label Content="Cos:" HorizontalAlignment="Left" Margin="31,156,0,0" VerticalAlignment="Top"/>
......
......@@ -189,6 +189,13 @@ namespace SpiderDriverDemo
private void ReadAllIds()
{
mAllId = driverProxy.QueryAllTagIdAndNames();
var tagName = mAllId.First().Value.Item1;
var ids = driverProxy.QueryTagId(new List<string>() { tagName });
if(ids.Count>0)
{
//test
}
}
private void ProcessSetTagValue()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册