-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1122 from Courseplay/OrchardDriver
Orchard driver
- Loading branch information
Showing
26 changed files
with
842 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
|
||
<!-- | ||
All the course generator settings can be setup here. | ||
For documentation look up the CpSettingUtil.lua. | ||
--> | ||
|
||
<Settings prefixText="CP_vehicle_vineCourseGeneratorSetting_" autoUpdateGui="true"> | ||
<SettingSubTitle title="basic"> | ||
<Setting classType="AIParameterSettingList" name="vineCenterOffset" default = "0"> | ||
<Values> | ||
<Value name="VINE_CENTER_OFFSET_LEFT">-1</Value> | ||
<Value name="VINE_CENTER_OFFSET_CENTER">0</Value> | ||
<Value name="VINE_CENTER_OFFSET_RIGHT">1</Value> | ||
</Values> | ||
<Texts> | ||
<Text>left</Text> | ||
<Text>center</Text> | ||
<Text>right</Text> | ||
</Texts> | ||
</Setting> | ||
<Setting classType="AIParameterSettingList" name="vineMultiTools" min="1" max="5" default="1"/> | ||
<Setting classType="AIParameterSettingList" name="vineRowsToSkip" min="0" max="1" default="0"/> | ||
</SettingSubTitle> | ||
</Settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--[[ | ||
This file is part of Courseplay (https://github.com/Courseplay/Courseplay_FS22) | ||
Copyright (C) 2021 Peter Vaiko | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Drive strategy for driving a vine field work course | ||
]]-- | ||
|
||
---@class AIDriveStrategyVineFieldWorkCourse : AIDriveStrategyFieldWorkCourse | ||
AIDriveStrategyVineFieldWorkCourse = {} | ||
local AIDriveStrategyVineFieldWorkCourse_mt = Class(AIDriveStrategyVineFieldWorkCourse, AIDriveStrategyFieldWorkCourse) | ||
|
||
function AIDriveStrategyVineFieldWorkCourse.new(customMt) | ||
if customMt == nil then | ||
customMt = AIDriveStrategyVineFieldWorkCourse_mt | ||
end | ||
local self = AIDriveStrategyFieldWorkCourse.new(customMt) | ||
|
||
return self | ||
end | ||
|
||
function AIDriveStrategyVineFieldWorkCourse:setAIVehicle(...) | ||
AIDriveStrategyVineFieldWorkCourse:superClass().setAIVehicle(self, ...) | ||
end | ||
|
||
--- Always disables turn on field. | ||
function AIDriveStrategyVineFieldWorkCourse:isTurnOnFieldActive() | ||
return false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- Makes sure the vine harvester is stop, once it's full. | ||
--- The vine harvester isn't using the combine drive strategy, as there is some bug. | ||
---@class VineCutterController : ImplementController | ||
VineCutterController = CpObject(ImplementController) | ||
|
||
function VineCutterController:init(vehicle, vineCutter) | ||
ImplementController.init(self, vehicle, vineCutter) | ||
self.vineCutterSpec = vineCutter.spec_vineCutter | ||
self.combine = AIUtil.getAllChildVehiclesWithSpecialization(vehicle, Combine)[1] | ||
self.combineSpec = self.combine.spec_combine | ||
end | ||
|
||
function VineCutterController:getIsFull() | ||
return self.combine:getFillUnitFreeCapacity(self.combineSpec.fillUnitIndex) <= 0 | ||
end | ||
|
||
function VineCutterController:update() | ||
if self:getIsFull() then | ||
self.vehicle:stopCurrentAIJob(AIMessageErrorIsFull.new()) | ||
end | ||
end | ||
|
||
--- Waits while it's full or unloading finished. | ||
function VineCutterController:getDriveData() | ||
local maxSpeed | ||
if self:getIsFull() then | ||
maxSpeed = 0 | ||
end | ||
|
||
return nil, nil, nil, maxSpeed | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.