C3Fire

Difference between revisions of "Config/Session"

From C3LearningLabs
Line 56: Line 56:
  
 
[[Config/Config_Update_Examples|Config Update Examples]]
 
[[Config/Config_Update_Examples|Config Update Examples]]
 +
 +
 +
= Misc Help =
 +
== Linux Commands==
 +
 +
===Rename multiple files in folder===
 +
:Install Linux: <code>sudo apt-get install mmv</code><br>
 +
:Install Mac: <code>brew install mmv</code><br>
 +
 +
:<code>mmv <FROM>\* <TO>\#1</code><br>
 +
 +
Example:<br>
 +
<source>$ ls
 +
a1.txt a2.txt a3.txt
 +
mmv a\* b\#1
 +
ls
 +
b1.txt b2.txt b3.txt</source>
 +
 +
Example:<br>
 +
 +
:;Mac
 +
:<code>cd /Users/regogranlund/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1</code><br>
 +
:<code>mmv P8F3WR3U2\* P4FWRU\#1</code>
 +
 +
:;Linux
 +
:<code>cd /home/rego/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1</code><br>
 +
:<code>mmv P8F3WR3U2\* P4FWRU\#1</code>
 +
 +
:;WSL Window Subsystem Linux
 +
:<code>cd /mnt/c/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1</code><br>
 +
:<code>mmv P8F3WR3U2\* P4FWRU\#1</code>
 +
 +
===Replace string in multiple files===
 +
 +
:<code>sudo find . -type f -name "*.txt" -print0 | xargs -0 sed -i "" -e 's/[FROM]/[TO]/g'</code>
 +
 +
Example:<br>
 +
 +
:;Mac
 +
:<code>cd /Users/regogranlund/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1</code>
 +
:<code>sudo find . -type f -name "*.con*" -print0 | xargs -0 sed -i "" -e 's/P8F3WR3U2/P4FWRU/g'</code>
 +
 +
 +
:'''Linux'''  (Works but give error message "sed: can't read : No such file or directory")
 +
:<code>cd /Users/regogranlund/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1</code>
 +
:<code>sudo find . -type f -name "*.con*" -print0 | xargs -0 sed -i "" -e 's/P8F3WR3U2/P4FWRU/g'</code>

Revision as of 10:29, 26 September 2023


Session Configuration

The information in the session configuration defines the static configuration values in a C3Fire session. It defines the players (Roles), the simulated units (Fire fighting units, etc.), the simulation data (geographic and fire parameters etc.), the session user interfaces etc.

Example configuration files are located in the distribution directory <C3FIRE-ROOT>/client/SessionDef/ Read more about the configuration examples at Session Example.


Config Include File

The configuration can be splitted in a set of files each containing a specific configurtion.

How to use configuration include files are described in page Config Include File.

XML Definition

The session configuration is written with xml syntax and a file can contain the following xml elements:


Create new Configuration

Create new Configuration

Config Update Examples


Misc Help

Linux Commands

Rename multiple files in folder

Install Linux: sudo apt-get install mmv
Install Mac: brew install mmv
mmv <FROM>\* <TO>\#1

Example:

$ ls
a1.txt a2.txt a3.txt
mmv a\* b\#1
ls
b1.txt b2.txt b3.txt

Example:

Mac
cd /Users/regogranlund/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1
mmv P8F3WR3U2\* P4FWRU\#1
Linux
cd /home/rego/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1
mmv P8F3WR3U2\* P4FWRU\#1
WSL Window Subsystem Linux
cd /mnt/c/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1
mmv P8F3WR3U2\* P4FWRU\#1

Replace string in multiple files

sudo find . -type f -name "*.txt" -print0 | xargs -0 sed -i "" -e 's/[FROM]/[TO]/g'

Example:

Mac
cd /Users/regogranlund/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1
sudo find . -type f -name "*.con*" -print0 | xargs -0 sed -i "" -e 's/P8F3WR3U2/P4FWRU/g'


Linux (Works but give error message "sed: can't read : No such file or directory")
cd /Users/regogranlund/dev/C3Systems/C3Systems/resources/C3Fire/SessionDef/P4FWRU-1
sudo find . -type f -name "*.con*" -print0 | xargs -0 sed -i "" -e 's/P8F3WR3U2/P4FWRU/g'