Fix available language
This commit is contained in:
@@ -138,15 +138,6 @@ namespace CMS_CORE_Application
|
||||
ICollection<CultureInfo> info = new List<CultureInfo>();
|
||||
cmsError = N.NC_GetAvailableLanguages(ref info);
|
||||
|
||||
cmsError = N.NC_WLanguage(new CultureInfo("it"));
|
||||
if (cmsError.IsError())
|
||||
{ error = true; SetError(Lines, cmsError); }
|
||||
|
||||
|
||||
cmsError = N.NC_WLanguage(new CultureInfo("en"));
|
||||
if (cmsError.IsError())
|
||||
{ error = true; SetError(Lines, cmsError); }
|
||||
|
||||
sw.Stop();
|
||||
Console.WriteLine(sw.ElapsedMilliseconds);
|
||||
|
||||
|
||||
@@ -211,13 +211,20 @@ namespace CMS_CORE_Library.Fanuc
|
||||
{
|
||||
foreach(string file in Directory.GetFiles(PLC_MESSAGE_PATH))
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(file);
|
||||
if(Path.GetExtension(file) == ".txt")
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(file);
|
||||
|
||||
// Get lang from threeletter
|
||||
var lang = GetCultureFromThreeLetter(fileName.Split('_')[1]);
|
||||
var splittedFileName = fileName.Split('_');
|
||||
if (splittedFileName.Count() == 2)
|
||||
{
|
||||
// Get lang from threeletter
|
||||
var lang = GetCultureFromThreeLetter(splittedFileName[1]);
|
||||
|
||||
if (lang != null)
|
||||
languages.Add(lang);
|
||||
if (lang != null)
|
||||
languages.Add(lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -201,15 +201,23 @@ namespace CMS_CORE_Library.Osai
|
||||
{
|
||||
foreach (string file in Directory.GetFiles(PLC_MESSAGE_PATH))
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(file);
|
||||
if (Path.GetExtension(file) == ".txt")
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(file);
|
||||
|
||||
var lang = CultureInfo
|
||||
.GetCultures(CultureTypes.NeutralCultures)
|
||||
.Where(ci => string.Equals(ci.EnglishName, fileName.Split('_')[1], StringComparison.OrdinalIgnoreCase))
|
||||
.FirstOrDefault();
|
||||
var splittedFileName = fileName.Split('_');
|
||||
|
||||
if (lang != null)
|
||||
languages.Add(lang);
|
||||
if (splittedFileName.Count() == 2)
|
||||
{
|
||||
var lang = CultureInfo
|
||||
.GetCultures(CultureTypes.NeutralCultures)
|
||||
.Where(ci => string.Equals(ci.EnglishName, splittedFileName[1], StringComparison.OrdinalIgnoreCase))
|
||||
.FirstOrDefault();
|
||||
|
||||
if (lang != null)
|
||||
languages.Add(lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1343,7 +1351,15 @@ namespace CMS_CORE_Library.Osai
|
||||
}
|
||||
|
||||
public override CmsError PLC_WTerminateAssistedToolingProcedure()
|
||||
{
|
||||
{
|
||||
// Terminate procedure with ACK-STROBE method
|
||||
CmsError cmsError = PLC_ManageActiveAck(PLC_ASSISTED_TOOLING_STROBE.Address, PLC_ASSISTED_TOOLING_STROBE.SubAddress,
|
||||
HMI_ASSISTED_TOOLING_ACK.Address, HMI_ASSISTED_TOOLING_ACK.SubAddress,
|
||||
PLC_ASSISTED_TOOLING_STROBE.MemType);
|
||||
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -446,13 +446,21 @@ namespace CMS_CORE_Library.Siemens
|
||||
{
|
||||
foreach (string file in Directory.GetFiles(PLC_MESSAGES_FILE_PATH))
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(file);
|
||||
if (Path.GetExtension(file) == ".ts")
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(file);
|
||||
|
||||
// Get lang from threeletter
|
||||
var lang = GetCultureFromThreeLetter(fileName.Split('_')[1]);
|
||||
var splittedFileName = fileName.Split('_');
|
||||
|
||||
if (lang != null)
|
||||
languages.Add(lang);
|
||||
if (splittedFileName.Count() == 2)
|
||||
{
|
||||
// Get lang from threeletter
|
||||
var lang = GetCultureFromThreeLetter(splittedFileName[1]);
|
||||
|
||||
if (lang != null)
|
||||
languages.Add(lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user