C3Fire

Difference between revisions of "Config/Config Create New"

From C3LearningLabs
 
(17 intermediate revisions by the same user not shown)
Line 66: Line 66:
 
= Copy an old configuration =
 
= Copy an old configuration =
  
Copy an configuration folder and update the following main steps.
+
Copy a configuration folder and update the following main steps.
  
 
== Organisation ==
 
== Organisation ==
Line 192: Line 192:
 
     </UnitInfoDisplayOutline>
 
     </UnitInfoDisplayOutline>
 
</source>
 
</source>
 +
 +
 +
= Config Update Examples =
 +
 +
{{Multicol}}
 +
[[Config/RemoveUnits|RemoveUnits]]<br>
 +
 +
 +
{{Multicol-break}}
 +
[[Config/P1-F4AUV-To-P2-F4AUV|P1-F4AUV To P2-F4AUV]]<br>
 +
[[Config/P4-F9L3R2Uav1-3x15min-To-P4-F8L2R2B1Uav1-3x15min|P4-F9L3R2Uav1-3x15min To P4-F8L2R2B1Uav1-3x15min]]<br>
 +
 +
{{Multicol-end}}
 +
               
 +
<br>
 +
 +
&emsp;&emsp;&emsp;&emsp;
 +
 +
= 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>
  
 
= Error messages =
 
= Error messages =

Latest revision as of 11:01, 26 September 2023


Create New Configuration

Set Default Configuration Files

When you load a session you needs to select what configuration file to load.
To make the start up proses easy, you can set the default configuration files,
so you don't need to manually select them when developing the new configuration.

Edit the file you uses
C3FireClientConfig-Lin.xml
C3FireClientConfig-Mac.xml
C3FireClientConfig-Win.xml

<DefaultFiles 
  SessionConfigDirectory   = "../../SessionDef/<CONFIG-FOLDER>"
  ...
  ScenarioDirectory        = "../../SessionDef/<CONFIG-FOLDER>"
  ...
  SessionConfigFile         = "<FILE_NAME>.con"
  ...
  ScenarioFile              = "<FILE_NAME>.sce"

Property

Value

SessionConfigDirectory

The default directory where the session configuration files are stored. This property does not need to be
defined.

Value example = "C:\c3fire\server\SessionConfig"

ScenarioDirectory

The default directory where the session scenario configuration files are stored. This property does not need
to be defined.

Value example = "C:\c3fire\server\SessionScenario"

SessionConfigFile

The session configuration default file. This property does not need to be defined.

Value example = "XY.con"

ScenarioFile

The session scenario default file. This property does not need to be defined.

Value example = "Dev.sce"

Copy an old configuration

Copy a configuration folder and update the following main steps.

Organisation

Copy the new roles and update

File name: xx-Global-Roles.coni

<Roles>
  <Role
      IDName = "A"
      LongName = "Chief"

      ControlUnits = "D13"

      MailSendTo = "B,C,E,G,H,I,K"
      MapDBTo = ""

Units

Copy the new Units and update
Update the numbers for the units images

File name: xx-Global-Units.coni

<Units>
  <Unit
      IDName = "F1"
      LongName = "Firefighter Unit 1"

      SendInfoTo = "C"

      ImageGoTo = "Unit\Number\White\1-White.gif"
      ImageGoToSelected = "Unit\Number\White\1-White-Selected.gif"
      ImagePos = "Unit\Number\Red\1-Red.gif"
      ImagePosSelected = "Unit\Number\Red\1-Red-Selected.gif"

UAVs

Copy the new UAV and update
Update the numbers for the UAV's images
Update who is controlling the UAV at start.

File name example: xx-Main-ss.con

<UAVs>

    <UAV
      IDName = "D15"
      ControllerActive = "A"

Map

Roles Map Scroll Positions

Add the new roles and Update all roles map scroll positions.

File name: xx-yy-RolesScrollPos.coni

  <RolesScrollPos>

    <Role
      IDName = "A"
      MapStartCenterScrollPos = "20,20"

Units Map Positions

Add the new units and update all units map positions.

File name: xx-yy-UnitsPos.coni

  <UnitsPos>

    <Unit
      IDName = "F1"
      Pos = "18,18" />

UAVs Map Positions

Add the new UAVs and update all UAVs map positions.

File name: xx-yy-UAVsPos.coni

  <UAVsPos>

    <UAV
      IDName = "D15"
      HomeBasePos = "20,20" />

UnitInfoDisplay

UnitInfoDisplay

UnitInfoDisplayOutline

Update unit information outline display. Update if Water or Fuel level should be visible.

File name: xx-Global-UIMain-zz.coni

    <UnitInfoDisplayOutline
      Name = "Ground Chief Info" >

      ...

      <UnitInfoDisplayOutlineCol
        Property = "WaterLevel"
        PropertyType = "String"
        width = "50" />

      <UnitInfoDisplayOutlineCol
        Property = "FuelLevel"
        PropertyType = "String"
        width = "50" />

    </UnitInfoDisplayOutline>


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'

Error messages

Old Unit pos configurations

If you converting an old configuration file and get this error.
You should update unit pos definitions.
Move units position from the elements in <Units> to the elements in <UnitsPos>.
In <Modules> element set Unit = true
In <Modules> element set MapObjects = "True"

Unable to parse session configuration. Error while parsing the tag <Units>
Error report generated by c3systems.global.sessionData.SessionConfigParser.parseSessionConfiguration<Units>