Skip to content

Commit

Permalink
MacOS Path Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mokny committed Nov 19, 2017
1 parent 7147297 commit a3bcf4b
Show file tree
Hide file tree
Showing 38 changed files with 118 additions and 180 deletions.
Binary file removed .DS_Store
Binary file not shown.
Binary file removed bin/.DS_Store
Binary file not shown.
Binary file removed bin/FFA320Connector/.DS_Store
Binary file not shown.
Binary file modified bin/FFA320Connector/64/mac.xpl
Binary file not shown.
Binary file modified bin/FFA320Connector/64/win.xpl
Binary file not shown.
95 changes: 37 additions & 58 deletions src/FFA320Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using namespace std;

string pluginversion = "1.1.2"; // Plugin-Version
string pluginversion = "1.1.4"; // Plugin-Version

string pluginpath;
string aircraftpath;
Expand Down Expand Up @@ -197,67 +197,46 @@ void get_paths() {
aircraftpath = "";

/* Getting the Aircraft Directory */
char FileNamePath[512];

char cacfilename[256] = { 0 };
char cacpath[512] = { 0 };
XPLMGetNthAircraftModel(0, cacfilename, cacpath);
char cacpath[1024] = { 0 };


aircraftpath = string(cacpath).substr(0, string(cacpath).find_last_of("\\/")); // Remove the Filename from the complete path

// CONFIG.CFG
XPLMGetNthAircraftModel(0, cacfilename, cacpath);
XPLMExtractFileAndPath(cacpath);
strcpy(FileNamePath, cacpath);
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "plugins");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "FFA320Connector");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "config.cfg");
defaultconfigpath = string(FileNamePath);

LogWrite("-> Default Config: " + defaultconfigpath);

/* Check in Aircraft Plugins folder */
if (file_exists(aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "config.cfg")) {
defaultconfigpath = aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "config.cfg";
defaultconfigfound = true;
}

/* Check in Default-Plugin Folder */
if (!defaultconfigfound) {
char PluginINIFile[512];
XPLMGetSystemPath(PluginINIFile);
strcat(PluginINIFile, "Resources");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "plugins");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "FFA320Connector");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "config.cfg");
string defaultfolderfilename = string(PluginINIFile);

/* defaultconfigpath */
if (file_exists(defaultfolderfilename)) {
defaultconfigpath = defaultfolderfilename;
defaultconfigfound = true;
}
}
// CUSTOM.CFG
XPLMGetNthAircraftModel(0, cacfilename, cacpath);
XPLMExtractFileAndPath(cacpath);
strcpy(FileNamePath, cacpath);
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "plugins");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "FFA320Connector");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "custom.cfg");
customconfigpath = string(FileNamePath);

LogWrite("-> Custom Config: " + customconfigpath);

/* Check in Aircraft Plugins folder */
if (file_exists(aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "custom.cfg")) {
customconfigpath = aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "custom.cfg";
customconfigfound = true;
}

// CUSTOM.CFG
if (file_exists(defaultconfigpath)) defaultconfigfound = true;
if (file_exists(customconfigpath)) customconfigfound = true;

/* Check in Default-Plugin Folder */
if (!customconfigfound) {
char PluginINIFile[512];
XPLMGetSystemPath(PluginINIFile);
strcat(PluginINIFile, "Resources");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "plugins");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "FFA320Connector");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "custom.cfg");
string defaultfolderfilename = string(PluginINIFile);

/* defaultconfigpath */
if (file_exists(defaultfolderfilename)) {
customconfigpath = defaultfolderfilename;
customconfigfound = true;
}
}

