Subversion Repositories tpanel

Rev

Rev 449 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 449 Rev 486
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2020 to 2023 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2020 to 2025 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 298... Line 298...
298
        delete mMap;
298
        delete mMap;
299
    else if (mSystemMap)
299
    else if (mSystemMap)
300
        delete mSystemMap;
300
        delete mSystemMap;
301
}
301
}
302
 
302
 
303
bool TAmxCommands::readMap()
303
bool TAmxCommands::readMap(bool tp5)
304
{
304
{
305
    DECL_TRACER("TAmxCommands::readMap()");
305
    DECL_TRACER("TAmxCommands::readMap(bool tp5)");
306
 
306
 
307
    bool err = false;
307
    bool err = false;
308
    string projectPath = TConfig::getProjectPath();
308
    string projectPath = TConfig::getProjectPath();
309
 
309
 
310
    if (fs::exists(projectPath + "/prj.xma"))
310
    if (fs::exists(projectPath + "/prj.xma"))
311
    {
311
    {
312
        mMap = new TMap(projectPath);
312
        mMap = new TMap(projectPath, tp5);
313
        err = mMap->haveError();
313
        err = mMap->haveError();
314
    }
314
    }
315
 
315
 
316
    projectPath += "/__system";
316
    projectPath += "/__system";
317
 
317
 
318
    if (fs::exists(projectPath + "/prj.xma"))
318
    if (fs::exists(projectPath + "/prj.xma"))
319
    {
319
    {
320
        mSystemMap = new TMap(projectPath);
320
        mSystemMap = new TMap(projectPath, tp5);
321
 
321
 
322
        if (!err)
322
        if (!err)
323
            err = mSystemMap->haveError();
323
            err = mSystemMap->haveError();
324
    }
324
    }
325
 
325
 
Line 396... Line 396...
396
{
396
{
397
    DECL_TRACER("TAmxCommands::findImage(const string& name)");
397
    DECL_TRACER("TAmxCommands::findImage(const string& name)");
398
 
398
 
399
    string str = mMap->findImage(name);
399
    string str = mMap->findImage(name);
400
 
400
 
401
    if (str.empty())
401
    if (str.empty() && mSystemMap)
402
        return mSystemMap->findImage(name);
402
        return mSystemMap->findImage(name);
403
 
403
 
404
    return str;
404
    return str;
405
}
405
}
406
 
406
 
Line 408... Line 408...
408
{
408
{
409
    DECL_TRACER("TAmxCommands::findButtonByName(const string& name)");
409
    DECL_TRACER("TAmxCommands::findButtonByName(const string& name)");
410
 
410
 
411
    vector<TMap::MAP_T> map = mMap->findButtonByName(name);
411
    vector<TMap::MAP_T> map = mMap->findButtonByName(name);
412
 
412
 
413
    if (map.empty())
413
    if (map.empty() && mSystemMap)
414
        return mSystemMap->findButtonByName(name);
414
        return mSystemMap->findButtonByName(name);
415
 
415
 
416
    return map;
416
    return map;
417
}
417
}
418
 
418
 
Line 420... Line 420...
420
{
420
{
421
    DECL_TRACER("TAmxCommands::findBargraphs(int port, vector<int>& channels)");
421
    DECL_TRACER("TAmxCommands::findBargraphs(int port, vector<int>& channels)");
422
 
422
 
423
    vector<TMap::MAP_T> map = mMap->findBargraphs(port, channels);
423
    vector<TMap::MAP_T> map = mMap->findBargraphs(port, channels);
424
 
424
 
425
    if (map.empty())
425
    if (map.empty() && mSystemMap)
426
        return mSystemMap->findBargraphs(port, channels);
426
        return mSystemMap->findBargraphs(port, channels);
427
 
427
 
428
    return map;
428
    return map;
429
}
429
}
430
 
430