text stringlengths 13 6.01M |
|---|
namespace _06._TruckTour
{
public class Pump
{
public Pump(int id, long petrol, long distance)
{
this.Id = id;
this.Petrol = petrol;
this.Distance = distance;
}
public int Id { get; set; }
public long Petrol { get; set; }
public long Distance { get; set; }
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class RecoverPassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Recover_Password_Button_Click(object sender, EventArgs e)
{
// Session
Session["RecoverEmail"] = Recover_Password_Email.Text;
// Redirect
Response.Redirect("RecoverPasswordQuestion.aspx");
}
} |
using UnityEngine;
namespace UnityAtoms.BaseAtoms
{
/// <summary>
/// Event Instancer of type `StringPair`. Inherits from `AtomEventInstancer<StringPair, StringPairEvent>`.
/// </summary>
[EditorIcon("atom-icon-sign-blue")]
[AddComponentMenu("Unity Atoms/Event Instancers/StringPair Event Instancer")]
public class StringPairEventInstancer : AtomEventInstancer<StringPair, StringPairEvent> { }
}
|
using gView.Framework.Data;
using gView.Framework.IO;
using System.Windows.Forms;
namespace gView.Framework.UI.Controls
{
public partial class DatasetInfoControl : UserControl
{
private IDataset _dataset;
public DatasetInfoControl()
{
InitializeComponent();
}
public IDataset Dataset
{
get
{
return _dataset;
}
set
{
_dataset = value;
MakeGui();
}
}
private void MakeGui()
{
if (_dataset != null)
{
txtName.Text = _dataset.DatasetName;
txtType.Text = _dataset.GetType().ToString();
txtGroupName.Text = _dataset.DatasetGroupName;
txtProvider.Text = _dataset.ProviderName;
txtConnectionString.Text = ConfigTextStream.SecureConfig(_dataset.ConnectionString);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace JustRipeFarm
{
public partial class LabourerDashboard : Form
{
public LabourerDashboard()
{
InitializeComponent();
}
private void logoutBtn_Click(object sender, EventArgs e)
{
// back to login screen
JRF.Logout(this);
}
}
}
|
using Puppeteer.Core.Action;
using Puppeteer.Core.Planning;
using Puppeteer.Core.WorldState;
using System.Collections.Generic;
using System.Linq;
namespace Puppeteer.Core
{
public class Planner<TKey, TValue> : IAStarPlanner<PlannerNode<TKey, TValue>>
{
public Planner()
{
m_Pathfinder = new AStar<PlannerNode<TKey, TValue>>(this);
m_NeighbourNodes = new List<PlannerNode<TKey, TValue>>();
m_UsedNodes = new List<PlannerNode<TKey, TValue>>();
int plannerNodeCacheSize = 512;
m_CachedPlannerNodes = new Stack<PlannerNode<TKey, TValue>>(plannerNodeCacheSize);
for (int i = 0; i < plannerNodeCacheSize; ++i)
{
m_CachedPlannerNodes.Push(new PlannerNode<TKey, TValue>());
}
}
public GoalPlanPair<TKey, TValue> GenerateGoalPlanPairForAgent(IAgent<TKey, TValue> _agent)
{
m_CurrentAgent = _agent;
Stack<PlannerNode<TKey, TValue>> foundPath = null;
bool newGoalBetterThanActiveGoal = false;
m_GoalPlanPair.GoalInstance = null;
m_GoalPlanPair.PlanInstance = null;
for(var goalQueue = m_CurrentAgent.CalculateSortedGoals(); goalQueue.Count > 0; )
{
SortableGoal<TKey, TValue> goal = goalQueue.Dequeue();
PlannerNode<TKey, TValue> agentNode = new PlannerNode<TKey, TValue>();
agentNode.CalculateWorldStateAtNode(_agent.GetWorkingMemory());
agentNode.CalculateGoalWorldStateAtNode(goal);
foundPath = m_Pathfinder.FindPath(agentNode, null);
if (foundPath != null && foundPath.Count > 0)
{
newGoalBetterThanActiveGoal = _agent.IsGoalBetterThanActiveGoal(goal);
if (newGoalBetterThanActiveGoal)
{
m_GoalPlanPair.GoalInstance = goal;
#if UNITY_EDITOR
_agent.CreatePlanHierarchy(foundPath.Last(), m_Pathfinder.GetOpenNodes(), m_Pathfinder.GetClosedNodes());
#endif
}
break;
}
}
m_GoalPlanPair.PlanInstance = new Plan<TKey, TValue>();
if (newGoalBetterThanActiveGoal && foundPath != null)
{
foreach (PlannerNode<TKey, TValue> pathNode in foundPath)
{
if (pathNode.Action != null)
{
m_GoalPlanPair.PlanInstance.Push(pathNode.Action);
}
}
}
m_UsedNodes.Clear();
RecycleUsedNodes();
return m_GoalPlanPair;
}
public float GetDistance(PlannerNode<TKey, TValue> _base, PlannerNode<TKey, TValue> _end)
{
/// GetNeighbours for this planner already filters out all the nodes that
/// don't get us closer to the end so we simply return the heuristic cost of the node
return _base.GetHeuristicCost();
}
public List<PlannerNode<TKey, TValue>> GetNeighbours(PlannerNode<TKey, TValue> _baseNode)
{
m_NeighbourNodes.Clear();
WorldStateModifier<TKey, TValue> basePreconditions = _baseNode.Action?.GetPreconditions();
WorldState<TKey, TValue> worldStateAtBaseNode = _baseNode.GetWorldStateAtNode();
Goal<TKey, TValue> goalWorldStateAtBaseNode = _baseNode.GetGoalWorldStateAtNode();
WorldState<TKey, TValue> remainingGoals = goalWorldStateAtBaseNode - worldStateAtBaseNode;
// We implement regressive A* for GOAP by chaining action preconditions to action effects until all preconditions are fulfilled.
// For this planner, neighbours are nodes that fulfil any of the remaining goals of the base node without conflicting with any of its preconditions.
foreach (IAction<TKey, TValue> possibleAction in m_CurrentAgent.GetActionSet())
{
var effects = possibleAction.GetEffects();
if (!effects.ContainsAny(remainingGoals))
{
continue;
}
if (effects.ConflictsAny(basePreconditions))
{
continue;
}
PlannerNode<TKey, TValue> plannerNode = GetAvailablePlannerNode();
plannerNode.Init(possibleAction);
plannerNode.CalculateWorldStateAtNode(worldStateAtBaseNode);
plannerNode.CalculateGoalWorldStateAtNode(goalWorldStateAtBaseNode);
bool foundInUsed = false;
foreach (PlannerNode<TKey, TValue> usedNode in m_UsedNodes)
{
if (usedNode.Equals(plannerNode))
{
plannerNode = usedNode;
foundInUsed = true;
break;
}
}
m_NeighbourNodes.Add(plannerNode);
if (!foundInUsed)
{
m_UsedNodes.Add(plannerNode);
}
}
return m_NeighbourNodes;
}
private PlannerNode<TKey, TValue> GetAvailablePlannerNode()
{
return m_CachedPlannerNodes.Count > 0 ? m_CachedPlannerNodes.Pop() : new PlannerNode<TKey, TValue>();
}
private void RecycleUsedNodes()
{
void RecycleNodes(IEnumerable<PlannerNode<TKey, TValue>> _nodes)
{
foreach (var node in _nodes)
{
node.Reset();
m_CachedPlannerNodes.Push(node);
}
}
RecycleNodes(m_Pathfinder.GetClosedNodes());
RecycleNodes(m_Pathfinder.GetOpenNodes());
}
private readonly List<PlannerNode<TKey, TValue>> m_NeighbourNodes;
private readonly IPathfinder<PlannerNode<TKey, TValue>> m_Pathfinder;
private readonly List<PlannerNode<TKey, TValue>> m_UsedNodes;
private readonly Stack<PlannerNode<TKey, TValue>> m_CachedPlannerNodes;
private readonly GoalPlanPair<TKey, TValue> m_GoalPlanPair = new GoalPlanPair<TKey, TValue>();
private IAgent<TKey, TValue> m_CurrentAgent;
}
} |
using System;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Rendering;
using UnityEngine;
[Serializable]
[MaterialProperty("_Color")]
public struct OverrideMaterialColorData : IComponentData
{
public float4 Value;
}
[DisallowMultipleComponent]
public class OverrideMaterialColor : MonoBehaviour
{
public Color color;
}
[WorldSystemFilter(WorldSystemFilterFlags.HybridGameObjectConversion)]
[ConverterVersion("unity", 1)]
public class OverrideMaterialColorSystem : GameObjectConversionSystem
{
protected override void OnUpdate()
{
Entities.ForEach((OverrideMaterialColor comp) =>
{
var entity = GetPrimaryEntity(comp);
var data = new OverrideMaterialColorData { Value = new float4(comp.color.r, comp.color.g, comp.color.b, comp.color.a) };
DstEntityManager.AddComponentData(entity, data);
});
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp3
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
DataTable table = new DataTable();
DataTable orderTable = new DataTable();
public DataTable f1table { get; set; }
public List<object> products3 = new List<object>(Merchandise.products); // Get list from form 1 to form 3
public float discount(int original, int percentage) {
float result = 0;
result = original - (percentage * original / 100);
return result;
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void Form3_Load(object sender, EventArgs e) {
// Add columns and rows for customer table
table.Columns.Add("ID", typeof(int)); // add column values for data table
table.Columns.Add("Name", typeof(string));
table.Columns.Add("OrderID", typeof(int));
table.Columns.Add("Date", typeof(DateTime));
table.Columns.Add("Total", typeof(int));
table.Columns.Add("AfterSaveOff", typeof(int));
DataRow dataRow = table.NewRow();
dataRow["ID"] = 1;
dataRow["Name"] = "Mark";
dataRow["OrderID"] = 215;
dataRow["Date"] = "12-10-2020 12:00:00 PM";
table.Rows.Add(dataRow);
DataRow dataRow1 = table.NewRow();
dataRow1["ID"] = 2;
dataRow1["Name"] = "Lisa";
dataRow1["OrderID"] = 216;
dataRow1["Date"] = "5-8-2020 03:00:00 PM";
table.Rows.Add(dataRow1);
DataRow dataRow2 = table.NewRow();
dataRow2["ID"] = 3;
dataRow2["Name"] = "Andy";
dataRow2["OrderID"] = 217;
dataRow2["Date"] = "1-10-2020 01:00:00 PM";
table.Rows.Add(dataRow2);
DataRow dataRow3 = table.NewRow();
dataRow3["ID"] = 4;
dataRow3["Name"] = "Hairy";
dataRow3["OrderID"] = 218;
dataRow3["Date"] = "2-2-2020 05:00:00 PM";
table.Rows.Add(dataRow3);
// Add columns and rows for order table
orderTable.Columns.Add("OrderIdCode", typeof(int));
orderTable.Columns.Add("ProductName", typeof(string));
orderTable.Columns.Add("Quantity", typeof(int));
orderTable.Columns.Add("Price", typeof(int));
DataRow orderRow1 = orderTable.NewRow();
orderRow1["OrderIdCode"] = 215;
orderRow1["ProductName"] = "CocaCola";
orderRow1["Quantity"] = 3;
orderRow1["Price"] = 2000;
orderTable.Rows.Add(orderRow1);
DataRow orderRow2 = orderTable.NewRow();
orderRow2["OrderIdCode"] = 216;
orderRow2["ProductName"] = "Pepsi";
orderRow2["Quantity"] = 5;
orderRow2["Price"] = 2500;
orderTable.Rows.Add(orderRow2);
DataRow orderRow3 = orderTable.NewRow();
orderRow3["OrderIdCode"] = 217;
orderRow3["ProductName"] = "Colgate Toothpaste";
orderRow3["Quantity"] = 5;
orderRow3["Price"] = 20000;
orderTable.Rows.Add(orderRow3);
DataRow orderRow4 = orderTable.NewRow();
orderRow4["OrderIdCode"] = 217;
orderRow4["ProductName"] = "Iphone";
orderRow4["Quantity"] = 2;
orderRow4["Price"] = 7000000;
orderTable.Rows.Add(orderRow4);
DataRow orderRow5 = orderTable.NewRow();
orderRow5["OrderIdCode"] = 218;
orderRow5["ProductName"] = "Sugar(1kg bag)";
orderRow5["Quantity"] = 2;
orderRow5["Price"] = 45000;
orderTable.Rows.Add(orderRow5);
DataRow orderRow6 = orderTable.NewRow();
orderRow6["OrderIdCode"] = 218;
orderRow6["ProductName"] = "Heinz Ketchup";
orderRow6["Quantity"] = 3;
orderRow6["Price"] = 35000;
orderTable.Rows.Add(orderRow6);
dataGridView1.DataSource = orderTable;
}
private void buttonSearch_Click(object sender, EventArgs e) {
dataGridView1.DataSource = null;
dataGridView1.DataSource = orderTable;
string str = textId.Text;
string name, orderId, date;
name = orderId = date = "";
int total = 0;
// Loop through each row in table to find the matching customerID then print out data from the corresponding row
foreach (DataRow row in table.Rows) {
if (row["ID"].ToString().Equals(str)) {
name = row["Name"].ToString();
orderId = row["OrderID"].ToString();
date = row["Date"].ToString();
textName.Text = name;
textOrderId.Text = orderId;
textDate.Text = date;
// Loop through each row in table to find the matching orderID then print them out on grid
// by hiding the unmatched rows
for (int i = 0; i < dataGridView1.Rows.Count - 1; i = i + 1) {
if (dataGridView1.Rows[i].Cells[0].Value.ToString() != orderId) {
// The "CurrencyManager" code lines fix an error, don't know how that works so don't bother asking
CurrencyManager currencyManager = (CurrencyManager)BindingContext[dataGridView1.DataSource];
currencyManager.SuspendBinding();
dataGridView1.Rows[i].Visible = false;
currencyManager.ResumeBinding();
}
}
// Loop through each row in table to calculate the total cost of order
for (int i = 0; i < dataGridView1.Rows.Count - 1; i = i + 1) {
if (dataGridView1.Rows[i].Cells[0].Value.ToString() == orderId) {
total = total + (Int32.Parse(dataGridView1.Rows[i].Cells["Price"].Value.ToString()) * Int32.Parse(dataGridView1.Rows[i].Cells["Quantity"].Value.ToString()));
}
}
textTotal.Text = total.ToString();
// Calculate total cost after discount
if (total > 1000000) { textAfterSave.Text = discount(total, 30).ToString(); }
else if (total > 500000 && total <= 1000000) { textAfterSave.Text = discount(total, 10).ToString(); }
else { textAfterSave.Text = discount(total, 0).ToString(); }
}
}
}
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) {
string product = orderTable.Rows[e.RowIndex].Field<string>(1);
int quantity = orderTable.Rows[e.RowIndex].Field<int>(2);
int productPrice = 0;
int totalPrice;
for (int i = 0; i < f1table.Rows.Count; i = i + 1) {
if (f1table.Rows[i].Field<string>(1).ToString() == product) {
productPrice = f1table.Rows[i].Field<int>(3);
break;
}
}
totalPrice = quantity * productPrice;
orderTable.Rows[e.RowIndex][3] = totalPrice;
}
private void billToolStripMenuItem_Click(object sender, EventArgs e) {
}
private void inputMerchandiseToolStripMenuItem_Click(object sender, EventArgs e) {
this.Close();
}
private void checkQuantityToolStripMenuItem_Click(object sender, EventArgs e) {
Form2 checkQuantity = new Form2();
checkQuantity.table = table;
checkQuantity.Show();
}
}
}
|
using System;
using System.Windows.Forms;
namespace gView.Framework.Carto.Rendering.UI
{
internal partial class PropertyForm_ValueMapRenderer_Dialog_InsertValue : Form
{
public PropertyForm_ValueMapRenderer_Dialog_InsertValue()
{
InitializeComponent();
}
private void txtKey_TextChanged(object sender, EventArgs e)
{
btnOK.Enabled = (txtKey.Text.Length > 0);
}
public string Key
{
get { return txtKey.Text; }
}
public string Label
{
get { return txtLabel.Text; }
}
}
} |
namespace PizzaMore.Controllers
{
using System.Linq;
using AutoMapper;
using BindingModels;
using Security;
using Data;
using Models;
using Services;
using SimpleHttpServer.Models;
using SimpleMVC.Attributes.Methods;
using SimpleMVC.Controllers;
using SimpleMVC.Interfaces;
using SimpleMVC.Interfaces.Generic;
using ViewModels;
public class MenuController : Controller
{
private readonly SignInManager signInManager;
public MenuController()
{
this.signInManager = new SignInManager(Data.Context);
}
[HttpGet]
public IActionResult<PizzaSugestionViewModel> Index(HttpSession session)
{
if (!this.signInManager.IsAuthenticated(session))
{
this.Redirect(new HttpResponse(), "/home/index");
}
var menuServices= new MenuServices();
var model = menuServices.GetModel(session);
return this.View(model);
}
[HttpGet]
public IActionResult Add(HttpSession session)
{
if (!this.signInManager.IsAuthenticated(session))
{
return this.View("Users", "SignIn");
}
return this.View();
}
[HttpPost]
public IActionResult Add(AddPizzaBindingModel model, HttpSession session)
{
if (!this.signInManager.IsAuthenticated(session))
{
return this.View("User", "SignIn");
}
using (var context = Data.Context)
{
this.ConfigureMapper(session, context);
Pizza pizzaEntity = Mapper.Map<Pizza>(model);
context.Pizzas.Add(pizzaEntity);
context.SaveChanges();
}
return this.View("Menu", "Index");
}
public void ConfigureMapper(HttpSession session, PizzaStoreContext context)
{
Mapper.Initialize(expression => expression.CreateMap<AddPizzaBindingModel, Pizza>()
.ForMember(p => p.Owner, confg => confg.MapFrom(
u => context.Sessions.First(s => s.SessionId == session.Id
))));
}
}
} |
using System;
using NUnit.Framework;
namespace SharpMap.Tests
{
[TestFixture]
public class TestWmsCapabilityParser
{
[Test]
[Ignore("Reguires internet")]
public void Test130()
{
SharpMap.Web.Wms.Client c = new SharpMap.Web.Wms.Client("http://wms.iter.dk/example_capabilities_1_3_0.xml");
Assert.AreEqual(3, c.ServiceDescription.Keywords.Length);
Assert.AreEqual("1.3.0", c.WmsVersion);
Assert.AreEqual("http://hostname/path?", c.GetMapRequests[0].OnlineResource);
Assert.AreEqual("image/gif", c.GetMapOutputFormats[0]);
Assert.AreEqual(4, c.Layer.ChildLayers.Length);
}
[Test]
[Ignore("Reguires internet")]
public void TestDemisv111()
{
SharpMap.Web.Wms.Client c = new SharpMap.Web.Wms.Client("http://www2.demis.nl/mapserver/request.asp");
Assert.AreEqual("Demis World Map", c.ServiceDescription.Title);
Assert.AreEqual("1.1.1", c.WmsVersion);
Assert.AreEqual("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&", c.GetMapRequests[0].OnlineResource);
Assert.AreEqual("image/png", c.GetMapOutputFormats[0]);
Assert.AreEqual(20, c.Layer.ChildLayers.Length);
}
[Test]
[Ignore("Reguires internet")]
public void AddLayerOK()
{
SharpMap.Layers.WmsLayer layer = new SharpMap.Layers.WmsLayer("wms", "http://wms.iter.dk/example_capabilities_1_3_0.xml");
layer.AddLayer("ROADS_1M");
}
[Test]
[ExpectedException(typeof(ArgumentException))]
[Ignore("Reguires internet")]
public void AddLayerFail()
{
SharpMap.Layers.WmsLayer layer = new SharpMap.Layers.WmsLayer("wms", "http://wms.iter.dk/example_capabilities_1_3_0.xml");
layer.AddLayer("NonExistingLayer");
}
}
} |
using System;
using System.Collections.Generic;
using System.Threading;
using TrainEngine;
namespace TrainConsole
{
class Program
{
static void Main(string[] args)
{
var klockan = new Clock();
klockan.Start();
List<Passenger> svejs = EngineOrms.ParsePassengers();
foreach(var hej in svejs)
{
Console.WriteLine(hej.FullName);
Thread.Sleep(100);
}
klockan.Stop();
Console.WriteLine("hejsan svensjan");
Console.ReadLine();
}
}
} |
namespace EventFeed.Consumer.Models
{
public class HomeModel
{
public int ClickCount { get; set; }
}
}
|
using System;
using ServiceStack;
namespace Infrastructure.Commands
{
public interface ICommand : IReturn<CommandResult>
{
Guid CommandId { get; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DSSAHP
{
public class SingleChoiceSystemRelations : DSSLib.NotifyObj, IAdviceSystem
{
public override string ToString() => "Система рейтинга критериев";
private Problem Problem { get; set; }
public CriteriaChoice[] Criterias { get; set; }
public CriteriaChoice Selected
{
get => selected;
set
{
selected = value;
OnPropertyChanged();
}
}
private CriteriaChoice selected;
public void SetProblem(Problem problem)
{
if(problem != Problem)
{
Problem = problem;
Criterias = Problem.AllCriterias.Where(cr => cr.Inner.Count > 0).Select(cr => new CriteriaChoice(cr)).ToArray();
}
}
public void ClearProblem()
{
SetProblem(new Problem());
}
}
public class CriteriaChoice
{
public override string ToString() => Node.ToString();
//Методика 1:
//Распределяем внутренние критерии по рейтингу от лучшего к худшему
//Спрашиваем про разницу между соседями
//Методика 2:
//Спрашиваем худший - лучший - средний
//Спрашиваем про разницу между соседями
public Node Node { get; set; }
public NodeRating[] NodeRatings { get; set; }
public CriteriaChoice(Node node)
{
Node = node;
NodeRatings = node.Inner.Select(cr => new NodeRating(cr,1)).ToArray();
for (int i = 0; i < NodeRatings.Length; i++)
{
NodeRatings[i].Rating = 1;
NodeRatings[i].RatingChanged += CriteriaChoice_RatingChanged;
}
}
private void CriteriaChoice_RatingChanged(NodeRating obj)
{
double min = NodeRatings.Select(n => n.Rating).Min();
Dictionary<Node, double> newRates = new Dictionary<Node, double>();
foreach (var item in NodeRatings)
{
newRates.Add(item.Node, min / item.Rating);
}
for (int i = 0; i < NodeRatings.Length; i++)
{
for (int a = i + 1; a < NodeRatings.Length; a++)
{
NodeRating first = NodeRatings[i];
NodeRating sec = NodeRatings[a];
Node.SetRelationBetween(Node, NodeRatings[i].Node, NodeRatings[a].Node, newRates[sec.Node] / newRates[first.Node]);
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using CustomXamarinControls;
using CustomXamarinControls.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(PageViewContainer), typeof(PageViewContainerRenderer))]
namespace CustomXamarinControls.Droid
{
public class PageViewContainerRenderer : ViewRenderer<PageViewContainer, Android.Views.View>
{
public PageViewContainerRenderer(Context context) : base(context)
{
}
Page _currentPage;
protected override void OnElementChanged(ElementChangedEventArgs<PageViewContainer> e)
{
base.OnElementChanged(e);
var pageViewContainer = e.NewElement as PageViewContainer;
if (e.NewElement != null)
{
ChangePage(e.NewElement.Content);
}
else
{
ChangePage(null);
}
}
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == "Content")
{
ChangePage(Element.Content);
}
}
bool _contentNeedsLayout;
protected override void OnLayout(bool changed, int l, int t, int r, int b)
{
base.OnLayout(changed, l, t, r, b);
if ((changed || _contentNeedsLayout) && this.Control != null)
{
if (_currentPage != null)
{
_currentPage.Layout(new Rectangle(0, 0, Element.Width, Element.Height));
}
var msw = MeasureSpec.MakeMeasureSpec(r - l, MeasureSpecMode.Exactly);
var msh = MeasureSpec.MakeMeasureSpec(b - t, MeasureSpecMode.Exactly);
this.Control.Measure(msw, msh);
this.Control.Layout(0, 0, r, b);
_contentNeedsLayout = false;
}
}
private int ConvertPixelsToDp(float pixelValue)
{
var dp = (int)((pixelValue) / Resources.DisplayMetrics.Density);
return dp;
}
void ChangePage(Page page)
{
//TODO handle current page
if (page != null)
{
var parentPage = Element.GetParentPage();
page.Parent = parentPage;
var existingRenderer = page.GetRenderer();
if (existingRenderer == null)
{
var renderer = RendererFactory.GetRenderer(page);
page.SetRenderer(renderer);
existingRenderer = page.GetRenderer();
}
_contentNeedsLayout = true;
SetNativeControl(existingRenderer.View);
Invalidate();
//TODO update the page
_currentPage = page;
}
else
{
//TODO - update the page
_currentPage = null;
}
if (_currentPage == null)
{
//have to set somethign for android not to get pissy
var view = new Android.Views.View(this.Context);
view.SetBackgroundColor(Element.BackgroundColor.ToAndroid());
SetNativeControl(view);
}
}
}
public static class ViewExtensions
{
private static readonly Type _platformType = Type.GetType("Xamarin.Forms.Platform.Android.Platform, Xamarin.Forms.Platform.Android", true);
private static BindableProperty _rendererProperty;
public static BindableProperty RendererProperty
{
get
{
_rendererProperty = (BindableProperty)_platformType.GetField("RendererProperty", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)
.GetValue(null);
return _rendererProperty;
}
}
public static IVisualElementRenderer GetRenderer(this BindableObject bindableObject)
{
var value = bindableObject.GetValue(RendererProperty);
return (IVisualElementRenderer)bindableObject.GetValue(RendererProperty);
}
public static Android.Views.View GetNativeView(this BindableObject bindableObject)
{
var renderer = bindableObject.GetRenderer();
var viewGroup = renderer.View;
return viewGroup;
}
public static void SetRenderer(this BindableObject bindableObject, IVisualElementRenderer renderer)
{
// var value = bindableObject.GetValue (RendererProperty);
bindableObject.SetValue(RendererProperty, renderer);
}
public static Point GetNativeScreenPosition(this BindableObject bindableObject)
{
var view = bindableObject.GetNativeView();
var point = Point.Zero;
if (view != null)
{
int[] location = new int[2];
view.GetLocationOnScreen(location);
point = new Xamarin.Forms.Point(location[0], location[1]);
}
return point;
}
/// <summary>
/// Gets the or create renderer.
/// </summary>
/// <returns>The or create renderer.</returns>
/// <param name="source">Source.</param>
public static IVisualElementRenderer GetOrCreateRenderer(this VisualElement source)
{
var renderer = source.GetRenderer();
if (renderer == null)
{
renderer = RendererFactory.GetRenderer(source);
source.SetRenderer(renderer);
renderer = source.GetRenderer();
}
return renderer;
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
/// <summary>
/// Descripción breve de Conexion
/// </summary>
public class Conexion
{
SqlConnection conexion;
SqlCommand comando;
SqlCommand comandoSP;
SqlDataReader leer;
SqlDataAdapter adaptador;
string conn;
String sConexionSOP = "DB_SOPConnectionString";///ID 1
String sConexionNADsi = "DB_NADsiConnectionString";/// ID 2
////Constructor para conexión por default para SOP
public Conexion(){
this.conn = sConexionSOP;
}
/// <summary>
/// Constructor para conexiones adicionales
/// </summary>
/// <param name="iTipoConexion"></param>
public Conexion(int iTipoConexion)
{
switch (iTipoConexion) {
case 2: //Tipo 2 es NAD SI
this.conn = sConexionNADsi;
break;
default: ///si se pone alguna incorrecta se toma Conexion SOP
this.conn = sConexionSOP;
break;
}
}
//Metodo para abrir la conexion
public string abrirConexion()
{
conexion = new SqlConnection(ConfigurationManager.ConnectionStrings[conn].ConnectionString);
try{
conexion.Open();
return "1"; //Exito en la conexion
}catch (Exception ex){
Console.Write(ex.Message);
return "Error al abrir la BD: "+ex.Message; //Error en la conexion
}
}
//Metodo para cerrar la conexion
public string cerrarConexion()
{
try
{
conexion.Close();
conexion.Dispose();
return "1";//Exito
}
catch (Exception ex)
{
return "Error al cerrar Conexion: " + ex.Message;
}
}
//Metodo para ejecutar sentencia
public string ejecutarComando(string query)
{
string res = abrirConexion();
string msj;
if (res == "1")
{
comando = new SqlCommand(query, conexion);
try
{
comando.ExecuteNonQuery();
msj = "1"; //Exito al ejecutar comando
}
catch (Exception ex)
{
msj = "Error al ejecutar comando: " + ex.Message; //Error
}
finally {
cerrarConexion();
}
}
else {
msj= "Error al abrir la BD y ejecutar comando: " + res; //Error al abrir la conexion
}
return msj;
}
//Metodo para ejecutar consulta y regresar un solo registro
public string[] ejecutarConsultaRegistroSimple(string query)
{
string[] res=new string[2];
string resCon;
resCon = abrirConexion();
string msj;
if (resCon == "1")
{
comando = new SqlCommand(query, conexion);
try
{
leer = comando.ExecuteReader();
if (leer.HasRows)
{
while (leer.Read())
{
res[1] = leer.GetValue(0).ToString();
}
}
else {
res[1] = "";
}
//comando.ExecuteNonQuery();
msj = "1"; //Exito al ejecutar comando
}
catch (Exception ex)
{
msj = "Error al ejecutar comando: " + ex.Message; //Error
res[1] = "";
}
finally {
cerrarConexion();
}
}
else
{
msj = "Error al abrir la BD y ejecutar la consulta registro: " + res; //Error al abrir la conexion
res[1] = "";
}
res[0] = msj;
return res;
}
//Metodo para ejecutar consulta y regresa multiples registros
public List<string> ejecutarConsultaRegistroMultiples(string query)
{
List<string> res = new List<string>();
res.Add("");
string resCon;
resCon = abrirConexion();
string msj;
if (resCon == "1")
{
comando = new SqlCommand(query, conexion);
try
{
leer = comando.ExecuteReader();
if (leer.HasRows)
{
while (leer.Read())
{
for (int i = 0; i < leer.FieldCount;i++ )
{
res.Add(leer.GetValue(i).ToString());
}
}
}
//comando.ExecuteNonQuery();
msj = "1"; //Exito al ejecutar comando
}
catch (Exception ex)
{
msj = "Error al ejecutar comando: " + ex.Message; //Error
}
finally
{
cerrarConexion();
}
}
else
{
msj = "Error al abrir la BD y ejecutar la consulta registro: " + res; //Error al abrir la conexion
}
res[0] = msj;
return res;
}
//Metodo para ejecutar consulta sin abrir Conexion
public List<string> ejecutarConsultaRegistroMultiples_sin_conexion(string query)
{
List<string> res = new List<string>();
res.Add("1");
comando = new SqlCommand(query, conexion);
leer = comando.ExecuteReader();
if (leer.HasRows){
while (leer.Read())
{
for (int i = 0; i < leer.FieldCount; i++)
{
res.Add(leer.GetValue(i).ToString());
}
}
}
leer.Close();
return res;
}
//Metodo para ejecutar consulta y regresa multiples registros en un DataTable
public DataTable ejecutarConsultaRegistroMultiplesData(string query)
{
DataTable res = new DataTable();
try
{
abrirConexion();
comando = new SqlCommand(query, conexion);
adaptador = new SqlDataAdapter(comando);
adaptador.Fill(res);
}finally
{
cerrarConexion();
}
return res;
}
//Metodo para ejecutar consulta y retornar multiples registros en un DataSet
public DataSet ejecutarConsultaRegistroMultiplesDataSet(string query,string nombre)
{
DataSet res = new DataSet();
try
{
abrirConexion();
comando = new SqlCommand(query,conexion);
adaptador = new SqlDataAdapter(comando);
adaptador.Fill(res,nombre);
}
finally {
cerrarConexion();
}
return res;
}
//MEtodo para ejecutar precedimiento almacenado y retornar multiples registrs en un DataTable
public DataTable ejecutarProcRegistroMultiplesData()
{
DataTable res = new DataTable();
try
{
adaptador = new SqlDataAdapter(comandoSP);
adaptador.Fill(res);
}
finally
{
cerrarConexion();
}
return res;
}
/**********************************************************************************************
Metodos para llamar procedimientos almacenados
**********************************************************************************************/
//Metodo para inicializar un procedimiento almacenado
public string generarSP(string nombreSP,int timeout)
{
string msj;
string con = abrirConexion();
if (con == "1")
{
try
{
comandoSP = new SqlCommand(nombreSP, conexion);
if (timeout > 0)
{
comandoSP.CommandTimeout = timeout;
}
comandoSP.CommandType = CommandType.StoredProcedure;
msj = "1";
}
catch (Exception ex)
{
msj = "Erro generar SP: " + ex.Message;
}
}
else {
msj = "Error con proc_ :"+con;
}
return msj;
}
//Metodo para agregar parametros al SP
public void agregarParametroSP(string variableProc,SqlDbType tipoSql,string valor)
{
comandoSP.Parameters.Add(variableProc, tipoSql).Value = valor;
}
//Metodo para ejecutar el procedimento almacenado
public string ejecutarProc()
{
string msj;
try{
comandoSP.ExecuteNonQuery();
msj = "1";
}catch(Exception ex){
msj = ex.Message;
}finally {
cerrarConexion();
}
return msj;
}
//Metodo para ejecutar el procedimiento almacenado con valor OUTPUT
public string[] ejecutarProcOUTPUT_INT(string valor)
{
string[] resultado=new string[2];
try
{
comandoSP.Parameters.Add(valor, SqlDbType.VarChar, 100);
comandoSP.Parameters[valor].Direction = ParameterDirection.Output;
comandoSP.ExecuteNonQuery();
resultado[0] = "1";
resultado[1] = comandoSP.Parameters[valor].Value.ToString();
}
catch (Exception ex)
{
resultado[0] = ex.Message;
}
finally {
cerrarConexion();
}
return resultado;
}
//Metodo para ejecutrar el procedimiento almacenado con valor STRING
public string[] ejecutarProcOUTPUT_STRING(string valor)
{
string[] resultado = new string[2];
try
{
comandoSP.Parameters.Add(valor,SqlDbType.VarChar,-1);
comandoSP.Parameters[valor].Direction = ParameterDirection.Output;
comandoSP.ExecuteNonQuery();
resultado[0] = "1";
resultado[1] = comandoSP.Parameters[valor].Value.ToString();
}
catch (Exception ex)
{
resultado[0] = ex.Message;
}
finally {
cerrarConexion();
}
return resultado;
}
//Método para ejecutar procedimiento con parametro de retorno
public string ejecutarProReturnValue()
{
string msj;
try
{
//comandoSP.Parameters.Add("@errSql", SqlDbType.TinyInt).Direction = ParameterDirection.ReturnValue;
comandoSP.Parameters.Add(new SqlParameter("@errSql", SqlDbType.TinyInt)).Direction = ParameterDirection.ReturnValue;
comandoSP.ExecuteNonQuery();
msj = Convert.ToString(comandoSP.Parameters["@errSql"].Value);
}
catch
{
msj = "20";
}
finally
{
cerrarConexion();
}
return msj;
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
private SqlConnection con;
private SqlDataReader reader;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ButtonRegistriraj_Click(object sender, EventArgs e)
{
string imeRacunalnika = "localhost";
string imeRazlicice = "SQLEXPRESS";
string imeBaze = "KRVODAJALSKA_AKCIJA";
string ukaz = "INSERT INTO admini(uporabnisko_ime, kriptirano_geslo) VALUES('" + TextBoxUser.Text + "', '" + FormsAuthentication.HashPasswordForStoringInConfigFile(TextBoxPass.Text, "SHA1") + "')";
String connectionString = "data source=" + imeRacunalnika + "\\" + imeRazlicice +
"; database=" + imeBaze + "; integrated security=SSPI";
con = new SqlConnection(connectionString);
con.Open();
try
{
SqlCommand cmd = new SqlCommand(ukaz, con);
cmd.ExecuteNonQuery();
TextBoxUser.Text = TextBoxPass.Text = "";
}
catch
{
}
finally
{
con.Close();
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BusinessLayer
{
public class UserWorkplanObject
{
public int person_id;
public int project_id;
public int user_workplan_id;
public string created_by;
public string action;
}
}
|
using Entities.Common;
using System.ComponentModel.DataAnnotations;
namespace Entities
{
public class Role : BaseEntity
{
[StringLength(100)]
[Required]
public string? Name { get; set; }=String.Empty;
[StringLength(100)]
[Required]
public string? Description { get; set; }
}
} |
using Alabo.Domains.Query.Dto;
using System.ComponentModel.DataAnnotations;
namespace Alabo.Data.People.Users.Dtos
{
/// <summary>
/// 用户操作类型
/// </summary>
public class UserActionInput : ApiInputDto
{
/// <summary>
/// 操作类型
/// </summary>
[Required(ErrorMessage = "操作类型必须输入")]
public string Type { get; set; }
}
} |
using UnityEngine;
using System.Collections;
public class VoteButtonSwitcher : MonoBehaviour {
//データセンター
DataCenter dataCenter;
//ゲームコントローラー
ClientController cc;
//マイプレイヤー
Player myPlayer;
//ボタン
GameObject backButton;
GameObject rightButton;
GameObject frontButton;
GameObject leftButton;
// Use this for initialization
void Start () {
//データセンターの取得
dataCenter = GameObject.Find ("DataCenter").GetComponent<DataCenter> ();
//ボタンの取得
backButton = GameObject.Find ("BackButton");
rightButton = GameObject.Find ("RightButton");
frontButton = GameObject.Find ("FrontButton");
leftButton = GameObject.Find ("LeftButton");
//ゲームコントローラの取得
cc = GameObject.Find("ClientController").GetComponent<ClientController>();
myPlayer = cc.myPlayerScript;
}
// Update is called once per frame
void Update () {
if (myPlayer.canVote == false && myPlayer.nextTurn == true) {
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
return;
}
switch (dataCenter.roomPatternFlag) {
case 0:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 1:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 2:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 3:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 4:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 5:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 6:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 7:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 8:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 9:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 10:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
case 11:
backButton.GetComponent<SpriteRenderer>().enabled = true;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 12:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = true;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 13:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = true;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
case 14:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = true;
break;
default:
backButton.GetComponent<SpriteRenderer>().enabled = false;
rightButton.GetComponent<SpriteRenderer>().enabled = false;
frontButton.GetComponent<SpriteRenderer>().enabled = false;
leftButton.GetComponent<SpriteRenderer>().enabled = false;
break;
}
}
}
|
using UsersLib.Service.Checkers.Results;
namespace UsersLib.Service.Checkers
{
public interface IUserChecker
{
IUserCheckerResult Check( string userLogin, string userPass, string serverIdentify );
}
} |
namespace Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class SaleDelivery : DbMigration
{
public override void Up()
{
DropIndex("Web.StockAdjs", "IX_Stock_DocID");
CreateTable(
"Web.SaleDeliveryHeaders",
c => new
{
SaleDeliveryHeaderId = c.Int(nullable: false, identity: true),
DocTypeId = c.Int(nullable: false),
DocDate = c.DateTime(nullable: false),
DocNo = c.String(nullable: false, maxLength: 20),
DivisionId = c.Int(nullable: false),
SiteId = c.Int(nullable: false),
SaleToBuyerId = c.Int(nullable: false),
DeliverToPerson = c.String(maxLength: 100),
DeliverToPersonReference = c.String(maxLength: 20),
ShipToPartyAddress = c.String(maxLength: 250),
GatePassHeaderId = c.Int(),
Remark = c.String(),
Status = c.Int(nullable: false),
ReviewCount = c.Int(),
ReviewBy = c.String(),
CreatedBy = c.String(),
ModifiedBy = c.String(),
CreatedDate = c.DateTime(nullable: false),
ModifiedDate = c.DateTime(nullable: false),
OMSId = c.String(maxLength: 50),
})
.PrimaryKey(t => t.SaleDeliveryHeaderId)
.ForeignKey("Web.Divisions", t => t.DivisionId)
.ForeignKey("Web.DocumentTypes", t => t.DocTypeId)
.ForeignKey("Web.GatePassHeaders", t => t.GatePassHeaderId)
.ForeignKey("Web.People", t => t.SaleToBuyerId)
.ForeignKey("Web.Sites", t => t.SiteId)
.Index(t => new { t.DocTypeId, t.DocNo, t.DivisionId, t.SiteId }, unique: true, name: "IX_SaleDeliveryHeader_DocID")
.Index(t => t.SaleToBuyerId)
.Index(t => t.GatePassHeaderId);
CreateTable(
"Web.SaleDeliveryLines",
c => new
{
SaleDeliveryLineId = c.Int(nullable: false, identity: true),
SaleDeliveryHeaderId = c.Int(nullable: false),
SaleInvoiceLineId = c.Int(nullable: false),
Qty = c.Decimal(nullable: false, precision: 18, scale: 4),
DealUnitId = c.String(nullable: false, maxLength: 3),
UnitConversionMultiplier = c.Decimal(nullable: false, precision: 18, scale: 4),
DealQty = c.Decimal(nullable: false, precision: 18, scale: 4),
Remark = c.String(),
CreatedBy = c.String(),
ModifiedBy = c.String(),
CreatedDate = c.DateTime(nullable: false),
ModifiedDate = c.DateTime(nullable: false),
OMSId = c.String(maxLength: 50),
LockReason = c.String(),
})
.PrimaryKey(t => t.SaleDeliveryLineId)
.ForeignKey("Web.Units", t => t.DealUnitId)
.ForeignKey("Web.SaleDeliveryHeaders", t => t.SaleDeliveryHeaderId)
.ForeignKey("Web.SaleInvoiceLines", t => t.SaleInvoiceLineId)
.Index(t => t.SaleDeliveryHeaderId)
.Index(t => t.SaleInvoiceLineId)
.Index(t => t.DealUnitId);
CreateTable(
"Web.SaleDeliverySettings",
c => new
{
SaleDeliverySettingId = c.Int(nullable: false, identity: true),
DocTypeId = c.Int(nullable: false),
SiteId = c.Int(nullable: false),
DivisionId = c.Int(nullable: false),
isVisibleDimension1 = c.Boolean(),
isVisibleDimension2 = c.Boolean(),
isVisibleDimension3 = c.Boolean(),
isVisibleDimension4 = c.Boolean(),
filterLedgerAccountGroups = c.String(),
filterLedgerAccounts = c.String(),
filterProductTypes = c.String(),
filterProductGroups = c.String(),
filterProducts = c.String(),
filterContraDocTypes = c.String(),
filterContraSites = c.String(),
filterContraDivisions = c.String(),
filterPersonRoles = c.String(),
SqlProcDocumentPrint = c.String(maxLength: 100),
SqlProcDocumentPrint_AfterSubmit = c.String(maxLength: 100),
SqlProcDocumentPrint_AfterApprove = c.String(maxLength: 100),
SqlProcGatePass = c.String(maxLength: 100),
UnitConversionForId = c.Byte(),
ImportMenuId = c.Int(),
ExportMenuId = c.Int(),
isVisibleDealUnit = c.Boolean(),
isVisibleProductUid = c.Boolean(),
ProcessId = c.Int(),
CreatedBy = c.String(),
ModifiedBy = c.String(),
CreatedDate = c.DateTime(nullable: false),
ModifiedDate = c.DateTime(nullable: false),
})
.PrimaryKey(t => t.SaleDeliverySettingId)
.ForeignKey("Web.Divisions", t => t.DivisionId)
.ForeignKey("Web.DocumentTypes", t => t.DocTypeId)
.ForeignKey("Web.Menus", t => t.ExportMenuId)
.ForeignKey("Web.Menus", t => t.ImportMenuId)
.ForeignKey("Web.Processes", t => t.ProcessId)
.ForeignKey("Web.Sites", t => t.SiteId)
.ForeignKey("Web.UnitConversionFors", t => t.UnitConversionForId)
.Index(t => t.DocTypeId)
.Index(t => t.SiteId)
.Index(t => t.DivisionId)
.Index(t => t.UnitConversionForId)
.Index(t => t.ImportMenuId)
.Index(t => t.ExportMenuId)
.Index(t => t.ProcessId);
CreateTable(
"Web.ViewSaleInvoiceBalanceForDelivery",
c => new
{
SaleInvoiceLineId = c.Int(nullable: false, identity: true),
BalanceQty = c.Decimal(nullable: false, precision: 18, scale: 4),
Rate = c.Decimal(nullable: false, precision: 18, scale: 4),
BalanceAmount = c.Decimal(nullable: false, precision: 18, scale: 4),
SaleInvoiceHeaderId = c.Int(nullable: false),
Dimension1Id = c.Int(),
Dimension2Id = c.Int(),
SiteId = c.Int(nullable: false),
DivisionId = c.Int(nullable: false),
SaleInvoiceNo = c.String(),
ProductId = c.Int(nullable: false),
BuyerId = c.Int(nullable: false),
OrderDate = c.DateTime(nullable: false),
})
.PrimaryKey(t => t.SaleInvoiceLineId)
.ForeignKey("Web.Dimension1", t => t.Dimension1Id)
.ForeignKey("Web.Dimension2", t => t.Dimension2Id)
.ForeignKey("Web.Products", t => t.ProductId)
.Index(t => t.Dimension1Id)
.Index(t => t.Dimension2Id)
.Index(t => t.ProductId);
AddColumn("Web.LedgerHeaders", "DrCr", c => c.String(maxLength: 2));
AddColumn("Web.StockLines", "Dimension3Id", c => c.Int());
AddColumn("Web.StockLines", "Dimension4Id", c => c.Int());
AddColumn("Web.RequisitionLines", "Dimension3Id", c => c.Int());
AddColumn("Web.RequisitionLines", "Dimension4Id", c => c.Int());
AddColumn("Web.DocumentTypeSettings", "ReferenceDocTypeCaption", c => c.String(maxLength: 50));
AddColumn("Web.DocumentTypeSettings", "ReferenceDocIdCaption", c => c.String(maxLength: 50));
AddColumn("Web.ExcessMaterialLines", "Dimension3Id", c => c.Int());
AddColumn("Web.ExcessMaterialLines", "Dimension4Id", c => c.Int());
AddColumn("Web.LedgerSettings", "isVisibleDrCr", c => c.Boolean());
AddColumn("Web.LedgerSettings", "isVisibleReferenceDocId", c => c.Boolean());
AddColumn("Web.LedgerSettings", "isVisibleReferenceDocTypeId", c => c.Boolean());
AddColumn("Web.LedgerSettings", "filterReferenceDocTypes", c => c.String());
AddColumn("Web.StockHeaderSettings", "isMandatoryProductUID", c => c.Boolean());
AddColumn("Web.ViewStockInBalance", "Dimension3Id", c => c.Int());
AddColumn("Web.ViewStockInBalance", "Dimension4Id", c => c.Int());
AlterColumn("Web.Sites", "Address", c => c.String());
CreateIndex("Web.StockLines", "Dimension3Id");
CreateIndex("Web.StockLines", "Dimension4Id");
CreateIndex("Web.RequisitionLines", "Dimension3Id");
CreateIndex("Web.RequisitionLines", "Dimension4Id");
CreateIndex("Web.ExcessMaterialLines", "Dimension3Id");
CreateIndex("Web.ExcessMaterialLines", "Dimension4Id");
CreateIndex("Web.StockAdjs", "DivisionId");
CreateIndex("Web.StockAdjs", "SiteId");
AddForeignKey("Web.StockLines", "Dimension3Id", "Web.Dimension3", "Dimension3Id");
AddForeignKey("Web.StockLines", "Dimension4Id", "Web.Dimension4", "Dimension4Id");
AddForeignKey("Web.RequisitionLines", "Dimension3Id", "Web.Dimension3", "Dimension3Id");
AddForeignKey("Web.RequisitionLines", "Dimension4Id", "Web.Dimension4", "Dimension4Id");
AddForeignKey("Web.ExcessMaterialLines", "Dimension3Id", "Web.Dimension3", "Dimension3Id");
AddForeignKey("Web.ExcessMaterialLines", "Dimension4Id", "Web.Dimension4", "Dimension4Id");
}
public override void Down()
{
DropForeignKey("Web.ViewSaleInvoiceBalanceForDelivery", "ProductId", "Web.Products");
DropForeignKey("Web.ViewSaleInvoiceBalanceForDelivery", "Dimension2Id", "Web.Dimension2");
DropForeignKey("Web.ViewSaleInvoiceBalanceForDelivery", "Dimension1Id", "Web.Dimension1");
DropForeignKey("Web.SaleDeliverySettings", "UnitConversionForId", "Web.UnitConversionFors");
DropForeignKey("Web.SaleDeliverySettings", "SiteId", "Web.Sites");
DropForeignKey("Web.SaleDeliverySettings", "ProcessId", "Web.Processes");
DropForeignKey("Web.SaleDeliverySettings", "ImportMenuId", "Web.Menus");
DropForeignKey("Web.SaleDeliverySettings", "ExportMenuId", "Web.Menus");
DropForeignKey("Web.SaleDeliverySettings", "DocTypeId", "Web.DocumentTypes");
DropForeignKey("Web.SaleDeliverySettings", "DivisionId", "Web.Divisions");
DropForeignKey("Web.SaleDeliveryLines", "SaleInvoiceLineId", "Web.SaleInvoiceLines");
DropForeignKey("Web.SaleDeliveryLines", "SaleDeliveryHeaderId", "Web.SaleDeliveryHeaders");
DropForeignKey("Web.SaleDeliveryLines", "DealUnitId", "Web.Units");
DropForeignKey("Web.SaleDeliveryHeaders", "SiteId", "Web.Sites");
DropForeignKey("Web.SaleDeliveryHeaders", "SaleToBuyerId", "Web.People");
DropForeignKey("Web.SaleDeliveryHeaders", "GatePassHeaderId", "Web.GatePassHeaders");
DropForeignKey("Web.SaleDeliveryHeaders", "DocTypeId", "Web.DocumentTypes");
DropForeignKey("Web.SaleDeliveryHeaders", "DivisionId", "Web.Divisions");
DropForeignKey("Web.ExcessMaterialLines", "Dimension4Id", "Web.Dimension4");
DropForeignKey("Web.ExcessMaterialLines", "Dimension3Id", "Web.Dimension3");
DropForeignKey("Web.RequisitionLines", "Dimension4Id", "Web.Dimension4");
DropForeignKey("Web.RequisitionLines", "Dimension3Id", "Web.Dimension3");
DropForeignKey("Web.StockLines", "Dimension4Id", "Web.Dimension4");
DropForeignKey("Web.StockLines", "Dimension3Id", "Web.Dimension3");
DropIndex("Web.ViewSaleInvoiceBalanceForDelivery", new[] { "ProductId" });
DropIndex("Web.ViewSaleInvoiceBalanceForDelivery", new[] { "Dimension2Id" });
DropIndex("Web.ViewSaleInvoiceBalanceForDelivery", new[] { "Dimension1Id" });
DropIndex("Web.StockAdjs", new[] { "SiteId" });
DropIndex("Web.StockAdjs", new[] { "DivisionId" });
DropIndex("Web.SaleDeliverySettings", new[] { "ProcessId" });
DropIndex("Web.SaleDeliverySettings", new[] { "ExportMenuId" });
DropIndex("Web.SaleDeliverySettings", new[] { "ImportMenuId" });
DropIndex("Web.SaleDeliverySettings", new[] { "UnitConversionForId" });
DropIndex("Web.SaleDeliverySettings", new[] { "DivisionId" });
DropIndex("Web.SaleDeliverySettings", new[] { "SiteId" });
DropIndex("Web.SaleDeliverySettings", new[] { "DocTypeId" });
DropIndex("Web.SaleDeliveryLines", new[] { "DealUnitId" });
DropIndex("Web.SaleDeliveryLines", new[] { "SaleInvoiceLineId" });
DropIndex("Web.SaleDeliveryLines", new[] { "SaleDeliveryHeaderId" });
DropIndex("Web.SaleDeliveryHeaders", new[] { "GatePassHeaderId" });
DropIndex("Web.SaleDeliveryHeaders", new[] { "SaleToBuyerId" });
DropIndex("Web.SaleDeliveryHeaders", "IX_SaleDeliveryHeader_DocID");
DropIndex("Web.ExcessMaterialLines", new[] { "Dimension4Id" });
DropIndex("Web.ExcessMaterialLines", new[] { "Dimension3Id" });
DropIndex("Web.RequisitionLines", new[] { "Dimension4Id" });
DropIndex("Web.RequisitionLines", new[] { "Dimension3Id" });
DropIndex("Web.StockLines", new[] { "Dimension4Id" });
DropIndex("Web.StockLines", new[] { "Dimension3Id" });
AlterColumn("Web.Sites", "Address", c => c.String(maxLength: 20));
DropColumn("Web.ViewStockInBalance", "Dimension4Id");
DropColumn("Web.ViewStockInBalance", "Dimension3Id");
DropColumn("Web.StockHeaderSettings", "isMandatoryProductUID");
DropColumn("Web.LedgerSettings", "filterReferenceDocTypes");
DropColumn("Web.LedgerSettings", "isVisibleReferenceDocTypeId");
DropColumn("Web.LedgerSettings", "isVisibleReferenceDocId");
DropColumn("Web.LedgerSettings", "isVisibleDrCr");
DropColumn("Web.ExcessMaterialLines", "Dimension4Id");
DropColumn("Web.ExcessMaterialLines", "Dimension3Id");
DropColumn("Web.DocumentTypeSettings", "ReferenceDocIdCaption");
DropColumn("Web.DocumentTypeSettings", "ReferenceDocTypeCaption");
DropColumn("Web.RequisitionLines", "Dimension4Id");
DropColumn("Web.RequisitionLines", "Dimension3Id");
DropColumn("Web.StockLines", "Dimension4Id");
DropColumn("Web.StockLines", "Dimension3Id");
DropColumn("Web.LedgerHeaders", "DrCr");
DropTable("Web.ViewSaleInvoiceBalanceForDelivery");
DropTable("Web.SaleDeliverySettings");
DropTable("Web.SaleDeliveryLines");
DropTable("Web.SaleDeliveryHeaders");
CreateIndex("Web.StockAdjs", new[] { "DivisionId", "SiteId" }, unique: true, name: "IX_Stock_DocID");
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PerspectiveShift : MonoBehaviour
{
public Material backgroundMat;
public Material playerMat;
public GameObject player;
public GameObject bgPlate;
public GameObject lightObjs;
public GameObject darkObjs;
private bool toggled = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown("e")) {
toggled = !toggled;
if(toggled) {
playerMat.SetColor("_Color", Color.white);
backgroundMat.SetColor("_Color", Color.black);
lightObjs.SetActive(false);
darkObjs.SetActive(true);
} else {
playerMat.SetColor("_Color", Color.black);
backgroundMat.SetColor("_Color", Color.white);
lightObjs.SetActive(true);
darkObjs.SetActive(false);
}
}
}
}
|
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web.Mvc;
using Services.Rest.Client.Models;
using Services.Rest.Client.RestClient;
namespace Services.Rest.Client.Controllers
{
public class ClientesController : Controller
{
private readonly ServicesRestClientContext _db = new ServicesRestClientContext();
// GET: Clientes
public ActionResult Index()
{
var service = new ServicesRestServer();
return View(service.GetClientesAnonimo().ToList());
}
// GET: Clientes/Details/5
public ActionResult Details(int? id)
{
if (id == null)
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
var clientes = _db.Clientes.Find(id);
if (clientes == null)
return HttpNotFound();
return View(clientes);
}
// GET: Clientes/Create
public ActionResult Create()
{
return View();
}
// POST: Clientes/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "Id,Nome,DataNacimento")] Cliente clientes)
{
if (ModelState.IsValid)
{
_db.Clientes.Add(clientes);
_db.SaveChanges();
return RedirectToAction("Index");
}
return View(clientes);
}
// GET: Clientes/Edit/5
public ActionResult Edit(int? id)
{
if (id == null)
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
var clientes = _db.Clientes.Find(id);
if (clientes == null)
return HttpNotFound();
return View(clientes);
}
// POST: Clientes/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "Id,Nome,DataNacimento")] Cliente clientes)
{
if (ModelState.IsValid)
{
_db.Entry(clientes).State = EntityState.Modified;
_db.SaveChanges();
return RedirectToAction("Index");
}
return View(clientes);
}
// GET: Clientes/Delete/5
public ActionResult Delete(int? id)
{
if (id == null)
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
var clientes = _db.Clientes.Find(id);
if (clientes == null)
return HttpNotFound();
return View(clientes);
}
// POST: Clientes/Delete/5
[HttpPost]
[ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult DeleteConfirmed(int id)
{
var clientes = _db.Clientes.Find(id);
_db.Clientes.Remove(clientes);
_db.SaveChanges();
return RedirectToAction("Index");
}
protected override void Dispose(bool disposing)
{
if (disposing)
_db.Dispose();
base.Dispose(disposing);
}
}
} |
using Tomelt.ContentManagement;
using Tomelt.Environment.Extensions;
using System.ComponentModel.DataAnnotations;
namespace Tomelt.Users.ViewModels
{
[TomeltFeature("Tomelt.Users.EditPasswordByAdmin")]
public class UserEditPasswordViewModel {
[DataType(DataType.Password)]
[StringLength(50, MinimumLength = 7)]
public string Password { get; set; }
[DataType(DataType.Password)]
public string ConfirmPassword { get; set; }
public IContent User { get; set; }
}
} |
using Pe.Stracon.SGC.Infraestructura.CommandModel.Contractual;
using Pe.Stracon.SGC.Infraestructura.Core.Base;
using System;
namespace Pe.Stracon.SGC.Infraestructura.Core.CommandContract.Contractual
{
/// <summary>
/// Definición del Repositorio de Plantilla
/// </summary>
/// <remarks>
/// Creación : GMD 20150519 <br />
/// Modificación : <br />
/// </remarks>
public interface IPlantillaEntityRepository : IComandRepository<PlantillaEntity>
{
/// <summary>
/// Realiza la actualización del Estado de Vigencia de la Plantilla
/// </summary>
/// <returns>Indicador con el resultado de la operación</returns>
int ActualizarPlantillaEstadoVigencia();
/// <summary>
/// Copia una plantilla
/// </summary>
/// <param name="codigoPlantillaCopiar">Código de la plantilla a copiar</param>
/// <param name="descripcion">Descripción de la nueva plantilla</param>
/// <param name="codigoTipoContrato">Tipo de contrato de la nueva plantilla</param>
/// <param name="codigoTipoDocumento">Tipo de documento de la nueva plantilla</param>
/// <param name="fechaInicioVigencia">Fecha de inicio de vigencia</param>
/// <param name="usuarioCreacion">Usuario de creación</param>
/// <param name="terminalCreacion">Terminal de creación</param>
/// <returns></returns>
int CopiarPlantilla(Guid codigoPlantillaCopiar, string descripcion, string codigoTipoContrato, string codigoTipoDocumento, DateTime fechaInicioVigencia, string usuarioCreacion, string terminalCreacion, bool esmayormenor);
}
}
|
using AdminAPI.Models;
using AdminAPI.TokenModels;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace AdminAPI
{
public partial class Startup
{
private void ConfigureAuth(IApplicationBuilder app)
{
app.UseAuthentication();
var signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(Configuration.GetSection("TokenAuthentication:SecretKey").Value));
var tokenValidationParameters = new TokenValidationParameters
{
// The signing key must match!
ValidateIssuerSigningKey = true,
IssuerSigningKey = signingKey,
// Validate the JWT Issuer (iss) claim
ValidateIssuer = true,
ValidIssuer = Configuration.GetSection("TokenAuthentication:Issuer").Value,
// Validate the JWT Audience (aud) claim
ValidateAudience = true,
ValidAudience = Configuration.GetSection("TokenAuthentication:Audience").Value,
// Validate the token expiry
ValidateLifetime = true,
// If you want to allow a certain amount of clock drift, set that here:
ClockSkew = TimeSpan.Zero
};
var tokenProviderOptions = new TokenProviderOptions
{
Path = Configuration.GetSection("TokenAuthentication:TokenPath").Value,
Audience = Configuration.GetSection("TokenAuthentication:Audience").Value,
Issuer = Configuration.GetSection("TokenAuthentication:Issuer").Value,
SigningCredentials = new SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256),
IdentityResolver = GetIdentity
};
app.UseMiddleware<TokenProviderMiddleware>(Options.Create(tokenProviderOptions));
}
private Task<ClaimsIdentity> GetIdentity(string username, string password)
{
using (var _context = new AdminDemoContext())
{
var data = _context.AdminLogins.Where(x => x.Username == username && x.Password == password && x.IsActive == true).FirstOrDefault();
if (data != null)
{
return Task.FromResult(new ClaimsIdentity(new GenericIdentity(username, "Token"), new Claim[] { }));
}
}
// Credentials are invalid, or account doesn't exist
return Task.FromResult<ClaimsIdentity>(null);
}
}
}
|
using System;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using Microsoft.Phone.Scheduler;
using Microsoft.Phone.Shell;
using Microsoft.Phone.UserData;
namespace MyConferenceCallsTaskAgent
{
public class ScheduledAgent : ScheduledTaskAgent
{
private static volatile bool _classInitialized;
private int AppointmentsCount = 0;
public ScheduledAgent()
{
if (!_classInitialized)
{
_classInitialized = true;
Deployment.Current.Dispatcher.BeginInvoke(delegate
{
Application.Current.UnhandledException += ScheduledAgent_UnhandledException;
});
}
}
private void ScheduledAgent_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
System.Diagnostics.Debugger.Break();
}
}
protected override void OnInvoke(ScheduledTask task)
{
// Get Appointments
Appointments appts = new Appointments();
//Identify the method that runs after the asynchronous search completes.
appts.SearchCompleted += new System.EventHandler<AppointmentsSearchEventArgs>(appts_SearchCompleted);
DateTime start = DateTime.Now;
DateTime end = DateTime.Now.AddHours(12);
int max = 40;
//Start the asynchronous search.
appts.SearchAsync(start, end, max, null);
}
void appts_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
{
AppointmentsCount = 0;
if (e.Results != null)
{
foreach (Appointment appt in e.Results)
{
if (IsConfCall(appt))
{
AppointmentsCount++;
}
}
}
// update the Tile
ShellTile PrimaryTile = ShellTile.ActiveTiles.First();
if (PrimaryTile != null)
{
IconicTileData tile = new IconicTileData();
tile.Count = AppointmentsCount;
tile.Title = "My Conference Calls";
tile.SmallIconImage = new Uri("/ApplicationIcon.png", UriKind.Relative);
tile.IconImage = new Uri("/icon200.png", UriKind.Relative);
PrimaryTile.Update(tile);
}
NotifyComplete();
}
bool IsConfCall(Appointment appt)
{
if (appt == null) return false;
if (string.IsNullOrWhiteSpace(appt.Details)) return false;
string[] patterns = { @"Conference ID: *(\d+)", @"gotomeeting.com/join/(\d+)", @"Call part. code *(\d+)", @"Participant code: *(\d+)", @"Meeting number: *(\d+)" };
foreach (string pattern in patterns)
{
Match match = Regex.Match(appt.Details, pattern, RegexOptions.IgnoreCase | RegexOptions.Singleline);
if (match.Success) return true;
}
return false;
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace SocialNetwork.Api.Controllers
{
[Authorize]
public class TestController : ControllerBase
{
[Route("test")]
public IActionResult Get()
{
var claims = User.Claims.Select(x => $"{x.Type}:{x.Value}");
return Ok(new
{
message = "Hello MVC Core API!",
claims = claims.ToArray()
});
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SDI_LCS
{
public class WorkSchedule
{
Form1 Main;
public int FLAG_Check_WorkType = 0;
//출발지 타입 확인
public int Check_WorkType_Source = 0;
//도착지 타입 확인
public int Check_WorkType_Dest = 0;
//양극 광폭 입출고대 작업 확인
public int Check_Plus_Big_Size_Input = 0; // 광폭 코터 입고대 작업 하는지 확인. lkw20190415
//기재 반입구
public int FLAG_Check_Entry_LGV_Minus_Roll = 0; //음극 롤 차량 확인 - 기재 -> 음극 롤창고 작업 하는지 확인
public int FLAG_Check_Entry_LGV_Plus_Roll = 0; //양극 롤 차량 확인 - 기재 -> 음극 롤창고 작업 하는지 확인
public int FLAG_Check_Entry_LGV = 0; //기재 반입구, 양극 기재 렉 창고 -> 한차가 작업중 일때 작업 할당 금지
public int FLAG_Check_Entry_LGV_Roll = 0; //기재 반입구, 양극 기재 렉 창고 -> 한차가 작업중 일때 작업 할당 금지
public int Alloc_Entry_Minus_Roll = 0;
public int Alloc_Entry_Plus_Roll = 0;
public int Alloc_Entry_LGV = 0;
//대기 장소 우선순위 작업 할당
public int Check_Charge_Station_Minus = 0;
public int Check_163_Node_Minus = 0;
public int Check_166_Node_Minus = 0;
public int Alloc_AGV_Charge = 0;
public int Alloc_AGV_163 = 0;
public int Alloc_AGV_166 = 0;
public int Check_Charge_Station_Plus = 0;
public int Check_1237_Node = 0;
public int Check_1041_Node = 0;
public int Alloc_AGV_Charge_Plus = 0;
public int Alloc_AGV_1237 = 0;
public int Alloc_AGV_1041 = 0;
public int Check_Node_1286_AGV = 0;
public int Check_Node_1313_AGV = 0;
public int Check_Node_1268_AGV = 0;
public int Check_Node_1054_AGV = 0;
public int Alloc_Plus_Work_Node = 0;
//릴타입 충전 장소
public int Check_Reel_Charge_Station_1438 = 0;
public int Check_Reel_Charge_Station_438 = 0;
public int Check_Reel_Charge_Station_496 = 0;
public int Check_Reel_Charge_Station_442 = 0; // 20200820 충전소 추가 설치 위치
public int Check_Reel_Charge_Station_1556 = 0; // 20200820 충전소 추가 설치 위치
public int Alloc_Reel_Charge_Station_1438 = 0;
public int Alloc_Reel_Charge_Station_438 = 0;
public int Alloc_Reel_Charge_Station_496 = 0;
public int Alloc_Reel_Charge_Station_442 = 0; // 20200820 충전소 추가 설치 위치
public int Alloc_Reel_Charge_Station_1556 = 0; // 20200820 충전소 추가 설치 위치
//오버브릿지 리프트 작업할당 플래그
public int Check_Over_Lift_Order = 0;
public int Alloc_Over_Lift_Order = 0;
public int FLAG_Lift_Order = 0; //오버 상승 가는 차량 있는지 확인
public int FLAG_Alloc_Lift_Order = 0;
//상승 만재 일때 상승 명령 팅구기
public int Check_UP_Lift_Carrier = 0;
public int Alloc_UP_Lift_Carrier = 0;
public int Check_Work_UpLift = 0;
//11.07 포장실 작업할당 막기
public int FLAG_Check_PackingRoom_Order = 0;
public int Alloc_PackingRoom_Order = 0;
//11.14 3층 하강 리프트 확인
public int Check_Floor3_Down_Lift = 0;
public int Alloc_Floor3_Down_Lift = 0;
//11.26양극 3식 슬리터 차량 확인
public int Check_Plus_SLT3 = 0;
public int Alloc_Plus_SLT3 = 0;
//12.07 양극 1식 슬리터 차량 확인
public int Check_PLUS_SLT_1 = 0;
public int Alloc_PLUS_SLT_1 = 0;
//12.10 음극 2,3슬리터 차량 확인
public int Check_23SLT_LGV = 0;
public int Alloc_23SLT_LGV = 0;
//01.08 음극 음극 3슬리터 차량 확인
public int Check_3SLT_LGV = 0;
public int Alloc_3SLT_LGV = 0;
//12.10 1156에선 작업 안받기
public int Alloc_1156_NoWork = 0;
//20200903 1369 위치에서 M동 하강 리프트 이외 작업 할당하지 않음
public int Alloc_1369_NoWork = 0;
//12.18 M동 상승리프트 구간 차량 확인
public int Check_3_Up_Lift = 0;
public int Alloc_3_Up_Lift = 0;
//11.12 3층 상승 리프트 확인
public int Check_Floor3_Up_Lift_LGV = 0;
public int Check_Floor3_Up_Lift = 0;
public int Alloc_Floor3_Up_Lift = 0;
//12.26 오버브릿지 버퍼 팅구기
public int Check_Over_Buffer_AGV = 0;
public int Alloc_Over_Buffer_Order = 0;
//--------------------------------------------------후공정 작업할당
//음/양 슬리터 명령 있는지 확인
public int Check_Plus_SLT1_Order = 0;
public int Check_Plus_SLT2_Order = 0;
public int Check_Plus_SLT3_Order = 0;
public int Check_Minus_SLT1_Order = 0;
public int Check_Minus_SLT2_Order = 0;
public int Check_Minus_SLT3_Order = 0;
//음/양 롤 리와인더 명령 있는지 확인. lkw20190617
public int Check_Plus_RRW1_Order = 0;
public int Check_Plus_RRW2_Order = 0;
public int Check_Minus_RRW1_Order = 0;
public int Check_Minus_RRW2_Order = 0;
//M동 하강리프트 명령 있는지 확인
public int Check_M_Down_Lift_Order = 0;
//음/양 공급 작업 있는지 학인
public int Check_Plus_SLT1_Working_LGV = 0;
public int Check_Plus_SLT2_Working_LGV = 0;
public int Check_Plus_SLT3_Working_LGV = 0;
public int Check_Minus_SLT1_Working_LGV = 0;
public int Check_Minus_SLT2_Working_LGV = 0;
public int Check_Minus_SLT3_Working_LGV = 0;
//ROLL 리와인더 음/양 공급 작업 있는지 학인. lkw20190617
public int Check_Plus_RRW1_Working_LGV = 0;
public int Check_Plus_RRW2_Working_LGV = 0;
public int Check_Minus_RRW1_Working_LGV = 0;
public int Check_Minus_RRW2_Working_LGV = 0;
//음/양 슬리터 작업할당 막기
public int Alloc_Work_Plus_SLT1 = 0;
public int Alloc_Work_Plus_SLT2 = 0;
public int Alloc_Work_Plus_SLT3 = 0;
public int Alloc_Work_Minus_SLT1 = 0;
public int Alloc_Work_Minus_SLT2 = 0;
public int Alloc_Work_Minus_SLT3 = 0;
//음/양 롤 리와인더 작업할당 막기. lkw20190617
public int Alloc_Work_Plus_RRW1 = 0;
public int Alloc_Work_Plus_RRW2 = 0;
public int Alloc_Work_Minus_RRW1 = 0;
public int Alloc_Work_Minus_RRW2 = 0;
//------------------------------------------롤 LGV작업할당
//롤창고 입고대 명령있는지 확인
public int Check_Plus_Roll_InPut1_Working_LGV = 0;
public int Check_Plus_Roll_InPut2_Working_LGV = 0;
public int Check_Minus_Roll_InPut1_Working_LGV = 0;
public int Check_Minus_Roll_InPut2_Working_LGV = 0;
public int Alloc_Plus_Roll_InPut1 = 0;
public int Alloc_Plus_Roll_InPut2 = 0;
public int Alloc_Minus_Roll_InPut1 = 0;
public int Alloc_Minus_Roll_InPut2 = 0;
public int Check_Plus_Roll_OutPut1_Order = 0;
public int Check_Plus_Roll_OutPut2_Order = 0;
public int Check_Minus_Roll_OutPut1_Order = 0;
public int Check_Minus_Roll_OutPut2_Order = 0;
//음/양 롤타입 충전소 영역에 차있는지 확인 - 차있으면 할당 금지(충전소에서)
public int Check_Charge_Station_M_Roll = 0;
public int Alloc_Charge_Station_M_Roll = 0;
public int Check_Charge_Station_P_Roll = 0;
public int Alloc_Charge_Station_P_Roll = 0;
public int Alloc_7SLT = 0;
public void Init_FLAG()
{
#region 플래그 초기화
//타입확인
Alloc_7SLT = 0;
FLAG_Check_WorkType = 0;
Check_WorkType_Source = 0;
Check_WorkType_Dest = 0;
//양극 광폭 코터 확인.
Check_Plus_Big_Size_Input = 0; // 광폭 코터 입고대 작업 하는지 확인. lkw20190415
//기재반입구
FLAG_Check_Entry_LGV_Minus_Roll = 0; //음극 롤 차량 확인 - 기재 -> 음극 롤창고 작업 하는지 확인
FLAG_Check_Entry_LGV_Plus_Roll = 0; //양극 롤 차량 확인 - 기재 -> 음극 롤창고 작업 하는지 확인
FLAG_Check_Entry_LGV = 0; //기재 반입구, 양극 기재 렉 창고 -> 한차가 작업중 일때 작업 할당 금지
FLAG_Check_Entry_LGV_Roll = 0;
Alloc_Entry_Minus_Roll = 0;
Alloc_Entry_Plus_Roll = 0;
Alloc_Entry_LGV = 0;
//롤타입 대기장소
Check_Charge_Station_Minus = 0;
Check_163_Node_Minus = 0;
Check_166_Node_Minus = 0;
Alloc_AGV_Charge = 0;
Alloc_AGV_163 = 0;
Alloc_AGV_166 = 0;
Check_Charge_Station_Plus = 0;
Check_1237_Node = 0;
Check_1041_Node = 0;
Alloc_AGV_Charge_Plus = 0;
Alloc_AGV_1237 = 0;
Alloc_AGV_1041 = 0;
//릴타입 충전 장소
Check_Reel_Charge_Station_1438 = 0;
Check_Reel_Charge_Station_438 = 0;
Check_Reel_Charge_Station_496 = 0;
Check_Reel_Charge_Station_1556 = 0;
Check_Reel_Charge_Station_442 = 0;
Alloc_Reel_Charge_Station_1438 = 0;
Alloc_Reel_Charge_Station_438 = 0;
Alloc_Reel_Charge_Station_496 = 0;
Alloc_Reel_Charge_Station_1556 = 0;
Alloc_Reel_Charge_Station_442 = 0;
//오버브릿지 리프트 작업할당 플래그
Check_Over_Lift_Order = 0;
Alloc_Over_Lift_Order = 0;
FLAG_Lift_Order = 0;
FLAG_Alloc_Lift_Order = 0;
//상승 만재 일때 상승 명령 팅구기
Check_UP_Lift_Carrier = 0;
Alloc_UP_Lift_Carrier = 0;
Check_Work_UpLift = 0;
//11.07 포장실 작업할당 막기
FLAG_Check_PackingRoom_Order = 0;
Alloc_PackingRoom_Order = 0;
//11.14 3층 하강 리프트 확인
Check_Floor3_Down_Lift = 0;
Alloc_Floor3_Down_Lift = 0;
//11.26양극 3식 슬리터 차량 확인
Check_Plus_SLT3 = 0;
Alloc_Plus_SLT3 = 0;
//12.07 양극 1식 슬리터 차량 확인
Check_PLUS_SLT_1 = 0;
Alloc_PLUS_SLT_1 = 0;
//12.10 음극 2,3슬리터 차량 확인
Check_23SLT_LGV = 0;
Alloc_23SLT_LGV = 0;
//01.08 음극 음극 3슬리터 차량 확인
Check_3SLT_LGV = 0;
Alloc_3SLT_LGV = 0;
//12.10 1156에선 작업 안받기
Alloc_1156_NoWork = 0;
//20200903 1369 위치에서 M동 하강 리프트 이외 작업 할당하지 않음
Alloc_1369_NoWork = 0;
//12.18 양극 상승리프트 구간 차량 확인
Check_3_Up_Lift = 0;
Alloc_3_Up_Lift = 0;
//11.12 3층 상승 리프트 확인
Check_Floor3_Up_Lift_LGV = 0;
Check_Floor3_Up_Lift = 0;
Alloc_Floor3_Up_Lift = 0;
//12.26 오버브릿지 버퍼 팅구기
Check_Over_Buffer_AGV = 0;
Alloc_Over_Buffer_Order = 0;
//--------------------------------------------------후공정 작업할당
//음/양 슬리터 명령 있는지 확인
Check_Plus_SLT1_Order = 0;
Check_Plus_SLT2_Order = 0;
Check_Plus_SLT3_Order = 0;
Check_Minus_SLT1_Order = 0;
Check_Minus_SLT2_Order = 0;
Check_Minus_SLT3_Order = 0;
//음/양 롤 리와인더 명령 있는지 확인. lkw20190617
Check_Plus_RRW1_Order = 0;
Check_Plus_RRW2_Order = 0;
Check_Minus_RRW1_Order = 0;
Check_Minus_RRW2_Order = 0;
//M동 하강리프트 명령 있는지 확인
Check_M_Down_Lift_Order = 0;
//음/양 공급 작업 있는지 학인
Check_Plus_SLT1_Working_LGV = 0;
Check_Plus_SLT2_Working_LGV = 0;
Check_Plus_SLT3_Working_LGV = 0;
Check_Minus_SLT1_Working_LGV = 0;
Check_Minus_SLT2_Working_LGV = 0;
Check_Minus_SLT3_Working_LGV = 0;
//ROLL 리와인더 음/양 공급 작업 있는지 학인. lkw20190617
Check_Plus_RRW1_Working_LGV = 0;
Check_Plus_RRW2_Working_LGV = 0;
Check_Minus_RRW1_Working_LGV = 0;
Check_Minus_RRW2_Working_LGV = 0;
//음/양 슬리터 작업할당 막기
Alloc_Work_Plus_SLT1 = 0;
Alloc_Work_Plus_SLT2 = 0;
Alloc_Work_Plus_SLT3 = 0;
Alloc_Work_Minus_SLT1 = 0;
Alloc_Work_Minus_SLT2 = 0;
Alloc_Work_Minus_SLT3 = 0;
//음/양 롤 리와인더 작업할당 막기. lkw20190617
Alloc_Work_Plus_RRW1 = 0;
Alloc_Work_Plus_RRW2 = 0;
Alloc_Work_Minus_RRW1 = 0;
Alloc_Work_Minus_RRW2 = 0;
//------------------------------------------롤 LGV작업할당
//롤창고 입고대 명령있는지 확인
Check_Plus_Roll_InPut1_Working_LGV = 0;
Check_Plus_Roll_InPut2_Working_LGV = 0;
Check_Minus_Roll_InPut1_Working_LGV = 0;
Check_Minus_Roll_InPut2_Working_LGV = 0;
Check_Plus_Roll_OutPut1_Order = 0;
Check_Plus_Roll_OutPut2_Order = 0;
Check_Minus_Roll_OutPut1_Order = 0;
Check_Minus_Roll_OutPut2_Order = 0;
Alloc_Plus_Roll_InPut1 = 0;
Alloc_Plus_Roll_InPut2 = 0;
Alloc_Minus_Roll_InPut1 = 0;
Alloc_Minus_Roll_InPut2 = 0;
Check_Node_1286_AGV = 0;
Check_Node_1313_AGV = 0;
Check_Node_1268_AGV = 0;
Check_Node_1054_AGV = 0;
Alloc_Plus_Work_Node = 0;
//음/양 롤타입 충전소 영역에 차있는지 확인 - 차있으면 할당 금지(충전소에서)
Check_Charge_Station_M_Roll = 0;
Alloc_Charge_Station_M_Roll = 0;
Check_Charge_Station_P_Roll = 0;
Alloc_Charge_Station_P_Roll = 0;
#endregion
}
// 생성자
public WorkSchedule()
{
}
public WorkSchedule(Form1 CS_Main)
{
Main = CS_Main;
}
//대기중인 명령 검색
public void waitCommand(int LGV_No)
{
if (Main.CS_Work_DB.waitCommand.Count > 0)
{
for (int WaitCommandCount = 0; WaitCommandCount < Main.CS_Work_DB.waitCommand.Count; WaitCommandCount++)
{
Init_FLAG();
#region 작업 우선순위 할당
#region 차량 위치, 명령 확인
for (int i = 0; i < Form1.LGV_NUM; i++)
{
if (i != LGV_No)
{
#region 자동일때만 막는 조건
if (Main.m_stAGV[i].mode != 0 && Main.m_stAGV[i].FLAG_LGV_Charge != 1)
{
//롤타입 음극 영역에 차량 있는지 확인
if ((Main.m_stAGV[i].current >= 1 && Main.m_stAGV[i].current <= 27)
|| (Main.m_stAGV[i].current >= 401 && Main.m_stAGV[i].current <= 412)
|| (Main.m_stAGV[i].current >= 455 && Main.m_stAGV[i].current <= 457)
|| (Main.m_stAGV[i].current >= 87 && Main.m_stAGV[i].current <= 89))
{
Check_Charge_Station_M_Roll = 1;
}
//롤타입 양극 영역에 차량 있는지 확인
if ((Main.m_stAGV[i].current >= 1001 && Main.m_stAGV[i].current <= 1033)
|| (Main.m_stAGV[i].current >= 1455 && Main.m_stAGV[i].current <= 1457)
|| (Main.m_stAGV[i].current >= 1401 && Main.m_stAGV[i].current <= 1412))
{
Check_Charge_Station_P_Roll = 1;
}
//양극 1식 슬리터에 있는지 확인(1084에서 1식슬리터 작업하는 차량 있으면 팅구기)
if (Main.m_stAGV[i].MCS_Source_Port == "CC8SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CC8SLT01_UBP01"
|| Main.m_stAGV[i].MCS_Source_Port == "CC8SLT01_UBP02" || Main.m_stAGV[i].MCS_Dest_Port == "CC8SLT01_UBP02")
{
Check_PLUS_SLT_1 = 1;
}
//양극 상승리프트 구간 차량 있는지 확인
if (i == 0 || i == 1 || i == 9 || i == 11 || i == 12)
{
if ((Main.m_stAGV[i].current >= 1106 && Main.m_stAGV[i].current <= 1112)
|| (Main.m_stAGV[i].current >= 1425 && Main.m_stAGV[i].current <= 1427))
{
Check_3_Up_Lift = 1;
}
}
//오버브릿지 버퍼 명령을 받을수 있는 차가 있는지 확인
if (((Main.m_stAGV[i].current >= 1273 && Main.m_stAGV[i].current <= 1292)
|| (Main.m_stAGV[i].current >= 1359 && Main.m_stAGV[i].current <= 1360)
|| (Main.m_stAGV[i].current >= 1391 && Main.m_stAGV[i].current <= 1393)
|| (Main.m_stAGV[i].current >= 1317 && Main.m_stAGV[i].current <= 1318)
|| (Main.m_stAGV[i].current >= 1500 && Main.m_stAGV[i].current <= 1502))
&& Main.m_stAGV[i].Goal == 1502 || Main.m_stAGV[i].Goal == 1393 || Main.m_stAGV[i].Goal == 1313)
{
Check_Over_Buffer_AGV = 1;
}
//-----------------------------------------------후공정 작업 할당 개선
#region 음/양 슬리터 공급 작업하는 차량있는지 확인
if (Main.m_stAGV[i].MCS_Dest_Port == "CC8SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CC8SLT01_UBP02")
{
Check_Plus_SLT1_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CC9SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CC9SLT01_UBP02")
{
Check_Plus_SLT2_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CC10SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CC10SLT01_UBP02")
{
Check_Plus_SLT3_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CA7SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CA7SLT01_UBP02")
{
Check_Minus_SLT1_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CA8SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CA8SLT01_UBP02")
{
Check_Minus_SLT2_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CA9SLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CA9SLT01_UBP02")
{
Check_Minus_SLT3_Working_LGV = 1;
}
if ((Main.m_stAGV[i].state == 0 || Main.m_stAGV[i].state == 4 || Main.m_stAGV[i].state == 5 || Main.m_stAGV[i].state == 6)
&& Main.m_stAGV[i].dqGoal.Count == 0)
{
#region 음/양 슬리터 공급 작업완료한 차량 있는지 확인
//양극 1식
if (Main.m_stAGV[i].current >= 1091 && Main.m_stAGV[i].current <= 1095)
{
Check_Plus_SLT1_Working_LGV = 1;
}
//양극 2식
if (Main.m_stAGV[i].current >= 1084 && Main.m_stAGV[i].current <= 1084)
{
Check_Plus_SLT2_Working_LGV = 1;
}
//양극 3식
if (Main.m_stAGV[i].current >= 1286 && Main.m_stAGV[i].current <= 1286)
{
Check_Plus_SLT3_Working_LGV = 1;
}
//음극 1식
if (Main.m_stAGV[i].current >= 113 && Main.m_stAGV[i].current <= 115)
{
Check_Minus_SLT1_Working_LGV = 1;
}
//음극 2식
if (Main.m_stAGV[i].current >= 278 && Main.m_stAGV[i].current <= 280)
{
Check_Minus_SLT2_Working_LGV = 1;
}
//음극 3식
if (Main.m_stAGV[i].current >= 265 && Main.m_stAGV[i].current <= 267)
{
Check_Minus_SLT3_Working_LGV = 1;
}
#endregion
#region 음/양 롤창고 입고대 작업완료한 차량 있는지 확인
if (Main.m_stAGV[i].current >= 1002 && Main.m_stAGV[i].current <= 1004)
{
Check_Plus_Roll_InPut1_Working_LGV = 1;
}
if (Main.m_stAGV[i].current >= 1020 && Main.m_stAGV[i].current <= 1022)
{
Check_Plus_Roll_InPut2_Working_LGV = 1;
}
if (Main.m_stAGV[i].current >= 24 && Main.m_stAGV[i].current <= 26)
{
Check_Minus_Roll_InPut1_Working_LGV = 1;
}
if (Main.m_stAGV[i].current >= 2 && Main.m_stAGV[i].current <= 4)
{
Check_Minus_Roll_InPut2_Working_LGV = 1;
}
#endregion
}
#endregion
//-----------------------------------------------후공정 롤 리와인드 작업 할당 개선. lkw20190617
#region 음/양 롤 리와인드 공급 작업하는 차량있는지 확인
// 양극
if (Main.m_stAGV[i].MCS_Dest_Port == "CC6MRW01_LBP01")
{
Check_Plus_RRW1_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CC6MRW02_LBP01")
{
Check_Plus_RRW2_Working_LGV = 1;
}
//음극
if (Main.m_stAGV[i].MCS_Dest_Port == "CA7MRW01_LBP01")
{
Check_Minus_RRW1_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Dest_Port == "CA7MRW02_LBP01")
{
Check_Minus_RRW2_Working_LGV = 1;
}
if ((Main.m_stAGV[i].state == 0 || Main.m_stAGV[i].state == 4 || Main.m_stAGV[i].state == 5 || Main.m_stAGV[i].state == 6)
&& Main.m_stAGV[i].dqGoal.Count == 0)
{
#region 음/양 롤 리와인드 공급 작업완료한 차량 있는지 확인
//양극 1식
if (Main.m_stAGV[i].current == 1085)
{
Check_Plus_RRW1_Working_LGV = 1;
}
//양극 2식
if (Main.m_stAGV[i].current == 1149)
{
Check_Plus_RRW2_Working_LGV = 1;
}
//음극 1식
if (Main.m_stAGV[i].current == 277)
{
Check_Minus_RRW1_Working_LGV = 1;
}
//음극 2식
if (Main.m_stAGV[i].current == 289)
{
Check_Minus_RRW2_Working_LGV = 1;
}
#endregion
}
#endregion
//------------------------------------------------롤타입 작업 할당 개선
#region 음/양 롤창고 입고대 하는 차량 있는지 확인
if (Main.m_stAGV[i].MCS_Source_Port != "CC8MIB01_BBP01" && Main.m_stAGV[i].MCS_Dest_Port == "CC8PLS01_LIP01" && Main.m_stAGV[LGV_No].current != 1002
&& Main.m_stAGV[LGV_No].current != 1004)
{
Check_Plus_Roll_InPut1_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Source_Port != "CC8MIB01_BBP01" && Main.m_stAGV[i].MCS_Dest_Port == "CC8PLS02_LIP01"
&& Main.m_stAGV[LGV_No].current != 1020 && Main.m_stAGV[LGV_No].current != 1022)
{
Check_Plus_Roll_InPut2_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Source_Port != "CC8MIB01_BBP01" && Main.m_stAGV[i].MCS_Dest_Port == "CA8PLS01_LIP01"
&& Main.m_stAGV[LGV_No].current != 24 && Main.m_stAGV[LGV_No].current != 26)
{
Check_Minus_Roll_InPut1_Working_LGV = 1;
}
if (Main.m_stAGV[i].MCS_Source_Port != "CC8MIB01_BBP01" && Main.m_stAGV[i].MCS_Dest_Port == "CA8PLS02_LIP01"
&& Main.m_stAGV[LGV_No].current != 2 && Main.m_stAGV[LGV_No].current != 4)
{
Check_Minus_Roll_InPut2_Working_LGV = 1;
}
#endregion
}
#endregion
//12.10 음극 2,3슬리터 차량 확인
if (((Main.m_stAGV[i].current >= 99 && Main.m_stAGV[i].current <= 108) && (Main.m_stAGV[i].Goal >= 262 && Main.m_stAGV[i].Goal <= 282))
|| (Main.m_stAGV[i].current >= 262 && Main.m_stAGV[i].current <= 282)
|| (Main.m_stAGV[i].current >= 482 && Main.m_stAGV[i].current <= 493)
|| (Main.m_stAGV[i].current >= 170 && Main.m_stAGV[i].current <= 172))
{
Check_23SLT_LGV = 1;
}
//01.08 음극 3슬리터 차량 확인
if ((Main.m_stAGV[i].current >= 262 && Main.m_stAGV[i].current <= 273)
|| (Main.m_stAGV[i].current >= 488 && Main.m_stAGV[i].current <= 493)
|| (Main.m_stAGV[i].current >= 170 && Main.m_stAGV[i].current <= 172))
{
Check_3SLT_LGV = 1;
}
//양극 광폭 코터 할당 확인.
if (((Main.m_stAGV[i].current >= 1071 && Main.m_stAGV[i].current <= 1075) && Main.m_stAGV[i].Dest_Port_Num == "1466")
|| (Main.m_stAGV[i].current >= 1222 && Main.m_stAGV[i].current <= 1232)
|| (Main.m_stAGV[i].current >= 1322 && Main.m_stAGV[i].current <= 1331)
|| (Main.m_stAGV[i].current >= 1464 && Main.m_stAGV[i].current <= 1466)
|| (Main.m_stAGV[i].current >= 1470 && Main.m_stAGV[i].current <= 1472))
{
Check_Plus_Big_Size_Input = 1;
}
//기재 반입라인 차량 확인 - 음극 차량
if (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 186 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 140 && Main.m_stAGV[i].current <= 151)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547))
|| (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 186 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 140 && Main.m_stAGV[i].current <= 151)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547) && (Main.m_stAGV[i].Error == 4)))) // || (Main.m_stAGV[i].Error == 4))
{
FLAG_Check_Entry_LGV_Minus_Roll = 1;
}
//기재 반입라인 차량 확인 - 양극 차량
if (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 1171 && Main.m_stAGV[i].current <= 1185)
|| (Main.m_stAGV[i].current >= 199 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 1191 && Main.m_stAGV[i].current <= 1221)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547)
|| (Main.m_stAGV[i].current >= 1494 && Main.m_stAGV[i].current <= 1495))
|| (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 1171 && Main.m_stAGV[i].current <= 1185)
|| (Main.m_stAGV[i].current >= 199 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 1191 && Main.m_stAGV[i].current <= 1221)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547)
|| (Main.m_stAGV[i].current >= 1494 && Main.m_stAGV[i].current <= 1495) && (Main.m_stAGV[i].Error == 4))))
{
FLAG_Check_Entry_LGV_Plus_Roll = 1;
}
for (int dqGoal = 0; dqGoal < Main.m_stAGV[i].dqGoal.Count; dqGoal++)
{
if (Main.m_stAGV[i].dqGoal.Count > 0)
{
if (i == 2 || i == 3 || i == 4)
{
if (Convert.ToInt32(Main.m_stAGV[i].dqGoal[dqGoal]) == 448)
{
FLAG_Check_Entry_LGV_Plus_Roll = 1;
}
}
}
}
//기재 반입 차량 확인 - 공통 - 할당 금지
if (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 199 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 1191 && Main.m_stAGV[i].current <= 1221)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547))
|| (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 199 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 1191 && Main.m_stAGV[i].current <= 1221)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547) && (Main.m_stAGV[i].Error == 4))))
{
FLAG_Check_Entry_LGV = 1;
}
//기재 반입 차량 확인 - 공통 - 할당 금지
if (((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 199 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 1177 && Main.m_stAGV[i].current <= 1185)
|| (Main.m_stAGV[i].current >= 1191 && Main.m_stAGV[i].current <= 1221)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547))
||(((Main.m_stAGV[i].current >= 446 && Main.m_stAGV[i].current <= 448)
|| (Main.m_stAGV[i].current >= 199 && Main.m_stAGV[i].current <= 221)
|| (Main.m_stAGV[i].current >= 1177 && Main.m_stAGV[i].current <= 1185)
|| (Main.m_stAGV[i].current >= 1191 && Main.m_stAGV[i].current <= 1221)
|| (Main.m_stAGV[i].current >= 1524 && Main.m_stAGV[i].current <= 1547) && (Main.m_stAGV[i].Error == 4)))) // && (Main.m_stAGV[i].Error == 4))
{
FLAG_Check_Entry_LGV_Roll = 1;
}
//포장실에 차 있으면 명령 팅궈잉
if ((Main.m_stAGV[i].current >= 1129 && Main.m_stAGV[i].current <= 1136)
|| (Main.m_stAGV[i].current >= 1148 && Main.m_stAGV[i].current <= 1170)
|| (Main.m_stAGV[i].current >= 1441 && Main.m_stAGV[i].current <= 1445))
{
FLAG_Check_PackingRoom_Order = 1;
}
//포장실 작업 있는지 확인 20200713 kjh 시작 위치 추가
if ((Main.m_stAGV[i].MCS_Dest_Port == "CC8MPB01_BBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CC8MPB01_BBP02")
|| (Main.m_stAGV[i].MCS_Source_Port == "CC8MPB01_BBP01" || Main.m_stAGV[i].MCS_Source_Port == "CC8MPB01_BBP02"))
{
FLAG_Check_PackingRoom_Order = 1;
}
//오버브릿지 상승 리프트 작업 있는지 확인 (만재 조건 확인)
if (Main.m_stAGV[i].MCS_Dest_Port == "CA7FLF02_BBP01")
{
Check_Work_UpLift = 1;
}
//M동 상승리프트 작업있는 차량 확인 (만재 조건 확인)
if (Main.m_stAGV[i].MCS_Dest_Port == "CC8FLF01_BBP01")
{
Check_Floor3_Up_Lift_LGV = 1;
}
//양극 3식 슬리터에 차량 있는지 확인
if (Main.m_stAGV[i].MCS_Source_Port == "CCASLT01_UBP01" || Main.m_stAGV[i].MCS_Source_Port == "CCASLT01_UBP02"
|| Main.m_stAGV[i].MCS_Dest_Port == "CCASLT01_UBP01" || Main.m_stAGV[i].MCS_Dest_Port == "CCASLT01_UBP02"
|| ((Main.m_stAGV[i].current >= 1488 && Main.m_stAGV[i].current <= 1493)
|| (Main.m_stAGV[i].current >= 1280 && Main.m_stAGV[i].current <= 1292)))
{
Check_Plus_SLT3 = 1;
}
if (Main.m_stAGV[i].dqGoal.Count != 0)
{
if (Convert.ToInt32(Main.m_stAGV[i].dqGoal[0]) == 1393)
{
//차가 상승리프트에 대기중이고, 하강 리프트가 꽉차면 할당 풀어주기
if (Main.m_stAGV[i].current == 1501 && Main.m_stAGV[i].Goal == 1502
&& Main.CS_Work_DB.Carrier_1_Down == 1 && Main.CS_Work_DB.Carrier_2_Down == 1 && Main.CS_Work_DB.Carrier_3_Down == 1
&& Main.CS_Work_DB.Carrier_1_Up == 1 && Main.CS_Work_DB.Carrier_2_Up == 1 && Main.CS_Work_DB.Carrier_3_Up == 1)
{
continue;
}
FLAG_Lift_Order = 1;
}
}
//오버브릿지라인 있을때 팅구기
if (((Main.m_stAGV[i].current >= 1500 && Main.m_stAGV[i].current <= 1505) //상승, 하강 리프트 작업지
|| (Main.m_stAGV[i].current >= 1311 && Main.m_stAGV[i].current <= 1318) //리프트 들어가기 직전 경로
|| (Main.m_stAGV[i].current >= 1268 && Main.m_stAGV[i].current <= 1292) //리프트(Roll 방향) 슬리터 10호기 출고대쪽
|| (Main.m_stAGV[i].current >= 1391 && Main.m_stAGV[i].current <= 1395) //리프트 들어가기 직전 경로
|| (Main.m_stAGV[i].current >= 1488 && Main.m_stAGV[i].current <= 1493) //슬리터 입고대
|| (Main.m_stAGV[i].current >= 1354 && Main.m_stAGV[i].current <= 1364) //
|| (((Main.m_stAGV[i].current >= 1482 && Main.m_stAGV[i].current <= 1487) || (Main.m_stAGV[i].current >= 1084 && Main.m_stAGV[i].current <= 1102)
|| (Main.m_stAGV[i].current >= 1431 && Main.m_stAGV[i].current <= 1438) || (Main.m_stAGV[i].current >= 1336 && Main.m_stAGV[i].current <= 1336)
|| (Main.m_stAGV[i].current >= 173 && Main.m_stAGV[i].current <= 183) || (Main.m_stAGV[i].current >= 1183 && Main.m_stAGV[i].current <= 1183))
&& Main.m_stAGV[i].Dest_Port_Num == "1502")) && Main.m_stAGV[i].mode == 1 && Main.m_stAGV[i].Error == 0)
{
//차가 상승리프트에 대기중이고, 하강 리프트가 꽉차면 할당 풀어주기
if (Main.m_stAGV[i].current == 1501 && Main.m_stAGV[i].Goal == 1502
&& Main.CS_Work_DB.Carrier_1_Down == 1 && Main.CS_Work_DB.Carrier_2_Down == 1 && Main.CS_Work_DB.Carrier_3_Down == 1
&& Main.CS_Work_DB.Carrier_1_Up == 1 && Main.CS_Work_DB.Carrier_2_Up == 1 && Main.CS_Work_DB.Carrier_3_Up == 1)
{
continue;
}
FLAG_Lift_Order = 1;
}
//충전소 차량 확인
if ((Main.m_stAGV[i].state == 0 || Main.m_stAGV[i].state == 4 || Main.m_stAGV[i].state == 8 || Main.m_stAGV[i].state == 9)
&& Main.m_stAGV[i].mode == 1 && Main.m_stAGV[i].dqGoal.Count == 0)
{
//----------------------------------------------음극------------------------------------------------------------------
//충전소에 있는지 확인
if ((Main.m_stAGV[i].current == 499 || Main.m_stAGV[i].current == 163 || Main.m_stAGV[i].current == 166) && Main.m_stAGV[i].FLAG_LGV_Charge == 0)
{
Check_Charge_Station_Minus = 1;
}
//33번에 있는지 확인
else if (Main.m_stAGV[i].current == 163 && Main.m_stAGV[i].FLAG_LGV_Charge == 0)
{
Check_163_Node_Minus = 1;
}
//44번에 있는지 확인
else if (Main.m_stAGV[i].current == 166 && Main.m_stAGV[i].FLAG_LGV_Charge == 0)
{
Check_166_Node_Minus = 1;
}
//----------------------------------------------양극------------------------------------------------------------------
//충전소에 있는지 확인
else if (Main.m_stAGV[i].current == 1499 && Main.m_stAGV[i].FLAG_LGV_Charge == 0)
{
Check_Charge_Station_Plus = 1;
}
//1237번에 있는지 확인
else if (Main.m_stAGV[i].current == 1237 && Main.m_stAGV[i].FLAG_LGV_Charge == 0)
{
Check_1237_Node = 1;
}
//1041번에 있는지 확인
else if (Main.m_stAGV[i].current == 1041 && Main.m_stAGV[i].FLAG_LGV_Charge == 0)
{
Check_1041_Node = 1;
}
//----------------------------------------------릴타입------------------------------------------------------------------
else if (Main.m_stAGV[i].current == 1286)
{
Check_Node_1286_AGV = 1;
}
else if (Main.m_stAGV[i].current == 1268)
{
Check_Node_1268_AGV = 1;
}
else if (Main.m_stAGV[i].current == 1313)
{
Check_Node_1313_AGV = 1;
}
else if (Main.m_stAGV[i].current == 1054)
{
Check_Node_1054_AGV = 1;
}
//충전소_1에 있는지 확인
else if (Main.m_stAGV[i].current == 1438 && Main.m_stAGV[i].FLAG_LGV_Charge == 0 && Main.m_stAGV[i].MCS_Carrier_ID == "")
{
Check_Reel_Charge_Station_1438 = 1;
}
//충전소_2에 있는지 확인
else if (Main.m_stAGV[i].current == 438 && Main.m_stAGV[i].FLAG_LGV_Charge == 0 && Main.m_stAGV[i].MCS_Carrier_ID == "")
{
Check_Reel_Charge_Station_438 = 1;
}
//충전소_3에 있는지 확인
else if (Main.m_stAGV[i].current == 496 && Main.m_stAGV[i].FLAG_LGV_Charge == 0 && Main.m_stAGV[i].MCS_Carrier_ID == "")
{
Check_Reel_Charge_Station_496 = 1;
}
//충전소_4에 있는지 확인
else if (Main.m_stAGV[i].current == 442 && Main.m_stAGV[i].FLAG_LGV_Charge == 0 && Main.m_stAGV[i].MCS_Carrier_ID == "")
{
Check_Reel_Charge_Station_442 = 1;
}
//충전소_5에 있는지 확인
/*else if (Main.m_stAGV[i].current == 1556 && Main.m_stAGV[i].FLAG_LGV_Charge == 0 && Main.m_stAGV[i].MCS_Carrier_ID == "")
{
Check_Reel_Charge_Station_1556 = 1;
}*/
}
}
}
//음극 롤 충전소 일때
if (Main.m_stAGV[LGV_No].current == 499 && Check_Charge_Station_M_Roll == 1)
{
Alloc_Charge_Station_M_Roll = 1;
}
//양극 롤 충전소 일때
if (Main.m_stAGV[LGV_No].current == 1499 && Check_Charge_Station_P_Roll == 1)
{
Alloc_Charge_Station_P_Roll = 1;
}
#endregion
if (LGV_No != 0 && LGV_No != 1 && LGV_No != 9 && LGV_No != 8 && LGV_No != 11 && LGV_No != 12)//20200820 중대형 Reel LGV 인덱스 추가
{
//----------------------------------------롤창고 작업 하당
#region 롤창고 입고대가는 차량 있으면 다른차량 출고대 명령 금지
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS01_UOP01" && Check_Plus_Roll_InPut1_Working_LGV == 1
&& Main.m_stAGV[LGV_No].current != 1002 && Main.m_stAGV[LGV_No].current != 1004)
{
Alloc_Plus_Roll_InPut1 = 1;
}
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS02_UOP01" && Check_Plus_Roll_InPut2_Working_LGV == 1
&& Main.m_stAGV[LGV_No].current != 1020 && Main.m_stAGV[LGV_No].current != 1022)
{
Alloc_Plus_Roll_InPut2 = 1;
}
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS01_UOP01" && Check_Minus_Roll_InPut1_Working_LGV == 1
&& Main.m_stAGV[LGV_No].current != 26 && Main.m_stAGV[LGV_No].current != 24)
{
Alloc_Minus_Roll_InPut1 = 1;
}
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS02_UOP01" && Check_Minus_Roll_InPut2_Working_LGV == 1
&& Main.m_stAGV[LGV_No].current != 2 && Main.m_stAGV[LGV_No].current != 4)
{
Alloc_Minus_Roll_InPut2 = 1;
}
#endregion
}
if (LGV_No == 0 || LGV_No == 1 || LGV_No == 9 || LGV_No == 11 || LGV_No == 12)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01" && Check_3_Up_Lift == 1)
{
Alloc_3_Up_Lift = 1;
}
//----------------------------------------후공정 작업할당
#region 후공정 해당 슬리터 가고 있을때 다른차 할당 금지
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02")
&& Check_Plus_SLT1_Working_LGV == 1)
{
Alloc_Work_Plus_SLT1 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02")
&& Check_Plus_SLT2_Working_LGV == 1)
{
Alloc_Work_Plus_SLT2 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
&& Check_Plus_SLT3_Working_LGV == 1)
{
Alloc_Work_Plus_SLT3 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02")
&& Check_Minus_SLT1_Working_LGV == 1)
{
Alloc_Work_Minus_SLT1 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02")
&& Check_Minus_SLT2_Working_LGV == 1)
{
Alloc_Work_Minus_SLT2 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02")
&& Check_Minus_SLT3_Working_LGV == 1)
{
Alloc_Work_Minus_SLT3 = 1;
}
#endregion
//----------------------------------------후공정 롤 리와인더 작업할당. lkw20190617
#region 후공정 해당 롤 리와인더 가고 있을때 다른차 할당 금지
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CC6MRW01_UBP01")
&& (Check_Plus_RRW1_Working_LGV == 1 || //양극 롤 리와인더 #1 입고 작업
Check_Plus_RRW2_Working_LGV == 1 || //양극 롤 리와인더 #2 입고 작업
FLAG_Check_PackingRoom_Order == 1)) //포장실 작업
{
Alloc_Work_Plus_RRW1 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7MRW01_UBP01")
&& (Check_Minus_RRW1_Working_LGV == 1 ||
Check_Minus_RRW2_Working_LGV == 1))
{
Alloc_Work_Minus_RRW1 = 1;
}
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7MRW02_UBP01")
&& (Check_Minus_RRW1_Working_LGV == 1 ||
Check_Minus_RRW2_Working_LGV == 1))
{
Alloc_Work_Minus_RRW2 = 1;
}
#endregion
//오버브릿지 하강, 오버 버퍼 작업일때 다른 차량이 오버브릿지 영역에 있으면 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP03"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP04")
&& FLAG_Lift_Order == 1 && Main.m_stAGV[LGV_No].current != 1313
&& Main.m_stAGV[LGV_No].current != 1268 && Main.m_stAGV[LGV_No].current != 1286 && Main.m_stAGV[LGV_No].current != 1369)
{
FLAG_Alloc_Lift_Order = 1;
}
//음극 2,3식에 차량있으면 음극1식, 충전소에서 할당 안받기
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"))
&& Check_23SLT_LGV == 1
&& ((Main.m_stAGV[LGV_No].current >= 108 && Main.m_stAGV[LGV_No].current <= 120)
|| (Main.m_stAGV[LGV_No].current >= 437 && Main.m_stAGV[LGV_No].current <= 438)
|| (Main.m_stAGV[LGV_No].current >= 173 && Main.m_stAGV[LGV_No].current <= 173)))
{
Alloc_23SLT_LGV = 1;
}
//음극 3식에 차량있으면, 1,2식 2식위치에서 할당 안받기
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"))
&& Check_3SLT_LGV == 1
&& Main.m_stAGV[LGV_No].current >= 278 && Main.m_stAGV[LGV_No].current <= 280)
{
Alloc_3SLT_LGV = 1;
}
}
//기재 반입구 - 음극 롤 (음극 롤이 작업 할때 롤 할당 금지)
if (LGV_No == 5 || LGV_No == 6 || LGV_No == 7)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01"
&& (Main.m_stCommand[WaitCommandCount].Dest_Port == "CA8PLS02_LIP01" || Main.m_stCommand[WaitCommandCount].Dest_Port == "CA8PLS01_LIP01"))
{
if (FLAG_Check_Entry_LGV == 1 || FLAG_Check_Entry_LGV_Minus_Roll == 1)
{
Alloc_Entry_Minus_Roll = 1;
}
}
}
//기재 반입구 - 양극 롤 (양극 롤이 작업 할때 롤 할당 금지)
if (LGV_No == 2 || LGV_No == 3 || LGV_No == 4)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01"
&& (Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8PLS01_LIP01" || Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8PLS02_LIP01"))
{
if (FLAG_Check_Entry_LGV == 1 || FLAG_Check_Entry_LGV_Plus_Roll == 1)
{
Alloc_Entry_Plus_Roll = 1;
}
}
}
if (LGV_No == 10)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01")
{
if (FLAG_Check_Entry_LGV_Roll == 1)
{
Alloc_Entry_LGV = 1;
}
}
}
//기재 반입구 - 공통
if (LGV_No != 0 && LGV_No != 1 && LGV_No != 9 && LGV_No != 11 && LGV_No != 12)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01")
{
if (FLAG_Check_Entry_LGV == 1)
{
Alloc_Entry_LGV = 1;
}
}
}
//기재 반입구 명령이 하나라도 있으면 절대 할당 금지 kjh 2020 06 05
/*if(Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01" || Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8MIB01_BBP01")
{
Alloc_Entry_LGV = 1;
}
//기재 반입구 경로에 LGV가 한대라도 있으면 절대 할당 금지 kjh 2020 06 05
if (Alloc_Entry_Minus_Roll == 1 || Alloc_Entry_Plus_Roll == 1 || FLAG_Check_Entry_LGV_Roll == 1)
{
Alloc_Entry_LGV = 1;
}*/
//양극 기재 렉 창고 - 양극 롤 차량이 기재 반입구 가고 있으면 할당 금지
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP03"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP04"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP05"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP06"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP07"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP08"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP09"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP10"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP11"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP12"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP13"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP14"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP15"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLB02_BBP16")
&& FLAG_Check_Entry_LGV_Plus_Roll == 1)
{
Alloc_Entry_LGV = 1;
}
//명령이 포장실인데 이미 다른 차량이 포장실 작업중이면 팅구기 2020 07 13 kjh 출발지 포장실 추가
if (((Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8MPB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8MPB01_BBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MPB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MPB01_BBP02"))
&& FLAG_Check_PackingRoom_Order == 1)
{
Alloc_PackingRoom_Order = 1;
}
//---------------------------------------------------------음극----------------------------------
if (Main.m_stAGV[LGV_No].current == 499)
{
//499에서 창고 명령이 아닌데 다른 차량이 대기장소에 있으면 팅구기
if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CA8PLS01_UOP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA8PLS02_UOP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8MIB01_BBP01")
&& (Check_163_Node_Minus == 1 || Check_166_Node_Minus == 1))
{
Alloc_AGV_Charge = 1;
}
}
else if (Main.m_stAGV[LGV_No].current == 163 || Main.m_stAGV[LGV_No].current == 166)
{
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS01_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS02_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01")
&& Check_Charge_Station_Minus == 1)
{
Alloc_AGV_163 = 1;
}
}
//---------------------------------------------------------양극----------------------------------
//1499 1순위 : 롤창고
else if (Main.m_stAGV[LGV_No].current == 1499)
{
//1499에서 창고 명령이 아닌데 다른 차량이 대기장소에 있으면 팅구기
if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CC8PLS01_UOP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8PLS02_UOP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8MIB01_BBP01")
&& (Check_1237_Node == 1 || Check_1041_Node == 1))
{
Alloc_AGV_Charge_Plus = 1;
}
}
//1041 : 창고, 1237부근 작업 팅구기
else if (Main.m_stAGV[LGV_No].current == 1041)
{
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS01_UOP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS02_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8MIB01_BBP01")
&& Check_Charge_Station_Plus == 1)
|| ((Main.m_stCommand[WaitCommandCount].Source_Port == "CC9PRE01_LBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CC9COT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9COT01_UBP01" || Main.m_stCommand[WaitCommandCount].Source_Port == "CC9COT01_LBP01")
&& Check_1237_Node == 1))
{
Alloc_AGV_1041 = 1;
}
}
//1237부근 작업 아니면 다 팅구기
else if (Main.m_stAGV[LGV_No].current == 1237)
{
// 양극 광폭 코터 입고대 근처에 작업이 있으면 충전소 ROLL 차량 할당 금지. lkw20190415
if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CC9PRE01_LBP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC9COT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC9COT01_UBP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC9COT01_LBP01")
&& (Check_1041_Node == 1 || Check_Plus_Big_Size_Input == 1))
{
Alloc_AGV_1237 = 1;
}
}
//---------------------------------------------------------릴타입----------------------------------
else if (Main.m_stAGV[LGV_No].current == 1268 || Main.m_stAGV[LGV_No].current == 1286
|| Main.m_stAGV[LGV_No].current == 1313 || Main.m_stAGV[LGV_No].current == 1054)
{
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"))
&& Check_Reel_Charge_Station_1438 == 1)
{
Alloc_Plus_Work_Node = 1;
}
}
else if (Main.m_stAGV[LGV_No].current == 1438)
{
//음극 슬리터
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"))
&& (Check_Reel_Charge_Station_438 == 1 || Check_Reel_Charge_Station_496 == 1
|| Check_Node_1054_AGV == 1 || Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_1438 = 1;
}
//M동 하강리프트
else if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01")
&& (Check_Node_1054_AGV == 1 || Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_1438 = 1;
}
//양극 3식 슬리터
else if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT02_UBP01")
&& (Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_1438 = 1;
}
}
else if (Main.m_stAGV[LGV_No].current == 438)
{
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"))
&& Check_Reel_Charge_Station_1438 == 1)
{
Alloc_Reel_Charge_Station_438 = 1;
}
//음극 2식 슬리터. 3식 슬리터
else if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"))
&& Check_Reel_Charge_Station_496 == 1)
{
Alloc_Reel_Charge_Station_438 = 1;
}
//M동 하강리프트
else if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01")
&& (Check_Reel_Charge_Station_1438 == 1 || Check_Node_1054_AGV == 1 || Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_438 = 1;
}
//양극 3식 슬리터
else if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT02_UBP01")
&& (Check_Reel_Charge_Station_438 == 1 || Check_Reel_Charge_Station_1438 == 1 || Check_Node_1054_AGV == 1
|| Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_438 = 1;
}
}
else if (Main.m_stAGV[LGV_No].current == 496)
{
//양극 슬리터
if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"))
&& (Check_Reel_Charge_Station_1438 == 1 || Check_Reel_Charge_Station_438 == 1))
{
Alloc_Reel_Charge_Station_496 = 1;
}
//음극 1식 슬리터
else if (((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02"))
&& Check_Reel_Charge_Station_438 == 1)
{
Alloc_Reel_Charge_Station_496 = 1;
}
//M동 하강리프트
else if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01")
&& (Check_Reel_Charge_Station_438 == 1 || Check_Reel_Charge_Station_1438 == 1 || Check_Node_1054_AGV == 1
|| Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_496 = 1;
}
//양극 3식 슬리터
else if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT02_UBP01")
&& (Check_Reel_Charge_Station_438 == 1 || Check_Reel_Charge_Station_1438 == 1 || Check_Node_1054_AGV == 1
|| Check_Node_1286_AGV == 1 || Check_Node_1268_AGV == 1 || Check_Node_1313_AGV == 1))
{
Alloc_Reel_Charge_Station_496 = 1;
}
}
#endregion
#region 오버브릿지 작업할당 관리
//오버브릿지 상승 리프트 물건이 다차있거나, 다찼을때 다른 차량이 가고 있으면 막기
if ((Main.CS_Work_DB.Carrier_1_Up == 1 && Main.CS_Work_DB.Carrier_2_Up == 1 && Main.CS_Work_DB.Carrier_3_Up == 1)
|| (Main.CS_Work_DB.Carrier_1_Up == 1 && Main.CS_Work_DB.Carrier_2_Up == 1 && Main.CS_Work_DB.Carrier_3_Up == 0 && Check_Work_UpLift == 1)
|| (Main.CS_Work_DB.Carrier_1_Up == 1 && Main.CS_Work_DB.Carrier_2_Up == 0 && Main.CS_Work_DB.Carrier_3_Up == 1 && Check_Work_UpLift == 1)
|| (Main.CS_Work_DB.Carrier_1_Up == 0 && Main.CS_Work_DB.Carrier_2_Up == 1 && Main.CS_Work_DB.Carrier_3_Up == 1 && Check_Work_UpLift == 1))
{
Check_UP_Lift_Carrier = 1;
}
if ((Main.CS_AGV_Logic.Carrier_1[1] == "1" && Main.CS_AGV_Logic.Lift_State[1] == "1" && Main.CS_AGV_Logic.Carrier_3[1] == "1")
|| (Main.CS_AGV_Logic.Carrier_1[1] == "1" && Main.CS_AGV_Logic.Lift_State[1] == "1" && Main.CS_AGV_Logic.Carrier_3[1] == "0" && Check_Floor3_Up_Lift_LGV == 1)
|| (Main.CS_AGV_Logic.Carrier_1[1] == "1" && Main.CS_AGV_Logic.Lift_State[1] == "0" && Main.CS_AGV_Logic.Carrier_3[1] == "1" && Check_Floor3_Up_Lift_LGV == 1)
|| (Main.CS_AGV_Logic.Carrier_1[1] == "0" && Main.CS_AGV_Logic.Lift_State[1] == "1" && Main.CS_AGV_Logic.Carrier_3[1] == "1" && Check_Floor3_Up_Lift_LGV == 1))
{
Check_Floor3_Up_Lift = 1;
}
int Check_7SLT_ORDER = 0;
for (int i = 0; i < Main.CS_Work_DB.waitCommand.Count; i++)
{
if (Main.m_stCommand[i].Alloc_State != "0") continue;
if (Main.M_7_SLT_First_Mode == true)
{
if (Main.m_stCommand[i].Source_Port == "CA7SLT01_UBP01"
&& ((Main.m_stAGV[LGV_No].current >= 108 && Main.m_stAGV[LGV_No].current <= 116)
|| (Main.m_stAGV[LGV_No].current >= 173 && Main.m_stAGV[LGV_No].current <= 173)
|| (Main.m_stAGV[LGV_No].current >= 264 && Main.m_stAGV[LGV_No].current <= 282)
|| (Main.m_stAGV[LGV_No].current >= 437 && Main.m_stAGV[LGV_No].current <= 439)
|| (Main.m_stAGV[LGV_No].current >= 494 && Main.m_stAGV[LGV_No].current <= 496)
|| (Main.m_stAGV[LGV_No].current >= 1090 && Main.m_stAGV[LGV_No].current <= 1098)
|| (Main.m_stAGV[LGV_No].current >= 1083 && Main.m_stAGV[LGV_No].current <= 1085)
|| (Main.m_stAGV[LGV_No].current >= 1437 && Main.m_stAGV[LGV_No].current <= 1439)))
{
Check_7SLT_ORDER = 1;
}
}
else if (Main.M_7_SLT_Minus_First_Mode == true)
{
if (Main.m_stCommand[i].Source_Port == "CA7SLT01_UBP01"
&& ((Main.m_stAGV[LGV_No].current >= 108 && Main.m_stAGV[LGV_No].current <= 116)
|| (Main.m_stAGV[LGV_No].current >= 173 && Main.m_stAGV[LGV_No].current <= 173)
|| (Main.m_stAGV[LGV_No].current >= 264 && Main.m_stAGV[LGV_No].current <= 282)
|| (Main.m_stAGV[LGV_No].current >= 437 && Main.m_stAGV[LGV_No].current <= 439)
|| (Main.m_stAGV[LGV_No].current >= 494 && Main.m_stAGV[LGV_No].current <= 496)))
{
Check_7SLT_ORDER = 1;
}
}
}
if(Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP01" && Check_7SLT_ORDER == 1)
{
Alloc_7SLT = 1;
}
//대기중인 작업 탐색
for (int i = 0; i < Main.CS_Work_DB.waitCommand.Count; i++)
{
if (WaitCommandCount == i) continue;
if (Main.m_stCommand[i].Alloc_State != "0") continue;
//오버브릿지 하강, 버퍼 명령 있는지 확인
if (Main.m_stCommand[i].Source_Port == "CC8FLF02_BBP01" || Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP01"
|| Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP02" || Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP03"
|| Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP04")
{
//오버브릿지 하강 리프트일때
if (Main.m_stCommand[i].Source_Port == "CC8FLF02_BBP01")
{
if (Main.m_stCommand[i].Dest_Port == "CC8ERB01_BBP01" || Main.m_stCommand[i].Dest_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[i].Dest_Port == "CC8ERB01_BBP03" || Main.m_stCommand[i].Dest_Port == "CC8ERB01_BBP04")
{
if (Check_Over_Buffer_AGV == 1)
{
continue;
}
}
}
if (Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP01" || Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP03" || Main.m_stCommand[i].Source_Port == "CC8ERB01_BBP04")
{
if (Check_Over_Buffer_AGV == 1)
{
continue;
}
}
Check_Over_Lift_Order = 1;
}
//M동 하강리프트 명령 있는지 확인
if (Main.m_stCommand[i].Source_Port == "CA7FLF01_BBP01")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0)
{
Check_Floor3_Down_Lift = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01")
{
Check_Floor3_Down_Lift = 1;
}
}
#region 음/양 슬리터 작업 있는지 확인
//음극 1식 슬리터 작업 있는지 확인
if (Main.m_stCommand[i].Source_Port == "CA7SLT01_UBP01" || Main.m_stCommand[i].Source_Port == "CA7SLT01_UBP02")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0 && Check_Minus_SLT1_Working_LGV == 0)
{
Check_Minus_SLT1_Order = 1;
}
//도착지가 M동 상승리프트 일때 만재 확인
else if (Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 0 && Check_Minus_SLT1_Working_LGV == 0)
{
Check_Minus_SLT1_Order = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01" && Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Minus_SLT1_Working_LGV == 0)
{
Check_Minus_SLT1_Order = 1;
}
}
//음극 2식 슬리터 작업 있는지 확인
else if (Main.m_stCommand[i].Source_Port == "CA8SLT01_UBP01" || Main.m_stCommand[i].Source_Port == "CA8SLT01_UBP02")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0 && Check_Minus_SLT2_Working_LGV == 0)
{
Check_Minus_SLT2_Order = 1;
}
//도착지가 M동 상승리프트 일때 만재 확인
else if (Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 0 && Check_Minus_SLT2_Working_LGV == 0)
{
Check_Minus_SLT2_Order = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01" && Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Minus_SLT2_Working_LGV == 0)
{
Check_Minus_SLT2_Order = 1;
}
}
//음극 3식 슬리터 작업 있는지 확인
else if (Main.m_stCommand[i].Source_Port == "CA9SLT01_UBP01" || Main.m_stCommand[i].Source_Port == "CA9SLT01_UBP02")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0 && Check_Minus_SLT3_Working_LGV == 0)
{
Check_Minus_SLT3_Order = 1;
}
//도착지가 M동 상승리프트 일때 만재 확인
else if (Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 0 && Check_Minus_SLT3_Working_LGV == 0)
{
Check_Minus_SLT3_Order = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01" && Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Minus_SLT3_Working_LGV == 0)
{
Check_Minus_SLT3_Order = 1;
}
}
//양극 1식 슬리터 작업 있는지 확인
else if (Main.m_stCommand[i].Source_Port == "CC8SLT01_UBP01" || Main.m_stCommand[i].Source_Port == "CC8SLT01_UBP02")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0 && Check_Plus_SLT1_Working_LGV == 0)
{
Check_Plus_SLT1_Order = 1;
}
//도착지가 M동 상승리프트 일때 만재 확인
else if (Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 0 && Check_Plus_SLT1_Working_LGV == 0)
{
Check_Plus_SLT1_Order = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01" && Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Plus_SLT1_Working_LGV == 0)
{
Check_Plus_SLT1_Order = 1;
}
}
//양극 2식 슬리터 작업 있는지 확인
else if (Main.m_stCommand[i].Source_Port == "CC9SLT01_UBP01" || Main.m_stCommand[i].Source_Port == "CC9SLT01_UBP02")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0 && Check_Plus_SLT2_Working_LGV == 0)
{
Check_Plus_SLT2_Order = 1;
}
//도착지가 M동 상승리프트 일때 만재 확인
else if (Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 0 && Check_Plus_SLT2_Working_LGV == 0)
{
Check_Plus_SLT2_Order = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01" && Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Plus_SLT2_Working_LGV == 0)
{
Check_Plus_SLT2_Order = 1;
}
}
//양극 3식 슬리터 작업 있는지 확인
else if (Main.m_stCommand[i].Source_Port == "CCASLT01_UBP01" || Main.m_stCommand[i].Source_Port == "CCASLT01_UBP02")
{
//도착지가 오버브릿지 상승리프트일때 만재 확인
if (Main.m_stCommand[i].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 0 && Check_Plus_SLT3_Working_LGV == 0)
{
Check_Plus_SLT3_Order = 1;
}
//도착지가 M동 상승리프트 일때 만재 확인
else if (Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 0 && Check_Plus_SLT3_Working_LGV == 0)
{
Check_Plus_SLT3_Order = 1;
}
else if (Main.m_stCommand[i].Dest_Port != "CA7FLF02_BBP01" && Main.m_stCommand[i].Dest_Port == "CC8FLF01_BBP01" && Check_Plus_SLT3_Working_LGV == 0)
{
Check_Plus_SLT3_Order = 1;
}
}
#endregion
#region 롤창고 출고대 작업 있는지 확인
if (Main.m_stCommand[i].Source_Port == "CC8PLS01_UOP01" && FLAG_Check_PackingRoom_Order == 0)
{
Check_Plus_Roll_OutPut1_Order = 1;
}
if (Main.m_stCommand[i].Source_Port == "CC8PLS02_UOP01" && FLAG_Check_PackingRoom_Order == 0)
{
Check_Plus_Roll_OutPut2_Order = 1;
}
if (Main.m_stCommand[i].Source_Port == "CA8PLS01_UOP01" && FLAG_Check_PackingRoom_Order == 0)
{
Check_Minus_Roll_OutPut1_Order = 1;
}
if (Main.m_stCommand[i].Source_Port == "CA8PLS02_UOP01" && FLAG_Check_PackingRoom_Order == 0)
{
Check_Minus_Roll_OutPut2_Order = 1;
}
#endregion
#region 롤 리와인더 출고대 작업 있는지 확인. lkw20190617
if (Main.m_stCommand[i].Source_Port == "CC6MRW01_UBP01")
{
Check_Plus_RRW1_Order = 1;
}
if (Main.m_stCommand[i].Source_Port == "CA7MRW01_UBP01")
{
Check_Minus_RRW1_Order = 1;
}
if (Main.m_stCommand[i].Source_Port == "CA7MRW02_UBP01")
{
Check_Minus_RRW2_Order = 1;
}
#endregion
}
//양극 3식 슬리터 작업 일때 다른 차량이 3식슬리터 작업 하고 있으면 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01" || Main.m_stCommand[WaitCommandCount].Dest_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02" || Main.m_stCommand[WaitCommandCount].Dest_Port == "CCASLT01_UBP02")
&& Check_Plus_SLT3 == 1)
{
Alloc_Plus_SLT3 = 1;
}
//오버 하강리프트 -> 버퍼 작업일때
if (Main.m_stAGV[LGV_No].current == 1313 || Main.m_stAGV[LGV_No].current == 1268)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01")
{
if (Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8ERB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8ERB01_BBP03"
|| Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8ERB01_BBP04")
{
//바로 뒤에 작업 가능한 차량이 있으면 팅구기
if (Check_Over_Buffer_AGV == 1)
{
Alloc_Over_Buffer_Order = 1;
}
}
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP03"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP04")
{
//바로 뒤에 작업 가능한 차량이 있으면 팅구기
if (Check_Over_Buffer_AGV == 1)
{
Alloc_Over_Buffer_Order = 1;
}
}
}
//1313,1268에서는 버퍼, 오버하강리프트 우선순위 1등, M동 하강리프트 2등
if (Main.m_stAGV[LGV_No].current == 1313 || Main.m_stAGV[LGV_No].current == 1268)
{
if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CC8FLF02_BBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP02" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP03"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP04" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP04")
&& Check_Over_Lift_Order == 1)
{
Alloc_Over_Lift_Order = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CC8FLF02_BBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP02" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP03"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP04" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP04")
&& (Check_Over_Lift_Order == 0 && Check_Floor3_Down_Lift == 1))
{
Alloc_Over_Lift_Order = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP03"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP04"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01")
{
Alloc_Over_Lift_Order = 0;
}
}
//양극 3식 슬리터 탈출지 우선순위 3식슬리터 1순위, (하강리프트,버퍼) 2순위, m동하강 리프트 3순위
if (Main.m_stAGV[LGV_No].current == 1286)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP02"
&& Check_Plus_SLT3_Order == 1)
{
Alloc_Over_Lift_Order = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP02"
&& Check_Plus_SLT3_Order == 0 && Check_Over_Lift_Order == 1)
{
Alloc_Over_Lift_Order = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8FLF02_BBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP01"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP02" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP03"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC8ERB01_BBP04")
&& (Check_Plus_SLT3_Order == 0 && Check_Over_Lift_Order == 0 && Check_Floor3_Down_Lift == 1))
{
Alloc_Over_Lift_Order = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP03"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8ERB01_BBP04"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
{
Alloc_Over_Lift_Order = 0;
}
}
//1054에서는 M동하강 리프트 우선순위1
if ((Main.m_stAGV[LGV_No].current >= 1054 && Main.m_stAGV[LGV_No].current <= 1054))
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA7FLF01_BBP01" && Check_Floor3_Down_Lift == 1)
{
Alloc_Floor3_Down_Lift = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01")
{
Alloc_Floor3_Down_Lift = 0;
}
}
//음극 1식 - 1순위 : 1식슬리터, 2순위 : 음극 슬리터, 3순위 : 양극 슬리터
if ((Main.m_stAGV[LGV_No].current >= 113 && Main.m_stAGV[LGV_No].current <= 115))
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP02"
&& Check_Minus_SLT1_Order == 1)
{
Alloc_Work_Minus_SLT1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP02"
&& Check_Minus_SLT1_Order == 0 && (Check_Minus_SLT2_Order == 1 || Check_Minus_SLT3_Order == 1))
{
Alloc_Work_Minus_SLT1 = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP02")
&& (Check_Minus_SLT1_Order == 0 && Check_Minus_SLT2_Order == 0 && Check_Minus_SLT3_Order == 0 &&
(Check_Plus_SLT1_Order == 1 || Check_Plus_SLT2_Order == 1 || Check_Plus_SLT3_Order == 1)))
{
Alloc_Work_Minus_SLT1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
{
Alloc_Work_Minus_SLT1 = 0;
}
}
//음극 2식 - 1순위 : 2식슬리터, 2순위 : 음극 슬리터, 3순위 : 양극 슬리터
if ((Main.m_stAGV[LGV_No].current >= 278 && Main.m_stAGV[LGV_No].current <= 280))
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP02"
&& Check_Minus_SLT2_Order == 1)
{
Alloc_Work_Minus_SLT2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP02"
&& Check_Minus_SLT2_Order == 0 && (Check_Minus_SLT1_Order == 1 || Check_Minus_SLT3_Order == 1))
{
Alloc_Work_Minus_SLT2 = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP02")
&& (Check_Minus_SLT1_Order == 0 && Check_Minus_SLT2_Order == 0 && Check_Minus_SLT3_Order == 0 &&
(Check_Plus_SLT1_Order == 1 || Check_Plus_SLT2_Order == 1 || Check_Plus_SLT3_Order == 1)))
{
Alloc_Work_Minus_SLT2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
{
Alloc_Work_Minus_SLT2 = 0;
}
}
//음극 3식 - 1순위 : 3식슬리터, 2순위 : 음극 슬리터, 3순위 : 양극 슬리터
if ((Main.m_stAGV[LGV_No].current >= 265 && Main.m_stAGV[LGV_No].current <= 267))
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP02"
&& Check_Minus_SLT3_Order == 1)
{
Alloc_Work_Minus_SLT3 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP02"
&& Check_Minus_SLT3_Order == 0 && (Check_Minus_SLT1_Order == 1 || Check_Minus_SLT2_Order == 1))
{
Alloc_Work_Minus_SLT3 = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA8SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CA9SLT01_UBP02")
&& (Check_Minus_SLT1_Order == 0 && Check_Minus_SLT2_Order == 0 && Check_Minus_SLT3_Order == 0 &&
(Check_Plus_SLT1_Order == 1 || Check_Plus_SLT2_Order == 1 || Check_Plus_SLT3_Order == 1)))
{
Alloc_Work_Minus_SLT3 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
{
Alloc_Work_Minus_SLT3 = 0;
}
}
//양극 롤창고 1 - 1순위 출고대_1, 2순위 출고대_2
if (Main.m_stAGV[LGV_No].current == 1002)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC8PLS01_UOP01" && Check_Plus_Roll_OutPut1_Order == 1)
{
Alloc_Plus_Roll_InPut1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC8PLS01_UOP01" && (Check_Plus_Roll_OutPut1_Order == 0 && Check_Plus_Roll_OutPut2_Order == 1))
{
Alloc_Plus_Roll_InPut1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS01_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS02_UOP01")
{
Alloc_Plus_Roll_InPut1 = 0;
}
}
//양극 롤창고 2 - 1순위 출고대_2, 2순위 출고대_1
if (Main.m_stAGV[LGV_No].current == 1020)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC8PLS02_UOP01" && Check_Plus_Roll_OutPut2_Order == 1)
{
Alloc_Plus_Roll_InPut2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC8PLS02_UOP01" && (Check_Plus_Roll_OutPut2_Order == 0 && Check_Plus_Roll_OutPut1_Order == 1))
{
Alloc_Plus_Roll_InPut2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS01_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8PLS02_UOP01")
{
Alloc_Plus_Roll_InPut2 = 0;
}
}
//음극 롤창고 1 - 1순위 출고대_1, 2순위 출고대_2
if (Main.m_stAGV[LGV_No].current == 1002)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA8PLS01_UOP01" && Check_Minus_Roll_OutPut1_Order == 1)
{
Alloc_Minus_Roll_InPut1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA8PLS01_UOP01" && (Check_Minus_Roll_OutPut1_Order == 0 && Check_Minus_Roll_OutPut2_Order == 1))
{
Alloc_Minus_Roll_InPut1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS01_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS02_UOP01")
{
Alloc_Minus_Roll_InPut1 = 0;
}
}
//음극 롤창고 2 - 1순위 출고대_2, 2순위 출고대_1
if (Main.m_stAGV[LGV_No].current == 4)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA8PLS02_UOP01" && Check_Minus_Roll_OutPut2_Order == 1)
{
Alloc_Minus_Roll_InPut2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA8PLS02_UOP01" && (Check_Minus_Roll_OutPut2_Order == 0 && Check_Minus_Roll_OutPut1_Order == 1))
{
Alloc_Minus_Roll_InPut2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS01_UOP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8PLS02_UOP01")
{
Alloc_Minus_Roll_InPut2 = 0;
}
}
//양극 1식 - 1순위 : 1식슬리터, 2순위 : 양극 슬리터, 3순위 : M동 하강,오버하강 리프트
if ((Main.m_stAGV[LGV_No].current >= 1091 && Main.m_stAGV[LGV_No].current <= 1097))
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP02"
&& Check_Plus_SLT1_Order == 1)
{
Alloc_Work_Plus_SLT1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP02"
&& Check_Plus_SLT1_Order == 0 && (Check_Plus_SLT2_Order == 1 || Check_Plus_SLT3_Order == 1))
{
Alloc_Work_Plus_SLT1 = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP02")
&& (Check_Plus_SLT1_Order == 0 && Check_Plus_SLT2_Order == 0 && Check_Plus_SLT3_Order == 0 &&
(Check_Over_Lift_Order == 1 || Check_Floor3_Down_Lift == 1)))
{
Alloc_Work_Plus_SLT1 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
{
Alloc_Work_Plus_SLT1 = 0;
}
}
//양극 2식 - 1순위 : 2식슬리터, 2순위 : 양극 슬리터, 3순위 : M동 하강,오버하강 리프트
if (Main.m_stAGV[LGV_No].current >= 1084 && Main.m_stAGV[LGV_No].current <= 1084)
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP02"
&& Check_Plus_SLT2_Order == 1)
{
Alloc_Work_Plus_SLT2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP02"
&& Check_Plus_SLT2_Order == 0 && (Check_Plus_SLT1_Order == 1 || Check_Plus_SLT3_Order == 1))
{
Alloc_Work_Plus_SLT2 = 1;
}
else if ((Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC8SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CC9SLT01_UBP02"
&& Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP01" && Main.m_stCommand[WaitCommandCount].Source_Port != "CCASLT01_UBP02")
&& (Check_Plus_SLT1_Order == 0 && Check_Plus_SLT2_Order == 0 && Check_Plus_SLT3_Order == 0 &&
(Check_Over_Lift_Order == 1 || Check_Floor3_Down_Lift == 1)))
{
Alloc_Work_Plus_SLT2 = 1;
}
else if (Main.m_stCommand[WaitCommandCount].Source_Port == "CA7FLF01_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8FLF02_BBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC9SLT01_UBP02"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CCASLT01_UBP02")
{
Alloc_Work_Plus_SLT2 = 0;
}
}
//음극 1식 슬리터 배출 작업일때 다른 차량이 1식슬리터로 공급 작업중일때 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02") && Check_Minus_SLT1_Working_LGV == 1)
{
Alloc_Work_Minus_SLT1 = 1;
}
//음극 2식 슬리터 배출 작업일때 다른 차량이 2식슬리터로 공급 작업중일때 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02") && Check_Minus_SLT2_Working_LGV == 1)
{
Alloc_Work_Minus_SLT2 = 1;
}
//음극 3식 슬리터 배출 작업일때 다른 차량이 3식슬리터로 공급 작업중일때 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02") && Check_Minus_SLT3_Working_LGV == 1)
{
Alloc_Work_Minus_SLT3 = 1;
}
//양극 1식 슬리터 배출 작업일때 다른 차량이 1식슬리터로 공급 작업중일때 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA7SLT01_UBP02") && Check_Minus_SLT1_Working_LGV == 1)
{
Alloc_Work_Plus_SLT1 = 1;
}
//양극 2식 슬리터 배출 작업일때 다른 차량이 2식슬리터로 공급 작업중일때 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA8SLT01_UBP02") && Check_Minus_SLT2_Working_LGV == 1)
{
Alloc_Work_Plus_SLT2 = 1;
}
//양극 3식 슬리터 배출 작업일때 다른 차량이 3식슬리터로 공급 작업중일때 할당 막기
if ((Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CA9SLT01_UBP02") && Check_Minus_SLT3_Working_LGV == 1)
{
Alloc_Work_Plus_SLT3 = 1;
}
//오버브릿지 상승리프트 만재 확인
if (Main.m_stCommand[WaitCommandCount].Dest_Port == "CA7FLF02_BBP01" && Check_UP_Lift_Carrier == 1)
{
Alloc_UP_Lift_Carrier = 1;
}
//3층 상승 리프트 물건이 다차있으면 막기
if (Main.m_stCommand[WaitCommandCount].Dest_Port == "CC8FLF01_BBP01" && Check_Floor3_Up_Lift == 1)
{
Alloc_Floor3_Up_Lift = 1;
}
//1084에서 다른차량이 양극1식 슬리터 작업중이면 막기
if (Main.m_stAGV[LGV_No].current == 1084 && Check_PLUS_SLT_1 == 1
&& (Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP01"
|| Main.m_stCommand[WaitCommandCount].Source_Port == "CC8SLT01_UBP02"))
{
Alloc_PLUS_SLT_1 = 1;
}
//포장실 탈출지에서는 할당 금지
//포장실 탈출지에서 양극 롤 리와인더 #1 출고대 작업이 없으면 할당 금지한다. lkw20190617
if (Main.m_stAGV[LGV_No].current == 1156 &&
Check_Plus_RRW1_Order == 0)
{
Alloc_1156_NoWork = 1;
}
if ((Main.m_stAGV[LGV_No].current == 1369 || Main.m_stAGV[LGV_No].current == 369) && (Main.m_stAGV[LGV_No].MCS_Source_Port == "" && Main.m_stAGV[LGV_No].MCS_Dest_Port == ""))
{
if (Main.m_stCommand[WaitCommandCount].Source_Port != "CA7FLF01_BBP01")
{
Alloc_1369_NoWork = 1;
}
}
//양극 롤 리와인더 #1 출고대 작업이 있고,
//양극 롤 리와인더 #1 입고대 작업이 끝난 상태이면 작업을 할당할 수 있게 한다.
//양극 롤 리와인더 #2 입고대 작업이 끝난 상태이면 작업을 할당할 수 있게 한다.
//포장실 작업이 끝난 상태이면 작업을 할당할 수 있게 한다. lkw20190617
if ((Main.m_stAGV[LGV_No].current == 1085 || Main.m_stAGV[LGV_No].current == 1149 || Main.m_stAGV[LGV_No].current == 1156)
&& Check_Plus_RRW1_Order == 1 && Main.m_stCommand[WaitCommandCount].Source_Port == "CC6MRW01_UBP01")
{
Alloc_Work_Plus_RRW1 = 0;
}
//양극 롤 리와인더 #1 입고대 작업이 끝난 상태에서 출고대 작업이 있으면 다른 작업은 무시한다.
//양극 롤 리와인더 #2 입고대 작업이 끝난 상태에서 출고대 작업이 있으면 다른 작업은 무시한다.
if ((Main.m_stAGV[LGV_No].current == 1085 || Main.m_stAGV[LGV_No].current == 1149)
&& Check_Plus_RRW1_Order == 1 && Main.m_stCommand[WaitCommandCount].Source_Port != "CC6MRW01_UBP01")
{
Alloc_Work_Plus_RRW1 = 1;
}
//음극 롤 리와인더 #1 출고대 작업이 있고,
//음극 롤 리와인더 #1 입고대 작업이 끝난 상태이면 작업을 할당할 수 있게 한다.
//음극 롤 리와인더 #2 입고대 작업이 끝난 상태이면 작업을 할당할 수 있게 한다. lkw20190617
if ((Main.m_stAGV[LGV_No].current == 271 || Main.m_stAGV[LGV_No].current == 289)
&& Check_Minus_RRW1_Order == 1 && Main.m_stCommand[WaitCommandCount].Source_Port == "CA7MRW01_UBP01")
{
Alloc_Work_Minus_RRW1 = 0;
}
//음극 롤 리와인더 #1 입고대 작업이 끝난 상태에서 출고대 작업이 있으면 다른 작업은 무시한다.
//음극 롤 리와인더 #2 입고대 작업이 끝난 상태에서 출고대 작업이 있으면 다른 작업은 무시한다.
if ((Main.m_stAGV[LGV_No].current == 271 || Main.m_stAGV[LGV_No].current == 289)
&& Check_Minus_RRW1_Order == 1 && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7MRW01_UBP01")
{
Alloc_Work_Minus_RRW1 = 1;
}
//음극 롤 리와인더 #2 출고대 작업이 있고,
//음극 롤 리와인더 #1 입고대 작업이 끝난 상태이면 작업을 할당할 수 있게 한다.
//음극 롤 리와인더 #2 입고대 작업이 끝난 상태이면 작업을 할당할 수 있게 한다. lkw20190617
if ((Main.m_stAGV[LGV_No].current == 271 || Main.m_stAGV[LGV_No].current == 289)
&& Check_Minus_RRW2_Order == 1 && Main.m_stCommand[WaitCommandCount].Source_Port == "CA7MRW02_UBP01")
{
Alloc_Work_Minus_RRW2 = 0;
}
//음극 롤 리와인더 #1 입고대 작업이 끝난 상태에서 출고대 작업이 있으면 다른 작업은 무시한다.
//음극 롤 리와인더 #2 입고대 작업이 끝난 상태에서 출고대 작업이 있으면 다른 작업은 무시한다.
if ((Main.m_stAGV[LGV_No].current == 271 || Main.m_stAGV[LGV_No].current == 289)
&& Check_Minus_RRW2_Order == 1 && Main.m_stCommand[WaitCommandCount].Source_Port != "CA7MRW02_UBP01")
{
Alloc_Work_Minus_RRW2 = 1;
}
#endregion
for (int Work_Station_Count = 0; Work_Station_Count < Main.CS_Work_DB.Path_Count; Work_Station_Count++)
{
if (((Main.CS_Work_Path[Work_Station_Count].Work_Station == Main.m_stCommand[WaitCommandCount].Source_Port) && Main.m_stAGV[LGV_No].MCS_Carrier_ID == "")
|| (Main.m_stCommand[WaitCommandCount].Source_Port == Main.m_stAGV[LGV_No].MCS_Vehicle_ID))
{
if ((Main.CS_AGV_C_Info[LGV_No].Type == Main.CS_Work_Path[Work_Station_Count].Type)
|| (Main.m_stCommand[WaitCommandCount].Source_Port == Main.m_stAGV[LGV_No].MCS_Vehicle_ID)
|| (Main.CS_Work_Path[Work_Station_Count].Type == "기재" || (Main.CS_Work_Path[Work_Station_Count].Type == "ROLL_공용(음)" && (LGV_No == 5 || LGV_No == 6 || LGV_No == 7 || LGV_No == 8))
|| (Main.CS_Work_Path[Work_Station_Count].Type == "ROLL_공용(양)" && (LGV_No == 2 || LGV_No == 3 || LGV_No == 4 || LGV_No == 10))
|| (Main.CS_Work_Path[Work_Station_Count].Type == "REEL_공용" && (LGV_No == 0 || LGV_No == 1 || LGV_No == 9 || LGV_No == 11 || LGV_No == 12))))
{
Check_WorkType_Source = 1;
}
}
if ((Main.CS_Work_Path[Work_Station_Count].Work_Station == Main.m_stCommand[WaitCommandCount].Dest_Port))
{
if ((Main.CS_AGV_C_Info[LGV_No].Type == Main.CS_Work_Path[Work_Station_Count].Type)
|| (Main.m_stCommand[WaitCommandCount].Source_Port == Main.m_stAGV[LGV_No].MCS_Vehicle_ID)
|| (Main.CS_Work_Path[Work_Station_Count].Type == "기재" || (Main.CS_Work_Path[Work_Station_Count].Type == "ROLL_공용(음)" && (LGV_No == 5 || LGV_No == 6 || LGV_No == 7 || LGV_No == 8))
|| (Main.CS_Work_Path[Work_Station_Count].Type == "ROLL_공용(양)" && (LGV_No == 2 || LGV_No == 3 || LGV_No == 4 || LGV_No == 10))
|| (Main.CS_Work_Path[Work_Station_Count].Type == "REEL_공용" && (LGV_No == 0 || LGV_No == 1 || LGV_No == 9 || LGV_No == 11 || LGV_No == 12))))
{
Check_WorkType_Dest = 1;
}
}
if (Check_WorkType_Source == 1 && Check_WorkType_Dest == 1)
{
FLAG_Check_WorkType = 1;
break;
}
}
//출발지가 차량 번호일때는 팅구는 조건 무시
if (Main.m_stCommand[WaitCommandCount].Source_Port == Main.m_stAGV[LGV_No].MCS_Vehicle_ID && FLAG_Check_WorkType == 1
&& Main.m_stCommand[WaitCommandCount].Alloc_State == "0"
&& (Main.m_stAGV[LGV_No].state == 0 || Main.m_stAGV[LGV_No].state == 4 || Main.m_stAGV[LGV_No].state == 8 || Main.m_stAGV[LGV_No].state == 5
|| Main.m_stAGV[LGV_No].state == 6 || Main.m_stAGV[LGV_No].state == 9 || Main.m_stAGV[LGV_No].state == 10))
{
Main.CS_AGV_Logic.Wait_Command_ID = Main.m_stCommand[WaitCommandCount].Command_ID;
Main.CS_AGV_Logic.Wait_Proiority = Main.m_stCommand[WaitCommandCount].Proiority;
Main.CS_AGV_Logic.Wait_Carrier_ID = Main.m_stCommand[WaitCommandCount].Carrier_ID;
Main.CS_AGV_Logic.Wait_Source_Port = Main.m_stCommand[WaitCommandCount].Source_Port;
Main.CS_AGV_Logic.Wait_Dest_Port = Main.m_stCommand[WaitCommandCount].Dest_Port;
Main.CS_AGV_Logic.Wait_Carrier_Type = Main.m_stCommand[WaitCommandCount].Carrier_Type;
Main.CS_AGV_Logic.Wait_Carrier_LOC = Main.m_stCommand[WaitCommandCount].Carrier_LOC;
Main.CS_AGV_Logic.Wait_Process_ID = Main.m_stCommand[WaitCommandCount].Process_ID;
Main.CS_AGV_Logic.Wait_Batch_ID = Main.m_stCommand[WaitCommandCount].Batch_ID;
Main.CS_AGV_Logic.Wait_LOT_ID = Main.m_stCommand[WaitCommandCount].LOT_ID;
Main.CS_AGV_Logic.Wait_Carrier_S_Count = Main.m_stCommand[WaitCommandCount].Carrier_S_Count;
Main.CS_AGV_Logic.Wait_Alloc_State = Main.m_stCommand[WaitCommandCount].Alloc_State;
Main.CS_AGV_Logic.Wait_Transfer_State = Main.m_stCommand[WaitCommandCount].Transfer_State;
Main.CS_AGV_Logic.Wait_LGV_No = Main.m_stCommand[WaitCommandCount].LGV_No;
Main.CS_AGV_Logic.Wait_Call_Time = Main.m_stCommand[WaitCommandCount].Call_Time;
Main.CS_AGV_Logic.Wait_Alloc_Time = Main.m_stCommand[WaitCommandCount].Alloc_Time;
Main.CS_AGV_Logic.Wait_Complete_Time = Main.m_stCommand[WaitCommandCount].Complete_Time;
Main.CS_AGV_Logic.Wait_Quantity = Main.m_stCommand[WaitCommandCount].Quantity;
break;
}
//일반
else if (FLAG_Check_WorkType == 1 && Alloc_AGV_166 == 0 && Alloc_AGV_163 == 0 && Alloc_AGV_Charge == 0 && Alloc_UP_Lift_Carrier == 0 && Alloc_Over_Lift_Order == 0 && Alloc_PackingRoom_Order == 0 && Alloc_Over_Buffer_Order == 0
&& Alloc_Reel_Charge_Station_1438 == 0 && Alloc_Reel_Charge_Station_438 == 0 && Alloc_Reel_Charge_Station_496 == 0 && Alloc_Floor3_Down_Lift == 0 && Alloc_Plus_SLT3 == 0 && Alloc_3_Up_Lift == 0 && Alloc_3SLT_LGV == 0
&& Alloc_Work_Plus_SLT1 == 0 && Alloc_Work_Plus_SLT2 == 0 && Alloc_Work_Plus_SLT3 == 0 && Alloc_Work_Minus_SLT1 == 0 && Alloc_Work_Minus_SLT2 == 0 && Alloc_Work_Minus_SLT3 == 0 && Alloc_1369_NoWork == 0
&& Alloc_AGV_1237 == 0 && Alloc_AGV_1041 == 0 && Alloc_AGV_Charge_Plus == 0 && Alloc_Entry_LGV == 0 && Alloc_Entry_Plus_Roll == 0 && FLAG_Alloc_Lift_Order == 0 && Alloc_PLUS_SLT_1 == 0
&& Alloc_Floor3_Up_Lift == 0 && Alloc_Entry_Minus_Roll == 0 && Alloc_23SLT_LGV == 0 && Alloc_1156_NoWork == 0 && Alloc_Plus_Roll_InPut1 == 0 && Alloc_Plus_Roll_InPut2 == 0 && Alloc_Minus_Roll_InPut1 == 0 && Alloc_Minus_Roll_InPut2 == 0
&& Main.m_stCommand[WaitCommandCount].Alloc_State == "0" && Alloc_Plus_Work_Node == 0 && Alloc_Charge_Station_M_Roll == 0 && Alloc_Charge_Station_P_Roll == 0
&& Alloc_Work_Plus_RRW1 == 0 && Alloc_Work_Minus_RRW1 == 0 && Alloc_Work_Minus_RRW2 == 0
&& (Main.m_stAGV[LGV_No].state == 0 || Main.m_stAGV[LGV_No].state == 4 || Main.m_stAGV[LGV_No].state == 8 || Main.m_stAGV[LGV_No].state == 5
|| Main.m_stAGV[LGV_No].state == 6 || Main.m_stAGV[LGV_No].state == 9 || Main.m_stAGV[LGV_No].state == 10) && Main.M_7_SLT_Normal == true)
{
Main.CS_AGV_Logic.Wait_Command_ID = Main.m_stCommand[WaitCommandCount].Command_ID;
Main.CS_AGV_Logic.Wait_Proiority = Main.m_stCommand[WaitCommandCount].Proiority;
Main.CS_AGV_Logic.Wait_Carrier_ID = Main.m_stCommand[WaitCommandCount].Carrier_ID;
Main.CS_AGV_Logic.Wait_Source_Port = Main.m_stCommand[WaitCommandCount].Source_Port;
Main.CS_AGV_Logic.Wait_Dest_Port = Main.m_stCommand[WaitCommandCount].Dest_Port;
Main.CS_AGV_Logic.Wait_Carrier_Type = Main.m_stCommand[WaitCommandCount].Carrier_Type;
Main.CS_AGV_Logic.Wait_Carrier_LOC = Main.m_stCommand[WaitCommandCount].Carrier_LOC;
Main.CS_AGV_Logic.Wait_Process_ID = Main.m_stCommand[WaitCommandCount].Process_ID;
Main.CS_AGV_Logic.Wait_Batch_ID = Main.m_stCommand[WaitCommandCount].Batch_ID;
Main.CS_AGV_Logic.Wait_LOT_ID = Main.m_stCommand[WaitCommandCount].LOT_ID;
Main.CS_AGV_Logic.Wait_Carrier_S_Count = Main.m_stCommand[WaitCommandCount].Carrier_S_Count;
Main.CS_AGV_Logic.Wait_Alloc_State = Main.m_stCommand[WaitCommandCount].Alloc_State;
Main.CS_AGV_Logic.Wait_Transfer_State = Main.m_stCommand[WaitCommandCount].Transfer_State;
Main.CS_AGV_Logic.Wait_LGV_No = Main.m_stCommand[WaitCommandCount].LGV_No;
Main.CS_AGV_Logic.Wait_Call_Time = Main.m_stCommand[WaitCommandCount].Call_Time;
Main.CS_AGV_Logic.Wait_Alloc_Time = Main.m_stCommand[WaitCommandCount].Alloc_Time;
Main.CS_AGV_Logic.Wait_Complete_Time = Main.m_stCommand[WaitCommandCount].Complete_Time;
Main.CS_AGV_Logic.Wait_Quantity = Main.m_stCommand[WaitCommandCount].Quantity;
break;
}
//슬리터 우선
else if (((Alloc_AGV_166 == 0 && Alloc_AGV_163 == 0 && Alloc_AGV_Charge == 0 && Alloc_UP_Lift_Carrier == 0 && Alloc_Over_Lift_Order == 0 && Alloc_PackingRoom_Order == 0 && Alloc_Over_Buffer_Order == 0
&& Alloc_Reel_Charge_Station_1438 == 0 && Alloc_Reel_Charge_Station_438 == 0 && Alloc_Reel_Charge_Station_496 == 0 && Alloc_Floor3_Down_Lift == 0 && Alloc_Plus_SLT3 == 0 && Alloc_3_Up_Lift == 0 && Alloc_3SLT_LGV == 0
&& Alloc_Work_Plus_SLT1 == 0 && Alloc_Work_Plus_SLT2 == 0 && Alloc_Work_Plus_SLT3 == 0 && Alloc_Work_Minus_SLT1 == 0 && Alloc_Work_Minus_SLT2 == 0 && Alloc_Work_Minus_SLT3 == 0 && Alloc_1369_NoWork == 0
&& Alloc_AGV_1237 == 0 && Alloc_AGV_1041 == 0 && Alloc_AGV_Charge_Plus == 0 && Alloc_Entry_LGV == 0 && Alloc_Entry_Plus_Roll == 0 && FLAG_Alloc_Lift_Order == 0 && Alloc_PLUS_SLT_1 == 0
&& Alloc_Floor3_Up_Lift == 0 && Alloc_Entry_Minus_Roll == 0 && Alloc_23SLT_LGV == 0 && Alloc_1156_NoWork == 0 && Alloc_Plus_Roll_InPut1 == 0 && Alloc_Plus_Roll_InPut2 == 0 && Alloc_Minus_Roll_InPut1 == 0 && Alloc_Minus_Roll_InPut2 == 0
&& Alloc_Plus_Work_Node == 0 && Alloc_Charge_Station_M_Roll == 0 && Alloc_Charge_Station_P_Roll == 0
&& Alloc_Work_Plus_RRW1 == 0 && Alloc_Work_Minus_RRW1 == 0 && Alloc_Work_Minus_RRW2 == 0 && Check_7SLT_ORDER == 0)
|| (Check_7SLT_ORDER == 1 && Alloc_UP_Lift_Carrier == 0 && Alloc_Floor3_Up_Lift == 0 && Alloc_7SLT == 0))
&& (Main.m_stAGV[LGV_No].state == 0 || Main.m_stAGV[LGV_No].state == 4 || Main.m_stAGV[LGV_No].state == 8 || Main.m_stAGV[LGV_No].state == 5
|| Main.m_stAGV[LGV_No].state == 6 || Main.m_stAGV[LGV_No].state == 9 || Main.m_stAGV[LGV_No].state == 10) && Main.M_7_SLT_First_Mode == true
&& FLAG_Check_WorkType == 1 && Main.m_stCommand[WaitCommandCount].Alloc_State == "0")
{
Main.CS_AGV_Logic.Wait_Command_ID = Main.m_stCommand[WaitCommandCount].Command_ID;
Main.CS_AGV_Logic.Wait_Proiority = Main.m_stCommand[WaitCommandCount].Proiority;
Main.CS_AGV_Logic.Wait_Carrier_ID = Main.m_stCommand[WaitCommandCount].Carrier_ID;
Main.CS_AGV_Logic.Wait_Source_Port = Main.m_stCommand[WaitCommandCount].Source_Port;
Main.CS_AGV_Logic.Wait_Dest_Port = Main.m_stCommand[WaitCommandCount].Dest_Port;
Main.CS_AGV_Logic.Wait_Carrier_Type = Main.m_stCommand[WaitCommandCount].Carrier_Type;
Main.CS_AGV_Logic.Wait_Carrier_LOC = Main.m_stCommand[WaitCommandCount].Carrier_LOC;
Main.CS_AGV_Logic.Wait_Process_ID = Main.m_stCommand[WaitCommandCount].Process_ID;
Main.CS_AGV_Logic.Wait_Batch_ID = Main.m_stCommand[WaitCommandCount].Batch_ID;
Main.CS_AGV_Logic.Wait_LOT_ID = Main.m_stCommand[WaitCommandCount].LOT_ID;
Main.CS_AGV_Logic.Wait_Carrier_S_Count = Main.m_stCommand[WaitCommandCount].Carrier_S_Count;
Main.CS_AGV_Logic.Wait_Alloc_State = Main.m_stCommand[WaitCommandCount].Alloc_State;
Main.CS_AGV_Logic.Wait_Transfer_State = Main.m_stCommand[WaitCommandCount].Transfer_State;
Main.CS_AGV_Logic.Wait_LGV_No = Main.m_stCommand[WaitCommandCount].LGV_No;
Main.CS_AGV_Logic.Wait_Call_Time = Main.m_stCommand[WaitCommandCount].Call_Time;
Main.CS_AGV_Logic.Wait_Alloc_Time = Main.m_stCommand[WaitCommandCount].Alloc_Time;
Main.CS_AGV_Logic.Wait_Complete_Time = Main.m_stCommand[WaitCommandCount].Complete_Time;
Main.CS_AGV_Logic.Wait_Quantity = Main.m_stCommand[WaitCommandCount].Quantity;
break;
}
//슬리터 우선(음극라인만)
else if (((Alloc_AGV_166 == 0 && Alloc_AGV_163 == 0 && Alloc_AGV_Charge == 0 && Alloc_UP_Lift_Carrier == 0 && Alloc_Over_Lift_Order == 0 && Alloc_PackingRoom_Order == 0 && Alloc_Over_Buffer_Order == 0
&& Alloc_Reel_Charge_Station_1438 == 0 && Alloc_Reel_Charge_Station_438 == 0 && Alloc_Reel_Charge_Station_496 == 0 && Alloc_Floor3_Down_Lift == 0 && Alloc_Plus_SLT3 == 0 && Alloc_3_Up_Lift == 0 && Alloc_3SLT_LGV == 0
&& Alloc_Work_Plus_SLT1 == 0 && Alloc_Work_Plus_SLT2 == 0 && Alloc_Work_Plus_SLT3 == 0 && Alloc_Work_Minus_SLT1 == 0 && Alloc_Work_Minus_SLT2 == 0 && Alloc_Work_Minus_SLT3 == 0 && Alloc_1369_NoWork == 0
&& Alloc_AGV_1237 == 0 && Alloc_AGV_1041 == 0 && Alloc_AGV_Charge_Plus == 0 && Alloc_Entry_LGV == 0 && Alloc_Entry_Plus_Roll == 0 && FLAG_Alloc_Lift_Order == 0 && Alloc_PLUS_SLT_1 == 0
&& Alloc_Floor3_Up_Lift == 0 && Alloc_Entry_Minus_Roll == 0 && Alloc_23SLT_LGV == 0 && Alloc_1156_NoWork == 0 && Alloc_Plus_Roll_InPut1 == 0 && Alloc_Plus_Roll_InPut2 == 0 && Alloc_Minus_Roll_InPut1 == 0 && Alloc_Minus_Roll_InPut2 == 0
&& Alloc_Plus_Work_Node == 0 && Alloc_Charge_Station_M_Roll == 0 && Alloc_Charge_Station_P_Roll == 0
&& Alloc_Work_Plus_RRW1 == 0 && Alloc_Work_Minus_RRW1 == 0 && Alloc_Work_Minus_RRW2 == 0 && Check_7SLT_ORDER == 0)
|| (Check_7SLT_ORDER == 1 && Alloc_UP_Lift_Carrier == 0 && Alloc_Floor3_Up_Lift == 0 && Alloc_7SLT == 0))
&& (Main.m_stAGV[LGV_No].state == 0 || Main.m_stAGV[LGV_No].state == 4 || Main.m_stAGV[LGV_No].state == 8 || Main.m_stAGV[LGV_No].state == 5
|| Main.m_stAGV[LGV_No].state == 6 || Main.m_stAGV[LGV_No].state == 9 || Main.m_stAGV[LGV_No].state == 10) && Main.M_7_SLT_Minus_First_Mode == true
&& FLAG_Check_WorkType == 1 && Main.m_stCommand[WaitCommandCount].Alloc_State == "0")
{
Main.CS_AGV_Logic.Wait_Command_ID = Main.m_stCommand[WaitCommandCount].Command_ID;
Main.CS_AGV_Logic.Wait_Proiority = Main.m_stCommand[WaitCommandCount].Proiority;
Main.CS_AGV_Logic.Wait_Carrier_ID = Main.m_stCommand[WaitCommandCount].Carrier_ID;
Main.CS_AGV_Logic.Wait_Source_Port = Main.m_stCommand[WaitCommandCount].Source_Port;
Main.CS_AGV_Logic.Wait_Dest_Port = Main.m_stCommand[WaitCommandCount].Dest_Port;
Main.CS_AGV_Logic.Wait_Carrier_Type = Main.m_stCommand[WaitCommandCount].Carrier_Type;
Main.CS_AGV_Logic.Wait_Carrier_LOC = Main.m_stCommand[WaitCommandCount].Carrier_LOC;
Main.CS_AGV_Logic.Wait_Process_ID = Main.m_stCommand[WaitCommandCount].Process_ID;
Main.CS_AGV_Logic.Wait_Batch_ID = Main.m_stCommand[WaitCommandCount].Batch_ID;
Main.CS_AGV_Logic.Wait_LOT_ID = Main.m_stCommand[WaitCommandCount].LOT_ID;
Main.CS_AGV_Logic.Wait_Carrier_S_Count = Main.m_stCommand[WaitCommandCount].Carrier_S_Count;
Main.CS_AGV_Logic.Wait_Alloc_State = Main.m_stCommand[WaitCommandCount].Alloc_State;
Main.CS_AGV_Logic.Wait_Transfer_State = Main.m_stCommand[WaitCommandCount].Transfer_State;
Main.CS_AGV_Logic.Wait_LGV_No = Main.m_stCommand[WaitCommandCount].LGV_No;
Main.CS_AGV_Logic.Wait_Call_Time = Main.m_stCommand[WaitCommandCount].Call_Time;
Main.CS_AGV_Logic.Wait_Alloc_Time = Main.m_stCommand[WaitCommandCount].Alloc_Time;
Main.CS_AGV_Logic.Wait_Complete_Time = Main.m_stCommand[WaitCommandCount].Complete_Time;
Main.CS_AGV_Logic.Wait_Quantity = Main.m_stCommand[WaitCommandCount].Quantity;
break;
}
}
}
}
}
}
|
using Xunit;
using ZKCloud.Domains.Repositories.Pager;
namespace ZKCloud.Test.Domains.Repositories
{
/// <summary>
/// 分页参数测试
/// </summary>
public class PagerTest
{
/// <summary>
/// 测试初始化
/// </summary>
public PagerTest()
{
_pager = new Pager();
}
/// <summary>
/// 分页参数
/// </summary>
private readonly Pager _pager;
/// <summary>
/// 测试分页默认值
/// </summary>
[Fact]
public void TestDefault()
{
Assert.Equal(1, _pager.Page);
Assert.Equal(20, _pager.PageSize);
Assert.Equal(0, _pager.TotalCount);
Assert.Equal(0, _pager.GetPageCount());
Assert.Equal(0, _pager.GetSkipCount());
Assert.Equal("", _pager.Order);
Assert.Equal(1, _pager.GetStartNumber());
Assert.Equal(20, _pager.GetEndNumber());
}
/// <summary>
/// 测试起始和结束行数
/// </summary>
[Fact]
public void TestGetStartNumber()
{
_pager.Page = 2;
_pager.PageSize = 10;
Assert.Equal(11, _pager.GetStartNumber());
Assert.Equal(20, _pager.GetEndNumber());
}
/// <summary>
/// 测试页索引 - 小于1,则修正为1
/// </summary>
[Fact]
public void TestPage()
{
_pager.Page = 0;
Assert.Equal(1, _pager.Page);
_pager.Page = -1;
Assert.Equal(1, _pager.Page);
}
/// <summary>
/// 测试总页数
/// </summary>
[Fact]
public void TestPageCount()
{
_pager.TotalCount = 0;
Assert.Equal(0, _pager.GetPageCount());
_pager.TotalCount = 100;
Assert.Equal(5, _pager.GetPageCount());
_pager.TotalCount = 1;
Assert.Equal(1, _pager.GetPageCount());
_pager.PageSize = 10;
_pager.TotalCount = 100;
Assert.Equal(10, _pager.GetPageCount());
}
/// <summary>
/// 测试跳过的行数
/// </summary>
[Fact]
public void TestSkipCount()
{
_pager.TotalCount = 100;
_pager.Page = 0;
Assert.Equal(0, _pager.GetSkipCount());
_pager.Page = 1;
Assert.Equal(0, _pager.GetSkipCount());
_pager.Page = 2;
Assert.Equal(20, _pager.GetSkipCount());
_pager.Page = 3;
Assert.Equal(40, _pager.GetSkipCount());
_pager.Page = 4;
Assert.Equal(60, _pager.GetSkipCount());
_pager.Page = 5;
Assert.Equal(80, _pager.GetSkipCount());
_pager.Page = 6;
Assert.Equal(80, _pager.GetSkipCount());
_pager.TotalCount = 99;
_pager.Page = 0;
Assert.Equal(0, _pager.GetSkipCount());
_pager.Page = 1;
Assert.Equal(0, _pager.GetSkipCount());
_pager.Page = 2;
Assert.Equal(20, _pager.GetSkipCount());
_pager.Page = 3;
Assert.Equal(40, _pager.GetSkipCount());
_pager.Page = 4;
Assert.Equal(60, _pager.GetSkipCount());
_pager.Page = 5;
Assert.Equal(80, _pager.GetSkipCount());
_pager.Page = 6;
Assert.Equal(80, _pager.GetSkipCount());
_pager.TotalCount = 0;
_pager.Page = 1;
Assert.Equal(0, _pager.GetSkipCount());
}
}
} |
using buildingEnergyLoss.Repository;
using System.Collections.Generic;
using System.Diagnostics;
namespace buildingEnergyLoss
{
public class MainViewModel
{
public string ProjectName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int OutdoorTemperatureId { get; set; }
public int IndoorTemperatureId { get; set; }
public int TypeOfBuilding { get; set; } = 1;
public int TypeOfCountry { get; set; } = 1;
private List<MaterialIdAndThickness> _wallId = new List<MaterialIdAndThickness>();
public double LengthA { get; set; }
public double LengthB { get; set; }
public void PrintProp()
{
Debug.WriteLine("Meno pr " + ProjectName);
Debug.WriteLine("Meno 1 " + FirstName);
Debug.WriteLine("Meno 2 " + LastName);
Debug.WriteLine("Vonku " + OutdoorTemperatureId);
Debug.WriteLine("Vnutri " + IndoorTemperatureId);
Debug.WriteLine("Building " + TypeOfBuilding);
Debug.WriteLine("Country " + TypeOfCountry);
}
public void AddWallId(MaterialIdAndThickness idAndThickness)
{
_wallId.Add(idAndThickness);
}
public void ClearWallThickness()
{
_wallId.Clear();
}
public double SolutionWall()
{
IMinimalTemperatureRepository minimalTemperature = new MinimalTemperatureRepository();
ITemperatureIndoorRepository temperatureIndoorRepository = new TemperatureIndoorRepository();
IMaterialsRepository materialsRepository = new MaterialsRepository();
Construction construction = new Wall(
LengthA,
LengthB,
minimalTemperature.GetMinimalOutdoorTemperatureById(OutdoorTemperatureId),
temperatureIndoorRepository.GetTemperatureIndoorById(IndoorTemperatureId));
materialsRepository.ConvertIdThicknessToMaterialList(_wallId).ForEach(material=> construction.AddMaterialToList(material));
return construction.GetQ();
}
}
} |
using UnityEngine;
using System.Collections;
public class EnemyScript : MonoBehaviour {
public int numberOfButtons;
int[] sequence;
public int cont = 0;
public int tempcont = 0;
public GameObject buttonShower;
public GameObject heart;
public bool good = false;
public bool aimable = true;
public int damages;
public LevelScript currentLevel;
public AudioClip[] getGoodSounds;
void Start () {
getGoodSounds = GameObject.Find ("SoundsManager").GetComponent<SoundsScript> ().getGoodSounds;
currentLevel = gameObject.GetComponentInParent<LevelScript> ();
if (name.StartsWith("Wurm"))
numberOfButtons = 18;
if (name.StartsWith("eye"))
numberOfButtons = 6;
sequence = new int[numberOfButtons];
for(int i = 0; i<sequence.Length; i++)
{
sequence[i] = Random.Range(0, 2);
}
}
void Update () {
}
public void ShowSequence()
{
if (!good && aimable)
{
int[] numbers = { sequence[cont], sequence[cont + 1] };
DeHighlightButton(0);
DeHighlightButton(1);
buttonShower.GetComponent<ButtonShowEnemy>().ShowButtons(numbers);
}
}
public void HideSequence()
{
buttonShower.GetComponent<ButtonShowEnemy>().HideButtons();
}
void HighlightButton(int index)
{
buttonShower.GetComponent<ButtonShowEnemy>().showSlaves[index % 2].GetComponent<ShowSlave>().Highlight();
}
void DeHighlightButton(int index)
{
buttonShower.GetComponent<ButtonShowEnemy>().showSlaves[index % 2].GetComponent<ShowSlave>().DeHighLight();
}
public void MatchSequence(int match)
{
if (!good) {
if (match == sequence [tempcont]) {
HighlightButton(tempcont);
tempcont += 1;
if (tempcont > cont + 1) {
StartCoroutine(DelayStuff());
}
}
else
{
tempcont = cont;
DeHighlightButton(tempcont);
}
}
}
IEnumerator DelayStuff()
{
yield return new WaitForSeconds(.1f);
cont += 2;
if (cont < sequence.Length)
ShowSequence();
else
{
GetGood();
}
}
public void GetGood()
{
HideSequence();
PlaySound ();
heart.SetActive(true);
good = true;
if(currentLevel!=null)
currentLevel.EnemyDied (gameObject);
StartCoroutine(GoAway());
}
public IEnumerator GoAway()
{
yield return new WaitForSeconds(2f);
Destroy(gameObject);
}
public void DealDamage(int multiplier,string characterHit)
{
GameObject.Find("Health").GetComponent<Health>().TakeDamage(damages*multiplier,characterHit);
}
void PlaySound(){
GameObject.Find ("SoundsManager").GetComponent<AudioSource> ().clip = getGoodSounds [Random.Range (0, getGoodSounds.Length-1)];
GameObject.Find ("SoundsManager").GetComponent<AudioSource> ().volume = 0.8f;
GameObject.Find ("SoundsManager").GetComponent<AudioSource> ().Play ();
GameObject.Find ("SoundsManager").GetComponent<AudioSource> ().volume = 1f;
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace Dictionary01
{
class Program
{
static void Main(string[] args)
{
string inputText = Console.ReadLine();
var words = new Dictionary<string, List<string>>();
foreach(string wordDefinitionPair in inputText.Split(" | "))
{
string[] splitted = wordDefinitionPair.Split(": ");
string word = splitted[0];
string definition = splitted[1];
if(!words.ContainsKey(word))
{
words.Add(word, new List<string>());
}
words[word].Add(definition);
}
string[] wordsToPrint = Console.ReadLine().Split(" | ");
foreach (string word in wordsToPrint.OrderBy(w => w))
{
if(words.ContainsKey(word))
{
Console.WriteLine(word);
foreach (var definition in words[word].OrderByDescending(d=>d.Length))
{
Console.WriteLine($"-{definition}");
}
}
}
string command = Console.ReadLine();
if (command == "List")
{
Console.WriteLine(string.Join(' ', words.Keys.OrderBy(w => w)));
}
else
{
return;
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Middleware.Data.Access
{
public class HttpMiddlewareInterceptor
{
public string ConnectionString { get; set; }
public Interceptor Interceptors { get; set; }
}
public class Interceptor
{
public string Method { get; set; }
public string Endpoint { get; set; }
}
}
|
using AForge.Neuro;
using AForge.Neuro.Learning;
using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunctionRegression
{
public class RegressionTaskV7 : RegressionTaskV6
{
protected override void LearningIteration()
{
int RepetitionCount=5;
for (int i = 0; i < Inputs.Length / RepetitionCount; i++)
{
var sample = rnd.Next(Inputs.Length);
for (int j = 0; j < RepetitionCount; j++)
teacher.Run(Inputs[sample], Answers[sample]);
}
}
}
}
|
using Nac.Field.Citect.WindowsService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Nac.Field.Citect {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main() {
if (Environment.UserInteractive) {
NacFieldCitectContext.Create();
NacFieldCitectWcfServer.Start($@"net.tcp://{NacFieldCitectContext.IP}:65457");
var f = new Form1();
Application.Run(f);
NacFieldCitectWcfServer.Stop();
NacFieldCitectContext.Destroy();
}
else {
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new HostService()
};
ServiceBase.Run(ServicesToRun);
}
}
}
}
|
using LoLInfo.Services.WebServices;
using LoLInfo.Views;
using Xamarin.Forms;
namespace LoLInfo
{
public partial class App : Application
{
public App()
{
InitializeComponent();
if (Device.OS == TargetPlatform.Android || Device.OS == TargetPlatform.iOS)
MainPage = new MasterDetailContainer();
else
MainPage = new RootTabPage();
}
protected override void OnStart()
{
// Handle when your app starts
}
protected override void OnSleep()
{
// Handle when your app sleeps
}
protected override void OnResume()
{
// Handle when your app resumes
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Unidade6
{
class Complementar6Exe6
{
public static string[] Nomes = new string[400];
public static double[] Altura = new double[400];
public static int Qt_mocas;
public static double Mais_Alta;
public static void LerDados()
{
for (int i = 1; i <= 400;i++ )
{
Console.WriteLine("Informe o nome");
Nomes[i] = Console.ReadLine();
Console.WriteLine("informe a altura: ");
Altura[i] = Convert.ToDouble(Console.ReadLine());
if (Nomes[i].ToLower() == "fim")
{
i = 401;
}
Qt_mocas = Qt_mocas + 1;
Console.WriteLine("Quantidade de moças: " + Qt_mocas);
Console.WriteLine("Nomes: " + Nomes[i]);
}
}
public static void Comparador()
{
for(int i = 1;i <= 400; i++){
if(Nomes[i] != null){
Mais_Alta = Altura[i]++;
}
}
}
static void Main213(string[] args)
{
LerDados();
Comparador();
}
}
}
|
using gView.Framework.Geometry;
namespace gView.Framework.SpatialAlgorithms
{
static public class Extensions
{
static public IGeometry MakeValid(this IGeometry geometry,
double tolerance,
GeometryType geometryType = GeometryType.Unknown,
bool closeRings = false)
{
if (geometry == null)
{
throw new InvalidGeometryException("geometry is null");
}
#region Check geometry type
switch (geometryType)
{
case GeometryType.Point:
if (!(geometry is IPoint))
{
throw new InvalidGeometryException("Invalid point type: " + geometry.GetType().ToString());
}
break;
case GeometryType.Multipoint:
if (!(geometry is IMultiPoint))
{
throw new InvalidGeometryException("Invalid multipoint type: " + geometry.GetType().ToString());
}
break;
case GeometryType.Polyline:
if (!(geometry is IPolyline))
{
throw new InvalidGeometryException("Invalid polyline type: " + geometry.GetType().ToString());
}
break;
case GeometryType.Polygon:
if (!(geometry is IPolygon))
{
throw new InvalidGeometryException("Invalid polygon type: " + geometry.GetType().ToString());
}
break;
case GeometryType.Aggregate:
if (!(geometry is IAggregateGeometry))
{
throw new InvalidGeometryException("Invalid aggregate geometry type: " + geometry.GetType().ToString());
}
break;
}
#endregion
if (geometry is IPolyline)
{
var polyline = (IPolyline)geometry;
#region Remove Zero Length Paths
int removePath;
do
{
removePath = -1;
for (int p = 0, to = polyline.PathCount; p < to; p++)
{
if (polyline[p] == null || polyline[p].Length == 0.0)
{
removePath = p;
break;
}
}
if (removePath >= 0)
{
polyline.RemovePath(removePath);
}
}
while (removePath >= 0);
#endregion
}
if (geometry is IPolygon)
{
var polygon = (IPolygon)geometry;
#region Remove Zero Area Rings
int removeRing;
do
{
removeRing = -1;
for (int p = 0, to = polygon.RingCount; p < to; p++)
{
if (polygon[p] == null || polygon[p].Area == 0.0)
{
removeRing = p;
break;
}
}
if (removeRing >= 0)
{
polygon.RemoveRing(removeRing);
}
}
while (removeRing >= 0);
#endregion
#region Check rings
//for (int p = 0, to = polygon.RingCount; p < to; p++)
//{
// var ring = polygon[p];
// if (Algorithm.IsSelfIntersecting(ring, tolerance))
// {
// throw new InvalidGeometryException("Selfintersecting polygon rings are not allowed");
// }
// if (closeRings)
// {
// ring.Close();
// }
//}
#endregion
//polygon.RemoveLineArtifacts(tolerance);
}
return geometry;
}
}
}
|
namespace Big_Bank_Inc
{
public class SavingsAccount : Account
{
public float SavingsAPR => (float)1.5;
public SavingsAccount(User user)
:base(user)
{
}
}
}
|
using System.ComponentModel;
namespace IRAPGeneralGateway
{
/// <summary>
/// 客户端安全等级
/// </summary>
public enum TSecurityLevel
{
/// <summary>
/// 明文
/// </summary>
[Description("明文")]
None = 1,
/// <summary>
/// 压缩
/// </summary>
[Description("压缩")]
Compressed,
/// <summary>
/// DES 加密和 GZIP 压缩(Base64)
/// </summary>
[Description("DES 加密和 GZIP 压缩(Base64)")]
DES,
/// <summary>
/// AES 加密(Base64)
/// </summary>
[Description("AES 加密(Base64)")]
AES,
}
/// <summary>
/// 数据库类型
/// </summary>
public enum TDBServerType
{
/// <summary>
/// Microsoft SQL Server
/// </summary>
[Description("Microsoft SQL Server")]
SQLServer = 1
}
/// <summary>
/// 调用模式
/// </summary>
public enum TInvokeType
{
/// <summary>
/// 样本模式
/// </summary>
[Description("样本模式")]
Demo = 0,
/// <summary>
/// 数据库存储过程模式
/// </summary>
[Description("数据库存储过程模式")]
StoreProcedure,
/// <summary>
/// 类库接口模式
/// </summary>
[Description("类库接口模式")]
Interface,
}
/// <summary>
/// 服务调用结果
/// </summary>
public enum TServiceCallResult
{
/// <summary>
/// 成功
/// </summary>
[Description("成功")]
Success = 0,
/// <summary>
/// 失败
/// </summary>
[Description("失败")]
Failure,
/// <summary>
/// 拒绝
/// </summary>
[Description("拒绝")]
Reject,
/// <summary>
/// 出错
/// </summary>
[Description("出错")]
Except,
}
/// <summary>
/// 服务状态
/// </summary>
public enum TServiceStatus
{
/// <summary>
/// 停止
/// </summary>
[Description("停止")]
Stop = 0,
/// <summary>
/// 正常
/// </summary>
[Description("正常")]
Normal,
/// <summary>
/// 异常
/// </summary>
[Description("异常")]
Unusual,
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KartObjects;
using KartLib;
namespace KartLib
{
public interface IAttributeTypeView : IAxiTradeView
{
IList<AttributeType> AttributeTypes { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aquamonix.Mobile.Lib.Extensions
{
/// <summary>
/// Class containing helper extension methods
/// </summary>
public static class TaskExtensions {
/// <summary>
/// Attaches a continuation on a task on the UI Thread
/// </summary>
/// <param Name="task"></param>
/// <param Name="callback"></param>
/// <returns></returns>
public static Task ContinueOnCurrentThread (this Task task, Action<Task> callback)
{
#if NCRUNCH
return task.ContinueWith (callback);
#else
return task.ContinueWith (callback, TaskScheduler.FromCurrentSynchronizationContext ());
#endif
}
/// <summary>
/// Attaches a continuation on a task on the UI Thread
/// </summary>
/// <typeparam Name="T"></typeparam>
/// <param Name="task"></param>
/// <param Name="callback"></param>
/// <returns></returns>
public static Task<T> ContinueOnCurrentThread<T> (this Task<T> task, Func<Task<T>, T> callback)
{
#if NCRUNCH
return task.ContinueWith<T> (callback);
#else
return task.ContinueWith<T> (callback, TaskScheduler.FromCurrentSynchronizationContext ());
#endif
}
/// <summary>
/// A quick helper to be able to chain 2 tasks together
/// </summary>
public static Task ContinueWith (this Task task, Task continuation)
{
return task.ContinueWith (t => continuation).Unwrap ();
}
/// <summary>
/// A quick helper to be able to chain 2 tasks together
/// </summary>
public static Task<T> ContinueWith<T> (this Task task, Task<T> continuation)
{
return task.ContinueWith (t => continuation).Unwrap ();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using DatabaseHelper;
using BusinessObjects;
namespace BusinessObjects
{
public class Post : HeaderData
{
#region Private Members
private Guid _UserId = Guid.Empty;
private String _ImagePath = string.Empty;
private String _Title = String.Empty;
private String _Description = String.Empty;
private BrokenRuleList _BrokenRules = new BrokenRuleList();
private String _FilePath = String.Empty;
private String _RelativeFileName = String.Empty;
private String _UserName = string.Empty;
private CommentsList _Comments = null;
//private decimal _LikeAbility = 0;
private String _LikeAbility = string.Empty;
#endregion
#region Public Properties
//public decimal LikeAbility
//{
// get
// {
// return _LikeAbility;
// }
// set { _LikeAbility = value; }
//}
public String LikeAbility
{
get
{
return _LikeAbility;
}
set { _LikeAbility = value; }
}
public string UserName
{
get
{
User user = new User();
user = user.GetById(_UserId);
_UserName = user.UserName;
return _UserName;
}
}
public String FilePath
{
get { return _FilePath; }
set { _FilePath = value; }
}
public String RelativeFileName
{
get { return _RelativeFileName; }
set { _RelativeFileName = value; }
}
public String Title
{
get { return _Title; }
set
{
if (_Title != value)
{
_Title = value;
base.IsDirty = true;
Boolean Savable = IsSavable();
SavableEventArgs e = new SavableEventArgs(Savable);
RaiseEvent(e);
}
}
}
public String Description
{
get { return _Description; }
set
{
if (_Description != value)
{
_Description = value;
base.IsDirty = true;
Boolean Savable = IsSavable();
SavableEventArgs e = new SavableEventArgs(Savable);
RaiseEvent(e);
}
}
}
public String ImagePath
{
get { return _ImagePath; }
set
{
if (_ImagePath != value)
{
_ImagePath = value;
base.IsDirty = true;
Boolean Savable = IsSavable();
SavableEventArgs e = new SavableEventArgs(Savable);
RaiseEvent(e);
}
}
}
public Guid UserId
{
get { return _UserId; }
set
{
if (UserId != value)
{
_UserId = value;
base.IsDirty = true;
Boolean Savable = IsSavable();
SavableEventArgs e = new SavableEventArgs(Savable);
RaiseEvent(e);
}
}
}
#endregion
#region Private Methods
private Boolean Insert(Database database)
{
Boolean result = true;
try
{
database.Command.Parameters.Clear();
database.Command.CommandType = CommandType.StoredProcedure;
database.Command.CommandText = "tblPostINSERT";
database.Command.Parameters.Add("@UserId", SqlDbType.UniqueIdentifier).Value = _UserId;
database.Command.Parameters.Add("@Title", SqlDbType.VarChar).Value = _Title;
database.Command.Parameters.Add("@Description", SqlDbType.VarChar).Value = _Description;
database.Command.Parameters.Add("@ImagePath", SqlDbType.VarChar).Value = _ImagePath;
// Provides the empty buckets
base.Initialize(database, Guid.Empty);
database.ExecuteNonQuery();
// Unloads the full buckets into the object
base.Initialize(database.Command);
}
catch (Exception e)
{
result = false;
throw;
}
//System.IO.File.Delete(_FilePath);
return result;
}
private Boolean Update(Database database)
{
Boolean result = true;
try
{
database.Command.Parameters.Clear();
database.Command.CommandType = CommandType.StoredProcedure;
database.Command.CommandText = "tblPostUPDATE";
database.Command.Parameters.Add("@UserId", SqlDbType.UniqueIdentifier).Value = _UserId;
database.Command.Parameters.Add("@Title", SqlDbType.VarChar).Value = _Title;
database.Command.Parameters.Add("@Description", SqlDbType.VarChar).Value = _Description;
database.Command.Parameters.Add("@ImagePath", SqlDbType.VarChar).Value = _ImagePath;
// Provides the empty buckets
base.Initialize(database, base.Id);
database.ExecuteNonQuery();
// Unloads the full buckets into the object
base.Initialize(database.Command);
}
catch (Exception e)
{
result = false;
throw;
}
return result;
}
private Boolean Delete(Database database)
{
Boolean result = true;
try
{
database.Command.Parameters.Clear();
database.Command.CommandType = CommandType.StoredProcedure;
database.Command.CommandText = "tblPostDELETE";
// Provides the empty buckets
base.Initialize(database, base.Id);
database.ExecuteNonQuery();
// Unloads the full buckets into the object
base.Initialize(database.Command);
}
catch (Exception e)
{
result = false;
throw;
}
return result;
}
private Boolean IsValid()
{
Boolean result = true;
_BrokenRules.List.Clear();
if (_UserId == Guid.Empty)
{
result = false;
BrokenRule rule = new BrokenRule("Invalid ID. ID cannot be empty");
_BrokenRules.List.Add(rule);
}
if (_Title == null || _Title.Trim() == String.Empty)
{
result = false;
BrokenRule rule = new BrokenRule("Invalid. Title cannot be empty.");
_BrokenRules.List.Add(rule);
}
if (_Title == null || _Title.Length > 20)
{
result = false;
BrokenRule rule = new BrokenRule("Invalid. Title cannot be greater than 20 characters.");
_BrokenRules.List.Add(rule);
}
if (_Description == null || _Description.Trim() == String.Empty)
{
result = false;
BrokenRule rule = new BrokenRule("Invalid Description. Description cannot be empty.");
_BrokenRules.List.Add(rule);
}
if (_Description == null || _Description.Length > 20)
{
result = false;
BrokenRule rule = new BrokenRule("Invalid Description. Description cannot be grater than 20 characters");
_BrokenRules.List.Add(rule);
}
if (_ImagePath == null)
{
result = false;
BrokenRule rule = new BrokenRule("Invalid. Photo cannot be null.");
_BrokenRules.List.Add(rule);
}
return result;
}
#endregion
#region Public Methods
public Post GetById(Guid id)
{
Database database = new Database("LooksGoodDatabase");
DataTable dt = new DataTable();
database.Command.CommandType = System.Data.CommandType.StoredProcedure;
database.Command.CommandText = "tblPostGetById";
database.Command.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = id;
dt = database.ExecuteQuery();
if (dt != null && dt.Rows.Count == 1)
{
DataRow dr = dt.Rows[0];
base.Initialize(dr);
InitializeBusinessData(dr);
base.IsNew = false;
base.IsDirty = false;
}
return this;
}
public void InitializeBusinessData(DataRow dr)
{
_UserId = (Guid)dr["UserId"];
_Title = dr["Title"].ToString();
_Description = dr["Description"].ToString();
_ImagePath = dr["ImagePath"].ToString();
String filepath = System.IO.Path.Combine(_FilePath, Id.ToString() + ".jpg");
_RelativeFileName = System.IO.Path.Combine("UploadedImages", Id.ToString() + ".jpg");
_LikeAbility = dr["LikeAbility"].ToString();
}
public Boolean IsSavable()
{
Boolean result = false;
if ((base.IsDirty == true) || (IsValid() == true))
{
result = true;
}
return result;
}
public Post Save()
{
Boolean result = true;
Database database = new Database("LooksGoodDatabase");
if (base.IsNew == true && IsSavable() == true)
{
result = Insert(database);
}
else if (base.Deleted == true && base.IsDirty)
{
result = Delete(database);
}
else if (base.IsNew == false && IsSavable() == true)
{
result = Update(database);
}
if (result == true)
{
base.IsDirty = false;
base.IsNew = false;
}
return this;
}
#endregion
#region Public Events
#endregion
#region Public Event Handlers
#endregion
#region Construction
#endregion
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper.DBContext;
using EBS.Domain.Entity;
using EBS.Infrastructure.Extension;
namespace EBS.Domain.Service
{
public class AdjustSalePriceService
{
IDBContext _db;
public AdjustSalePriceService(IDBContext dbContext)
{
this._db = dbContext;
}
public void Create(AdjustSalePrice model)
{
if (_db.Table.Exists<AdjustSalePrice>(n => n.Code == model.Code))
{
throw new Exception("调价单号已经存在");
}
_db.Insert(model);
}
public AdjustSalePrice Create(Product product, decimal adjustPrice,string code,int editBy)
{
AdjustSalePrice model = new AdjustSalePrice();
model.Code = code;
model.Status = ValueObject.AdjustSalePriceStatus.Valid;
model.CreatedBy = editBy;
model.UpdatedBy = editBy;
model.AddItem(product, adjustPrice);
return model;
}
public void Update(AdjustSalePrice model)
{
if (_db.Table.Exists<AdjustSalePrice>(n => n.Code == model.Code && n.Id != model.Id))
{
throw new Exception("调价单号不能重复!");
}
if (_db.Table.Exists<AdjustSalePriceItem>(n => n.AdjustSalePriceId == model.Id))
{
_db.Delete<AdjustSalePriceItem>(n => n.AdjustSalePriceId == model.Id);
}
_db.Insert<AdjustSalePriceItem>(model.Items.ToArray());
_db.Update(model);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp
{
public class ListaFuncionario
{
// Atributo da classe ListaFuncionario: Funcionarios
// Funcionarios = lista de objetos Funcionario
List<Funcionario> Funcionarios = new List<Funcionario>();
// Metodo Procedure (sem retorno)
// Que irá inserir um unico objeto Funcionario dentro da lista de objetos Funcionarios
public void ArmazenarFuncionario(string nome, float salario, float desconto,
float adicional,float bonus, string cpf, bool semDesconto, bool gerente)
{
// Cada item (indice) da lista é um objeto Funcionario que contem nome, cpf, salario, desconto
if (gerente) {
Gerente funcionarioObj = new Gerente(nome, salario, desconto, adicional, cpf);
// dependendo do valor da variavel semDesconto
// executa versões diferentes da CalcularLiquido (conceito de sobrecarga)
if (semDesconto)
{
funcionarioObj.CalcularLiquido(funcionarioObj.salarioBruto, funcionarioObj.adicional);
funcionarioObj.CalcularBonus(funcionarioObj.salarioBruto, funcionarioObj.adicional);
}
else
{
funcionarioObj.CalcularLiquido(funcionarioObj.salarioBruto, funcionarioObj.desconto, funcionarioObj.adicional);
funcionarioObj.CalcularBonus(funcionarioObj.salarioBruto, funcionarioObj.desconto, funcionarioObj.adicional);
}
// Função add é herdada da list
Funcionarios.Add(funcionarioObj);
}
else
{
Funcionario funcionarioObj = new Funcionario(nome, salario, desconto, adicional, cpf);
// dependendo do valor da variavel semDesconto
// executa versões diferentes da CalcularLiquido (conceito de sobrecarga)
if (semDesconto)
{
funcionarioObj.CalcularLiquido(funcionarioObj.salarioBruto, funcionarioObj.adicional);
funcionarioObj.CalcularBonus(funcionarioObj.salarioBruto, funcionarioObj.adicional);
}
else
{
funcionarioObj.CalcularLiquido(funcionarioObj.salarioBruto, funcionarioObj.desconto, funcionarioObj.adicional);
funcionarioObj.CalcularBonus(funcionarioObj.salarioBruto, funcionarioObj.desconto, funcionarioObj.adicional);
}
// Função add é herdada da list
Funcionarios.Add(funcionarioObj);
//try
//{
// var sqlConnection = Conexao();
// string comand = $"insert into funcionario(nome, cpf, salario_bruto,adicional, desconto, salario_liquido) values('{funcionarioObj.nome}','{funcionarioObj.cpf}',{Convert.ToDecimal(funcionarioObj.salarioBruto)},{ Convert.ToDecimal(funcionarioObj.adicional)},{ Convert.ToDecimal(funcionarioObj.desconto)},{ Convert.ToDecimal(funcionarioObj.salarioLiquido)})";
// SqlCommand sqlCommand = new SqlCommand(comand, sqlConnection);
// sqlCommand.ExecuteNonQuery();
//}
//catch (Exception ex)
//{
// MessageBox.Show(ex.ToString());
//}
}
}
public void RemoverFuncionario(String cpf)
{
// Função removeall é herdada da list
Funcionarios.RemoveAll(f => f.cpf == cpf); // a expressão lambda é uma representação :
// (input-parameters) => expression
//try
//{
// var sqlConnection = Conexao();
// string comand = $"DELETE FROM funcionario WHERE cpf = '{cpf}';";
// SqlCommand sqlCommand = new SqlCommand(comand, sqlConnection);
// sqlCommand.ExecuteNonQuery();
//}
//catch (Exception ex)
//{
// MessageBox.Show(ex.ToString());
//}
}
public int BuscarFuncionario(String cpf)
{
// Função findindex é herdada da list
return Funcionarios.FindIndex(f => f.cpf == cpf); // expressao lambda. Parametro f do tipo Funcionario
// variavel capturada: nome comparada com o nome recebido por parametro
}
public void OrdenarFuncionario()
{
// Função OrderBy é herdada da list
Funcionarios = Funcionarios.OrderBy(f => f.nome).ToList();
}
// Retorna o tamanho da list.
// Lembrando que esses metodos da list só existem dentro da classe.
// em outro escopo, instanciado a classe ListaFuncionario, a lista está encapsulada dentro do objeto
// por isso é enrxgado como list apenas dentro da classe
public int RetornarTamanhoLista()
{
return Funcionarios.Count;
}
// busca um unico objeto funcionario, de acordo com o indice recebido.
// retorna um unico objeto Funcionario
// lembrando que aqui temos uma lista de vários objetos funcionarios, um em cada indice
public Funcionario RetornaObjetoFuncionario(int index)
{
// var é uma forma implicita de definir um dado.
// a variavel irá tomar a forma que lhe form atribuido
var funcionarioObj = Funcionarios[index]; // perceba que aqui pode-se manipular a lista diretamente com colchetes
return funcionarioObj;
}
public static SqlConnection Conexao()
{
string conexao = "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BancoParaTestes;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
SqlConnection sqlConnection = new SqlConnection(conexao);
sqlConnection.Open();
return sqlConnection;
}
}
}
|
using System.Drawing;
namespace PterodactylCharts
{
public class GraphSettings
{
public GraphSettings(string graphTitle, GraphSizes graphSizes, Color graphColor, GraphAxis graphAxis)
{
Title = graphTitle;
GraphColor = graphColor;
Sizes = graphSizes;
Axis = graphAxis;
}
public override string ToString()
{
return "Graph Settings";
}
public string Title { get; set; }
public Color GraphColor { get; set; }
public GraphSizes Sizes { get; set; }
public GraphAxis Axis { get; set; }
}
}
|
using NASTYADANYA;
using NUnit.Framework;
namespace NASTYADANYATest
{
[TestFixture]
public class MinusTests
{
[TestCase(4, 7, -3)]
[TestCase(5, 9, -4)]
[TestCase(27, 51, -36)]
public void CalculateTest(double firstValue, double secondValue, double expected)
{
var calculator = new Minus();
var actualResult = calculator.Calculate(firstValue, secondValue);
Assert.AreEqual(expected, actualResult);
}
}
} |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MasterLIO.Forms
{
public partial class CreateExercise : Form
{
public CreateExercise()
{
InitializeComponent();
}
private void validateAll()
{
if ((textBox1.Text != "")
&& (areasTextBox.Text!=""))
{
richTextBox1.ReadOnly = false;
richTextBox1.BackColor = Color.White;
}
}
private void selectAreaButton_Click(object sender, EventArgs e)
{
List<Boolean> areasList = new List<Boolean>();
Form f = new SelectAreaForm(ref areasList);
f.ShowDialog();
String areas = "";
int areasCount = 0;
for (int i = 0; i < areasList.Count; i++)
{
int realNum = i + 1;
if (areasList[i] == true)
{
areas += i + " ";
areasCount++;
}
}
areasTextBox.Text = areas;
textBox4.Text = areasList.Count.ToString();
areasTextBox.BackColor = Color.GreenYellow;
if (textBox1.Text == "")
{
List<Exercise> exercises = DBUtils.LoadExercises(areasCount);
int maxnum = 0;
int num;
foreach (Exercise exercise in exercises)
{
num = Convert.ToInt16(exercise.id.ToString().Substring(1));
if (num > maxnum) maxnum = num;
}
maxnum++;
textBox1.Text = "Упражнение " + maxnum;
textBox1.BackColor = Color.GreenYellow;
}
validateAll();
}
private void textBox1_Validating(object sender, CancelEventArgs e)
{
if (textBox1.Text != "")
textBox1.BackColor = Color.GreenYellow;
validateAll();
}
}
}
|
/*using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
namespace Couche_CAD
{
public class initialisation
{
/*private String cnx; //Contient la chaine de connexion à la BDD
private String rq_sql; //Contient la requête SQL
private SqlDataAdapter dataAdaptater; //Lien entre l'application et la BDD
private SqlConnection connection; //Assure la connexion
private SqlCommand command; //Execute les requêtes
private DataSet data; //Stock les données de la BDD en local
public initialisation()
{
this.rq_sql = null;
this.cnx = @"Data Source = ALIENWARE - 11R6H\EXIABDDSERVER; Initial Catalog = REDXBDD; Integrated Security = True"; //Information de location de la BDD
this.connection = new SqlConnection(this.cnx); //Instanciation objet connection qui va s'appuyer sur cette chaine de caractère
this.command = null;
this.dataAdaptater = null;
this.data = new DataSet();
}
//fonction pour requetes d'actions
public void ActionRows(string SQLRequest)
{
this.data = new DataSet();
this.rq_sql = rq_sql;
this.command = new SqlCommand(this.rq_sql, this.connection);
this.dataAdaptater = new SqlDataAdapter(this.command);
this.dataAdaptater.Fill(this.data, "rows");
}
//fonction pour requetes de récupération de données
public DataSet getRows(string rq_sql)
{
this.data.Clear();
this.SQLRequest = rq_sql;
this.command = new SqlCommand(this.rq_sql, this.connection);
this.connection.Open();
this.dataAdaptater = new SqlDataAdapter(this.command);
this.dataAdaptater.Fill(this.data, "rows");
connection.Close();
return this.data;
}
}
}*/
|
using KartObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace KartExchangeEngine
{
public class FEDiscountRecord:Entity
{
[DBIgnoreAutoGenerateParam]
[DBIgnoreReadParam]
public override string FriendlyName
{
get { return "Запись отчета о дисконтных картах"; }
}
/// <summary>
/// Код дисконтной карты
/// </summary>
public string CustomerCardCode
{
get;
set;
}
/// <summary>
/// Сумма продажи по дисконтной карте
/// </summary>
public decimal SaleSum
{
get;
set;
}
}
}
|
using System;
namespace FeriaVirtual.Domain.SeedWork.Events
{
public class InvalidDomainEventException
: Exception
{
public InvalidDomainEventException(string message)
: base(message) { }
}
}
|
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
namespace MmPort
{
public class MmConfiguration
{
/// <summary>
/// 串口号
/// </summary>
public string portName { get; set; }
/// <summary>
/// 波特率
/// </summary>
public int baudRate { get; set; }
/// <summary>
/// 校验
/// </summary>
public Parity parity { get; set; }
/// <summary>
/// 数据位
/// </summary>
public int dataBits { get; set; }
/// <summary>
/// 停止位
/// </summary>
public StopBits stopBits { get; set; }
/// <summary>
/// 是否全部自定义
/// </summary>
public bool isAllCustom { get; set; }
/// <summary>
/// 触发串口接受事件的最低字节数
/// </summary>
public int ReceivedBytesThreshold { get; set; }
/// <summary>
/// 是否开启超时处理
/// </summary>
public bool openTimeOut { get; set; }
/// <summary>
/// 超时时间 ms
/// </summary>
public int timeOutTime { get; set; }
/// <summary>
/// 通信方式
/// </summary>
public Common.CommunicationType communicationType { get; set; }
public MmConfiguration()
{
}
/// <summary>
///
/// </summary>
/// <param name="portName">串口号</param>
/// <param name="baudRate">波特率</param>
/// <param name="parity">校验</param>
/// <param name="dataBits">数据位</param>
/// <param name="stopBits">停止位</param>
/// <param name="receivedBytesThreshold">触发串口接受事件的最低字节数</param>
public MmConfiguration(string portName,
int baudRate,
Parity parity,
int dataBits,
StopBits stopBits,
int receivedBytesThreshold)
{
this.portName = portName;
this.baudRate = baudRate;
this.parity = parity;
this.dataBits = dataBits;
this.stopBits = stopBits;
this.ReceivedBytesThreshold = receivedBytesThreshold;
this.isAllCustom = true;
}
/// <summary>
///
/// </summary>
/// <param name="portName">串口号</param>
/// <param name="baudRate">波特率</param>
public MmConfiguration(string portName,
int baudRate)
{
this.portName = portName;
this.baudRate = baudRate;
this.isAllCustom = false;
}
}
}
|
using System;
using System.Linq;
using System.Text;
namespace FomattingCSharpCode
{
static class Messages
{
public static StringBuilder Output
{
get
{
return Output;
}
}
public static void EventAdded()
{
Output.Append("Event added");
Output.Append(System.Environment.NewLine);
}
public static void EventDeleted(int amount)
{
if (amount == 0)
{
NoEventsFound();
}
else
{
Output.AppendFormat("{0} events deleted.", amount);
Output.Append(System.Environment.NewLine);
}
}
public static void NoEventsFound()
{
Output.Append("No events found");
Output.Append(System.Environment.NewLine);
}
public static void PrintEvent(Event eventToPrint)
{
if (eventToPrint != null)
{
Output.Append(eventToPrint);
Output.Append(System.Environment.NewLine);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace SplatEngine
{
public class Screen
{
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Graphic
{
static class Functions
{
public static double sin(double arg)
{
return Math.Sin(arg);
}
public static double cos(double arg)
{
return Math.Cos(arg);
}
public static double exp(double arg)
{
return Math.Exp(arg);
}
public static double x3(double arg)
{
return arg * arg * arg;
}
public static double sqrt(double arg)
{
if(arg > 0) return Math.Sqrt(arg);
return 0;
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadSceneOnClick : MonoBehaviour {
public void LoadByIndex(int scenceIndex)
{
SceneManager.LoadScene(scenceIndex);
}
}
|
using System;
using System.Threading;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using System.Timers;
using DirectXTools;
namespace MapEditor
{
/// <summary>
/// Instance of the main game window.
/// </summary>
public partial class MainWindow : Window
{
// DirectX control scene.
private ControlScene controlScene = new ControlScene();
private System.Timers.Timer updateTimer;
public MainWindow()
{
InitializeComponent();
// Set the ForceResize callback.
StaticObjects.ResizeDel = ForceResize;
// Set initial window parameters.
this.Left = 0;
this.Top = 0;
this.Width = System.Windows.SystemParameters.PrimaryScreenWidth -1;
this.Height = System.Windows.SystemParameters.PrimaryScreenHeight -1;
this.WindowState = System.Windows.WindowState.Normal;
//Set the map work area static.
StaticObjects.WorkArea = new Dim2D((int)SystemParameters.WorkArea.Width, (int)SystemParameters.WorkArea.Height);
// Attempt to attach the scene object.
try
{
Direct2DControl.Scene = controlScene;
}
catch (Exception e)
{
// Display a detailed error message.
MessageBox.Show("ERROR: Unable to initialize DirectX. Details: " + e.ToString(),
"Application Error",
MessageBoxButton.OK,
MessageBoxImage.Error);
// Close the application.
App.Current.Shutdown();
}
// Setup the update time for mouse position.
updateTimer = new System.Timers.Timer(25);
updateTimer.Elapsed += new ElapsedEventHandler(OnTimerUpdate);
updateTimer.Start();
}
/// <summary>
/// Accesses window thread in order to force a resize.
/// </summary>
public void ForceResize()
{
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
{
try
{
this.WindowState = System.Windows.WindowState.Maximized;
this.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
this.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
this.RaiseEvent(new RoutedEventArgs(MainWindow.SizeChangedEvent));
this.InvalidateVisual();
}
catch(Exception e)
{
// Display a detailed error message.
MessageBox.Show("ERROR: Unable to resize window. Detail: " + e.ToString(),
"Application Error",
MessageBoxButton.OK,
MessageBoxImage.Error);
// Close the application.
App.Current.Shutdown();
}
}));
}
protected override void OnClosed(EventArgs e)
{
controlScene.Dispose();
base.OnClosed(e);
}
private void Window_KeyUp(object sender, KeyEventArgs e)
{
}
/// <summary>
/// Gets a more accurate WPF mouse position including off window.
/// </summary>
private void OnTimerUpdate(object sender, ElapsedEventArgs e)
{
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
{
try
{
StaticObjects.MousePosition = this.PointFromScreen(MousePositionInterop.GetCursorPosition());
}
catch (Exception ex)
{
Console.WriteLine("WARNING: Unable to update mouse position. Details: " + ex.ToString());
}
}));
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DummyAnimator : MonoBehaviour {
Animator anim;
enemyScript dummy;
void Start () {
dummy = gameObject.GetComponent<enemyScript>();
anim = gameObject.GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
if (dummy.rb.velocity.magnitude > 0)
{
anim.SetBool("Walking", true);
}
else
anim.SetBool("Walking", false);
if (dummy.toAttack == true)
{
anim.SetTrigger("Attack");
dummy.toAttack = false;
}
if (dummy.dieTrigger == true)
{
anim.SetTrigger("Death");
dummy.toAttack = false;
dummy.dieTrigger = false;
}
}
}
|
using NUnit.Framework;
using Domain.Entities;
using System;
using System.Linq;
namespace Domain.Test
{
public class CreditoTests
{
Empleado empleado;
Credito credito;
[SetUp]
public void Setup()
{
/* En los escenario de prueba se mencionó "Valor a Pagar", dichos valores deben tomarse como el valor solicitado y no como el saldo total */
empleado = new Empleado
{
Cedula = "1082470166",
Nombre = "Ramiro González",
Salario = 1200000
};
}
/*
* HU 001 - Como usuario quiero registrar créditos por libranzas para llevar el control de créditos
* Criterios:
* 1. Los créditos deben ser por valores entre 5 millón y 10 millones
* 2. El valor del interés del crédito será de 0.5% por cada mes de plazo
* 3. El plazo para el pago del crédito debe ser de máximo 10 meses
* 4. El valor total para pagar será valor del crédito + Tasa Interés por el plazo del crédito SaldoInicialCredito = ValorCredito*(1 + TasaInteres x PlazoCredito)
* 5. El sistema debe llevar el registro de las cuotas
* **/
[Test]
public void ValorInferiorIncorrecto()
{
Exception ex = Assert.Throws<Exception>(() => empleado.SolicitarCredito(valor: 4000000, plazo: 10));
Assert.AreEqual("El valor del crédito debe estar entre 5 y 10 millones.", ex.Message);
}
[Test]
public void ValorSuperiorIncorrecto()
{
Exception ex = Assert.Throws<Exception>(() => empleado.SolicitarCredito(15000000, 10));
Assert.AreEqual("El valor del crédito debe estar entre 5 y 10 millones.", ex.Message);
}
[Test]
public void PlazoIncorrecto()
{
Exception ex = Assert.Throws<Exception>(() => empleado.SolicitarCredito(6000000, 11));
Assert.AreEqual("El plazo para el pago del crédito debe ser de máximo 10 meses.", ex.Message);
}
[Test]
public void SolicitudCorrecta()
{
string response = empleado.SolicitarCredito(6000000, 10);
Assert.AreEqual("Crédito registrado. Valor a pagar: $6300000.", response);
}
/*
* HU 002 - Como cliente Quiero registrar abonos de dinero al crédito para ir amortizando el valor de dicho crédito
* 1. El cliente puede abonar mínimo el valor de la cuota pendiente, pero puede decir abonar más del valor correspondiente lo cual se descontaría de las cuotas siguientes
* 2. El sistema debe llevar el registro de los abonos
* 3. Los abonos a los créditos deben ser mayor a 0 y no pueden superar el saldo del crédito.
* 4. El valor abonado del crédito se debe mantener registrado en el sistema para futuras consultas
* **/
[Test]
public void AbonoMenorACuota()
{
// En el escenario de prueba, los 6 millones aparecen como "Valor a pagar", pero debe tomarse como el valor inicial del crédito.
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
Exception ex = Assert.Throws<Exception>(() => credito.Abonar(500000));
Assert.AreEqual("El valor del abono debe ser mínimo de $630000.", ex.Message);
}
[Test]
public void AbonoCeroONegativo()
{
// En el escenario de prueba, los 6 millones aparecen como "Valor a pagar", pero debe tomarse como el valor inicial del crédito.
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
Exception ex = Assert.Throws<Exception>(() => credito.Abonar(0));
Assert.AreEqual("El valor del abono es incorrecto.", ex.Message);
}
[Test]
public void AbonoSuperiorASaldo()
{
// En el escenario de prueba, los 6 millones aparecen como "Valor a pagar", pero debe tomarse como el valor inicial del crédito.
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
Exception ex = Assert.Throws<Exception>(() => credito.Abonar(7000000));
Assert.AreEqual("El valor del abono es incorrecto.", ex.Message);
}
[Test]
public void AbonoCorrecto()
{
// En el escenario de prueba, los 6 millones aparecen como "Valor a pagar", pero debe tomarse como el valor inicial del crédito.
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
credito.Abonar(630000);
credito.Abonar(630000);
string response = credito.Abonar(800000);
Assert.AreEqual("Abono registrado correctamente. Su nuevo saldo es: $4240000.", response);
}
/*
* HU 003 - Como cliente quiero consultar el saldo de cada cuota del crédito para conocer el estado de su crédito.
* 1. El sistema debe visualizar el listado de abonos realizados a un crédito, visualizando su valor y fecha de abono.
*/
[Test]
public void ConsultarCuotas()
{
// En el escenario de prueba, los 6 millones aparecen como "Valor a pagar", pero debe tomarse como el valor inicial del crédito.
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
credito.Abonar(1890000);
Assert.AreEqual($"Numero = 2, Estado = Pagada, Valor = 630000, Saldo = 0, Fecha = {credito.Cuotas[1].FechaDePago}", credito.Cuotas[1].ToString());
}
/*
* HU 004 - Como cliente quiero consulta la lista de los abonos realizados a mi crédito para conocer el histórico de pagos.
* 1. El sistema debe visualizar el listado de abonos realizados a un crédito, visualizando su valor y fecha de abono
*/
[Test]
public void ConsultarAbonos()
{
// En el escenario de prueba, los 6 millones aparecen como "Valor a pagar", pero debe tomarse como el valor inicial del crédito.
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
credito.Abonar(660000);
credito.Abonar(820000);
credito.Abonar(700000);
var abono = credito.Abonos[2];
Assert.AreEqual($"Valor = 700000, Fecha = {abono.FechaDeCreacion}", abono.ToString());
}
[Test]
public void ListarAbonos()
{
CreateCredit(6000000, 10);
credito = empleado.Creditos.FirstOrDefault();
credito.Abonar(660000);
credito.Abonar(820000);
credito.Abonar(700000);
Assert.AreEqual(3, credito.Abonos.Count);
Assert.AreEqual(10, credito.Cuotas.Count);
}
/* NoTests */
public void CreateCredit(double amount, int plazo)
{
empleado.SolicitarCredito(amount, plazo);
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankApp.Services
{
public abstract class Report
{
public byte[] Data { get; private set; }
public Report(byte[]data)
{
Data = data;
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
public class SpawnManager : MonoBehaviour
{
public GameObject playerPrefab;
//public GameObject SceneCamera;
public GameObject Canvas;
// Start is called before the first frame update
void Start()
{
SpawnPlayer();
Canvas.SetActive(true);
}
// Update is called once per frame
void SpawnPlayer()
{
PhotonNetwork.Instantiate(playerPrefab.name, playerPrefab.transform.position, playerPrefab.transform.rotation);
Canvas.SetActive(false);
//SceneCamera.SetActive(false);
}
}
|
using System.Windows.Controls;
namespace WPF.NewClientl.UI.Dialogs
{
/// <summary>
/// SiginStatisticsDialog.xaml 的交互逻辑
/// </summary>
public partial class SiginStatisticsDialog : UserControl
{
public SiginStatisticsDialog()
{
InitializeComponent();
}
}
}
|
using System;
namespace SFA.DAS.Tools.Support.Web.Configuration
{
public class ClaimsConfiguration
{
public string NameClaim { get; set; }
public string NameIdentifierClaim { get; set; }
public string EmailClaim { get; set; }
public void ValidateConfiguration()
{
if(string.IsNullOrWhiteSpace(NameClaim) || string.IsNullOrWhiteSpace(NameIdentifierClaim) || string.IsNullOrWhiteSpace(EmailClaim))
{
throw new ArgumentException("ClaimsConfiguration must be configured with a Name, NameIdentifier & Email Claim Type");
}
}
}
}
|
using UnityEngine;
public abstract class CameraBehaviour : MonoBehaviour {
[SerializeField] protected float _orthographicSize;
public float orthographicSize => _orthographicSize;
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using damdrempe_zadaca_1.Citaci;
using static damdrempe_zadaca_1.Podaci.Enumeracije;
namespace damdrempe_zadaca_1.Podaci.Modeli
{
class Spremnik
{
public int ID { get; set; }
public string Naziv { get; set; }
public VrstaSpremnika Vrsta { get; set; }
public int BrojnostMali { get; set; }
public int BrojnostSrednji { get; set; }
public int BrojnostVeliki { get; set; }
public int Nosivost { get; set; }
public List<int> Korisnici { get; set; }
public Spremnik()
{
Korisnici = new List<int>();
}
public Spremnik(SpremnikRedak spremnikRedak)
{
Naziv = spremnikRedak.Naziv;
Vrsta = spremnikRedak.Vrsta;
BrojnostMali = spremnikRedak.BrojnostMali;
BrojnostSrednji = spremnikRedak.BrojnostSrednji;
BrojnostVeliki = spremnikRedak.BrojnostVeliki;
Nosivost = spremnikRedak.Nosivost;
Korisnici = new List<int>();
}
}
}
|
namespace NetEscapades.AspNetCore.SecurityHeaders.Headers.PermissionsPolicy
{
/// <summary>
/// Controls access to audio output devices requested through
/// the NavigatorUserMedia interface. If disabled then calls to
/// <code>getUserMedia()</code> will not grant access to audio
/// output devices in that document.
/// </summary>
public class SpeakerPermissionsPolicyDirectiveBuilder : PermissionsPolicyDirectiveBuilder
{
/// <summary>
/// Initializes a new instance of the <see cref="SpeakerPermissionsPolicyDirectiveBuilder"/> class.
/// </summary>
public SpeakerPermissionsPolicyDirectiveBuilder() : base("speaker")
{
}
}
}
|
using kindergarden.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace kindergarden.Controllers
{
[LoginCheck]
public class HomeController : Controller
{
readonly KinderModelContext db = new KinderModelContext();
public ActionResult AdminPage()
{
int schoolId = Convert.ToInt32(Session["schoolId"]);
ViewBag.GUID = db.School.Find(schoolId).schoolGuid;
ViewBag.Activities = db.activities.Where(p => p.isActive == true && p.SchoolId == schoolId).Count();
ViewBag.Calendar = db.CalendarActivities.Where(p => p.SchoolId == schoolId).Count();
ViewBag.News = db.news.Where(p => p.SchoolId == schoolId).Count();
var model = db.news.Where(p => p.priority == Priority.Prio0 && p.SchoolId == schoolId).ToList();
return View(model);
}
public ActionResult MasterPage()
{
ViewBag.SchoolCount = db.School.Count();
ViewBag.Parents = db.person.Where(p => p.IsActive == true && p.IsParent == true).Count();
ViewBag.PayParent = CalculatePayParent();
ViewBag.Activities = db.activities.Count();
return View();
}
private int CalculatePayParent()
{
List<Person> veliler = new List<Person>();
using (var context = new KinderModelContext())
{
var model = context.person.Where(p => p.IsActive == true && p.IsParent == true).ToList();
foreach (var item in model)
{
TimeSpan sonuc = DateTime.Now - item.CreatedDate;
if (sonuc.TotalDays >= 90)
{
veliler.Add(item);
}
}
}
return veliler.Count;
}
public ActionResult ParentPage()
{
int schoolId = Convert.ToInt32(Session["schoolId"]);
int userId = Convert.ToInt32(Session["userId"]);
ViewBag.Activities = db.activities.Where(p => p.isActive == true && p.SchoolId == schoolId).Count();
ViewBag.Messages = db.personMessage.Where(p => p.PersonId == userId).Count();
ViewBag.News = db.news.Where(p => p.SchoolId == schoolId).Count();
var model = db.news.Where(p => p.priority == Priority.Prio0 && p.SchoolId == schoolId).Take(5).ToList();
return View(model);
}
public ActionResult TeacherPage()
{
int schoolId = Convert.ToInt32(Session["schoolId"]);
int userId = Convert.ToInt32(Session["userId"]);
ViewBag.Activities = db.activities.Where(p => p.isActive == true && p.SchoolId == schoolId).Count();
ViewBag.Messages = db.personMessage.Where(p => p.PersonId == userId).Count();
ViewBag.News = db.news.Where(p => p.SchoolId == schoolId).Count();
var model = db.news.Where(p => p.priority == Priority.Prio0 && p.SchoolId == schoolId).Take(5).ToList();
return View(model);
}
public ActionResult Chat()
{
ViewBag.name = Session["name"];
return View();
}
}
}
|
using Common.Models;
using NHibernate;
using NHibernate.Criterion;
using System;
using System.Collections.Generic;
namespace Common.Services
{
public class StaatsbuergerschaftService : BaseService
{
public StaatsbuergerschaftService(Func<ISession> session)
: base(session)
{
}
public IList<Staatsbuergerschaft> Get()
{
return CurrentSession.CreateCriteria(typeof(Staatsbuergerschaft)).List<Staatsbuergerschaft>();
}
public Staatsbuergerschaft Get(int id)
{
return CurrentSession.Get<Staatsbuergerschaft>(id);
}
public Staatsbuergerschaft Add(Staatsbuergerschaft staatsbuergerschaft)
{
using (var tran = CurrentSession.BeginTransaction())
{
try
{
if (staatsbuergerschaft.StaatsbuergerschaftID > 0)
{
throw new Exception(String.Format("A Staatsbuergerschaft with Bid {0} already exists. To update please use PUT.",staatsbuergerschaft.StaatsbuergerschaftID));
}
CurrentSession.Save(staatsbuergerschaft);
tran.Commit();
return staatsbuergerschaft;
}
catch (Exception ex)
{
tran.Rollback();
throw ex;
}
}
}
public Staatsbuergerschaft Update(Staatsbuergerschaft staatsbuergerschaft)
{
using (var tran = CurrentSession.BeginTransaction())
{
try
{
if (staatsbuergerschaft.StaatsbuergerschaftID == 0)
{
throw new Exception("For creating a Staatsbuergerschaft please use POST");
}
CurrentSession.Update(staatsbuergerschaft);
tran.Commit();
return staatsbuergerschaft;
}
catch (Exception ex)
{
tran.Rollback();
throw ex;
}
}
}
public bool Delete(int id)
{
using (var tran = CurrentSession.BeginTransaction())
{
try
{
var staatsbuergerschaft = Get(id);
if (staatsbuergerschaft != null)
{
CurrentSession.Delete(staatsbuergerschaft);
tran.Commit();
}
return true;
}
catch (Exception ex)
{
tran.Rollback();
throw ex;
}
}
}
}
}
|
/* ================================================================================
* This is the "DestroyByContact" script component of the Asteroid prefab.
* What it does:
* -> Locates the "GameController" script inside the GameController object in the Main scene
* -> Emits explosion effects when it is destroyed
* -> Signals the score to update when it is destroyed by the player weapon
* -> Signals the game to be over when it is destroyed by collision with the player
* ================================================================================ */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyByContact : MonoBehaviour
{
public GameObject explosion;
public GameObject playerExplosion;
public int scoreValue;
private GameController gameController; // this script needs to locate the GameController itself
void Start() // called as soon as an asteroid is created
{
GameObject gameControllerObject = GameObject.FindWithTag("GameController");
if (gameControllerObject != null)
{
gameController = gameControllerObject.GetComponent<GameController>(); // make 'gameController' a reference to the "GameController" script object
}
if (gameControllerObject == null)
{
Debug.Log ("Cannot find 'GameController' script.");
}
}
void OnTriggerEnter(Collider other) // anything that enters the asteroid's trigger becomes Collider 'other'
{
if (other.tag == "Boundary")
{
return;
}
Instantiate(explosion, transform.position, transform.rotation); // explode when anything (other than game area boundary) touches it
if (other.tag == "Player")
{
Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
gameController.GameOver(); // destroy player and signal game over
}
gameController.AddScore(scoreValue); // increase score when asteroid is destroyed
Destroy(other.gameObject); // destroys whatever enters the trigger
Destroy(gameObject); // destroys the game object (asteroid) that the trigger is attached to
}
}
|
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Description;
using WebAPIService.Models;
namespace WebAPIService.Controllers
{
public class TeasController : ApiController
{
private TeastoreEntities db = new TeastoreEntities();
// GET: api/Teas
public IQueryable<Tea> GetTeas()
{
return db.Teas;
}
// GET: api/Teas/5
[ResponseType(typeof(Tea))]
public IHttpActionResult GetTea(int id)
{
Tea tea = db.Teas.Find(id);
if (tea == null)
{
return NotFound();
}
return Ok(tea);
}
// PUT: api/Teas/5
[ResponseType(typeof(void))]
public IHttpActionResult PutTea(int id, Tea tea)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != tea.Id)
{
return BadRequest();
}
db.Entry(tea).State = EntityState.Modified;
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!TeaExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return StatusCode(HttpStatusCode.NoContent);
}
// POST: api/Teas
[ResponseType(typeof(Tea))]
public IHttpActionResult PostTea(Tea tea)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
db.Teas.Add(tea);
db.SaveChanges();
return CreatedAtRoute("DefaultApi", new { id = tea.Id }, tea);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
private bool TeaExists(int id)
{
return db.Teas.Count(e => e.Id == id) > 0;
}
}
} |
using Compent.Extensions;
using System.Linq;
using UBaseline.Core.RequestContext;
using Uintra.Core.Activity;
using Uintra.Core.Activity.Helpers;
using Uintra.Core.Member.Entities;
using Uintra.Core.Member.Services;
using Uintra.Core.UbaselineModels.RestrictedNode;
using Uintra.Features.Groups.Services;
using Uintra.Features.Likes.Models;
using Uintra.Features.Likes.Services;
using Uintra.Features.Links;
using Uintra.Infrastructure.Extensions;
namespace Uintra.Features.Likes.Converters
{
public class LikesPanelViewModelConverter :
UintraRestrictedNodeViewModelConverter<LikesPanelModel, LikesPanelViewModel>
{
private readonly IIntranetMemberService<IntranetMember> _intranetMemberService;
private readonly IUBaselineRequestContext _requestContext;
private readonly ILikesService _likesService;
private readonly IActivityTypeHelper _activityTypeHelper;
private readonly IGroupActivityService _groupActivityService;
private readonly IUBaselineRequestContext _context;
public LikesPanelViewModelConverter(
IUBaselineRequestContext requestContext,
IIntranetMemberService<IntranetMember> intranetMemberService,
ILikesService likesService,
IActivityTypeHelper activityTypeHelper,
IGroupActivityService groupActivityService,
IErrorLinksService errorLinksService,
IUBaselineRequestContext context)
: base(errorLinksService)
{
_requestContext = requestContext;
_likesService = likesService;
_intranetMemberService = intranetMemberService;
_activityTypeHelper = activityTypeHelper;
_groupActivityService = groupActivityService;
_context = context;
}
public override ConverterResponseModel MapViewModel(LikesPanelModel node, LikesPanelViewModel viewModel)
{
var activityId = _context.ParseQueryString("id").TryParseGuid();
var activityType = activityId.HasValue
? _activityTypeHelper.GetActivityType(activityId.Value)
: IntranetActivityTypeEnum.ContentPage;
var id = activityType.Equals(IntranetActivityTypeEnum.ContentPage)
? _requestContext.Node?.Key
: activityId;
if (!id.HasValue) return NotFoundResult();
var groupId = _groupActivityService.GetGroupId(id.Value);
var currentMember = _intranetMemberService.GetCurrentMember();
viewModel.IsGroupMember = !groupId.HasValue || currentMember.GroupIds.Contains(groupId.Value);
if (!viewModel.IsGroupMember) return ForbiddenResult();
var likes = _likesService.GetLikeModels(id.Value).ToArray();
viewModel.Likes = likes;
viewModel.EntityId = id.Value;
viewModel.LikedByCurrentUser = likes.Any(el => el.UserId == currentMember.Id);
viewModel.ActivityType = activityType;
return OkResult();
}
}
} |
using System;
namespace Ntech.Saga.Contracts
{
public interface IBookingFailedEvent
{
Guid CorrelationId { get; }
string CustomerId { get; }
string BookingId { get; }
string FaultMessage { get; }
DateTime FaultTime { get; }
}
}
|
// <copyright file="OperatorNodeFactory.cs" company="Jiangquan Li">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace ExpressionTreeEngine
{
/// <summary>
/// Operator Node Factory.
/// </summary>
public class OperatorNodeFactory
{
/// <summary>
/// Deal with each operator node.
/// </summary>
/// <param name="op">operator.</param>
/// <returns>Operator Node.</returns>
public OperatorNode CreateOperatorNode(char op)
{
if (op == '+')
{
return new AddOperatorNode(1);
}
else if (op == '-')
{
return new MinusOperatorNode(1);
}
else if (op == '*')
{
return new MultiplyOperatorNode(2);
}
else if (op == '/')
{
return new DivideOperatorNode(2);
}
return null;
}
}
} |
using Cricetidae.Pipeline;
using System;
using System.Collections.Generic;
namespace Cricetidae.DTO
{
public class BonusContext : APipeLineContext
{
public IReadOnlyList<BonusProductEvent> Items { get; set; }
}
}
|
using System;
namespace Docller.Core.Services
{
public class DownloadState
{
public IDownloadProvider DownloadProvider { get; set; }
public Exception Exception { get; set; }
}
} |
using KartObjects;
namespace KartSystem.Entities
{
public class ExpGoodSpecRecord:DocGoodSpecRecord
{
[DBIgnoreAutoGenerateParam]
[DBIgnoreReadParam]
public override string FriendlyName
{
get
{
return "Строка спецификации для расходных документов";
}
}
/// <summary>
/// Количество для заказа
/// </summary>
public double DemandQuant
{
get;
set;
}
/// <summary>
/// Количество в упаковке
/// </summary>
[DBIgnoreAutoGenerateParam]
public int QuantInPack
{
get;
set;
}
[DBIgnoreAutoGenerateParam]
public decimal Weight { get; set; }
[DBIgnoreAutoGenerateParam]
[DBIgnoreReadParam]
public decimal WeightPos {
get { return Weight*(decimal) Quantity; }
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using AutoMapper;
using Conditions;
using Conditions.Guards;
using Properties.Core.Interfaces;
using Properties.Models;
using Swashbuckle.Swagger.Annotations;
namespace Properties.Controllers
{
[RoutePrefix("api/landlords/{landlordReference:length(1,12)}/submittedproperties/{submittedPropertyReference:length(1,14)}/uploads")]
public class UploadController : ApiController
{
private readonly IUploadService _uploadService;
public UploadController(IUploadService uploadService)
{
Check.If(uploadService).IsNotNull();
_uploadService = uploadService;
}
[HttpGet, Route("")]
public List<Upload> GetSubmittedPropertyUploads(string landlordReference, string submittedPropertyReference)
{
Check.If(landlordReference).IsNotNullOrEmpty();
Check.If(submittedPropertyReference).IsNotNullOrEmpty();
return
_uploadService.GetUploadsForSubmittedProperty(landlordReference, submittedPropertyReference)
.Select(Mapper.Map<Upload>)
.ToList();
}
[HttpGet, Route("{uploadReference:length(1,10)}", Name = "GetSubmittedPropertyUpload")]
[SwaggerResponse(HttpStatusCode.OK, Type = typeof(Upload))]
public HttpResponseMessage GetSubmittedPropertyUpload(string landlordReference, string submittedPropertyReference, string uploadReference)
{
Check.If(landlordReference).IsNotNullOrEmpty();
Check.If(submittedPropertyReference).IsNotNullOrEmpty();
Check.If(uploadReference).IsNotNullOrEmpty();
var result = _uploadService.GetUploadForSubmittedPropertyy(landlordReference, submittedPropertyReference, uploadReference);
return result.IsNull()
? Request.CreateResponse(HttpStatusCode.NotFound)
: Request.CreateResponse(Mapper.Map<Models.Video>(result));
}
[HttpPost, Route("")]
public HttpResponseMessage PostUpload(string landlordReference, string submittedPropertyReference, Upload upload)
{
Check.If(landlordReference).IsNotNullOrEmpty();
Check.If(submittedPropertyReference).IsNotNullOrEmpty();
Check.If(upload).IsNotNull();
var result = _uploadService.CreateUpload(landlordReference, submittedPropertyReference,
Mapper.Map<Core.Objects.Upload>(upload));
if (result == null)
{
return new HttpResponseMessage {StatusCode = HttpStatusCode.InternalServerError};
}
var response = new HttpResponseMessage {StatusCode = HttpStatusCode.Created};
response.Headers.Location =
new Uri(Url.Link("GetSubmittedPropertyUpload",
new {landlordReference, submittedPropertyReference, uploadReference = result}));
return response;
}
[HttpPut, Route("{uploadReference:length(1,10)}")]
public HttpResponseMessage PutUpload(string landlordReference, string submittedPropertyReference, string uploadReference, Upload upload)
{
Check.If(landlordReference).IsNotNullOrEmpty();
Check.If(submittedPropertyReference).IsNotNullOrEmpty();
Check.If(uploadReference).IsNotNullOrEmpty();
Check.If(upload).IsNotNull();
var result = _uploadService.UpdateUpload(landlordReference, submittedPropertyReference, uploadReference, Mapper.Map<Core.Objects.Upload>(upload));
return result
? new HttpResponseMessage { StatusCode = HttpStatusCode.OK }
: new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError };
}
[HttpDelete, Route("{uploadReference:length(1,10)}")]
public HttpResponseMessage DeleteUpload(string landlordReference, string submittedPropertyReference, string uploadReference)
{
Check.If(landlordReference).IsNotNullOrEmpty();
Check.If(submittedPropertyReference).IsNotNullOrEmpty();
Check.If(uploadReference).IsNotNullOrEmpty();
var result = _uploadService.DeleteUpload(landlordReference, submittedPropertyReference, uploadReference);
return result
? new HttpResponseMessage { StatusCode = HttpStatusCode.NoContent }
: new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError };
}
}
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AWords = Aspose.Words;
namespace AsposeCreds
{
public class AsposeLicenseHelper
{
public static void SetLicense()
{
AWords.License license = new AWords.License();
var licenseFileInfo = GetLicenseFile();
var licenseFileFullPath = licenseFileInfo.FullName;
license.SetLicense(licenseFileFullPath);
}
private static FileInfo GetLicenseFile()
{
var current = Process.GetCurrentProcess().MainModule.FileName;
var dir = new DirectoryInfo(current);
var root = dir.Root;
var licenseDirectory = new DirectoryInfo(Path.Combine(root.FullName, "invisettings"));
licenseDirectory.Create();
var settingsFile = new FileInfo(Path.Combine(licenseDirectory.FullName, "Aspose.Total.lic"));
return settingsFile;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace DgInitEFCore.Application
{
public class ShareYunSourseAppService : IShareYunSourseAppService
{
private readonly IRepository<YunSourse> _yunsourseIRepository;
public ShareYunSourseAppService(IRepository<YunSourse> yunsourseIRepository)
{
_yunsourseIRepository = yunsourseIRepository;
}
public async Task GetName()
{
var list = _yunsourseIRepository.GetAll().Where(m => !string.IsNullOrWhiteSpace(m.Content)).ToList();
}
}
//————————————————
//版权声明:本文为CSDN博主「黄黄同学爱学习」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
//原文链接:https://blog.csdn.net/huanghuangtongxue/article/details/78937494
}
|
using SuperMario.Entities.Blocks;
using System.Collections.Generic;
namespace SuperMario.Commands.BrickCommands
{
class InvisibleToUsedBlockCommand : ICommand
{
private List<InvisibleBlock> invisibleBlocks;
public InvisibleToUsedBlockCommand(List<InvisibleBlock> invisibleBlocks)
{
this.invisibleBlocks = invisibleBlocks;
}
public void Execute()
{
foreach (InvisibleBlock invisibleBlock in invisibleBlocks)
{
invisibleBlock.Hit(PowerUpType.RedMushroom);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace BDONotiBot.Models
{
[Table("Bosses")]
public class Boss
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public virtual List<Resp> Resps { get; set; }
public Boss()
{
Resps = new List<Resp>();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Restaurants.Domain
{
public class Customer
{
public int CustomerId { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string Telephone { get; set; }
public string Adress { get; set; }
public string Number { get; set; }
public string OptionalAdress { get; set; }
public string AccessKey { get; set; }
public string ImagePath { get; set; }
public int IdPermission { get; set; }
//Propertie Control
public Boolean Authenticated { get; set; }
public string Created { get; set; }
public string Expiration { get; set; }
public string AccessToken { get; set; }
public string Message { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using TestShop.Application.Models.CartHistory;
using TestShop.Application.ServiceInterfaces;
using TestShop.Domain;
namespace TestShop.Application.Services
{
public class CartHistoryService : ICartHistoryService
{
private readonly ApplicationDbContext context;
private readonly IMapper mapper;
public CartHistoryService(ApplicationDbContext context, IMapper mapper)
{
this.context = context;
this.mapper = mapper;
}
public IList<CartHistoryViewModel> Get(string userId)
{
var orders = context.Orders
.Include(x => x.OrderProducts)
.ThenInclude(y => y.Product)
.Where(x => x.UserId == userId && x.IsProcessed)
.OrderByDescending(x => x.Id);
return mapper.Map<IList<CartHistoryViewModel>>(orders);
}
}
} |
namespace Boxofon.Web.ViewModels
{
public class AccountOverview
{
public bool IsTwilioAccountConnected { get; set; }
public string TwilioConnectAuthorizationUrl { get; set; }
public string TwilioAccountManagementUrl { get; set; }
public string BoxofonNumber { get; set; }
public string PrivatePhoneNumber { get; set; }
public string Email { get; set; }
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace System
{
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, TResult>
{
private readonly Func<T1, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <returns></returns>
public TResult Invoke(T1 t1)
{
TResult val;
val = _func(t1);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <returns></returns>
public TResult this[T1 t1]
{
get
{
return Invoke(t1);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, TResult>
{
private readonly Func<T1, T2, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2)
{
TResult val;
val = _func(t1, t2);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2]
{
get
{
return Invoke(t1, t2);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="T3"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, T3, TResult>
{
private readonly Func<T1, T2, T3, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, T3, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2, T3 t3)
{
TResult val;
val = _func(t1, t2, t3);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2, T3 t3]
{
get
{
return Invoke(t1, t2, t3);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="T3"></typeparam>
/// <typeparam name="T4"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, T3, T4, TResult>
{
private readonly Func<T1, T2, T3, T4, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, T3, T4, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2, T3 t3, T4 t4)
{
TResult val;
val = _func(t1, t2, t3, t4);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2, T3 t3, T4 t4]
{
get
{
return Invoke(t1, t2, t3, t4);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="T3"></typeparam>
/// <typeparam name="T4"></typeparam>
/// <typeparam name="T5"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, T3, T4, T5, TResult>
{
private readonly Func<T1, T2, T3, T4, T5, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, T3, T4, T5, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
{
TResult val;
val = _func(t1, t2, t3, t4, t5);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2, T3 t3, T4 t4, T5 t5]
{
get
{
return Invoke(t1, t2, t3, t4, t5);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="T3"></typeparam>
/// <typeparam name="T4"></typeparam>
/// <typeparam name="T5"></typeparam>
/// <typeparam name="T6"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, T3, T4, T5, T6, TResult>
{
private readonly Func<T1, T2, T3, T4, T5, T6, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, T3, T4, T5, T6, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <param name="t6"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
{
TResult val;
val = _func(t1, t2, t3, t4, t5, t6);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <param name="t6"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6]
{
get
{
return Invoke(t1, t2, t3, t4, t5, t6);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="T3"></typeparam>
/// <typeparam name="T4"></typeparam>
/// <typeparam name="T5"></typeparam>
/// <typeparam name="T6"></typeparam>
/// <typeparam name="T7"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, T3, T4, T5, T6, T7, TResult>
{
private readonly Func<T1, T2, T3, T4, T5, T6, T7, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, T3, T4, T5, T6, T7, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <param name="t6"></param>
/// <param name="t7"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
{
TResult val;
val = _func(t1, t2, t3, t4, t5, t6, t7);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <param name="t6"></param>
/// <param name="t7"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7]
{
get
{
return Invoke(t1, t2, t3, t4, t5, t6, t7);
}
}
}
/// <summary>
/// Invokes the function with the set of parameter values in various ways.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="T3"></typeparam>
/// <typeparam name="T4"></typeparam>
/// <typeparam name="T5"></typeparam>
/// <typeparam name="T6"></typeparam>
/// <typeparam name="T7"></typeparam>
/// <typeparam name="T8"></typeparam>
/// <typeparam name="TResult"></typeparam>
public struct FuncInvoker<T1, T2, T3, T4, T5, T6, T7, T8, TResult>
{
private readonly Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> _func;
/// <summary>
/// Creates a function invoker to invoke functions with parameters in various ways.
/// </summary>
public FuncInvoker(Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> func)
{
if (func == null) throw new ArgumentNullException("func");
this._func = func;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <param name="t6"></param>
/// <param name="t7"></param>
/// <param name="t8"></param>
/// <returns></returns>
public TResult Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
{
TResult val;
val = _func(t1, t2, t3, t4, t5, t6, t7, t8);
return val;
}
/// <summary>
/// Invokes the function with the parameter values.
/// </summary>
/// <param name="t1"></param>
/// <param name="t2"></param>
/// <param name="t3"></param>
/// <param name="t4"></param>
/// <param name="t5"></param>
/// <param name="t6"></param>
/// <param name="t7"></param>
/// <param name="t8"></param>
/// <returns></returns>
public TResult this[T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8]
{
get
{
return Invoke(t1, t2, t3, t4, t5, t6, t7, t8);
}
}
}
public static partial class Function
{
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, TResult> MakeInvoker<T1, TResult>(Func<T1, TResult> func)
{
return new FuncInvoker<T1, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, TResult> MakeInvoker<T1, T2, TResult>(Func<T1, T2, TResult> func)
{
return new FuncInvoker<T1, T2, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, T3, TResult> MakeInvoker<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult> func)
{
return new FuncInvoker<T1, T2, T3, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, T3, T4, TResult> MakeInvoker<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult> func)
{
return new FuncInvoker<T1, T2, T3, T4, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, T3, T4, T5, TResult> MakeInvoker<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult> func)
{
return new FuncInvoker<T1, T2, T3, T4, T5, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, T3, T4, T5, T6, TResult> MakeInvoker<T1, T2, T3, T4, T5, T6, TResult>(Func<T1, T2, T3, T4, T5, T6, TResult> func)
{
return new FuncInvoker<T1, T2, T3, T4, T5, T6, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, T3, T4, T5, T6, T7, TResult> MakeInvoker<T1, T2, T3, T4, T5, T6, T7, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, TResult> func)
{
return new FuncInvoker<T1, T2, T3, T4, T5, T6, T7, TResult>(func);
}
/// <summary>
/// Makes a FuncInvoker out of the given Func.
/// </summary>
/// <param name="func"></param>
public static FuncInvoker<T1, T2, T3, T4, T5, T6, T7, T8, TResult> MakeInvoker<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> func)
{
return new FuncInvoker<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(func);
}
}
} |
//using CoffeeReview;
//using CoffeeReview.Models;
//using CoffeeReview.Repositories;
//using System;
//using System.Linq;
//using Xunit;
//namespace CoffeeReview.Tests
//{
// public class CoffeeRepositoryTests : IDisposable
// {
// private CoffeeContext db;
// private CoffeeRepository underTest;
// public CoffeeRepositoryTests()
// {
// db = new CoffeeContext();
// db.Database.BeginTransaction();
// underTest = new CoffeeRepository(db);
// }
// public void Dispose()
// {
// db.Database.RollbackTransaction();
// }
// [Fact]
// public void Count_Starts_At_Zero()
// {
// var count = underTest.Count();
// Assert.Equal(0, count);
// }
// [Fact]
// public void Create_Increases_Count()
// {
// underTest.Create(new Coffee() { Brand = "Foo" });
// var count = underTest.Count();
// Assert.Equal(1, count);
// }
// [Fact]
// public void GetById_Returns_Created_Item()
// {
// var expectedCoffee = new Coffee() { Brand = "Baby Coffee" };
// underTest.Create(expectedCoffee);
// var result = underTest.GetById(expectedCoffee.Id); // The Id was set by EF when we call Create above.
// Assert.Equal(expectedCoffee.Brand, result.Brand);
// }
// [Fact]
// public void Delete_Reduces_Count()
// {
// var coffee = new Coffee() { Brand = "Baby Coffee" };
// underTest.Create(coffee);
// underTest.Delete(coffee);
// var count = underTest.Count();
// Assert.Equal(0, count);
// }
// [Fact]
// public void GetAll_Returns_All()
// {
// underTest.Create(new Coffee() { Brand = "Baby Coffee" });
// underTest.Create(new Coffee() { Brand = "Never gonna give you up" });
// var all = underTest.GetAll();
// Assert.Equal(2, all.Count());
// }
// //Save or Update?
// }
// public class ReviewRepositoryTests : IDisposable
// {
// private CoffeeContext db;
// private ReviewRepository underTest;
// public ReviewRepositoryTests()
// {
// db = new CoffeeContext();
// db.Database.BeginTransaction();
// underTest = new ReviewRepository(db);
// }
// public void Dispose()
// {
// db.Database.RollbackTransaction();
// }
// [Fact]
// public void Count_Starts_At_Zero()
// {
// var count = underTest.Count();
// Assert.Equal(0, count);
// }
// [Fact]
// public void Create_Increases_Count()
// {
// underTest.Create(new Review() { Content = "Baby" });
// var count = underTest.Count();
// Assert.Equal(1, count);
// }
// [Fact]
// public void GetById_Returns_Created_Item()
// {
// var expectedReview = new Review() { Content = "Baby" };
// underTest.Create(expectedReview);
// var result = underTest.GetById(expectedReview.Id); // The Id was set by EF when we call Create above.
// Assert.Equal(expectedReview.Coffee, result.Coffee);
// }
// [Fact]
// public void Delete_Reduces_Count()
// {
// var review = new Review() { Content = "Baby" };
// underTest.Create(review);
// underTest.Delete(review);
// var count = underTest.Count();
// Assert.Equal(0, count);
// }
// [Fact]
// public void GetAll_Returns_All()
// {
// underTest.Create(new Review() { Content = "Baby" });
// underTest.Create(new Review() { Content = "Baby" });
// var all = underTest.GetAll();
// Assert.Equal(2, all.Count());
// }
// //Save or Update?
// }
//}
|
using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RecoveringDemo
{
interface IRecoverable
{
void Recover();
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace TestProject_Aarif.Models
{
public class SlabModel
{
public double From { get; set; }
public double To { get; set; }
public double MinTax { get; set; }
public double Rate { get; set; }
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using HackAtHome.Entities;
using HackAtHome.SAL;
using Android.Graphics;
namespace HackAtHomeClient
{
[Activity(Label = "@string/ApplicationName", MainLauncher = false, Icon = "@drawable/Icon")]
public class EvidenceDetailActivity : Activity
{
protected async override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.EvidenceDetail);
int EvidenceID = Intent.GetIntExtra("EvidenceID", 0);
string EvidenceTitle = Intent.GetStringExtra("EvidenceTitle");
string EvidenceStatus = Intent.GetStringExtra("EvidenceStatus");
string UserName = Intent.GetStringExtra("UserName");
string Token = Intent.GetStringExtra("Token");
var TextUserName = FindViewById<TextView>(Resource.Id.TextViewUserNameEvidence);
var TextEvidenceTitle = FindViewById<TextView>(Resource.Id.TextViewEvidenceTitle);
var TextEvidenceStatus = FindViewById<TextView>(Resource.Id.TextViewEvidenceStatus);
var Image = FindViewById<ImageView>(Resource.Id.ImageView);
var WebView = FindViewById<Android.Webkit.WebView>(Resource.Id.WebViewDesc);
WebView.SetBackgroundColor(Color.WhiteSmoke);
TextUserName.Text = UserName;
TextEvidenceTitle.Text = EvidenceTitle;
TextEvidenceStatus.Text = EvidenceStatus;
ServiceClient ServiceClient = new ServiceClient();
EvidenceDetail ItemEvidenceDetail = await ServiceClient.GetEvidenceByIDAsync(Token, EvidenceID);
Koush.UrlImageViewHelper.SetUrlDrawable(Image, ItemEvidenceDetail.Url);
WebView.LoadDataWithBaseURL(null,ItemEvidenceDetail.Description, "text/html", "utf-8", null);
}
}
} |
using System.Data;
using System.Data.SqlClient;
using CommonLibrary;
namespace DAL
{
public class UserService
{
//注册个人账户
public int InsertUser(string email, string strFirstName, string strLastName, string password, string strBirthDay,
string strAdddate)
{
string strSql = @"INSERT INTO [dbo].[QcUser]
([Email] ,[FirstName] ,[LastName] ,[Password]
,[BirthDay], [AddDate])
VALUES
(@email ,@firstName ,@LastName ,@Password
,@BirthDay, @AddDate)
SELECT @@IDENTITY AS Id ";
object obj = DbHelperSQL.GetSingle(strSql,
new SqlParameter[]
{
new SqlParameter("@Email", email),
new SqlParameter("@FirstName", strFirstName),
new SqlParameter("@LastName", strLastName),
new SqlParameter("@Password", password),
new SqlParameter("@BirthDay", strBirthDay),
new SqlParameter("@AddDate", strAdddate)
});
return Common.ToInt(obj.ToString(), 0);
}
//获取当前用户的个数
public int GetUserCount()
{
string strSql = @"select count(1) from QcUser ";
object obj = DbHelperSQL.GetSingle(strSql);
return Common.ToInt(obj.ToString(), 0);
}
//验证登陆信息
public string GetPaCheckLogin(string iP, string provinceID, string autoLogin, string browser, string userName,
string passWord, string passWordDe, int id, int idType, int loginFrom)
{
string strP1 = "";
string strSql = "wpPaMainByLoginUpdate";
var sp = new SqlParameter();
sp.Direction = ParameterDirection.Output;
sp.SqlDbType = SqlDbType.Int;
sp.ParameterName = "@PaType";
string strReturn = DbHelperSQL.RunProcedure(strSql,
new[]
{
new SqlParameter("@UserName", userName),
new SqlParameter("@Password", passWord),
new SqlParameter("@PasswordDe", passWordDe),
new SqlParameter("@IP", iP),
new SqlParameter("@dcSubSiteId", int.Parse(provinceID)),
new SqlParameter("@AutoLogin", int.Parse(autoLogin)),
new SqlParameter("@browser", browser),
new SqlParameter("@ID", id),
new SqlParameter("@IDType", idType),
sp,
new SqlParameter("@loginFrom", loginFrom)
}, 8, 8, out strP1, out strP1);
return strReturn;
}
public DataTable GetUserInfo(string email)
{
string strSql = "select * from QcUser where Email = @email";
return DbHelperSQL.Query(strSql,
new SqlParameter[]
{
new SqlParameter("@email", email)
}).Tables[0];
}
public DataTable GetOneUserNameAndPsdByEmail(string email)
{
string strSql = "select Email, Password from QcUser where Email = @email";
return DbHelperSQL.Query(strSql,
new SqlParameter[]
{
new SqlParameter("@email", email)
}).Tables[0];
}
public bool CheckEmailExist(string email)
{
string strSql = "select count(1) from QcUser where Email = @email";
return DbHelperSQL.Query(strSql,
new SqlParameter[]
{
new SqlParameter("@email", email)
}).Tables[0].Rows.Count > 0;
}
}
} |
using CrystalDecisions.CrystalReports.Engine;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Admin_Cheques_SupplierReports : System.Web.UI.Page
{
static string _name;
protected void Page_Load(object sender, EventArgs e)
{
Helper.ValidateAdmin();
if (Request.QueryString["datea"] != null &&
Request.QueryString["dateb"] != null)
{
if (!IsPostBack)
{
txtDateA.Text = Request.QueryString["datea"];
txtDateB.Text = Request.QueryString["dateb"];
GetName();
GetSupplierReport();
}
}
}
private void GetName()
{
using (var con = new SqlConnection(Helper.GetCon()))
using (var cmd = new SqlCommand())
{
con.Open();
cmd.Connection = con;
cmd.CommandText = @"SELECT FirstName, LastName FROM Users WHERE UserID = @id";
cmd.Parameters.AddWithValue("@id", Session["userid"].ToString());
using (var dr = cmd.ExecuteReader())
{
if (!dr.HasRows) return;
while (dr.Read())
{
_name = dr["FirstName"] + " " + dr["LastName"];
}
}
}
}
private void GetSupplierReport()
{
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("~/Admin/Cheques/rptSupplierReports.rpt"));
report.DataSourceConnections[0].SetConnection(Helper.server, Helper.database, Helper.username, Helper.password);
report.SetParameterValue("User", _name);
report.SetParameterValue("datea", txtDateA.Text);
report.SetParameterValue("dateb", txtDateB.Text);
report.SetParameterValue("Logo", "~/Admin/assets/img/adminlogo.jpg");
crvSupplierReports.ReportSource = report;
crvSupplierReports.DataBind();
}
protected void txtDateA_TextChanged(object sender, EventArgs e)
{
GetName();
GetSupplierReport();
}
protected void txtDateB_TextChanged(object sender, EventArgs e)
{
GetName();
GetSupplierReport();
}
} |
namespace gView.Framework.Carto
{
public enum MapTools { ZoomIn, ZoomOut, Pan }
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using static Microsoft.ML.DataOperationsCatalog;
namespace Microsoft.ML.AutoML
{
public static class AutoMLExperimentExtension
{
/// <summary>
/// Set train and validation dataset for <see cref="AutoMLExperiment"/>. This will make <see cref="AutoMLExperiment"/> uses <paramref name="train"/>
/// to train a model, and use <paramref name="validation"/> to evaluate the model.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="train">dataset for training a model.</param>
/// <param name="validation">dataset for validating a model during training.</param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetDataset(this AutoMLExperiment experiment, IDataView train, IDataView validation)
{
var datasetManager = new TrainTestDatasetManager()
{
TrainDataset = train,
TestDataset = validation
};
experiment.ServiceCollection.AddSingleton<IDatasetManager>(datasetManager);
experiment.ServiceCollection.AddSingleton(datasetManager);
return experiment;
}
/// <summary>
/// Set train and validation dataset for <see cref="AutoMLExperiment"/>. This will make <see cref="AutoMLExperiment"/> uses <see cref="TrainTestData.TrainSet"/> from <paramref name="trainValidationSplit"/>
/// to train a model, and use <see cref="TrainTestData.TestSet"/> from <paramref name="trainValidationSplit"/> to evaluate the model.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="trainValidationSplit">a <see cref="TrainTestData"/> for train and validation.</param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetDataset(this AutoMLExperiment experiment, TrainTestData trainValidationSplit)
{
return experiment.SetDataset(trainValidationSplit.TrainSet, trainValidationSplit.TestSet);
}
/// <summary>
/// Set cross-validation dataset for <see cref="AutoMLExperiment"/>. This will make <see cref="AutoMLExperiment"/> use n=<paramref name="fold"/> cross-validation split on <paramref name="dataset"/>
/// to train and evaluate a model.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="dataset">dataset for cross-validation split.</param>
/// <param name="fold"></param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetDataset(this AutoMLExperiment experiment, IDataView dataset, int fold = 10)
{
var datasetManager = new CrossValidateDatasetManager()
{
Dataset = dataset,
Fold = fold,
};
experiment.ServiceCollection.AddSingleton<IDatasetManager>(datasetManager);
experiment.ServiceCollection.AddSingleton(datasetManager);
return experiment;
}
/// <summary>
/// Set <see cref="BinaryMetricManager"/> as evaluation manager for <see cref="AutoMLExperiment"/>. This will make
/// <see cref="AutoMLExperiment"/> uses <paramref name="metric"/> as evaluation metric.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="metric">evaluation metric.</param>
/// <param name="labelColumn">label column.</param>
/// <param name="predictedColumn">predicted column.</param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetBinaryClassificationMetric(this AutoMLExperiment experiment, BinaryClassificationMetric metric, string labelColumn = "label", string predictedColumn = "PredictedLabel")
{
var metricManager = new BinaryMetricManager(metric, labelColumn, predictedColumn);
return experiment.SetEvaluateMetric(metricManager);
}
/// <summary>
/// Set <see cref="MultiClassMetricManager"/> as evaluation manager for <see cref="AutoMLExperiment"/>. This will make
/// <see cref="AutoMLExperiment"/> uses <paramref name="metric"/> as evaluation metric.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="metric">evaluation metric.</param>
/// <param name="labelColumn">label column.</param>
/// <param name="predictedColumn">predicted column.</param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetMulticlassClassificationMetric(this AutoMLExperiment experiment, MulticlassClassificationMetric metric, string labelColumn = "label", string predictedColumn = "PredictedLabel")
{
var metricManager = new MultiClassMetricManager()
{
Metric = metric,
PredictedColumn = predictedColumn,
LabelColumn = labelColumn,
};
return experiment.SetEvaluateMetric(metricManager);
}
/// <summary>
/// Set <see cref="RegressionMetricManager"/> as evaluation manager for <see cref="AutoMLExperiment"/>. This will make
/// <see cref="AutoMLExperiment"/> uses <paramref name="metric"/> as evaluation metric.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="metric">evaluation metric.</param>
/// <param name="labelColumn">label column.</param>
/// <param name="scoreColumn">score column.</param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetRegressionMetric(this AutoMLExperiment experiment, RegressionMetric metric, string labelColumn = "Label", string scoreColumn = "Score")
{
var metricManager = new RegressionMetricManager()
{
Metric = metric,
ScoreColumn = scoreColumn,
LabelColumn = labelColumn,
};
return experiment.SetEvaluateMetric(metricManager);
}
/// <summary>
/// Set <paramref name="pipeline"/> for training. This also make <see cref="AutoMLExperiment"/> uses <see cref="SweepablePipelineRunner"/>
/// , <see cref="MLContextMonitor"/> and <see cref="EciCostFrugalTuner"/> for automl traininng as well.
/// </summary>
/// <param name="experiment"><see cref="AutoMLExperiment"/></param>
/// <param name="pipeline"><see cref="SweepablePipeline"/></param>
/// <returns><see cref="AutoMLExperiment"/></returns>
public static AutoMLExperiment SetPipeline(this AutoMLExperiment experiment, SweepablePipeline pipeline)
{
experiment.AddSearchSpace(AutoMLExperiment.PipelineSearchspaceName, pipeline.SearchSpace);
experiment.ServiceCollection.AddSingleton(pipeline);
experiment.SetTrialRunner<SweepablePipelineRunner>();
experiment.SetMonitor<MLContextMonitor>();
experiment.SetTuner<EciCostFrugalTuner>();
return experiment;
}
private static AutoMLExperiment SetEvaluateMetric<TEvaluateMetricManager>(this AutoMLExperiment experiment, TEvaluateMetricManager metricManager)
where TEvaluateMetricManager : class, IEvaluateMetricManager
{
experiment.ServiceCollection.AddSingleton<IMetricManager>(metricManager);
experiment.ServiceCollection.AddSingleton<IEvaluateMetricManager>(metricManager);
experiment.SetIsMaximize(metricManager.IsMaximize);
return experiment;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
namespace IdiotTalk
{
public class AnswerManager
{
private static AnswerManager _answerManager;
private Parser _parser;
private string _knowledgeBasePath;
//无实际意义的虚词词性标注集合
private const string _funcitonWord = "b d e g h i o u wp x";
private static object _sycobj = new object();
//设置知识库路径
public string KnowledgeBasePath
{
set { _knowledgeBasePath = value; }
}
private AnswerManager()
{
_parser = new Parser();
_knowledgeBasePath = @"F:\Demo\DemoKnowledgeBase\knowledgeBase.xml";
}
public static AnswerManager Instance
{
get
{
if (_answerManager == null)
{
lock(_sycobj)
{
if (_answerManager == null)
{
_answerManager = new AnswerManager();
return _answerManager;
}
}
}
return _answerManager;
}
}
/// <summary>
/// 对传入的xml片段获取对应的句子模式
/// </summary>
/// <param name="xmlSen">句法分析后的xml片段</param>
/// <param name="id">是否保留词性标记在句子中出现的位置id</param>
/// <returns>返回字符串中以空格分割,数字代表其后的词性标记在原始句子中的位置</returns>
public string GetPattern(string xmlSeg)
{
StringBuilder sb = new StringBuilder() ;
try
{
XDocument xdoc = XDocument.Parse(xmlSeg);
foreach (XElement xele in xdoc.Descendants("word"))
{
if (!_funcitonWord.Contains(xele.Attribute("pos").Value))
sb.AppendFormat("{0},{1} ", xele.Attribute("id").Value, xele.Attribute("pos").Value);
}
}
catch
{
StackTrace st = new StackTrace(new StackFrame(true));
new Exception(string.Format("Error in {0} Load xml segment",st.ToString()));
}
return sb.ToString();
}
/// <summary>
/// 对输入的句子进行词性标注
/// </summary>
/// <param name="sentence"></param>
/// <returns></returns>
public string POS(string sentence)
{
_parser.Pattern = HttpParams.Pattern.POS;
try
{
return _parser.Analyze(sentence);
}
catch
{
StackTrace st = new StackTrace(new StackFrame(true));
new Exception(string.Format("Error in {0} POS sentence", st.ToString()));
return string.Empty;
}
}
/// <summary>
///根据输入的问题,从知识库中搜索答案
/// </summary>
/// <param name="question">问题</param>
/// <returns>1)当知识库中没有这类问题模板时返回空串;2)知识库中有这类问题模板,但是语料库中没有这个问题的语料信息,返回“语料不足”
/// 3)知识库中有此类问题的模板,并且已经从语料库中学到这个问题的答案,则返回答案 </returns>
public string GetAnswer(string question)
{
string answer = string.Empty;
try
{
//加载知识库
XDocument knowledgeBase = XDocument.Load(_knowledgeBasePath);
string questionPOS = POS(question);
XDocument questionDoc = XDocument.Parse(questionPOS);
string questionPattern = GetPattern(questionPOS);
string patternWithoutID = EliminatePatternID(questionPattern);
//获取所有的knowledge节点
XElement knowledge = knowledgeBase.Descendants("knowledge").Where(ele => ele.Attribute("questionPattern").Value ==patternWithoutID).FirstOrDefault();
bool isRightNode = true;
if (knowledge!=null)
{
int[] wordIDs;
string[] wordPOSs;
int len;
SplitPOSAndID(questionPattern, out wordIDs, out wordPOSs, out len);
//获取区分不同问题的特征下标
string []quesFeatureIndexes = knowledge.Attribute("questionFearture").Value.Split(' ');
foreach(XElement answerDetail in knowledge.Descendants("answerDetail"))
{
isRightNode = true;
foreach(var str in quesFeatureIndexes)
{
string quesCont = questionDoc.Descendants("word").Where(ele => ele.Attribute("id").Value == wordIDs[Convert.ToInt32(str)].ToString()).FirstOrDefault().Attribute("cont").Value;
string knowledgeCont = answerDetail.Attribute(wordPOSs[Convert.ToInt32(str)]).Value;
if (quesCont != knowledgeCont)
{
isRightNode = false;
break;
}
}
if (isRightNode)
{
answer = answerDetail.Descendants("answer").FirstOrDefault().Value;
break;
}
}
if (!isRightNode)
answer = "语料信息不足,无法回答该问题";
}
}catch
{
StackTrace st = new StackTrace(new StackFrame(true));
new Exception(string.Format("Error in {0} get answer", st.ToString()));
}
return answer;
}
/// <summary>
/// 向知识库中添加新的知识
/// </summary>
/// <param name="file">语料库文件路径</param>
/// <param name="questionPOS">词性标注后的问题</param>
/// <param name="answerPOS">词性标注后的答案</param>
/// <param name="exactAnswerPOS">词性标注后的精确答案</param>
/// <returns>向知识库中添加的记录条数</returns>
public int AddNewPattern(FileInfo file, string questionPOS,string answerPOS,string exactAnswerPOS)
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(_knowledgeBasePath);
//获取模板并消除模板中的ID信息
string questionPattern = EliminatePatternID(GetPattern(questionPOS));
string answerPattern = EliminatePatternID(GetPattern(answerPOS));
string exactAnswerPattern = EliminatePatternID(GetPattern(exactAnswerPOS));
//获取问题和答案关联特征
List<Tuple<string, string, int, int>> features = LearnFeatures(questionPOS,answerPOS);
StringBuilder sb = new StringBuilder();
//准备knowledge节点的属性信息
int[] answerFeatureIndexes = new int[features.Count];
for(int i=0;i<features.Count;i++)
{
sb.Append(features[i].Item3.ToString()+" ");
answerFeatureIndexes[i] = features[i].Item4;
}
string quesFeatureIndexes = sb.ToString();
int[] exactAnswerIndexes = ExactAnswerPos(answerPOS, exactAnswerPOS);
sb.Clear();
foreach (var i in exactAnswerIndexes)
sb.Append(i.ToString()+" ");
string strExactAnswerIndexes = sb.ToString().Trim();
sb.Clear();
foreach(var i in answerFeatureIndexes)
sb.Append(i.ToString()+" ");
string strAswerFeaIndexes = sb.ToString().Trim();
//填充knowledge节点属性
XmlNode xmlNode = xdoc.SelectSingleNode(string.Format("//knowledge[@questionPattern=\"{0}\"]",questionPattern));
XmlElement xele;
if (xmlNode == null)
{
xele = xdoc.CreateElement("knowledge");
xele.SetAttribute("questionPattern", questionPattern);
xele.SetAttribute("questionFearture", quesFeatureIndexes.Trim());
xele.SetAttribute("answerPattern", answerPattern);
xele.SetAttribute("answerFeature", strAswerFeaIndexes);
xele.SetAttribute("exactAnswerPosition", strExactAnswerIndexes);
}
else
xele = xmlNode as XmlElement;
//获取语料库中所有符合答案模板的语句
List<string> targetSents= Extractor.ExtractSentence(file,answerPattern);
XmlElement quesDetail;
//对符合答案模板的语料信息进行整理并装填为answerDetail结点
foreach (string sent in targetSents)
{
string[] splitedPattern= LocateAnswerPattern(sent,answerPattern);
List<Tuple<string, string>> exactAnswerTuple = ExtractFeature(sent,splitedPattern,exactAnswerIndexes);
sb.Clear();
foreach (var t in exactAnswerTuple)
sb.Append(t.Item2);
quesDetail = FillDetailNode(xdoc,ExtractFeature(sent,splitedPattern,answerFeatureIndexes),sb.ToString());
xele.AppendChild(quesDetail);
}
xdoc.DocumentElement.AppendChild(xele);
xdoc.Save(_knowledgeBasePath);
return targetSents.Count;
}
public int AddNewPattern(DirectoryInfo dir,string questionPOS, string answerPOS, string exactAnswerPOS)
{
int count = 0;
foreach(var childDir in dir.EnumerateDirectories())
count += AddNewPattern(childDir, questionPOS, answerPOS, exactAnswerPOS); ;
foreach (var file in dir.EnumerateFiles())
count += AddNewPattern(file,questionPOS,answerPOS,exactAnswerPOS);
return count;
}
/// <summary>
/// 生成一个具体的答案节点
/// </summary>
/// <param name="attributes">用于区分不同问题的属性值集合</param>
/// <param name="exactAnswer">该问题的准确答案</param>
/// <returns></returns>
public XmlElement FillDetailNode(XmlDocument xdoc, List<Tuple<string,string>> attributes,string exactAnswer)
{
XmlElement quesDetail = xdoc.CreateElement("answerDetail");
foreach (var attr in attributes)
quesDetail.SetAttribute(attr.Item1,attr.Item2);
XmlElement answer = xdoc.CreateElement("answer");
answer.InnerText = exactAnswer;
quesDetail.AppendChild(answer);
return quesDetail;
}
/// <summary>
/// 消除模板里的ID
/// </summary>
/// <param name="patternWithID">含有ID的模板</param>
/// <returns></returns>
public string EliminatePatternID(string patternWithID)
{
StringBuilder sb = new StringBuilder();
string[] splitedString = patternWithID.Split(' ');
foreach (string str in splitedString)
sb.AppendFormat("{0} ", str.Substring(str.IndexOf(',') + 1));
return sb.ToString().Trim()+" ";
}
/// <summary>
/// 获取区分具体问题的属性
/// </summary>
/// <param name="posQuestion">词性标注后的问题</param>
/// <param name="posAnswer">词性标注后的答案</param>
/// <returns>以元组数组的形式返回属性值,每个元组的第一项为词性标记,第二项为对应的词,第三项为该词性标记在问题模板中的位置,第四项为词性标记在答案模板中的位置</returns>
public List<Tuple<string,string,int,int>> LearnFeatures(string posQuestionXml,string posAnswerXml)
{
XDocument questionDoc = XDocument.Parse(posQuestionXml);
XDocument answerDoc = XDocument.Parse(posAnswerXml);
List<Tuple<string, string,int,int>> features = new List<Tuple<string, string,int,int>>();
int[] questionIDs,answerIDs;
string[] questionPOSs,answerPOSs;
int questionLen,answerLen;
SplitPOSAndID(GetPattern(posQuestionXml),out questionIDs,out questionPOSs,out questionLen);
SplitPOSAndID(GetPattern(posAnswerXml), out answerIDs, out answerPOSs, out answerLen);
for(int i=0;i<questionLen;i++)
{
for(int j=0;j<answerLen;j++)
{
if(questionPOSs[i]==answerPOSs[j])
{
string quesAttrCont = questionDoc.Descendants("word").Where(ele => ele.Attribute("id").Value == questionIDs[i].ToString())
.FirstOrDefault().Attribute("cont").Value;
string answerAttrCont= answerDoc.Descendants("word").Where(ele => ele.Attribute("id").Value == answerIDs[j].ToString())
.FirstOrDefault().Attribute("cont").Value;
if (quesAttrCont==answerAttrCont)
{
Tuple<string, string,int,int> tuple = new Tuple<string, string,int,int>(questionPOSs[i],quesAttrCont,i,j);
features.Add(tuple);
}
}
}
}
return features ;
}
/// <summary>
/// 分离模板中的ID和词性标注
/// </summary>
/// <param name="pattern"></param>
/// <param name="IDs">分离后ID的存储数组</param>
/// <param name="POSs">分离后POS的存储数组</param>
/// <param name="len">数组长度</param>
/// <returns></returns>
private bool SplitPOSAndID(string pattern,out int [] IDs,out string[] POSs,out int len)
{
string[] splitedPattern = pattern.Trim().Split(' ');
IDs = new int[splitedPattern.Length];
POSs = new string[splitedPattern.Length];
len = splitedPattern.Length;
for(int i=0;i<splitedPattern.Length;i++)
{
try
{
IDs[i]= Convert.ToInt32(splitedPattern[i].Split(',')[0]);
POSs[i] = splitedPattern[i].Split(',')[1];
}catch
{
StackTrace st = new StackTrace(new StackFrame(true));
new Exception(string.Format("Error in {0} Convert ID", st.ToString()));
return false;
}
}
return true;
}
/// <summary>
/// 在答案语句中提取精确答案的词性位置
/// </summary>
/// <param name="answerPOSXml">词性标记后的答案语句</param>
/// <param name="exactAnswerPOSXml">词性标记后的精确答案的位置</param>
/// <returns></returns>
private int[] ExactAnswerPos(string answerPOSXml,string exactAnswerPOSXml)
{
List<int> indexes = new List<int>();
XDocument answerDoc = XDocument.Parse(answerPOSXml);
XDocument exactAnswerDoc = XDocument.Parse(exactAnswerPOSXml);
int[] answerIDs, exactAnswerIDs;
string[] answerPOS, exactAnswerPOS;
int answerLen,exactAnswerLen;
SplitPOSAndID(GetPattern(answerPOSXml), out answerIDs, out answerPOS,out answerLen);
SplitPOSAndID(GetPattern(exactAnswerPOSXml),out exactAnswerIDs,out exactAnswerPOS,out exactAnswerLen);
for(int i=0;i<exactAnswerLen;i++)
{
for(int j=0;j<answerLen;j++)
{
if(answerPOS[j]==exactAnswerPOS[i])
{
string answerCont= answerDoc.Descendants("word").Where(ele => ele.Attribute("id").Value == answerIDs[j].ToString()).FirstOrDefault().Attribute("cont").Value;
string exactAnswerCont= exactAnswerDoc.Descendants("word").Where(ele => ele.Attribute("id").Value == exactAnswerIDs[i].ToString()).FirstOrDefault().Attribute("cont").Value;
if(answerCont==exactAnswerCont)
indexes.Add(j);
}
}
}
return indexes.ToArray();
}
/// <summary>
/// 提取句子中的答案模板所在的词性标注
/// </summary>
/// <param name="posAnswerXml">经词性标注后含有答案模板的句子</param>
/// <param name="answerPattern">答案模板(不含ID)</param>
/// <returns>以数组形式返回句子中答案模板中含有的成分,每组为标号,词性标记</returns>
private string [] LocateAnswerPattern(string posSenXml,string answerPattern)
{
string pattern = EliminatePatternID(GetPattern(posSenXml));
int answerLen = answerPattern.Trim().Split(' ').Length;
string[] answerInSen = new string[answerLen];
string[] items = pattern.Substring(0, pattern.IndexOf(answerPattern)).Trim().Split(' ');
int startPos;
if (items.Length != 0 && items[0] == "")
startPos = 0;
else startPos = items.Length;
string[] word = GetPattern(posSenXml).Split(' ');
for (int i = 0; i < answerLen; i++)
answerInSen[i] = word[startPos + i];
return answerInSen;
}
/// <summary>
/// 从含有词性标注的句子中提取指定位置的特征
/// </summary>
/// <param name="posSent">经词性标注后的句子</param>
/// <param name="splitedPOS">切分后的模板</param>
/// <param name="indexes">指定</param>
/// <returns></returns>
private List<Tuple<string ,string>> ExtractFeature(string posSent,string[]splitedPattern,int[] indexes)
{
XDocument xdoc = XDocument.Parse(posSent);
List<Tuple<string, string>> features=new List<Tuple<string, string>>();
int[] IDs;
string[] POSs;
int len;
for(int i=0;i<indexes.Length;i++)
{
SplitPOSAndID(splitedPattern[indexes[i]],out IDs,out POSs,out len);
string cont = xdoc.Descendants("word").Where(ele => ele.Attribute("id").Value == IDs[0].ToString()).FirstOrDefault().Attribute("cont").Value;
Tuple<string, string> tuple = new Tuple<string, string>(POSs[0],cont);
features.Add(tuple);
}
return features;
}
}
}
|
using System;
using System.ComponentModel.DataAnnotations;
namespace com.Sconit.Entity.CUST
{
[Serializable]
public partial class HuMemo : EntityBase, IAuditable
{
[Display(Name = "HuMemo_Code", ResourceType = typeof(Resources.CUST.HuMemo))]
public string Code { get; set; }
[Display(Name = "HuMemo_Description", ResourceType = typeof(Resources.CUST.HuMemo))]
public string Description { get; set; }
public Int32 CreateUserId { get; set; }
public string CreateUserName { get; set; }
public DateTime CreateDate { get; set; }
public Int32 LastModifyUserId { get; set; }
public string LastModifyUserName { get; set; }
public DateTime LastModifyDate { get; set; }
[Display(Name = "HuMemo_ResourceGroup", ResourceType = typeof(Resources.CUST.HuMemo))]
public com.Sconit.CodeMaster.ResourceGroup ResourceGroup { get; set; }
public override int GetHashCode()
{
if (Code != null)
{
return Code.GetHashCode();
}
else
{
return base.GetHashCode();
}
}
public override bool Equals(object obj)
{
HuMemo another = obj as HuMemo;
if (another == null)
{
return false;
}
else
{
return (this.Code == another.Code);
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GodaddyWrapper.Responses
{
public class CartItemTrackingResponse
{
public string ClientIp { get; set; }
public string ItemTrackingCode { get; set; }
public string Pathway { get; set; }
public CartAffiliateResponse Affiliate { get; set; }
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.