if (!defaultconfigfound && !customconfigfound) {
LogWrite("#####################################################");
Expand Down Expand Up @@ -320,15 +299,15 @@ class DataObject {
void initialize() {
/* Create the command */
if (Type == OBJECT_TYPE_COMMAND) {
LogWrite("Creating Command " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
DebugOut("Creating Command " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
CMD = XPLMCreateCommand(Command.c_str(), CommandName.c_str());
XPLMRegisterCommandHandler(CMD, UniversalCommandHandler, 1, &Value);
NextUpdateCycle = 0;
}

/* Create the command to dataref */
if (Type == OBJECT_TYPE_COMMANDTODATAREF) {
LogWrite("Creating Comdef " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
DebugOut("Creating Comdef " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
CMD = XPLMCreateCommand(Command.c_str(), CommandName.c_str());
DREF = XPLMFindDataRef(DataRef.c_str());
XPLMRegisterCommandHandler(CMD, UniversalCommandHandler, 1, &Value);
Expand All @@ -344,7 +323,7 @@ class DataObject {

if ((DREF == NULL) || (IgnoreExistingDataRef == true)) {
IsExistingDataRef = false;
LogWrite("Creating Dataref " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
DebugOut("Creating Dataref " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
if (DataRefValueType == VALUE_TYPE_INT) {
DREF = XPLMRegisterDataAccessor(DataRef.c_str(),
xplmType_Int, // The types we support
Expand Down Expand Up @@ -380,7 +359,7 @@ class DataObject {

} else {
IsExistingDataRef = true;
LogWrite("Using existing Dataref (READONLY) " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
DebugOut("Using existing Dataref (READONLY) " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
}

NextUpdateCycle = 0;
Expand Down Expand Up @@ -1347,5 +1326,5 @@ PLUGIN_API void XPluginReceiveMessage(
int inMessage,
void * inParam)
{
LogWrite("Message Received.");
DebugOut("Message Received.");
}
95 changes: 37 additions & 58 deletions src_vs2013/FFA320Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using namespace std;

string pluginversion = "1.1.2"; // Plugin-Version
string pluginversion = "1.1.4"; // Plugin-Version

string pluginpath;
string aircraftpath;
Expand Down Expand Up @@ -197,67 +197,46 @@ void get_paths() {
aircraftpath = "";

/* Getting the Aircraft Directory */
char FileNamePath[512];

char cacfilename[256] = { 0 };
char cacpath[512] = { 0 };
XPLMGetNthAircraftModel(0, cacfilename, cacpath);
char cacpath[1024] = { 0 };


aircraftpath = string(cacpath).substr(0, string(cacpath).find_last_of("\\/")); // Remove the Filename from the complete path

// CONFIG.CFG
XPLMGetNthAircraftModel(0, cacfilename, cacpath);
XPLMExtractFileAndPath(cacpath);
strcpy(FileNamePath, cacpath);
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "plugins");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "FFA320Connector");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "config.cfg");
defaultconfigpath = string(FileNamePath);

LogWrite("-> Default Config: " + defaultconfigpath);

/* Check in Aircraft Plugins folder */
if (file_exists(aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "config.cfg")) {
defaultconfigpath = aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "config.cfg";
defaultconfigfound = true;
}

/* Check in Default-Plugin Folder */
if (!defaultconfigfound) {
char PluginINIFile[512];
XPLMGetSystemPath(PluginINIFile);
strcat(PluginINIFile, "Resources");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "plugins");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "FFA320Connector");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "config.cfg");
string defaultfolderfilename = string(PluginINIFile);

/* defaultconfigpath */
if (file_exists(defaultfolderfilename)) {
defaultconfigpath = defaultfolderfilename;
defaultconfigfound = true;
}
}
// CUSTOM.CFG
XPLMGetNthAircraftModel(0, cacfilename, cacpath);
XPLMExtractFileAndPath(cacpath);
strcpy(FileNamePath, cacpath);
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "plugins");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "FFA320Connector");
strcat(FileNamePath, XPLMGetDirectorySeparator());
strcat(FileNamePath, "custom.cfg");
customconfigpath = string(FileNamePath);

LogWrite("-> Custom Config: " + customconfigpath);

/* Check in Aircraft Plugins folder */
if (file_exists(aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "custom.cfg")) {
customconfigpath = aircraftpath + string(XPLMGetDirectorySeparator()) + "plugins" + string(XPLMGetDirectorySeparator()) + "FFA320Connector" + string(XPLMGetDirectorySeparator()) + "custom.cfg";
customconfigfound = true;
}

// CUSTOM.CFG
if (file_exists(defaultconfigpath)) defaultconfigfound = true;
if (file_exists(customconfigpath)) customconfigfound = true;

/* Check in Default-Plugin Folder */
if (!customconfigfound) {
char PluginINIFile[512];
XPLMGetSystemPath(PluginINIFile);
strcat(PluginINIFile, "Resources");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "plugins");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "FFA320Connector");
strcat(PluginINIFile, XPLMGetDirectorySeparator());
strcat(PluginINIFile, "custom.cfg");
string defaultfolderfilename = string(PluginINIFile);

/* defaultconfigpath */
if (file_exists(defaultfolderfilename)) {
customconfigpath = defaultfolderfilename;
customconfigfound = true;
}
}

if (!defaultconfigfound && !customconfigfound) {
LogWrite("#####################################################");
Expand Down Expand Up @@ -320,15 +299,15 @@ class DataObject {
void initialize() {
/* Create the command */
if (Type == OBJECT_TYPE_COMMAND) {
LogWrite("Creating Command " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
DebugOut("Creating Command " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
CMD = XPLMCreateCommand(Command.c_str(), CommandName.c_str());
XPLMRegisterCommandHandler(CMD, UniversalCommandHandler, 1, &Value);
NextUpdateCycle = 0;
}

/* Create the command to dataref */
if (Type == OBJECT_TYPE_COMMANDTODATAREF) {
LogWrite("Creating Comdef " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
DebugOut("Creating Comdef " + Command + " / " + to_string(WorkMode) + " / " + FFVar);
CMD = XPLMCreateCommand(Command.c_str(), CommandName.c_str());
DREF = XPLMFindDataRef(DataRef.c_str());
XPLMRegisterCommandHandler(CMD, UniversalCommandHandler, 1, &Value);
Expand All @@ -344,7 +323,7 @@ class DataObject {

if ((DREF == NULL) || (IgnoreExistingDataRef == true)) {
IsExistingDataRef = false;
LogWrite("Creating Dataref " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
DebugOut("Creating Dataref " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
if (DataRefValueType == VALUE_TYPE_INT) {
DREF = XPLMRegisterDataAccessor(DataRef.c_str(),
xplmType_Int, // The types we support
Expand Down Expand Up @@ -380,7 +359,7 @@ class DataObject {

} else {
IsExistingDataRef = true;
LogWrite("Using existing Dataref (READONLY) " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
DebugOut("Using existing Dataref (READONLY) " + DataRef + " / " + to_string(ValueType) + " / #" + to_string(RefConID) + " / " + FFVar);
}

NextUpdateCycle = 0;
Expand Down Expand Up @@ -1347,5 +1326,5 @@ PLUGIN_API void XPluginReceiveMessage(
int inMessage,
void * inParam)
{
LogWrite("Message Received.");
DebugOut("Message Received.");
}
Binary file modified src_vs2013/FFA320Connector.sdf
Binary file not shown.
Binary file modified src_vs2013/FFA320Connector.v12.suo
Binary file not shown.
Binary file modified src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.exp
Binary file not shown.
Binary file modified src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.lib
Binary file not shown.
10 changes: 5 additions & 5 deletions src_vs2013/Release/64/FFA320Connector.log
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Der Buildvorgang wurde am 18.11.2017 20:04:42 gestartet.
Der Buildvorgang wurde am 19.11.2017 14:58:10 gestartet.
1>Projekt "E:\FFA320Connector\src_vs2013\FFA320Connector.vcxproj" auf Knoten "2", Rebuild Ziel(e).
1>ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /ISDK\CHeaders\XPLM /ISDK\CHeaders\Widgets /Zi /nologo /W3 /WX- /O2 /Ob1 /D WIN32 /D NDEBUG /D _WINDOWS /D _USRDLL /D SIMDATA_EXPORTS /D IBM=1 /D XPLM200=1 /D XPLM210=1 /D _CRT_SECURE_NO_WARNINGS /D _VC80_UPGRADE=0x0600 /D _WINDLL /D _MBCS /GF /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo".\Release\64\\" /Fd".\Release\64\vc120.pdb" /Gd /TP /errorReport:prompt FFA320Connector.cpp
FFA320Connector.cpp
1>FFA320Connector.cpp(38): warning C4005: 'XPLM200': Makro-Neudefinition
Befehlszeilenargumente: siehe vorherige Definition von "XPLM200"
1>FFA320Connector.cpp(1147): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1126): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1156): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1163): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1170): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1177): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1184): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1191): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1198): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1205): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>FFA320Connector.cpp(1212): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"..\bin\FFA320Connector\64\win.xpl" /INCREMENTAL:NO /NOLOGO /LIBPATH:SDK\Libraries\Win Opengl32.lib odbc32.lib odbccp32.lib XPLM_64.lib XPWidgets_64.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST:NO /PDB:"..\bin\FFA320Connector\64\win.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Release\64\Custom-Command-with-Custom-DataRef.lib" /MACHINE:X64 /DLL .\Release\64\FFA320Connector.obj
Bibliothek ".\Release\64\Custom-Command-with-Custom-DataRef.lib" und Objekt ".\Release\64\Custom-Command-with-Custom-DataRef.exp" werden erstellt.
Expand Down
Binary file modified src_vs2013/Release/64/FFA320Connector.obj
Binary file not shown.
Binary file modified src_vs2013/Release/64/vc120.pdb
Binary file not shown.
Binary file modified src_xcode3.2/.DS_Store
Binary file not shown.
Binary file modified src_xcode3.2/DerivedData/.DS_Store
Binary file not shown.
Binary file modified src_xcode3.2/DerivedData/FFA320Connector/.DS_Store
Binary file not shown.
Binary file modified src_xcode3.2/DerivedData/FFA320Connector/Build/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/Cache.db
Binary file not shown.
Binary file not shown.
Binary file modified src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/Cache.db
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src_xcode3.2/DerivedData/FFA320Connector/TextIndex/text-filter.idx
Binary file not shown.
2 changes: 1 addition & 1 deletion src_xcode3.2/DerivedData/FFA320Connector/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>LastAccessedDate</key>
<date>2017-11-19T10:58:08Z</date>
<date>2017-11-19T13:59:16Z</date>
<key>WorkspacePath</key>
<string>../../FFA320Connector.xcodeproj</string>
</dict>
Expand Down
Loading

0 comments on commit a3bcf4b

Please sign in to comment.